Compare commits
17 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
9741a17371 | |
|
|
96f984744f | |
|
|
6aae49456c | |
|
|
a2ab8989ef | |
|
|
964cc069fe | |
|
|
6d7a55890e | |
|
|
98e6cb49ed | |
|
|
18386ea886 | |
|
|
913fee2130 | |
|
|
c643d2a4c7 | |
|
|
73d315753f | |
|
|
f78a54c5ad | |
|
|
bc4f8340b8 | |
|
|
ef03a269f5 | |
|
|
acb1a55e97 | |
|
|
6d7c6380e4 | |
|
|
97733ceba5 |
2
BUILD
2
BUILD
|
|
@ -215,7 +215,7 @@ g_stands_for = "guardian" # @unused
|
|||
|
||||
core_version = "39.0.0" # @unused
|
||||
|
||||
version = "1.62.0-dev" # @unused
|
||||
version = "1.62.2" # @unused
|
||||
|
||||
GPR_PUBLIC_HDRS = [
|
||||
"include/grpc/support/alloc.h",
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(PACKAGE_NAME "grpc")
|
||||
set(PACKAGE_VERSION "1.62.0-dev")
|
||||
set(PACKAGE_VERSION "1.62.2")
|
||||
set(gRPC_CORE_VERSION "39.0.0")
|
||||
set(gRPC_CORE_SOVERSION "39")
|
||||
set(gRPC_CPP_VERSION "1.62.0-dev")
|
||||
set(gRPC_CPP_VERSION "1.62.2")
|
||||
set(gRPC_CPP_SOVERSION "1.62")
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ Q = @
|
|||
endif
|
||||
|
||||
CORE_VERSION = 39.0.0
|
||||
CPP_VERSION = 1.62.0-dev
|
||||
CPP_VERSION = 1.62.2
|
||||
|
||||
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
|
||||
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!!
|
||||
|
||||
__version__ = """1.62.0.dev0"""
|
||||
__version__ = """1.62.2"""
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ EXPERIMENTS = {
|
|||
"v3_compression_filter",
|
||||
],
|
||||
"core_end2end_test": [
|
||||
"chaotic_good",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
"work_serializer_dispatch",
|
||||
|
|
@ -157,7 +156,6 @@ EXPERIMENTS = {
|
|||
"v3_compression_filter",
|
||||
],
|
||||
"core_end2end_test": [
|
||||
"chaotic_good",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
"work_serializer_dispatch",
|
||||
|
|
@ -234,7 +232,6 @@ EXPERIMENTS = {
|
|||
"v3_compression_filter",
|
||||
],
|
||||
"core_end2end_test": [
|
||||
"chaotic_good",
|
||||
"event_engine_client",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ settings:
|
|||
csharp_major_version: 2
|
||||
g_stands_for: guardian
|
||||
protobuf_version: 3.25.1
|
||||
version: 1.62.0-dev
|
||||
version: 1.62.2
|
||||
configs:
|
||||
asan:
|
||||
CC: clang
|
||||
|
|
|
|||
|
|
@ -1368,7 +1368,7 @@ if test "$PHP_GRPC" != "no"; then
|
|||
-D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \
|
||||
-DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \
|
||||
-DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"\"PHP\""' \
|
||||
-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.62.0dev\""')
|
||||
-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.62.2\""')
|
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_channel)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/backend_metrics)
|
||||
|
|
|
|||
|
|
@ -61,4 +61,4 @@
|
|||
- 1.59 'g' stands for ['generative'](https://github.com/grpc/grpc/tree/v1.59.x)
|
||||
- 1.60 'g' stands for ['gjallarhorn'](https://github.com/grpc/grpc/tree/v1.60.x)
|
||||
- 1.61 'g' stands for ['grand'](https://github.com/grpc/grpc/tree/v1.61.x)
|
||||
- 1.62 'g' stands for ['guardian'](https://github.com/grpc/grpc/tree/master)
|
||||
- 1.62 'g' stands for ['guardian'](https://github.com/grpc/grpc/tree/v1.62.x)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
gRPC Python Observability
|
||||
====================
|
||||
=========================
|
||||
|
||||
Module Contents
|
||||
---------------
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ API Reference
|
|||
grpc_reflection
|
||||
grpc_status
|
||||
grpc_testing
|
||||
grpc_observability
|
||||
glossary
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-C++'
|
||||
# TODO (mxyan): use version that match gRPC version when pod is stabilized
|
||||
version = '1.62.0-dev'
|
||||
version = '1.62.2'
|
||||
s.version = version
|
||||
s.summary = 'gRPC C++ library'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
@ -225,7 +225,7 @@ Pod::Spec.new do |s|
|
|||
ss.dependency "#{s.name}/Privacy", version
|
||||
ss.dependency "#{s.name}/Interface", version
|
||||
ss.dependency 'gRPC-Core', version
|
||||
abseil_version = '1.20240116.0'
|
||||
abseil_version = '1.20240116.1'
|
||||
ss.dependency 'abseil/algorithm/container', abseil_version
|
||||
ss.dependency 'abseil/base/base', abseil_version
|
||||
ss.dependency 'abseil/base/config', abseil_version
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-Core'
|
||||
version = '1.62.0-dev'
|
||||
version = '1.62.2'
|
||||
s.version = version
|
||||
s.summary = 'Core cross-platform gRPC library, written in C'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
@ -46,7 +46,7 @@ Pod::Spec.new do |s|
|
|||
s.requires_arc = false
|
||||
|
||||
name = 'grpc'
|
||||
abseil_version = '1.20240116.0'
|
||||
abseil_version = '1.20240116.1'
|
||||
|
||||
# When creating a dynamic framework, name it grpc.framework instead of gRPC-Core.framework.
|
||||
# This lets users write their includes like `#include <grpc/grpc.h>` as opposed to `#include
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-ProtoRPC'
|
||||
version = '1.62.0-dev'
|
||||
version = '1.62.2'
|
||||
s.version = version
|
||||
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-RxLibrary'
|
||||
version = '1.62.0-dev'
|
||||
version = '1.62.2'
|
||||
s.version = version
|
||||
s.summary = 'Reactive Extensions library for iOS/OSX.'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC'
|
||||
version = '1.62.0-dev'
|
||||
version = '1.62.2'
|
||||
s.version = version
|
||||
s.summary = 'gRPC client library for iOS/OSX'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
#define GRPC_CPP_VERSION_MAJOR 1
|
||||
#define GRPC_CPP_VERSION_MINOR 62
|
||||
#define GRPC_CPP_VERSION_PATCH 0
|
||||
#define GRPC_CPP_VERSION_TAG "dev"
|
||||
#define GRPC_CPP_VERSION_STRING "1.62.0-dev"
|
||||
#define GRPC_CPP_VERSION_PATCH 2
|
||||
#define GRPC_CPP_VERSION_TAG ""
|
||||
#define GRPC_CPP_VERSION_STRING "1.62.2"
|
||||
|
||||
#endif // GRPCPP_VERSION_INFO_H
|
||||
|
|
|
|||
|
|
@ -13,16 +13,16 @@
|
|||
<date>2019-09-24</date>
|
||||
<time>16:06:07</time>
|
||||
<version>
|
||||
<release>1.62.0dev</release>
|
||||
<api>1.62.0dev</api>
|
||||
<release>1.62.2</release>
|
||||
<api>1.62.2</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license>Apache 2.0</license>
|
||||
<notes>
|
||||
- gRPC Core 1.62.0 update
|
||||
- gRPC Core 1.62.2 update
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="/" name="/">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ coverage==4.5.4
|
|||
cython==0.29.21
|
||||
protobuf>=3.5.0.post1, < 4.0dev
|
||||
wheel==0.38.1
|
||||
google-auth==1.24.0
|
||||
oauth2client==4.1.0
|
||||
requests==2.25.1
|
||||
urllib3==1.26.18
|
||||
|
|
@ -13,12 +12,11 @@ idna==2.7
|
|||
gevent==22.08.0
|
||||
zope.event==4.5.0
|
||||
setuptools==44.1.1
|
||||
xds-protos==0.0.11
|
||||
absl-py==1.4.0
|
||||
google-cloud-trace==1.11.3
|
||||
opencensus-context==0.1.3
|
||||
google-cloud-monitoring==2.16.0
|
||||
google-api-core==2.14.0
|
||||
google-api-core==1.34.1
|
||||
proto-plus==1.22.3
|
||||
google-auth==2.23.4
|
||||
googleapis-common-protos==1.61.0
|
||||
|
|
@ -30,9 +28,9 @@ greenlet==1.1.3.post0
|
|||
zope.interface==6.1
|
||||
opentelemetry-sdk==1.21.0
|
||||
opentelemetry-api==1.21.0
|
||||
importlib-metadata==7.0.1
|
||||
importlib-metadata==6.11.0
|
||||
Deprecated==1.2.14
|
||||
opentelemetry-semantic-conventions==0.43b0
|
||||
opentelemetry-semantic-conventions==0.42b0
|
||||
typing-extensions==4.9.0
|
||||
pyasn1-modules==0.3.0
|
||||
zipp==3.17.0
|
||||
|
|
|
|||
|
|
@ -2897,7 +2897,6 @@ static void next_bdp_ping_timer_expired_locked(
|
|||
grpc_core::RefCountedPtr<grpc_chttp2_transport> t,
|
||||
GRPC_UNUSED grpc_error_handle error) {
|
||||
GPR_DEBUG_ASSERT(error.ok());
|
||||
GPR_ASSERT(t->next_bdp_ping_timer_handle != TaskHandle::kInvalid);
|
||||
t->next_bdp_ping_timer_handle = TaskHandle::kInvalid;
|
||||
if (t->flow_control.bdp_estimator()->accumulator() == 0) {
|
||||
// Block the bdp ping till we receive more data.
|
||||
|
|
|
|||
|
|
@ -183,11 +183,6 @@ const char* const description_wrr_delegate_to_pick_first =
|
|||
"Change WRR code to delegate to pick_first as per dualstack backend "
|
||||
"design.";
|
||||
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -196,7 +191,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"call_status_override_on_cancellation",
|
||||
description_call_status_override_on_cancellation,
|
||||
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
|
||||
kDefaultForDebugOnly, true},
|
||||
false, true},
|
||||
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
|
||||
false, true},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
@ -456,11 +451,6 @@ const char* const description_wrr_delegate_to_pick_first =
|
|||
"Change WRR code to delegate to pick_first as per dualstack backend "
|
||||
"design.";
|
||||
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -469,7 +459,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"call_status_override_on_cancellation",
|
||||
description_call_status_override_on_cancellation,
|
||||
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
|
||||
kDefaultForDebugOnly, true},
|
||||
false, true},
|
||||
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
|
||||
false, true},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
@ -729,11 +719,6 @@ const char* const description_wrr_delegate_to_pick_first =
|
|||
"Change WRR code to delegate to pick_first as per dualstack backend "
|
||||
"design.";
|
||||
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -742,7 +727,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"call_status_override_on_cancellation",
|
||||
description_call_status_override_on_cancellation,
|
||||
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
|
||||
kDefaultForDebugOnly, true},
|
||||
false, true},
|
||||
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
|
||||
false, true},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
|
|||
|
|
@ -57,16 +57,7 @@ namespace grpc_core {
|
|||
#ifdef GRPC_EXPERIMENTS_ARE_FINAL
|
||||
|
||||
#if defined(GRPC_CFSTREAM)
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
|
||||
#endif
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() { return false; }
|
||||
inline bool IsCallV3Enabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
|
||||
|
|
@ -119,16 +110,7 @@ inline bool IsWriteSizeCapEnabled() { return true; }
|
|||
inline bool IsWrrDelegateToPickFirstEnabled() { return true; }
|
||||
|
||||
#elif defined(GPR_WINDOWS)
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
|
||||
#endif
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() { return false; }
|
||||
inline bool IsCallV3Enabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
|
||||
|
|
@ -182,16 +164,7 @@ inline bool IsWriteSizeCapEnabled() { return true; }
|
|||
inline bool IsWrrDelegateToPickFirstEnabled() { return true; }
|
||||
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
|
||||
#endif
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsCallStatusOverrideOnCancellationEnabled() { return false; }
|
||||
inline bool IsCallV3Enabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
expiry: 2024/09/09
|
||||
owner: ctiller@google.com
|
||||
requires: [promise_based_client_call, promise_based_server_call]
|
||||
test_tags: [core_end2end_test]
|
||||
test_tags: []
|
||||
- name: client_idleness
|
||||
description: If enabled, client channel idleness is enabled by default.
|
||||
expiry: 2024/03/15
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
# Supported platforms: ios, windows, posix
|
||||
|
||||
- name: call_status_override_on_cancellation
|
||||
default: debug
|
||||
default: false
|
||||
- name: call_v3
|
||||
default: false
|
||||
- name: canary_client_privacy
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- This file is generated -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GrpcCsharpVersion>2.62.0-dev</GrpcCsharpVersion>
|
||||
<GrpcCsharpVersion>2.62.2</GrpcCsharpVersion>
|
||||
<GoogleProtobufVersion>3.25.1</GoogleProtobufVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
|||
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
|
||||
# before them.
|
||||
s.name = '!ProtoCompiler-gRPCCppPlugin'
|
||||
v = '1.62.0-dev'
|
||||
v = '1.62.2'
|
||||
s.version = v
|
||||
s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
|
||||
s.description = <<-DESC
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Pod::Spec.new do |s|
|
|||
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
|
||||
# before them.
|
||||
s.name = '!ProtoCompiler-gRPCPlugin'
|
||||
v = '1.62.0-dev'
|
||||
v = '1.62.2'
|
||||
s.version = v
|
||||
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
|
||||
s.description = <<-DESC
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@
|
|||
// instead. This file can be regenerated from the template by running
|
||||
// `tools/buildgen/generate_projects.sh`.
|
||||
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.62.0-dev"
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.62.2"
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@
|
|||
// instead. This file can be regenerated from the template by running
|
||||
// `tools/buildgen/generate_projects.sh`.
|
||||
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.62.0-dev"
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.62.2"
|
||||
#define GRPC_C_VERSION_STRING @"39.0.0"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "grpc/grpc-dev",
|
||||
"description": "gRPC library for PHP - for Development use only",
|
||||
"license": "Apache-2.0",
|
||||
"version": "1.62.0",
|
||||
"version": "1.62.2",
|
||||
"require": {
|
||||
"php": ">=7.0.0",
|
||||
"google/protobuf": "^v3.3.0"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@
|
|||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
#define PHP_GRPC_VERSION "1.62.0dev"
|
||||
#define PHP_GRPC_VERSION "1.62.2"
|
||||
|
||||
#endif /* VERSION_H */
|
||||
|
|
|
|||
|
|
@ -437,8 +437,9 @@ cdef class ComputeEngineChannelCredentials(ChannelCredentials):
|
|||
raise ValueError("Call credentials may not be NULL.")
|
||||
|
||||
cdef grpc_channel_credentials *c(self) except *:
|
||||
self._c_creds = grpc_google_default_credentials_create(self._call_creds)
|
||||
return self._c_creds
|
||||
with nogil:
|
||||
self._c_creds = grpc_google_default_credentials_create(self._call_creds)
|
||||
return self._c_creds
|
||||
|
||||
|
||||
def channel_credentials_compute_engine(call_creds):
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
|
||||
|
||||
__version__ = """1.62.0.dev0"""
|
||||
__version__ = """1.62.2"""
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ class ObservabilityPlugin(
|
|||
interface and wrapped in a PyCapsule using `client_call_tracer` as name.
|
||||
|
||||
Args:
|
||||
method_name: The method name of the call in byte format.
|
||||
target: The channel target of the call in byte format.
|
||||
method_name: The method name of the call in byte format.
|
||||
target: The channel target of the call in byte format.
|
||||
|
||||
Returns:
|
||||
A PyCapsule which stores a ClientCallTracer object.
|
||||
A PyCapsule which stores a ClientCallTracer object.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ class ObservabilityPlugin(
|
|||
interface and wrapped in a PyCapsule using `client_call_tracer` as name.
|
||||
|
||||
Args:
|
||||
client_call_tracer: A PyCapsule which stores a ClientCallTracer object.
|
||||
client_call_tracer: A PyCapsule which stores a ClientCallTracer object.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
@ -111,12 +111,12 @@ class ObservabilityPlugin(
|
|||
This method can be used to propagate census context.
|
||||
|
||||
Args:
|
||||
trace_id: The identifier for the trace associated with the span as a
|
||||
32-character hexadecimal encoded string,
|
||||
e.g. 26ed0036f2eff2b7317bccce3e28d01f
|
||||
span_id: The identifier for the span as a 16-character hexadecimal encoded
|
||||
string. e.g. 113ec879e62583bc
|
||||
is_sampled: A bool indicates whether the span is sampled.
|
||||
trace_id: The identifier for the trace associated with the span as a
|
||||
32-character hexadecimal encoded string,
|
||||
e.g. 26ed0036f2eff2b7317bccce3e28d01f
|
||||
span_id: The identifier for the span as a 16-character hexadecimal encoded
|
||||
string. e.g. 113ec879e62583bc
|
||||
is_sampled: A bool indicates whether the span is sampled.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ class ObservabilityPlugin(
|
|||
using `server_call_tracer_factory` as name.
|
||||
|
||||
Returns:
|
||||
A PyCapsule which stores a ServerCallTracerFactory object.
|
||||
A PyCapsule which stores a ServerCallTracerFactory object.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
@ -149,12 +149,12 @@ class ObservabilityPlugin(
|
|||
called at the end of each RPC.
|
||||
|
||||
Args:
|
||||
method: The fully-qualified name of the RPC method being invoked.
|
||||
target: The target name of the RPC method being invoked.
|
||||
rpc_latency: The latency for the RPC in seconds, equals to the time between
|
||||
when the client invokes the RPC and when the client receives the status.
|
||||
status_code: An element of grpc.StatusCode in string format representing the
|
||||
final status for the RPC.
|
||||
method: The fully-qualified name of the RPC method being invoked.
|
||||
target: The target name of the RPC method being invoked.
|
||||
rpc_latency: The latency for the RPC in seconds, equals to the time between
|
||||
when the client invokes the RPC and when the client receives the status.
|
||||
status_code: An element of grpc.StatusCode in string format representing the
|
||||
final status for the RPC.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ class ObservabilityPlugin(
|
|||
"""Enable or disable tracing.
|
||||
|
||||
Args:
|
||||
enable: A bool indicates whether tracing should be enabled.
|
||||
enable: A bool indicates whether tracing should be enabled.
|
||||
"""
|
||||
self._tracing_enabled = enable
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ class ObservabilityPlugin(
|
|||
"""Enable or disable stats(metrics).
|
||||
|
||||
Args:
|
||||
enable: A bool indicates whether stats should be enabled.
|
||||
enable: A bool indicates whether stats should be enabled.
|
||||
"""
|
||||
self._stats_enabled = enable
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ def get_plugin() -> Generator[Optional[ObservabilityPlugin], None, None]:
|
|||
"""Get the ObservabilityPlugin in _observability module.
|
||||
|
||||
Returns:
|
||||
The ObservabilityPlugin currently registered with the _observability
|
||||
The ObservabilityPlugin currently registered with the _observability
|
||||
module. Or None if no plugin exists at the time of calling this method.
|
||||
"""
|
||||
with _plugin_lock:
|
||||
|
|
@ -203,11 +203,11 @@ def set_plugin(observability_plugin: Optional[ObservabilityPlugin]) -> None:
|
|||
"""Save ObservabilityPlugin to _observability module.
|
||||
|
||||
Args:
|
||||
observability_plugin: The ObservabilityPlugin to save.
|
||||
observability_plugin: The ObservabilityPlugin to save.
|
||||
|
||||
Raises:
|
||||
ValueError: If an ObservabilityPlugin was already registered at the
|
||||
time of calling this method.
|
||||
time of calling this method.
|
||||
"""
|
||||
global _OBSERVABILITY_PLUGIN # pylint: disable=global-statement
|
||||
with _plugin_lock:
|
||||
|
|
@ -223,11 +223,11 @@ def observability_init(observability_plugin: ObservabilityPlugin) -> None:
|
|||
channels/servers are built.
|
||||
|
||||
Args:
|
||||
observability_plugin: The ObservabilityPlugin to use.
|
||||
observability_plugin: The ObservabilityPlugin to use.
|
||||
|
||||
Raises:
|
||||
ValueError: If an ObservabilityPlugin was already registered at the
|
||||
time of calling this method.
|
||||
time of calling this method.
|
||||
"""
|
||||
set_plugin(observability_plugin)
|
||||
try:
|
||||
|
|
@ -256,7 +256,7 @@ def delete_call_tracer(client_call_tracer_capsule: Any) -> None:
|
|||
interface and wrapped in a PyCapsule using `client_call_tracer` as the name.
|
||||
|
||||
Args:
|
||||
client_call_tracer_capsule: A PyCapsule which stores a ClientCallTracer object.
|
||||
client_call_tracer_capsule: A PyCapsule which stores a ClientCallTracer object.
|
||||
"""
|
||||
with get_plugin() as plugin:
|
||||
if not (plugin and plugin.observability_enabled):
|
||||
|
|
@ -270,8 +270,8 @@ def maybe_record_rpc_latency(state: "_channel._RPCState") -> None:
|
|||
This method will be called at the end of each RPC.
|
||||
|
||||
Args:
|
||||
state: a grpc._channel._RPCState object which contains the stats related to the
|
||||
RPC.
|
||||
state: a grpc._channel._RPCState object which contains the stats related to the
|
||||
RPC.
|
||||
"""
|
||||
# TODO(xuanwn): use channel args to exclude those metrics.
|
||||
for exclude_prefix in _SERVICES_TO_EXCLUDE:
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
gRPC Python Observability
|
||||
===========
|
||||
=========================
|
||||
|
||||
Package for gRPC Python Observability.
|
||||
|
||||
More details can be found in `OpenTelemetry Metrics gRFC <https://github.com/grpc/proposal/blob/master/A66-otel-stats.md#opentelemetry-metrics>`_.
|
||||
|
||||
How gRPC Python Observability Works
|
||||
-------------------------
|
||||
-----------------------------------
|
||||
|
||||
gRPC Python is a wrapper layer built upon the gRPC Core (written in C/C++). Most of telemetry data
|
||||
is collected at core layer and then exported to Python layer. To optimize performance and reduce
|
||||
|
|
@ -56,7 +57,7 @@ GCC-like stuff, but you may end up having a bad time.
|
|||
|
||||
|
||||
Dependencies
|
||||
-------------------------
|
||||
------------
|
||||
gRPC Python Observability Depends on the following packages:
|
||||
|
||||
::
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import grpc_version
|
|||
_parallel_compile_patch.monkeypatch_compile_maybe()
|
||||
|
||||
CLASSIFIERS = [
|
||||
"Private :: Do Not Upload",
|
||||
"Development Status :: 4 - Beta",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: Apache Software License",
|
||||
|
|
@ -274,6 +274,7 @@ setuptools.setup(
|
|||
name="grpcio-observability",
|
||||
version=grpc_version.VERSION,
|
||||
description="gRPC Python observability package",
|
||||
long_description_content_type="text/x-rst",
|
||||
long_description=open(README_PATH, "r").read(),
|
||||
author="The gRPC Authors",
|
||||
author_email="grpc-io@googlegroups.com",
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
|
|
|
|||
|
|
@ -112,20 +112,61 @@ class ChannelConnectivityTest(unittest.TestCase):
|
|||
|
||||
|
||||
class ChannelTest(unittest.TestCase):
|
||||
def test_secure_channel(self):
|
||||
channel_credentials = grpc.ssl_channel_credentials()
|
||||
channel = grpc.secure_channel("google.com:443", channel_credentials)
|
||||
def compute_engine_channel_credentials(self):
|
||||
class TestCallCredentials(grpc.AuthMetadataPlugin):
|
||||
def __call__(self, context, callback):
|
||||
callback((), None)
|
||||
|
||||
test_call_credentials = TestCallCredentials()
|
||||
call_credentials = grpc.metadata_call_credentials(
|
||||
test_call_credentials, "test call credentials"
|
||||
)
|
||||
return grpc.compute_engine_channel_credentials(call_credentials)
|
||||
|
||||
def test_ssl_secure_channel(self):
|
||||
channel = grpc.secure_channel(
|
||||
"google.com:443", grpc.ssl_channel_credentials()
|
||||
)
|
||||
channel.close()
|
||||
|
||||
def test_multiple_secure_channel(self):
|
||||
def test_compute_engine_secure_channel(self):
|
||||
channel = grpc.secure_channel(
|
||||
"google.com:443", self.compute_engine_channel_credentials()
|
||||
)
|
||||
channel.close()
|
||||
|
||||
def test_multiple_ssl_secure_channel(self):
|
||||
_THREAD_COUNT = 10
|
||||
wait_group = test_common.WaitGroup(_THREAD_COUNT)
|
||||
|
||||
def create_secure_channel():
|
||||
channel_credentials = grpc.ssl_channel_credentials()
|
||||
wait_group.done()
|
||||
wait_group.wait()
|
||||
channel = grpc.secure_channel("google.com:443", channel_credentials)
|
||||
channel = grpc.secure_channel(
|
||||
"google.com:443", grpc.ssl_channel_credentials()
|
||||
)
|
||||
channel.close()
|
||||
|
||||
threads = []
|
||||
for _ in range(_THREAD_COUNT):
|
||||
thread = threading.Thread(target=create_secure_channel)
|
||||
thread.setDaemon(True)
|
||||
thread.start()
|
||||
threads.append(thread)
|
||||
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
|
||||
def test_multiple_compute_engine_secure_channel(self):
|
||||
_THREAD_COUNT = 10
|
||||
wait_group = test_common.WaitGroup(_THREAD_COUNT)
|
||||
|
||||
def create_secure_channel():
|
||||
wait_group.done()
|
||||
wait_group.wait()
|
||||
channel = grpc.secure_channel(
|
||||
"google.com:443", self.compute_engine_channel_credentials()
|
||||
)
|
||||
channel.close()
|
||||
|
||||
threads = []
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ COPY . .
|
|||
RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client
|
||||
RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/
|
||||
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
|
|
@ -25,4 +29,7 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
|
|||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_client"]
|
||||
# tini serves as PID 1 and enables the server to properly respond to signals.
|
||||
COPY --from=0 /tini /tini
|
||||
|
||||
ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_client"]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ COPY . .
|
|||
RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_server
|
||||
RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server* /artifacts/
|
||||
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
|
|
@ -25,4 +29,7 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
|
|||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_server"]
|
||||
# tini serves as PID 1 and enables the server to properly respond to signals.
|
||||
COPY --from=0 /tini /tini
|
||||
|
||||
ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_server"]
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# GRPC contains the General RPC module.
|
||||
module GRPC
|
||||
VERSION = '1.62.0.dev'
|
||||
VERSION = '1.62.2'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
module GRPC
|
||||
module NativeDebug
|
||||
VERSION = '1.62.0.dev'
|
||||
VERSION = '1.62.2'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
module GRPC
|
||||
module Tools
|
||||
VERSION = '1.62.0.dev'
|
||||
VERSION = '1.62.2'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@
|
|||
ss.dependency "#{s.name}/Privacy", version
|
||||
ss.dependency "#{s.name}/Interface", version
|
||||
ss.dependency 'gRPC-Core', version
|
||||
abseil_version = '1.20240116.0'
|
||||
abseil_version = '1.20240116.1'
|
||||
% for abseil_spec in grpcpp_abseil_specs:
|
||||
ss.dependency '${abseil_spec}', abseil_version
|
||||
% endfor
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
s.requires_arc = false
|
||||
|
||||
name = 'grpc'
|
||||
abseil_version = '1.20240116.0'
|
||||
abseil_version = '1.20240116.1'
|
||||
|
||||
# When creating a dynamic framework, name it grpc.framework instead of gRPC-Core.framework.
|
||||
# This lets users write their includes like `#include <grpc/grpc.h>` as opposed to `#include
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
PROTOBUF_VERSION = '3.25.1'
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
PROTOBUF_VERSION = '3.25.1'
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.62.0.dev0'
|
||||
VERSION = '1.62.2'
|
||||
PROTOBUF_VERSION = '3.25.1'
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ COPY . .
|
|||
RUN tools/bazel build //test/cpp/interop:xds_interop_client
|
||||
RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/
|
||||
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
|
|
@ -39,4 +43,7 @@ RUN apt-get update \
|
|||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_client"]
|
||||
# tini serves as PID 1 and enables the server to properly respond to signals.
|
||||
COPY --from=0 /tini /tini
|
||||
|
||||
ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_client"]
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ COPY . .
|
|||
RUN tools/bazel build //test/cpp/interop:xds_interop_server
|
||||
RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/
|
||||
|
||||
ENV TINI_VERSION v0.19.0
|
||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
||||
RUN chmod +x /tini
|
||||
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
|
|
@ -39,4 +43,7 @@ RUN apt-get update \
|
|||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_server"]
|
||||
# tini serves as PID 1 and enables the server to properly respond to signals.
|
||||
COPY --from=0 /tini /tini
|
||||
|
||||
ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_server"]
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.62.0-dev
|
||||
PROJECT_NUMBER = 1.62.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.62.0-dev
|
||||
PROJECT_NUMBER = 1.62.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.62.0-dev
|
||||
PROJECT_NUMBER = 1.62.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.62.0-dev
|
||||
PROJECT_NUMBER = 1.62.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC PHP"
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.62.0-dev
|
||||
PROJECT_NUMBER = 1.62.2
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-cpp.sh"
|
||||
timeout_mins: 240
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "lb"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,192 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test client Docker images
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building C++ xDS interop test app Docker images"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
gcloud -q auth configure-docker
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping C++ test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# SECONDARY_KUBE_CONTEXT: The name of kubectl context with secondary GKE cluster access, if any
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--secondary_kube_context="${SECONDARY_KUBE_CONTEXT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
${@:2} \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
run_alpha_test() {
|
||||
local test_name=$1
|
||||
run_test ${test_name} \
|
||||
--compute_api_version="v1alpha"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test captured from the master branch.
|
||||
echo "Sourcing test driver install captured from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_LB
|
||||
activate_secondary_gke_cluster GKE_CLUSTER_PSM_LB
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
run_alpha_test subsetting_test || (( ++failed_tests ))
|
||||
test_suites=(
|
||||
"app_net_test"
|
||||
"affinity_test"
|
||||
"api_listener_test"
|
||||
"change_backend_service_test"
|
||||
"custom_lb_test"
|
||||
"failover_test"
|
||||
"outlier_detection_test"
|
||||
"remove_neg_test"
|
||||
"round_robin_test"
|
||||
)
|
||||
if [[ "${TESTING_VERSION}" =~ "master" ]]; then
|
||||
test_suites+=('bootstrap_generator_test')
|
||||
fi
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-python.sh"
|
||||
timeout_mins: 180
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "lb"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,195 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test client Docker images
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
readonly LANGUAGE_NAME="Python"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
|
||||
|
||||
pushd "${SRC_DIR}"
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
|
||||
-t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server \
|
||||
-t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
popd
|
||||
|
||||
gcloud -q auth configure-docker
|
||||
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping ${LANGUAGE_NAME} test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# SECONDARY_KUBE_CONTEXT: The name of kubectl context with secondary GKE cluster access, if any
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--secondary_kube_context="${SECONDARY_KUBE_CONTEXT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_LB
|
||||
activate_secondary_gke_cluster GKE_CLUSTER_PSM_LB
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
test_suites=(
|
||||
"app_net_test"
|
||||
"api_listener_test"
|
||||
"change_backend_service_test"
|
||||
"failover_test"
|
||||
"outlier_detection_test"
|
||||
"remove_neg_test"
|
||||
"round_robin_test"
|
||||
)
|
||||
if [[ "${TESTING_VERSION}" =~ "master" ]]; then
|
||||
test_suites+=('bootstrap_generator_test')
|
||||
fi
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
## xDS test server/client Docker images
|
||||
readonly IMAGE_REPO="gcr.io/grpc-testing/xds-interop"
|
||||
readonly IMAGE_REPO="us-docker.pkg.dev/grpc-testing/psm-interop"
|
||||
|
||||
find_latest() {
|
||||
gcloud container images list-tags --filter='tags~v1\.\d+\.x' "${IMAGE_REPO}/${1}-${2}" --flatten='tags[]' --format='value(tags)' | sort --version-sort | tail -n 1
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/grpc_xds_url_map.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-cpp.sh"
|
||||
timeout_mins: 90
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "url_map"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,149 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test client Docker images
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building C++ xDS interop test app Docker images"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
gcloud -q auth configure-docker
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping C++ test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--flagfile="config/url-map.cfg" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_BASIC
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
run_test url_map || echo "Failed url_map test"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-python.sh"
|
||||
timeout_mins: 90
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "url_map"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,159 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test client Docker images
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
readonly LANGUAGE_NAME="Python"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
|
||||
|
||||
pushd "${SRC_DIR}"
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
|
||||
-t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
popd
|
||||
|
||||
gcloud -q auth configure-docker
|
||||
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping ${LANGUAGE_NAME} test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--flagfile="config/url-map.cfg" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_BASIC
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
run_test url_map || echo "Failed url_map test"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-csm-python.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-python.sh"
|
||||
timeout_mins: 240
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "csm"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,188 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test server/client Docker images
|
||||
## We're only testing Python client for now
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building Python xDS interop test app Docker images"
|
||||
|
||||
pushd "${SRC_DIR}"
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
|
||||
-t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
docker build \
|
||||
-f tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server \
|
||||
-t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
popd
|
||||
|
||||
gcloud -q auth configure-docker
|
||||
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping Python test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--flagfile="config/common-csm.cfg" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--nocheck_local_certs \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
set +x
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_CSM
|
||||
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
test_suites=(
|
||||
"gamma.gamma_baseline_test"
|
||||
"gamma.affinity_test"
|
||||
)
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
|
||||
main "$@"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-csm.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-cpp.sh"
|
||||
timeout_mins: 120
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "csm"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,173 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2023 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test server/client Docker images
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building C++ xDS interop test app Docker images"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
gcloud -q auth configure-docker
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping C++ test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--flagfile="config/common-csm.cfg" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_CSM
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
test_suites=(
|
||||
"gamma.gamma_baseline_test"
|
||||
"gamma.affinity_test"
|
||||
"gamma.csm_observability_test"
|
||||
"app_net_ssa_test"
|
||||
)
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -eo pipefail
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR.
|
||||
# Called from psm_interop_kokoro_lib.sh.
|
||||
#
|
||||
# Globals:
|
||||
# SRC_DIR: Absolute path to the source repo on Kokoro VM
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# DOCKER_REGISTRY: Docker registry to push to
|
||||
# Outputs:
|
||||
# Writes the output of docker image build stdout, stderr
|
||||
#######################################
|
||||
psm::lang::build_docker_images() {
|
||||
local client_dockerfile="tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client"
|
||||
local server_dockerfile="tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server"
|
||||
psm::build::docker_images_generic "${client_dockerfile}" "${server_dockerfile}"
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -eo pipefail
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR.
|
||||
# Called from psm_interop_kokoro_lib.sh.
|
||||
#
|
||||
# Globals:
|
||||
# SRC_DIR: Absolute path to the source repo on Kokoro VM
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# DOCKER_REGISTRY: Docker registry to push to
|
||||
# Outputs:
|
||||
# Writes the output of docker image build stdout, stderr
|
||||
#######################################
|
||||
psm::lang::build_docker_images() {
|
||||
local client_dockerfile="src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client"
|
||||
local server_dockerfile="src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server"
|
||||
psm::build::docker_images_generic "${client_dockerfile}" "${server_dockerfile}"
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -eo pipefail
|
||||
|
||||
# Used locally.
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
|
||||
psm::lang::source_install_lib() {
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
local install_lib
|
||||
# Download to a tmp file.
|
||||
install_lib="$(mktemp -d)/psm_interop_kokoro_lib.sh"
|
||||
curl -s --retry-connrefused --retry 5 -o "${install_lib}" "${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
# Checksum.
|
||||
if command -v sha256sum &> /dev/null; then
|
||||
echo "Install script checksum:"
|
||||
sha256sum "${install_lib}"
|
||||
fi
|
||||
source "${install_lib}"
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -eo pipefail
|
||||
|
||||
# Input parameters to psm:: methods of the install script.
|
||||
readonly GRPC_LANGUAGE="cpp"
|
||||
readonly BUILD_SCRIPT_DIR="$(dirname "$0")"
|
||||
|
||||
source "${BUILD_SCRIPT_DIR}/psm-interop-install-lib.sh"
|
||||
psm::lang::source_install_lib
|
||||
source "${BUILD_SCRIPT_DIR}/psm-interop-build-${GRPC_LANGUAGE}.sh"
|
||||
psm::run "${PSM_TEST_SUITE}"
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2024 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
set -eo pipefail
|
||||
|
||||
# Input parameters to psm:: methods of the install script.
|
||||
readonly GRPC_LANGUAGE="python"
|
||||
readonly BUILD_SCRIPT_DIR="$(dirname "$0")"
|
||||
|
||||
source "${BUILD_SCRIPT_DIR}/psm-interop-install-lib.sh"
|
||||
psm::lang::source_install_lib
|
||||
source "${BUILD_SCRIPT_DIR}/psm-interop-build-${GRPC_LANGUAGE}.sh"
|
||||
psm::run "${PSM_TEST_SUITE}"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-security-python.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-python.sh"
|
||||
timeout_mins: 240
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "security"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,184 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test server/client Docker images
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
readonly LANGUAGE_NAME="Python"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
|
||||
|
||||
pushd "${SRC_DIR}"
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
|
||||
-t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
docker build \
|
||||
-f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server \
|
||||
-t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
.
|
||||
|
||||
popd
|
||||
|
||||
gcloud -q auth configure-docker
|
||||
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping ${LANGUAGE_NAME} test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--nocheck_local_certs \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
set +x
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
test_suites=("baseline_test" "security_test" "authz_test")
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
# Config file for the internal CI (in protobuf text format)
|
||||
|
||||
# Location of the continuous shell script in repository.
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-security.sh"
|
||||
build_file: "grpc/tools/internal_ci/linux/psm-interop-test-cpp.sh"
|
||||
timeout_mins: 240
|
||||
action {
|
||||
define_artifacts {
|
||||
|
|
@ -24,3 +24,7 @@ action {
|
|||
strip_prefix: "artifacts"
|
||||
}
|
||||
}
|
||||
env_vars {
|
||||
key: "PSM_TEST_SUITE"
|
||||
value: "security"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,168 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2021 gRPC authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/psm-interop/${TEST_DRIVER_BRANCH:-main}/.kokoro/psm_interop_kokoro_lib.sh"
|
||||
## xDS test server/client Docker images
|
||||
readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
|
||||
readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
|
||||
readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
|
||||
readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
|
||||
|
||||
#######################################
|
||||
# Builds test app Docker images and pushes them to GCR
|
||||
# Globals:
|
||||
# BUILD_APP_PATH
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of `gcloud builds submit` to stdout, stderr
|
||||
#######################################
|
||||
build_test_app_docker_images() {
|
||||
echo "Building C++ xDS interop test app Docker images"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
|
||||
gcloud -q auth configure-docker
|
||||
docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
|
||||
if is_version_branch "${TESTING_VERSION}"; then
|
||||
tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Builds test app and its docker images unless they already exist
|
||||
# Globals:
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# FORCE_IMAGE_BUILD
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output to stdout, stderr
|
||||
#######################################
|
||||
build_docker_images_if_needed() {
|
||||
# Check if images already exist
|
||||
server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${server_tags:-Server image not found}"
|
||||
|
||||
client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
|
||||
printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
|
||||
echo "${client_tags:-Client image not found}"
|
||||
|
||||
# Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
|
||||
if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
|
||||
build_test_app_docker_images
|
||||
else
|
||||
echo "Skipping C++ test app build"
|
||||
fi
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Executes the test case
|
||||
# Globals:
|
||||
# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
|
||||
# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
|
||||
# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
|
||||
# SERVER_IMAGE_NAME: Test server Docker image name
|
||||
# CLIENT_IMAGE_NAME: Test client Docker image name
|
||||
# GIT_COMMIT: SHA-1 of git commit being built
|
||||
# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
|
||||
# features.
|
||||
# Arguments:
|
||||
# Test case name
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
|
||||
#######################################
|
||||
run_test() {
|
||||
# Test driver usage:
|
||||
# https://github.com/grpc/psm-interop#basic-usage
|
||||
local test_name="${1:?Usage: run_test test_name}"
|
||||
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
|
||||
mkdir -pv "${out_dir}"
|
||||
set -x
|
||||
python3 -m "tests.${test_name}" \
|
||||
--flagfile="${TEST_DRIVER_FLAGFILE}" \
|
||||
--kube_context="${KUBE_CONTEXT}" \
|
||||
--server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
|
||||
--testing_version="${TESTING_VERSION}" \
|
||||
--nocheck_local_certs \
|
||||
--force_cleanup \
|
||||
--collect_app_logs \
|
||||
--log_dir="${out_dir}" \
|
||||
--xml_output_file="${out_dir}/sponge_log.xml" \
|
||||
|& tee "${out_dir}/sponge_log.log"
|
||||
}
|
||||
|
||||
#######################################
|
||||
# Main function: provision software necessary to execute tests, and run them
|
||||
# Globals:
|
||||
# KOKORO_ARTIFACTS_DIR
|
||||
# GITHUB_REPOSITORY_NAME
|
||||
# SRC_DIR: Populated with absolute path to the source repo
|
||||
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
|
||||
# the test driver
|
||||
# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
|
||||
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
|
||||
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
|
||||
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
|
||||
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
|
||||
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
|
||||
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
|
||||
# Arguments:
|
||||
# None
|
||||
# Outputs:
|
||||
# Writes the output of test execution to stdout, stderr
|
||||
#######################################
|
||||
main() {
|
||||
local script_dir
|
||||
script_dir="$(dirname "$0")"
|
||||
|
||||
# Source the test driver from the master branch.
|
||||
echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
|
||||
source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
|
||||
|
||||
activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
|
||||
|
||||
set -x
|
||||
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
|
||||
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
|
||||
else
|
||||
local_setup_test_driver "${script_dir}"
|
||||
fi
|
||||
build_docker_images_if_needed
|
||||
# Run tests
|
||||
cd "${TEST_DRIVER_FULL_DIR}"
|
||||
local failed_tests=0
|
||||
test_suites=("baseline_test" "security_test" "authz_test")
|
||||
for test in "${test_suites[@]}"; do
|
||||
run_test $test || (( ++failed_tests ))
|
||||
done
|
||||
echo "Failed test suites: ${failed_tests}"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Loading…
Reference in New Issue