Compare commits
15 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
4af785929c | |
|
|
f75bae6b92 | |
|
|
8a60bb8828 | |
|
|
8743965615 | |
|
|
ce4257da5d | |
|
|
ac5c3f3164 | |
|
|
e549292430 | |
|
|
fc516dc33d | |
|
|
c6e2638d35 | |
|
|
0f8cb206ef | |
|
|
ed6634c4d8 | |
|
|
0417b882aa | |
|
|
e097a3220b | |
|
|
beaf3a7ba3 | |
|
|
1edf19f04a |
2
BUILD
2
BUILD
|
|
@ -215,7 +215,7 @@ g_stands_for = "goku" # @unused
|
|||
|
||||
core_version = "35.0.0" # @unused
|
||||
|
||||
version = "1.58.0-dev" # @unused
|
||||
version = "1.58.2" # @unused
|
||||
|
||||
GPR_PUBLIC_HDRS = [
|
||||
"include/grpc/support/alloc.h",
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
set(PACKAGE_NAME "grpc")
|
||||
set(PACKAGE_VERSION "1.58.0-dev")
|
||||
set(PACKAGE_VERSION "1.58.2")
|
||||
set(gRPC_CORE_VERSION "35.0.0")
|
||||
set(gRPC_CORE_SOVERSION "35")
|
||||
set(gRPC_CPP_VERSION "1.58.0-dev")
|
||||
set(gRPC_CPP_VERSION "1.58.2")
|
||||
set(gRPC_CPP_SOVERSION "1.58")
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ Q = @
|
|||
endif
|
||||
|
||||
CORE_VERSION = 35.0.0
|
||||
CPP_VERSION = 1.58.0-dev
|
||||
CPP_VERSION = 1.58.2
|
||||
|
||||
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
|
||||
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
|
||||
|
|
|
|||
|
|
@ -1085,6 +1085,7 @@ let package = Package(
|
|||
"src/core/lib/event_engine/handle_containers.h",
|
||||
"src/core/lib/event_engine/memory_allocator.cc",
|
||||
"src/core/lib/event_engine/memory_allocator_factory.h",
|
||||
"src/core/lib/event_engine/nameser.h",
|
||||
"src/core/lib/event_engine/poller.h",
|
||||
"src/core/lib/event_engine/posix.h",
|
||||
"src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc",
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!!
|
||||
|
||||
__version__ = """1.58.0.dev0"""
|
||||
__version__ = """1.58.2"""
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ EXPERIMENTS = {
|
|||
"event_engine_listener",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
"work_stealing",
|
||||
],
|
||||
"cpp_end2end_test": [
|
||||
"promise_based_server_call",
|
||||
|
|
@ -60,9 +61,6 @@ EXPERIMENTS = {
|
|||
],
|
||||
},
|
||||
"on": {
|
||||
"core_end2end_test": [
|
||||
"work_stealing",
|
||||
],
|
||||
},
|
||||
},
|
||||
"ios": {
|
||||
|
|
@ -76,6 +74,7 @@ EXPERIMENTS = {
|
|||
"event_engine_listener",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
"work_stealing",
|
||||
],
|
||||
"cpp_end2end_test": [
|
||||
"promise_based_server_call",
|
||||
|
|
@ -108,9 +107,6 @@ EXPERIMENTS = {
|
|||
],
|
||||
},
|
||||
"on": {
|
||||
"core_end2end_test": [
|
||||
"work_stealing",
|
||||
],
|
||||
},
|
||||
},
|
||||
"posix": {
|
||||
|
|
@ -128,6 +124,7 @@ EXPERIMENTS = {
|
|||
"event_engine_listener",
|
||||
"promise_based_client_call",
|
||||
"promise_based_server_call",
|
||||
"work_stealing",
|
||||
],
|
||||
"cpp_end2end_test": [
|
||||
"promise_based_server_call",
|
||||
|
|
@ -166,9 +163,6 @@ EXPERIMENTS = {
|
|||
],
|
||||
},
|
||||
"on": {
|
||||
"core_end2end_test": [
|
||||
"work_stealing",
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -696,6 +696,7 @@ libs:
|
|||
- src/core/lib/event_engine/grpc_polled_fd.h
|
||||
- src/core/lib/event_engine/handle_containers.h
|
||||
- src/core/lib/event_engine/memory_allocator_factory.h
|
||||
- src/core/lib/event_engine/nameser.h
|
||||
- src/core/lib/event_engine/poller.h
|
||||
- src/core/lib/event_engine/posix.h
|
||||
- src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h
|
||||
|
|
@ -2103,6 +2104,7 @@ libs:
|
|||
- src/core/lib/event_engine/grpc_polled_fd.h
|
||||
- src/core/lib/event_engine/handle_containers.h
|
||||
- src/core/lib/event_engine/memory_allocator_factory.h
|
||||
- src/core/lib/event_engine/nameser.h
|
||||
- src/core/lib/event_engine/poller.h
|
||||
- src/core/lib/event_engine/posix.h
|
||||
- src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h
|
||||
|
|
@ -4069,6 +4071,7 @@ libs:
|
|||
- src/core/lib/event_engine/grpc_polled_fd.h
|
||||
- src/core/lib/event_engine/handle_containers.h
|
||||
- src/core/lib/event_engine/memory_allocator_factory.h
|
||||
- src/core/lib/event_engine/nameser.h
|
||||
- src/core/lib/event_engine/poller.h
|
||||
- src/core/lib/event_engine/posix.h
|
||||
- src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h
|
||||
|
|
@ -8718,6 +8721,7 @@ targets:
|
|||
- src/core/lib/event_engine/grpc_polled_fd.h
|
||||
- src/core/lib/event_engine/handle_containers.h
|
||||
- src/core/lib/event_engine/memory_allocator_factory.h
|
||||
- src/core/lib/event_engine/nameser.h
|
||||
- src/core/lib/event_engine/poller.h
|
||||
- src/core/lib/event_engine/posix.h
|
||||
- src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ settings:
|
|||
csharp_major_version: 2
|
||||
g_stands_for: goku
|
||||
protobuf_version: 3.23.4
|
||||
version: 1.58.0-dev
|
||||
version: 1.58.2
|
||||
configs:
|
||||
asan:
|
||||
CC: clang
|
||||
|
|
|
|||
|
|
@ -1333,7 +1333,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.58.0dev\""')
|
||||
-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.58.2\""')
|
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/backend_metrics)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/census)
|
||||
|
|
|
|||
|
|
@ -57,4 +57,4 @@
|
|||
- 1.55 'g' stands for ['grandslam'](https://github.com/grpc/grpc/tree/v1.55.x)
|
||||
- 1.56 'g' stands for ['galvanized'](https://github.com/grpc/grpc/tree/v1.56.x)
|
||||
- 1.57 'g' stands for ['grounded'](https://github.com/grpc/grpc/tree/v1.57.x)
|
||||
- 1.58 'g' stands for ['goku'](https://github.com/grpc/grpc/tree/master)
|
||||
- 1.58 'g' stands for ['goku'](https://github.com/grpc/grpc/tree/v1.58.x)
|
||||
|
|
|
|||
|
|
@ -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.58.0-dev'
|
||||
version = '1.58.2'
|
||||
s.version = version
|
||||
s.summary = 'gRPC C++ library'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
@ -767,6 +767,7 @@ Pod::Spec.new do |s|
|
|||
'src/core/lib/event_engine/grpc_polled_fd.h',
|
||||
'src/core/lib/event_engine/handle_containers.h',
|
||||
'src/core/lib/event_engine/memory_allocator_factory.h',
|
||||
'src/core/lib/event_engine/nameser.h',
|
||||
'src/core/lib/event_engine/poller.h',
|
||||
'src/core/lib/event_engine/posix.h',
|
||||
'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h',
|
||||
|
|
@ -1824,6 +1825,7 @@ Pod::Spec.new do |s|
|
|||
'src/core/lib/event_engine/grpc_polled_fd.h',
|
||||
'src/core/lib/event_engine/handle_containers.h',
|
||||
'src/core/lib/event_engine/memory_allocator_factory.h',
|
||||
'src/core/lib/event_engine/nameser.h',
|
||||
'src/core/lib/event_engine/poller.h',
|
||||
'src/core/lib/event_engine/posix.h',
|
||||
'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h',
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-Core'
|
||||
version = '1.58.0-dev'
|
||||
version = '1.58.2'
|
||||
s.version = version
|
||||
s.summary = 'Core cross-platform gRPC library, written in C'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
@ -1186,6 +1186,7 @@ Pod::Spec.new do |s|
|
|||
'src/core/lib/event_engine/handle_containers.h',
|
||||
'src/core/lib/event_engine/memory_allocator.cc',
|
||||
'src/core/lib/event_engine/memory_allocator_factory.h',
|
||||
'src/core/lib/event_engine/nameser.h',
|
||||
'src/core/lib/event_engine/poller.h',
|
||||
'src/core/lib/event_engine/posix.h',
|
||||
'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc',
|
||||
|
|
@ -2572,6 +2573,7 @@ Pod::Spec.new do |s|
|
|||
'src/core/lib/event_engine/grpc_polled_fd.h',
|
||||
'src/core/lib/event_engine/handle_containers.h',
|
||||
'src/core/lib/event_engine/memory_allocator_factory.h',
|
||||
'src/core/lib/event_engine/nameser.h',
|
||||
'src/core/lib/event_engine/poller.h',
|
||||
'src/core/lib/event_engine/posix.h',
|
||||
'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h',
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'gRPC-ProtoRPC'
|
||||
version = '1.58.0-dev'
|
||||
version = '1.58.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.58.0-dev'
|
||||
version = '1.58.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.58.0-dev'
|
||||
version = '1.58.2'
|
||||
s.version = version
|
||||
s.summary = 'gRPC client library for iOS/OSX'
|
||||
s.homepage = 'https://grpc.io'
|
||||
|
|
|
|||
|
|
@ -1091,6 +1091,7 @@ Gem::Specification.new do |s|
|
|||
s.files += %w( src/core/lib/event_engine/handle_containers.h )
|
||||
s.files += %w( src/core/lib/event_engine/memory_allocator.cc )
|
||||
s.files += %w( src/core/lib/event_engine/memory_allocator_factory.h )
|
||||
s.files += %w( src/core/lib/event_engine/nameser.h )
|
||||
s.files += %w( src/core/lib/event_engine/poller.h )
|
||||
s.files += %w( src/core/lib/event_engine/posix.h )
|
||||
s.files += %w( src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc )
|
||||
|
|
|
|||
|
|
@ -185,10 +185,17 @@ class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
|
|||
// This function takes ownership of slice and return a newly created Cord off
|
||||
// of it.
|
||||
static absl::Cord MakeCordFromSlice(grpc_slice slice) {
|
||||
// slice_for_cord is created to keep inlined data of the given slice
|
||||
grpc_slice* slice_for_cord = new grpc_slice;
|
||||
*slice_for_cord = slice;
|
||||
return absl::MakeCordFromExternal(
|
||||
absl::string_view(reinterpret_cast<char*>(GRPC_SLICE_START_PTR(slice)),
|
||||
GRPC_SLICE_LENGTH(slice)),
|
||||
[slice](absl::string_view /* view */) { grpc_slice_unref(slice); });
|
||||
absl::string_view(
|
||||
reinterpret_cast<char*>(GRPC_SLICE_START_PTR(*slice_for_cord)),
|
||||
GRPC_SLICE_LENGTH(*slice_for_cord)),
|
||||
[slice_for_cord](absl::string_view /* view */) {
|
||||
grpc_slice_unref(*slice_for_cord);
|
||||
delete slice_for_cord;
|
||||
});
|
||||
}
|
||||
#endif // GRPC_PROTOBUF_CORD_SUPPORT_ENABLED
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
#define GRPC_CPP_VERSION_MAJOR 1
|
||||
#define GRPC_CPP_VERSION_MINOR 58
|
||||
#define GRPC_CPP_VERSION_PATCH 0
|
||||
#define GRPC_CPP_VERSION_TAG "dev"
|
||||
#define GRPC_CPP_VERSION_STRING "1.58.0-dev"
|
||||
#define GRPC_CPP_VERSION_PATCH 2
|
||||
#define GRPC_CPP_VERSION_TAG ""
|
||||
#define GRPC_CPP_VERSION_STRING "1.58.2"
|
||||
|
||||
#endif // GRPCPP_VERSION_INFO_H
|
||||
|
|
|
|||
|
|
@ -13,16 +13,16 @@
|
|||
<date>2019-09-24</date>
|
||||
<time>16:06:07</time>
|
||||
<version>
|
||||
<release>1.58.0dev</release>
|
||||
<api>1.58.0dev</api>
|
||||
<release>1.58.2</release>
|
||||
<api>1.58.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.58.0 update
|
||||
- gRPC Core 1.58.2 update
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="/" name="/">
|
||||
|
|
@ -1073,6 +1073,7 @@
|
|||
<file baseinstalldir="/" name="src/core/lib/event_engine/handle_containers.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/memory_allocator.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/memory_allocator_factory.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/nameser.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/poller.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/posix.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc" role="src" />
|
||||
|
|
|
|||
|
|
@ -2375,6 +2375,7 @@ grpc_cc_library(
|
|||
hdrs = [
|
||||
"lib/event_engine/ares_resolver.h",
|
||||
"lib/event_engine/grpc_polled_fd.h",
|
||||
"lib/event_engine/nameser.h",
|
||||
"lib/event_engine/posix_engine/grpc_polled_fd_posix.h",
|
||||
],
|
||||
external_deps = [
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ Json::Object ValidateStatefulSession(
|
|||
envoy_extensions_filters_http_stateful_session_v3_StatefulSession_session_state(
|
||||
stateful_session);
|
||||
if (session_state == nullptr) {
|
||||
errors->AddError("field not present");
|
||||
return {};
|
||||
}
|
||||
ValidationErrors::ScopedField field2(errors, ".typed_config");
|
||||
|
|
@ -188,9 +187,7 @@ XdsHttpStatefulSessionFilter::GenerateFilterConfigOverride(
|
|||
const auto* stateful_session =
|
||||
envoy_extensions_filters_http_stateful_session_v3_StatefulSessionPerRoute_stateful_session(
|
||||
stateful_session_per_route);
|
||||
if (stateful_session == nullptr) {
|
||||
errors->AddError("field not present");
|
||||
} else {
|
||||
if (stateful_session != nullptr) {
|
||||
config = ValidateStatefulSession(context, stateful_session, errors);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "src/core/lib/iomgr/port.h"
|
||||
|
||||
// IWYU pragma: no_include <ares_version.h>
|
||||
// IWYU pragma: no_include <arpa/inet.h>
|
||||
// IWYU pragma: no_include <arpa/nameser.h>
|
||||
// IWYU pragma: no_include <inttypes.h>
|
||||
|
|
@ -33,7 +34,15 @@
|
|||
|
||||
#if GRPC_ARES == 1
|
||||
|
||||
#include <ares.h>
|
||||
|
||||
#if ARES_VERSION >= 0x011200
|
||||
// c-ares 1.18.0 or later starts to provide ares_nameser.h as a public header.
|
||||
#include <ares_nameser.h>
|
||||
#else
|
||||
#include "src/core/lib/event_engine/nameser.h" // IWYU pragma: keep
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
// Copyright 2023 The 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.
|
||||
|
||||
#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_NAMESER_H
|
||||
#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_NAMESER_H
|
||||
|
||||
#include <grpc/support/port_platform.h>
|
||||
|
||||
#include "src/core/lib/iomgr/port.h"
|
||||
|
||||
#ifdef GRPC_HAVE_ARPA_NAMESER
|
||||
|
||||
#include <arpa/nameser.h> // IWYU pragma: keep
|
||||
|
||||
#else // GRPC_HAVE_ARPA_NAMESER
|
||||
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0, // Cookie.
|
||||
ns_c_in = 1, // Internet.
|
||||
ns_c_2 = 2, // unallocated/unsupported.
|
||||
ns_c_chaos = 3, // MIT Chaos-net.
|
||||
ns_c_hs = 4, // MIT Hesiod.
|
||||
// Query class values which do not appear in resource records
|
||||
ns_c_none = 254, // for prereq. sections in update requests
|
||||
ns_c_any = 255, // Wildcard match.
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
typedef enum __ns_type {
|
||||
ns_t_invalid = 0, // Cookie.
|
||||
ns_t_a = 1, // Host address.
|
||||
ns_t_ns = 2, // Authoritative server.
|
||||
ns_t_md = 3, // Mail destination.
|
||||
ns_t_mf = 4, // Mail forwarder.
|
||||
ns_t_cname = 5, // Canonical name.
|
||||
ns_t_soa = 6, // Start of authority zone.
|
||||
ns_t_mb = 7, // Mailbox domain name.
|
||||
ns_t_mg = 8, // Mail group member.
|
||||
ns_t_mr = 9, // Mail rename name.
|
||||
ns_t_null = 10, // Null resource record.
|
||||
ns_t_wks = 11, // Well known service.
|
||||
ns_t_ptr = 12, // Domain name pointer.
|
||||
ns_t_hinfo = 13, // Host information.
|
||||
ns_t_minfo = 14, // Mailbox information.
|
||||
ns_t_mx = 15, // Mail routing information.
|
||||
ns_t_txt = 16, // Text strings.
|
||||
ns_t_rp = 17, // Responsible person.
|
||||
ns_t_afsdb = 18, // AFS cell database.
|
||||
ns_t_x25 = 19, // X_25 calling address.
|
||||
ns_t_isdn = 20, // ISDN calling address.
|
||||
ns_t_rt = 21, // Router.
|
||||
ns_t_nsap = 22, // NSAP address.
|
||||
ns_t_nsap_ptr = 23, // Reverse NSAP lookup (deprecated).
|
||||
ns_t_sig = 24, // Security signature.
|
||||
ns_t_key = 25, // Security key.
|
||||
ns_t_px = 26, // X.400 mail mapping.
|
||||
ns_t_gpos = 27, // Geographical position (withdrawn).
|
||||
ns_t_aaaa = 28, // Ip6 Address.
|
||||
ns_t_loc = 29, // Location Information.
|
||||
ns_t_nxt = 30, // Next domain (security).
|
||||
ns_t_eid = 31, // Endpoint identifier.
|
||||
ns_t_nimloc = 32, // Nimrod Locator.
|
||||
ns_t_srv = 33, // Server Selection.
|
||||
ns_t_atma = 34, // ATM Address
|
||||
ns_t_naptr = 35, // Naming Authority PoinTeR
|
||||
ns_t_kx = 36, // Key Exchange
|
||||
ns_t_cert = 37, // Certification record
|
||||
ns_t_a6 = 38, // IPv6 address (deprecates AAAA)
|
||||
ns_t_dname = 39, // Non-terminal DNAME (for IPv6)
|
||||
ns_t_sink = 40, // Kitchen sink (experimentatl)
|
||||
ns_t_opt = 41, // EDNS0 option (meta-RR)
|
||||
ns_t_apl = 42, // Address prefix list (RFC3123)
|
||||
ns_t_ds = 43, // Delegation Signer (RFC4034)
|
||||
ns_t_sshfp = 44, // SSH Key Fingerprint (RFC4255)
|
||||
ns_t_rrsig = 46, // Resource Record Signature (RFC4034)
|
||||
ns_t_nsec = 47, // Next Secure (RFC4034)
|
||||
ns_t_dnskey = 48, // DNS Public Key (RFC4034)
|
||||
ns_t_tkey = 249, // Transaction key
|
||||
ns_t_tsig = 250, // Transaction signature.
|
||||
ns_t_ixfr = 251, // Incremental zone transfer.
|
||||
ns_t_axfr = 252, // Transfer zone of authority.
|
||||
ns_t_mailb = 253, // Transfer mailbox records.
|
||||
ns_t_maila = 254, // Transfer mail agent records.
|
||||
ns_t_any = 255, // Wildcard match.
|
||||
ns_t_zxfr = 256, // BIND-specific, nonstandard.
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
#endif // GRPC_HAVE_ARPA_NAMESER
|
||||
|
||||
#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_NAMESER_H
|
||||
|
|
@ -101,11 +101,6 @@ const char* const description_keepalive_server_fix =
|
|||
"Allows overriding keepalive_permit_without_calls for servers. Refer "
|
||||
"https://github.com/grpc/grpc/pull/33917 for more information.";
|
||||
const char* const additional_constraints_keepalive_server_fix = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -145,7 +140,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"event_engine_dns", description_event_engine_dns,
|
||||
additional_constraints_event_engine_dns, false, false},
|
||||
{"work_stealing", description_work_stealing,
|
||||
additional_constraints_work_stealing, kDefaultForDebugOnly, false},
|
||||
additional_constraints_work_stealing, false, false},
|
||||
{"client_privacy", description_client_privacy,
|
||||
additional_constraints_client_privacy, false, false},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
@ -243,11 +238,6 @@ const char* const description_keepalive_server_fix =
|
|||
"Allows overriding keepalive_permit_without_calls for servers. Refer "
|
||||
"https://github.com/grpc/grpc/pull/33917 for more information.";
|
||||
const char* const additional_constraints_keepalive_server_fix = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -287,7 +277,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"event_engine_dns", description_event_engine_dns,
|
||||
additional_constraints_event_engine_dns, false, false},
|
||||
{"work_stealing", description_work_stealing,
|
||||
additional_constraints_work_stealing, kDefaultForDebugOnly, false},
|
||||
additional_constraints_work_stealing, false, false},
|
||||
{"client_privacy", description_client_privacy,
|
||||
additional_constraints_client_privacy, false, false},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
@ -385,11 +375,6 @@ const char* const description_keepalive_server_fix =
|
|||
"Allows overriding keepalive_permit_without_calls for servers. Refer "
|
||||
"https://github.com/grpc/grpc/pull/33917 for more information.";
|
||||
const char* const additional_constraints_keepalive_server_fix = "{}";
|
||||
#ifdef NDEBUG
|
||||
const bool kDefaultForDebugOnly = false;
|
||||
#else
|
||||
const bool kDefaultForDebugOnly = true;
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
namespace grpc_core {
|
||||
|
|
@ -429,7 +414,7 @@ const ExperimentMetadata g_experiment_metadata[] = {
|
|||
{"event_engine_dns", description_event_engine_dns,
|
||||
additional_constraints_event_engine_dns, false, false},
|
||||
{"work_stealing", description_work_stealing,
|
||||
additional_constraints_work_stealing, kDefaultForDebugOnly, false},
|
||||
additional_constraints_work_stealing, false, false},
|
||||
{"client_privacy", description_client_privacy,
|
||||
additional_constraints_client_privacy, false, false},
|
||||
{"canary_client_privacy", description_canary_client_privacy,
|
||||
|
|
|
|||
|
|
@ -75,16 +75,7 @@ inline bool IsEventEngineListenerEnabled() { return false; }
|
|||
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
|
||||
inline bool IsTraceRecordCallopsEnabled() { return false; }
|
||||
inline bool IsEventEngineDnsEnabled() { return false; }
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING
|
||||
#endif
|
||||
inline bool IsWorkStealingEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsWorkStealingEnabled() { return false; }
|
||||
inline bool IsClientPrivacyEnabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
inline bool IsServerPrivacyEnabled() { return false; }
|
||||
|
|
@ -110,16 +101,7 @@ inline bool IsEventEngineListenerEnabled() { return false; }
|
|||
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
|
||||
inline bool IsTraceRecordCallopsEnabled() { return false; }
|
||||
inline bool IsEventEngineDnsEnabled() { return false; }
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING
|
||||
#endif
|
||||
inline bool IsWorkStealingEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsWorkStealingEnabled() { return false; }
|
||||
inline bool IsClientPrivacyEnabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
inline bool IsServerPrivacyEnabled() { return false; }
|
||||
|
|
@ -145,16 +127,7 @@ inline bool IsEventEngineListenerEnabled() { return false; }
|
|||
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
|
||||
inline bool IsTraceRecordCallopsEnabled() { return false; }
|
||||
inline bool IsEventEngineDnsEnabled() { return false; }
|
||||
#ifndef NDEBUG
|
||||
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING
|
||||
#endif
|
||||
inline bool IsWorkStealingEnabled() {
|
||||
#ifdef NDEBUG
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
inline bool IsWorkStealingEnabled() { return false; }
|
||||
inline bool IsClientPrivacyEnabled() { return false; }
|
||||
inline bool IsCanaryClientPrivacyEnabled() { return false; }
|
||||
inline bool IsServerPrivacyEnabled() { return false; }
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
# implemented
|
||||
windows: broken
|
||||
- name: work_stealing
|
||||
default: debug
|
||||
default: false
|
||||
- name: client_privacy
|
||||
default: false
|
||||
- name: canary_client_privacy
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- This file is generated -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GrpcCsharpVersion>2.58.0-dev</GrpcCsharpVersion>
|
||||
<GrpcCsharpVersion>2.58.2</GrpcCsharpVersion>
|
||||
<GoogleProtobufVersion>3.23.4</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.58.0-dev'
|
||||
v = '1.58.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.58.0-dev'
|
||||
v = '1.58.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.58.0-dev"
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.58.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.58.0-dev"
|
||||
#define GRPC_OBJC_VERSION_STRING @"1.58.2"
|
||||
#define GRPC_C_VERSION_STRING @"35.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.58.0",
|
||||
"version": "1.58.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.58.0dev"
|
||||
#define PHP_GRPC_VERSION "1.58.2"
|
||||
|
||||
#endif /* VERSION_H */
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
|
||||
|
||||
__version__ = """1.58.0.dev0"""
|
||||
__version__ = """1.58.2"""
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM python:3.9-slim-bullseye
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl
|
||||
|
||||
|
|
@ -11,14 +11,18 @@ 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/
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,ring_hash_lb,outlier_detection_lb"
|
||||
|
||||
RUN apt-get update -y && apt-get install -y python3
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y python3 \
|
||||
&& apt-get -y autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_client"]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM python:3.9-slim-bullseye
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl
|
||||
|
||||
|
|
@ -11,14 +11,18 @@ 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/
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb"
|
||||
|
||||
RUN apt-get update -y && apt-get install -y python3
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y python3 \
|
||||
&& apt-get -y autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN ln -s /usr/bin/python3 /usr/bin/python
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_server"]
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# GRPC contains the General RPC module.
|
||||
module GRPC
|
||||
VERSION = '1.58.0.dev'
|
||||
VERSION = '1.58.2'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
module GRPC
|
||||
module Tools
|
||||
VERSION = '1.58.0.dev'
|
||||
VERSION = '1.58.2'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1333,14 +1333,13 @@ TEST_P(XdsStatefulSessionFilterConfigTest, PathAndTtl) {
|
|||
|
||||
TEST_P(XdsStatefulSessionFilterConfigTest, SessionStateUnset) {
|
||||
auto config = GenerateConfig(StatefulSession());
|
||||
absl::Status status = errors_.status(absl::StatusCode::kInvalidArgument,
|
||||
"errors validating filter config");
|
||||
ASSERT_EQ(status.code(), absl::StatusCode::kInvalidArgument);
|
||||
EXPECT_EQ(
|
||||
status.message(),
|
||||
absl::StrCat("errors validating filter config: [field:", FieldPrefix(),
|
||||
".session_state error:field not present]"))
|
||||
<< status;
|
||||
ASSERT_TRUE(errors_.ok()) << errors_.status(
|
||||
absl::StatusCode::kInvalidArgument, "unexpected errors");
|
||||
ASSERT_TRUE(config.has_value());
|
||||
EXPECT_EQ(config->config_proto_type_name,
|
||||
GetParam() ? filter_->OverrideConfigProtoName()
|
||||
: filter_->ConfigProtoName());
|
||||
EXPECT_EQ(config->config, Json::FromObject({})) << JsonDump(config->config);
|
||||
}
|
||||
|
||||
TEST_P(XdsStatefulSessionFilterConfigTest, CookieNotPresent) {
|
||||
|
|
|
|||
|
|
@ -40,71 +40,78 @@ namespace grpc {
|
|||
namespace testing {
|
||||
namespace {
|
||||
using ::envoy::config::core::v3::HealthStatus;
|
||||
using ::envoy::config::route::v3::Route;
|
||||
using ::envoy::extensions::filters::http::stateful_session::v3::StatefulSession;
|
||||
using ::envoy::extensions::filters::http::stateful_session::v3::
|
||||
StatefulSessionPerRoute;
|
||||
using ::envoy::extensions::filters::network::http_connection_manager::v3::
|
||||
HttpFilter;
|
||||
using ::envoy::extensions::http::stateful_session::cookie::v3 ::
|
||||
CookieBasedSessionState;
|
||||
|
||||
constexpr absl::string_view kCookieName = "grpc_session_cookie";
|
||||
constexpr absl::string_view kFilterName = "envoy.stateful_session";
|
||||
|
||||
class OverrideHostTest : public XdsEnd2endTest {
|
||||
protected:
|
||||
struct Cookie {
|
||||
std::string name;
|
||||
std::string value;
|
||||
std::set<std::string> attributes;
|
||||
std::string raw;
|
||||
|
||||
std::pair<std::string, std::string> Header() const {
|
||||
return std::make_pair("cookie", absl::StrFormat("%s=%s", name, value));
|
||||
}
|
||||
|
||||
template <typename Sink>
|
||||
friend void AbslStringify(Sink& sink, const Cookie& cookie) {
|
||||
absl::Format(&sink, "(Cookie: %s, value: %s, attributes: {%s})",
|
||||
cookie.name, cookie.value,
|
||||
absl::StrJoin(cookie.attributes, ", "));
|
||||
}
|
||||
};
|
||||
|
||||
static absl::optional<Cookie> ParseCookie(absl::string_view header,
|
||||
absl::string_view cookie_name) {
|
||||
static Cookie ParseCookie(absl::string_view header) {
|
||||
Cookie cookie;
|
||||
std::pair<absl::string_view, absl::string_view> name_value =
|
||||
absl::StrSplit(header, absl::MaxSplits('=', 1));
|
||||
if (name_value.first.empty() || name_value.first != cookie_name) {
|
||||
return absl::nullopt;
|
||||
}
|
||||
cookie.name = std::string(name_value.first);
|
||||
std::pair<absl::string_view, absl::string_view> value_attrs =
|
||||
absl::StrSplit(name_value.second, absl::MaxSplits(';', 1));
|
||||
std::set<std::string> attributes;
|
||||
cookie.value = std::string(value_attrs.first);
|
||||
for (absl::string_view segment : absl::StrSplit(name_value.second, ';')) {
|
||||
attributes.emplace(absl::StripAsciiWhitespace(segment));
|
||||
cookie.attributes.emplace(absl::StripAsciiWhitespace(segment));
|
||||
}
|
||||
return Cookie({std::string(value_attrs.first), std::move(attributes),
|
||||
std::string(name_value.second)});
|
||||
return cookie;
|
||||
}
|
||||
|
||||
static std::vector<std::pair<std::string, std::string>>
|
||||
GetHeadersWithSessionCookie(
|
||||
const std::multimap<std::string, std::string>& server_initial_metadata,
|
||||
absl::string_view cookie_name = kCookieName) {
|
||||
std::vector<std::string> values;
|
||||
static std::vector<Cookie> GetCookies(
|
||||
const std::multimap<std::string, std::string>& server_initial_metadata) {
|
||||
std::vector<Cookie> values;
|
||||
auto pair = server_initial_metadata.equal_range("set-cookie");
|
||||
for (auto it = pair.first; it != pair.second; ++it) {
|
||||
auto cookie = ParseCookie(it->second, cookie_name);
|
||||
if (!cookie.has_value()) {
|
||||
continue;
|
||||
}
|
||||
EXPECT_FALSE(cookie->value.empty());
|
||||
EXPECT_THAT(cookie->attributes, ::testing::Contains("HttpOnly"));
|
||||
values.emplace_back(cookie->value);
|
||||
}
|
||||
EXPECT_EQ(values.size(), 1);
|
||||
if (values.size() == 1) {
|
||||
return {{"cookie", absl::StrFormat("%s=%s", kCookieName, values[0])}};
|
||||
} else {
|
||||
return {};
|
||||
gpr_log(GPR_INFO, "set-cookie header: %s",
|
||||
std::string(it->second).c_str());
|
||||
values.emplace_back(ParseCookie(it->second));
|
||||
EXPECT_FALSE(values.back().value.empty());
|
||||
EXPECT_THAT(values.back().attributes, ::testing::Contains("HttpOnly"));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
// Builds a Listener with Fault Injection filter config. If the http_fault
|
||||
// is nullptr, then assign an empty filter config. This filter config is
|
||||
// required to enable the fault injection features.
|
||||
Listener BuildListenerWithStatefulSessionFilter() {
|
||||
CookieBasedSessionState cookie_state;
|
||||
cookie_state.mutable_cookie()->set_name(std::string(kCookieName));
|
||||
Listener BuildListenerWithStatefulSessionFilter(
|
||||
absl::string_view cookie_name = kCookieName) {
|
||||
StatefulSession stateful_session;
|
||||
stateful_session.mutable_session_state()->mutable_typed_config()->PackFrom(
|
||||
cookie_state);
|
||||
if (!cookie_name.empty()) {
|
||||
CookieBasedSessionState cookie_state;
|
||||
cookie_state.mutable_cookie()->set_name(std::string(cookie_name));
|
||||
stateful_session.mutable_session_state()
|
||||
->mutable_typed_config()
|
||||
->PackFrom(cookie_state);
|
||||
}
|
||||
// HttpConnectionManager http_connection_manager;
|
||||
Listener listener = default_listener_;
|
||||
HttpConnectionManager http_connection_manager =
|
||||
|
|
@ -113,21 +120,16 @@ class OverrideHostTest : public XdsEnd2endTest {
|
|||
HttpFilter* session_filter =
|
||||
http_connection_manager.mutable_http_filters(0);
|
||||
*http_connection_manager.add_http_filters() = *session_filter;
|
||||
session_filter->set_name("envoy.stateful_session");
|
||||
session_filter->set_name(kFilterName);
|
||||
session_filter->mutable_typed_config()->PackFrom(stateful_session);
|
||||
ClientHcmAccessor().Pack(http_connection_manager, &listener);
|
||||
return listener;
|
||||
}
|
||||
|
||||
// Send requests until a desired backend is hit and returns cookie name/value
|
||||
// pairs. Empty collection is returned if the backend was never hit.
|
||||
// For weighted clusters, more than one request per backend may be necessary
|
||||
// to obtain the cookie. max_requests_per_backend argument specifies
|
||||
// the number of requests per backend to send.
|
||||
std::vector<std::pair<std::string, std::string>>
|
||||
GetAffinityCookieHeaderForBackend(grpc_core::DebugLocation debug_location,
|
||||
size_t backend_index,
|
||||
size_t max_requests_per_backend = 1) {
|
||||
std::vector<Cookie> GetCookiesForBackend(
|
||||
grpc_core::DebugLocation debug_location, size_t backend_index,
|
||||
size_t max_requests_per_backend = 1,
|
||||
const RpcOptions& options = RpcOptions()) {
|
||||
EXPECT_LT(backend_index, backends_.size());
|
||||
if (backend_index >= backends_.size()) {
|
||||
return {};
|
||||
|
|
@ -135,8 +137,7 @@ class OverrideHostTest : public XdsEnd2endTest {
|
|||
const auto& backend = backends_[backend_index];
|
||||
for (size_t i = 0; i < max_requests_per_backend * backends_.size(); ++i) {
|
||||
std::multimap<std::string, std::string> server_initial_metadata;
|
||||
grpc::Status status =
|
||||
SendRpc(RpcOptions(), nullptr, &server_initial_metadata);
|
||||
grpc::Status status = SendRpc(options, nullptr, &server_initial_metadata);
|
||||
EXPECT_TRUE(status.ok())
|
||||
<< "code=" << status.error_code()
|
||||
<< ", message=" << status.error_message() << "\n"
|
||||
|
|
@ -149,7 +150,7 @@ class OverrideHostTest : public XdsEnd2endTest {
|
|||
backend->backend_service2()->request_count();
|
||||
ResetBackendCounters();
|
||||
if (count == 1) {
|
||||
return GetHeadersWithSessionCookie(server_initial_metadata);
|
||||
return GetCookies(server_initial_metadata);
|
||||
}
|
||||
}
|
||||
ADD_FAILURE_AT(debug_location.file(), debug_location.line())
|
||||
|
|
@ -157,6 +158,27 @@ class OverrideHostTest : public XdsEnd2endTest {
|
|||
return {};
|
||||
}
|
||||
|
||||
// Send requests until a desired backend is hit and returns cookie name/value
|
||||
// pairs. Empty collection is returned if the backend was never hit.
|
||||
// For weighted clusters, more than one request per backend may be necessary
|
||||
// to obtain the cookie. max_requests_per_backend argument specifies
|
||||
// the number of requests per backend to send.
|
||||
absl::optional<std::pair<std::string, std::string>>
|
||||
GetAffinityCookieHeaderForBackend(
|
||||
grpc_core::DebugLocation debug_location, size_t backend_index,
|
||||
size_t max_requests_per_backend = 1,
|
||||
const RpcOptions& options = RpcOptions(),
|
||||
absl::string_view cookie_name = kCookieName) {
|
||||
auto cookies = GetCookiesForBackend(debug_location, backend_index,
|
||||
max_requests_per_backend, options);
|
||||
for (const auto& cookie : cookies) {
|
||||
if (cookie.name == cookie_name) {
|
||||
return cookie.Header();
|
||||
}
|
||||
}
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
void SetClusterResource(absl::string_view cluster_name,
|
||||
absl::string_view eds_resource_name) {
|
||||
Cluster cluster = default_cluster_;
|
||||
|
|
@ -194,6 +216,36 @@ class OverrideHostTest : public XdsEnd2endTest {
|
|||
return static_cast<double>(backend->backend_service()->request_count()) /
|
||||
num_requests;
|
||||
}
|
||||
|
||||
static Route BuildStatefulSessionRouteConfig(absl::string_view match_prefix,
|
||||
absl::string_view cookie_name) {
|
||||
StatefulSessionPerRoute stateful_session_per_route;
|
||||
if (!cookie_name.empty()) {
|
||||
auto* session_state =
|
||||
stateful_session_per_route.mutable_stateful_session()
|
||||
->mutable_session_state();
|
||||
session_state->set_name("envoy.http.stateful_session.cookie");
|
||||
CookieBasedSessionState cookie_config;
|
||||
cookie_config.mutable_cookie()->set_name(cookie_name);
|
||||
session_state->mutable_typed_config()->PackFrom(cookie_config);
|
||||
}
|
||||
google::protobuf::Any any;
|
||||
any.PackFrom(stateful_session_per_route);
|
||||
Route route;
|
||||
route.mutable_match()->set_prefix(match_prefix);
|
||||
route.mutable_route()->set_cluster(kDefaultClusterName);
|
||||
route.mutable_typed_per_filter_config()->emplace(kFilterName, any);
|
||||
return route;
|
||||
}
|
||||
|
||||
static std::string CookieNames(absl::Span<const Cookie> cookies) {
|
||||
std::vector<absl::string_view> names;
|
||||
for (const auto& cookie : cookies) {
|
||||
names.emplace_back(cookie.name);
|
||||
}
|
||||
absl::c_sort(names);
|
||||
return absl::StrJoin(names, ", ");
|
||||
}
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(XdsTest, OverrideHostTest,
|
||||
|
|
@ -211,9 +263,10 @@ TEST_P(OverrideHostTest, HappyPath) {
|
|||
WaitForAllBackends(DEBUG_LOCATION);
|
||||
// Get cookie for backend #0.
|
||||
auto session_cookie = GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 0);
|
||||
ASSERT_FALSE(session_cookie.empty());
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
// All requests go to the backend we specified
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 5, RpcOptions().set_metadata(session_cookie));
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 5,
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 5);
|
||||
// Round-robin spreads the load
|
||||
ResetBackendCounters();
|
||||
|
|
@ -224,7 +277,7 @@ TEST_P(OverrideHostTest, HappyPath) {
|
|||
ResetBackendCounters();
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 5,
|
||||
RpcOptions()
|
||||
.set_metadata(session_cookie)
|
||||
.set_metadata({*session_cookie})
|
||||
.set_rpc_service(RpcService::SERVICE_ECHO2));
|
||||
EXPECT_EQ(backends_[0]->backend_service2()->request_count(), 5);
|
||||
}
|
||||
|
|
@ -253,7 +306,7 @@ TEST_P(OverrideHostTest, DrainingIncludedFromOverrideSet) {
|
|||
ResetBackendCounters();
|
||||
// Get cookie for backend #0.
|
||||
auto session_cookie = GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 0);
|
||||
ASSERT_FALSE(session_cookie.empty());
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
balancer_->ads_service()->SetEdsResource(BuildEdsResource(
|
||||
EdsResourceArgs({{"locality0",
|
||||
{CreateEndpoint(0, HealthStatus::DRAINING),
|
||||
|
|
@ -261,7 +314,8 @@ TEST_P(OverrideHostTest, DrainingIncludedFromOverrideSet) {
|
|||
CreateEndpoint(2, HealthStatus::HEALTHY)}}})));
|
||||
WaitForAllBackends(DEBUG_LOCATION, 2);
|
||||
// Draining subchannel works when used as an override host.
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 4, RpcOptions().set_metadata(session_cookie));
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 4,
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
EXPECT_EQ(4, backends_[0]->backend_service()->request_count());
|
||||
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
|
||||
EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
|
||||
|
|
@ -297,7 +351,7 @@ TEST_P(OverrideHostTest, DrainingExcludedFromOverrideSet) {
|
|||
ResetBackendCounters();
|
||||
// Get a cookie for backends_[0].
|
||||
auto session_cookie = GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 0);
|
||||
ASSERT_FALSE(session_cookie.empty());
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
balancer_->ads_service()->SetEdsResource(BuildEdsResource(
|
||||
EdsResourceArgs({{"locality0",
|
||||
{CreateEndpoint(0, HealthStatus::DRAINING),
|
||||
|
|
@ -305,7 +359,8 @@ TEST_P(OverrideHostTest, DrainingExcludedFromOverrideSet) {
|
|||
CreateEndpoint(2, HealthStatus::UNKNOWN)}}})));
|
||||
WaitForAllBackends(DEBUG_LOCATION, 2);
|
||||
// Override for the draining host is not honored, RR is used instead.
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 4, RpcOptions().set_metadata(session_cookie));
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 4,
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
EXPECT_EQ(0, backends_[0]->backend_service()->request_count());
|
||||
EXPECT_EQ(2, backends_[1]->backend_service()->request_count());
|
||||
EXPECT_EQ(2, backends_[2]->backend_service()->request_count());
|
||||
|
|
@ -335,10 +390,10 @@ TEST_P(OverrideHostTest, OverrideWithWeightedClusters) {
|
|||
// Get cookie
|
||||
auto session_cookie =
|
||||
GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 1, kNumEchoRpcs / 3);
|
||||
ASSERT_FALSE(session_cookie.empty());
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
// All requests go to the backend we requested.
|
||||
CheckRpcSendOk(DEBUG_LOCATION, kNumEchoRpcs,
|
||||
RpcOptions().set_metadata(session_cookie));
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 0);
|
||||
EXPECT_EQ(backends_[1]->backend_service()->request_count(), kNumEchoRpcs);
|
||||
EXPECT_EQ(backends_[2]->backend_service()->request_count(), 0);
|
||||
|
|
@ -368,14 +423,14 @@ TEST_P(OverrideHostTest, ClusterOverrideHonoredButHostGone) {
|
|||
WaitForAllBackends(DEBUG_LOCATION, 0, 3);
|
||||
auto session_cookie =
|
||||
GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 1, kNumEchoRpcs / 4);
|
||||
ASSERT_FALSE(session_cookie.empty());
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
// Remove backends[1] from cluster2
|
||||
balancer_->ads_service()->SetEdsResource(BuildEdsResource(
|
||||
EdsResourceArgs({{"locality0", CreateEndpointsForBackends(2, 4)}}),
|
||||
kNewEdsService2Name));
|
||||
WaitForAllBackends(DEBUG_LOCATION, 3, 4);
|
||||
CheckRpcSendOk(DEBUG_LOCATION, kNumEchoRpcs,
|
||||
RpcOptions().set_metadata(session_cookie));
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
// Traffic goes to a second cluster, where it is equally distributed between
|
||||
// the two remaining hosts
|
||||
EXPECT_THAT(BackendRequestPercentage(backends_[2], kNumEchoRpcs),
|
||||
|
|
@ -412,7 +467,7 @@ TEST_P(OverrideHostTest, ClusterGoneHostStays) {
|
|||
WaitForAllBackends(DEBUG_LOCATION, 0, 2);
|
||||
auto backend1_in_cluster2_cookie =
|
||||
GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 1, kNumEchoRpcs / 3);
|
||||
ASSERT_FALSE(backend1_in_cluster2_cookie.empty());
|
||||
ASSERT_TRUE(backend1_in_cluster2_cookie.has_value());
|
||||
// Create a new cluster, cluster 3, containing a new backend, backend 2.
|
||||
SetCdsAndEdsResources(kNewCluster3Name, kNewEdsService3Name, 2, 3);
|
||||
// Send an EDS update for cluster 1 that adds backend 1. (Now cluster 1 has
|
||||
|
|
@ -426,7 +481,7 @@ TEST_P(OverrideHostTest, ClusterGoneHostStays) {
|
|||
{{kNewCluster1Name, kWeight1}, {kNewCluster3Name, kWeight2}}));
|
||||
WaitForAllBackends(DEBUG_LOCATION, 2);
|
||||
CheckRpcSendOk(DEBUG_LOCATION, kNumEchoRpcs,
|
||||
RpcOptions().set_metadata(backend1_in_cluster2_cookie));
|
||||
RpcOptions().set_metadata({*backend1_in_cluster2_cookie}));
|
||||
// Traffic is split between clusters. Cluster1 traffic is sent to backends_[1]
|
||||
EXPECT_THAT(BackendRequestPercentage(backends_[0], kNumEchoRpcs),
|
||||
::testing::DoubleNear(0, kErrorTolerance));
|
||||
|
|
@ -440,6 +495,98 @@ TEST_P(OverrideHostTest, ClusterGoneHostStays) {
|
|||
GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 1, kNumEchoRpcs / 3));
|
||||
}
|
||||
|
||||
TEST_P(OverrideHostTest, EnabledInRouteConfig) {
|
||||
CreateAndStartBackends(2);
|
||||
RouteConfiguration route_config = default_route_config_;
|
||||
*route_config.mutable_virtual_hosts(0)->mutable_routes(0) =
|
||||
BuildStatefulSessionRouteConfig("", kCookieName);
|
||||
SetListenerAndRouteConfiguration(balancer_.get(),
|
||||
BuildListenerWithStatefulSessionFilter(""),
|
||||
route_config);
|
||||
balancer_->ads_service()->SetEdsResource(BuildEdsResource(EdsResourceArgs(
|
||||
{{"locality0", {CreateEndpoint(0), CreateEndpoint(1)}}})));
|
||||
WaitForAllBackends(DEBUG_LOCATION);
|
||||
// Get cookie for backend #0.
|
||||
auto session_cookie = GetAffinityCookieHeaderForBackend(DEBUG_LOCATION, 0);
|
||||
ASSERT_TRUE(session_cookie.has_value());
|
||||
// All requests go to the backend we specified
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 5,
|
||||
RpcOptions().set_metadata({*session_cookie}));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 5);
|
||||
}
|
||||
|
||||
TEST_P(OverrideHostTest, DifferentPerRoute) {
|
||||
constexpr absl::string_view kOverriddenCookie = "overridden-cookie-name";
|
||||
CreateAndStartBackends(2);
|
||||
RouteConfiguration route_config = default_route_config_;
|
||||
*route_config.mutable_virtual_hosts(0)->mutable_routes(0) =
|
||||
BuildStatefulSessionRouteConfig("/grpc.testing.EchoTestService/Echo1",
|
||||
"");
|
||||
*route_config.mutable_virtual_hosts(0)->add_routes() =
|
||||
BuildStatefulSessionRouteConfig("/grpc.testing.EchoTestService/Echo2",
|
||||
kOverriddenCookie);
|
||||
*route_config.mutable_virtual_hosts(0)->add_routes() =
|
||||
default_route_config_.virtual_hosts(0).routes(0);
|
||||
SetListenerAndRouteConfiguration(
|
||||
balancer_.get(), BuildListenerWithStatefulSessionFilter(), route_config);
|
||||
balancer_->ads_service()->SetEdsResource(BuildEdsResource(EdsResourceArgs(
|
||||
{{"locality0", {CreateEndpoint(0), CreateEndpoint(1)}}})));
|
||||
WaitForAllBackends(DEBUG_LOCATION);
|
||||
// Disabled for "echo1" method
|
||||
auto echo1_cookie = GetCookiesForBackend(
|
||||
DEBUG_LOCATION, 0, 1, RpcOptions().set_rpc_method(METHOD_ECHO1));
|
||||
ASSERT_EQ(CookieNames(echo1_cookie), "");
|
||||
// Overridden for "echo2" method
|
||||
auto echo2_cookie = GetCookiesForBackend(
|
||||
DEBUG_LOCATION, 0, 1, RpcOptions().set_rpc_method(METHOD_ECHO2));
|
||||
ASSERT_EQ(CookieNames(echo2_cookie), kOverriddenCookie);
|
||||
// Default for "echo" method
|
||||
auto echo_cookie = GetCookiesForBackend(
|
||||
DEBUG_LOCATION, 0, 1, RpcOptions().set_rpc_method(METHOD_ECHO));
|
||||
ASSERT_EQ(CookieNames(echo_cookie), kCookieName);
|
||||
// Echo1 endpoint ignores cookies
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 6,
|
||||
RpcOptions()
|
||||
.set_metadata({
|
||||
echo_cookie.front().Header(),
|
||||
echo2_cookie.front().Header(),
|
||||
})
|
||||
.set_rpc_method(METHOD_ECHO1));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 3);
|
||||
EXPECT_EQ(backends_[1]->backend_service()->request_count(), 3);
|
||||
// Echo2 honours the overwritten cookie but not the cookie from the top-level
|
||||
// config.
|
||||
backends_[0]->backend_service()->ResetCounters();
|
||||
backends_[1]->backend_service()->ResetCounters();
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 6,
|
||||
RpcOptions()
|
||||
.set_metadata({echo_cookie.front().Header()})
|
||||
.set_rpc_method(METHOD_ECHO2));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 3);
|
||||
EXPECT_EQ(backends_[1]->backend_service()->request_count(), 3);
|
||||
backends_[0]->backend_service()->ResetCounters();
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 6,
|
||||
RpcOptions()
|
||||
.set_metadata({echo2_cookie.front().Header()})
|
||||
.set_rpc_method(METHOD_ECHO2));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 6);
|
||||
// Echo honours the original cookie but not the override cookie
|
||||
backends_[0]->backend_service()->ResetCounters();
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 6,
|
||||
RpcOptions()
|
||||
.set_metadata({echo_cookie.front().Header()})
|
||||
.set_rpc_method(METHOD_ECHO));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 6);
|
||||
backends_[0]->backend_service()->ResetCounters();
|
||||
backends_[1]->backend_service()->ResetCounters();
|
||||
CheckRpcSendOk(DEBUG_LOCATION, 6,
|
||||
RpcOptions()
|
||||
.set_metadata({echo2_cookie.front().Header()})
|
||||
.set_rpc_method(METHOD_ECHO));
|
||||
EXPECT_EQ(backends_[0]->backend_service()->request_count(), 3);
|
||||
EXPECT_EQ(backends_[1]->backend_service()->request_count(), 3);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace testing
|
||||
} // namespace grpc
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
PROTOBUF_VERSION = '3.23.4'
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
PROTOBUF_VERSION = '3.23.4'
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@
|
|||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
|
||||
|
||||
VERSION = '1.58.0.dev0'
|
||||
VERSION = '1.58.2'
|
||||
PROTOBUF_VERSION = '3.23.4'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
# Dockerfile for building //test/cpp/interop:xds_interop_client
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl
|
||||
|
||||
|
|
@ -27,10 +27,16 @@ COPY . .
|
|||
RUN tools/bazel build //test/cpp/interop:xds_interop_client
|
||||
RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
COPY --from=0 /artifacts ./
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,xds_server_config_fetcher,ring_hash_lb,outlier_detection_lb,xds_wrr_locality_lb,xds_override_host_lb"
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y upgrade \
|
||||
&& apt-get -y autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/xds_interop_client"]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
# Dockerfile for building //test/cpp/interop:xds_interop_client
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl
|
||||
|
||||
|
|
@ -27,11 +27,16 @@ COPY . .
|
|||
RUN tools/bazel build //test/cpp/interop:xds_interop_server
|
||||
RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/
|
||||
|
||||
FROM python:3.9-slim-bullseye
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
FROM python:3.9-slim-bookworm
|
||||
|
||||
ENV GRPC_VERBOSITY="DEBUG"
|
||||
ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,xds_server_config_fetcher,ring_hash_lb,outlier_detection_lb,xds_wrr_locality_lb,xds_override_host_lb"
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y upgrade \
|
||||
&& apt-get -y autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=0 /artifacts ./
|
||||
|
||||
ENTRYPOINT ["/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.58.0-dev
|
||||
PROJECT_NUMBER = 1.58.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.58.0-dev
|
||||
PROJECT_NUMBER = 1.58.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
|
||||
|
|
@ -2088,6 +2088,7 @@ src/core/lib/event_engine/grpc_polled_fd.h \
|
|||
src/core/lib/event_engine/handle_containers.h \
|
||||
src/core/lib/event_engine/memory_allocator.cc \
|
||||
src/core/lib/event_engine/memory_allocator_factory.h \
|
||||
src/core/lib/event_engine/nameser.h \
|
||||
src/core/lib/event_engine/poller.h \
|
||||
src/core/lib/event_engine/posix.h \
|
||||
src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc \
|
||||
|
|
|
|||
|
|
@ -1866,6 +1866,7 @@ src/core/lib/event_engine/grpc_polled_fd.h \
|
|||
src/core/lib/event_engine/handle_containers.h \
|
||||
src/core/lib/event_engine/memory_allocator.cc \
|
||||
src/core/lib/event_engine/memory_allocator_factory.h \
|
||||
src/core/lib/event_engine/nameser.h \
|
||||
src/core/lib/event_engine/poller.h \
|
||||
src/core/lib/event_engine/posix.h \
|
||||
src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc \
|
||||
|
|
|
|||
|
|
@ -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.58.0-dev
|
||||
PROJECT_NUMBER = 1.58.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.58.0-dev
|
||||
PROJECT_NUMBER = 1.58.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.58.0-dev
|
||||
PROJECT_NUMBER = 1.58.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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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,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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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"
|
||||
)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ set -eo pipefail
|
|||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
|
||||
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"
|
||||
readonly LANGS="cpp go java"
|
||||
readonly MAIN_BRANCH="${MAIN_BRANCH:-master}"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ set -eo pipefail
|
|||
|
||||
# Constants
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
|
||||
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_LANGS="cpp go java"
|
||||
readonly CLIENT_LANGS="cpp go java"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ set -ex
|
|||
|
||||
# consts
|
||||
readonly GITHUB_REPOSITORY_NAME="grpc"
|
||||
readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
|
||||
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"
|
||||
|
||||
cd "$(dirname "$0")/../../.."
|
||||
|
||||
|
|
|
|||
|
|
@ -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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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 "$@"
|
||||
|
|
@ -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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.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/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#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 "$@"
|
||||
|
|
@ -51,6 +51,8 @@ spec:
|
|||
value: "true"
|
||||
- name: GRPC_XDS_EXPERIMENTAL_V3_SUPPORT
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_XDS_ENABLE_OVERRIDE_HOST
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/grpc-xds/
|
||||
name: grpc-td-conf
|
||||
|
|
|
|||
|
|
@ -51,9 +51,11 @@ spec:
|
|||
value: "true"
|
||||
- name: GRPC_XDS_EXPERIMENTAL_ENABLE_RETRY
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION
|
||||
- name: GRPC_EXPERIMENTAL_XDS_ENABLE_OVERRIDE_HOST
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/grpc-xds/
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ spec:
|
|||
value: "true"
|
||||
- name: GRPC_XDS_EXPERIMENTAL_RBAC
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_XDS_ENABLE_OVERRIDE_HOST
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/grpc-xds/
|
||||
name: grpc-td-conf
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ spec:
|
|||
value: "/tmp/grpc-xds/td-grpc-bootstrap.json"
|
||||
- name: GRPC_XDS_EXPERIMENTAL_V3_SUPPORT
|
||||
value: "true"
|
||||
- name: GRPC_EXPERIMENTAL_XDS_ENABLE_OVERRIDE_HOST
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- mountPath: /tmp/grpc-xds/
|
||||
name: grpc-td-conf
|
||||
|
|
|
|||
Loading…
Reference in New Issue