mirror of https://github.com/grpc/grpc.git
commit
13b6030ceb
135 changed files with 2002 additions and 272 deletions
@ -0,0 +1,93 @@ |
||||
# 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. |
||||
|
||||
import os |
||||
import re |
||||
import subprocess |
||||
import sys |
||||
import tempfile |
||||
|
||||
_OK_TEST_REGEX = r"^-+.*Ran ([\d]+) tests* in ([\d.]+)s.*OK(?: \(skipped=(\d+)\))?\n$" |
||||
|
||||
# Tests with known exception logs. |
||||
# TODO(sourabhsinghs): Investigate and enable _rpc_part_1_test and _rpc_part_2_test tests. |
||||
_SKIP_TESTS = [ |
||||
"_rpc_part_1_test", |
||||
"_server_shutdown_test", |
||||
"_xds_credentials_test", |
||||
"_server_test", |
||||
"_invalid_metadata_test", |
||||
"_reconnect_test", |
||||
"_channel_close_test", |
||||
"_rpc_part_2_test", |
||||
"_invocation_defects_test", |
||||
"_dynamic_stubs_test", |
||||
"_channel_connectivity_test", |
||||
] |
||||
|
||||
if __name__ == "__main__": |
||||
if len(sys.argv) != 3: |
||||
print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr) |
||||
sys.exit(1) |
||||
|
||||
test_script = sys.argv[1] |
||||
target_module = sys.argv[2] |
||||
|
||||
if target_module in _SKIP_TESTS: |
||||
print(f"Skipping {target_module}") |
||||
sys.exit(0) |
||||
|
||||
command = [ |
||||
sys.executable, |
||||
os.path.realpath(test_script), |
||||
target_module, |
||||
os.path.dirname(os.path.relpath(__file__)), |
||||
] |
||||
|
||||
with tempfile.TemporaryFile(mode="w+") as stdout_file: |
||||
with tempfile.TemporaryFile(mode="w+") as stderr_file: |
||||
result = subprocess.run( |
||||
command, |
||||
stdout=stdout_file, |
||||
stderr=stderr_file, |
||||
text=True, |
||||
check=True, |
||||
) |
||||
|
||||
stdout_file.seek(0) |
||||
stderr_file.seek(0) |
||||
|
||||
stdout_count = len(stdout_file.readlines()) |
||||
stderr_count = len(stderr_file.readlines()) |
||||
|
||||
if result.returncode != 0: |
||||
sys.exit("Test failure") |
||||
|
||||
stderr_file.seek(0) |
||||
if not re.fullmatch(_OK_TEST_REGEX, stderr_file.read(), re.DOTALL): |
||||
print( |
||||
f"Warning: Excessive error output detected ({stderr_count} lines):" |
||||
) |
||||
stderr_file.seek(0) |
||||
for line in stderr_file: |
||||
print(line) |
||||
|
||||
if stdout_count > 0: |
||||
print( |
||||
f"Warning: Unexpected output detected ({stdout_count} lines):" |
||||
) |
||||
stdout_file.seek(0) |
||||
for line in stdout_file: |
||||
print(line) |
||||
|
@ -0,0 +1,54 @@ |
||||
# 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. |
||||
|
||||
from typing import Sequence, Optional |
||||
|
||||
import unittest |
||||
import sys |
||||
import pkgutil |
||||
|
||||
|
||||
class SingleLoader(object): |
||||
def __init__(self, pattern: str, unittest_path: str): |
||||
loader = unittest.TestLoader() |
||||
self.suite = unittest.TestSuite() |
||||
tests = [] |
||||
|
||||
for importer, module_name, is_package in pkgutil.walk_packages([unittest_path]): |
||||
if pattern in module_name: |
||||
module = importer.find_module(module_name).load_module(module_name) |
||||
tests.append(loader.loadTestsFromModule(module)) |
||||
if len(tests) != 1: |
||||
raise AssertionError("Expected only 1 test module. Found {}".format(tests)) |
||||
self.suite.addTest(tests[0]) |
||||
|
||||
def loadTestsFromNames(self, names: Sequence[str], module: Optional[str] = None) -> unittest.TestSuite: |
||||
return self.suite |
||||
|
||||
if __name__ == "__main__": |
||||
|
||||
if len(sys.argv) != 3: |
||||
print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr) |
||||
sys.exit(1) |
||||
|
||||
|
||||
target_module = sys.argv[1] |
||||
unittest_path = sys.argv[2] |
||||
|
||||
loader = SingleLoader(target_module, unittest_path) |
||||
runner = unittest.TextTestRunner(verbosity=0) |
||||
result = runner.run(loader.suite) |
||||
|
||||
if not result.wasSuccessful(): |
||||
sys.exit("Test failure.") |
@ -0,0 +1,73 @@ |
||||
# Copyright 2024 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. |
||||
""" |
||||
Houses py_grpc_logging_threshold_test. |
||||
""" |
||||
|
||||
_COPIED_MAIN_SUFFIX = ".logging_threshold.main" |
||||
|
||||
def py_grpc_logging_threshold_test( |
||||
name, |
||||
srcs, |
||||
main = None, |
||||
deps = None, |
||||
data = None, |
||||
**kwargs): |
||||
"""Runs a Python unit test and checks amount of logging against a threshold. |
||||
|
||||
Args: |
||||
name: The name of the test. |
||||
srcs: The source files. |
||||
main: The main file of the test. |
||||
deps: The dependencies of the test. |
||||
data: The data dependencies of the test. |
||||
**kwargs: Any other test arguments. |
||||
""" |
||||
if main == None: |
||||
if len(srcs) != 1: |
||||
fail("When main is not provided, srcs must be of size 1.") |
||||
main = srcs[0] |
||||
deps = [] if deps == None else deps |
||||
data = [] if data == None else data |
||||
|
||||
lib_name = name + ".logging_threshold.lib" |
||||
native.py_library( |
||||
name = lib_name, |
||||
srcs = srcs, |
||||
) |
||||
augmented_deps = deps + [ |
||||
":{}".format(lib_name), |
||||
] |
||||
|
||||
# The main file needs to be in the same package as the test file. |
||||
copied_main_name = name + _COPIED_MAIN_SUFFIX |
||||
copied_main_filename = copied_main_name + ".py" |
||||
native.genrule( |
||||
name = copied_main_name, |
||||
srcs = ["//bazel:_logging_threshold_test_main.py"], |
||||
outs = [copied_main_filename], |
||||
cmd = "cp $< $@", |
||||
) |
||||
|
||||
native.py_test( |
||||
name = name + ".logging_threshold", |
||||
args = ["$(location //bazel:_single_module_tester)", name], |
||||
data = data + ["//bazel:_single_module_tester"], |
||||
deps = augmented_deps, |
||||
srcs = [copied_main_filename], |
||||
main = copied_main_filename, |
||||
python_version = "PY3", |
||||
flaky = False, |
||||
**kwargs |
||||
) |
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
include grpc_version.py |
||||
include python_version.py |
||||
recursive-include grpc_admin *.py |
||||
global-exclude *.pyc |
||||
include LICENSE |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
include grpc_version.py |
||||
include python_version.py |
||||
recursive-include grpc_channelz *.py *.pyi |
||||
global-exclude *.pyc |
||||
include LICENSE |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
include grpc_version.py |
||||
include python_version.py |
||||
recursive-include grpc_csds *.py |
||||
global-exclude *.pyc |
||||
include LICENSE |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
graft src/python/grpcio_csm_observability/grpc_csm_observability.egg-info |
||||
graft grpc_csm_observability |
||||
include grpc_version.py |
||||
include python_version.py |
||||
include README.rst |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
include grpc_version.py |
||||
include python_version.py |
||||
recursive-include grpc_health *.py *.pyi |
||||
global-exclude *.pyc |
||||
include LICENSE |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -1,4 +1,5 @@ |
||||
include grpc_version.py |
||||
include python_version.py |
||||
recursive-include grpc_reflection *.py *.pyi |
||||
global-exclude *.pyc |
||||
include LICENSE |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,22 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/xds_protos/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ${settings.supported_python_versions} |
||||
|
||||
MIN_PYTHON_VERSION = ${settings.min_python_version} |
||||
MAX_PYTHON_VERSION = ${settings.max_python_version} |
@ -0,0 +1,14 @@ |
||||
#================= |
||||
# Install ccache |
||||
|
||||
# Install ccache from source since ccache 3.x packaged with most linux distributions |
||||
# does not support Redis backend for caching. |
||||
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD STRIP OBJCOPY ${'\\'} |
||||
&& curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz ${'\\'} |
||||
&& tar -zxf ccache.tar.gz ${'\\'} |
||||
&& cd ccache-4.7.5 ${'\\'} |
||||
&& mkdir build && cd build ${'\\'} |
||||
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. ${'\\'} |
||||
&& make -j4 && make install ${'\\'} |
||||
&& cd ../.. ${'\\'} |
||||
&& rm -rf ccache-4.7.5 ccache.tar.gz |
@ -0,0 +1,21 @@ |
||||
#================= |
||||
# Compile CPython 3.13.0rc2 from source |
||||
|
||||
RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev libsqlite3-dev && apt-get clean |
||||
RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean |
||||
|
||||
RUN cd /tmp && ${'\\'} |
||||
wget -q https://www.python.org/ftp/python/3.13.0/Python-3.13.0rc2.tgz && ${'\\'} |
||||
tar xzvf Python-3.13.0rc2.tgz && ${'\\'} |
||||
cd Python-3.13.0rc2 && ${'\\'} |
||||
./configure && ${'\\'} |
||||
make -j4 && ${'\\'} |
||||
make install |
||||
|
||||
|
||||
RUN cd /tmp && ${'\\'} |
||||
echo "ad7f44153649e27ec385e7633e853e03 Python-3.13.0rc2.tgz" > checksum.md5 && ${'\\'} |
||||
md5sum -c checksum.md5 |
||||
|
||||
RUN python3.13 -m ensurepip && ${'\\'} |
||||
python3.13 -m pip install coverage |
@ -0,0 +1,22 @@ |
||||
# TODO: simplify the list of third_party modules list |
||||
# NOTE: git>=2.46 allows leading paths like third_party/* to include all subdirectories |
||||
# current docker base images use git versions lower than 2.46 and hence require separate configs for each submodule |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/bloaty |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/xds |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googleapis |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googletest |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opencensus-proto |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/boringssl-with-bazel |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/envoy-api |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protobuf |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/zlib |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/benchmark |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/re2 |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/abseil-cpp |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry-cpp |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protoc-gen-validate |
||||
RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/cares/cares |
||||
RUN git config --global protocol.file.allow always |
@ -0,0 +1,57 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# The aarch64 wheels are being crosscompiled to allow running the build |
||||
# on x64 machine. The dockcross/linux-armv7 image is a x86_64 |
||||
# image with crosscompilation toolchain installed |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile.template`!!! |
||||
FROM dockcross/linux-armv7 |
||||
|
||||
<%text>RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \ |
||||
libnss3-dev libssl-dev libreadline-dev libffi-dev && apt-get clean</%text> |
||||
|
||||
ADD install_python_for_wheel_crosscompilation.sh /scripts/install_python_for_wheel_crosscompilation.sh |
||||
|
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.8.8" "3.8.8" /opt/python/cp38-cp38 |
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.9.2" "3.9.2" /opt/python/cp39-cp39 |
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.10.0" "3.10.0rc1" /opt/python/cp310-cp310 |
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.11.0" "3.11.0rc1" /opt/python/cp311-cp311 |
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.12.0" "3.12.0rc2" /opt/python/cp312-cp312 |
||||
RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.13.0" "3.13.0rc2" /opt/python/cp313-cp313 |
||||
|
||||
ENV AUDITWHEEL_ARCH armv7l |
||||
ENV AUDITWHEEL_PLAT linux_armv7l |
||||
|
||||
<%include file="../ccache_crosscompile.include"/> |
||||
|
||||
# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations |
||||
# to ccache via a symlink. Use relative paths instead. |
||||
<%text> |
||||
ENV CC ${CROSS_TRIPLE}-gcc |
||||
ENV CXX ${CROSS_TRIPLE}-g++ |
||||
</%text> |
||||
|
||||
# For historical reasons, task_runner.py the script under docker container using "bash -l" |
||||
# which loads /etc/profile on startup. dockcross/linux-armv7 is based on an image where |
||||
# /etc/profile overwrites contents of PATH (for security reasons) when run as root. |
||||
# That causes the crosscompiler binaries located under /usr/xcc/armv7-unknown-linux-gnueabi/bin |
||||
# to be removed from PATH. Since in our builds we don't need the /etc/profile for anything, we can just |
||||
# truncate it. |
||||
# TODO(jtattermusch): Remove this hack when possible. |
||||
RUN echo "# file contents removed to avoid resetting PATH set by the docker image" >/etc/profile |
||||
|
||||
<%include file="../git_config.include"/> |
@ -0,0 +1,28 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile.template`!!! |
||||
|
||||
FROM dockcross/manylinux2014-aarch64:20240812-60fa1b0 |
||||
|
||||
# manylinux_2_17 is the preferred alias of manylinux2014 |
||||
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH |
||||
|
||||
<%include file="../python_pip_builds.include"/> |
||||
|
||||
<%include file="../ccache_crosscompile.include"/> |
||||
|
||||
<%include file="../git_config.include"/> |
@ -0,0 +1,33 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# Docker file for building gRPC manylinux Python artifacts. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile.template`!!! |
||||
|
||||
FROM quay.io/pypa/manylinux2014_x86_64:2024-09-09-f386546 |
||||
|
||||
# manylinux_2_17 is the preferred alias of manylinux2014 |
||||
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH |
||||
|
||||
# TODO(jtattermusch): revisit which of the deps are really required |
||||
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel |
||||
|
||||
<%include file="../python_pip_builds.include"/> |
||||
|
||||
<%include file="../ccache.include"/> |
||||
|
||||
<%include file="../git_config.include"/> |
@ -0,0 +1,34 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# Docker file for building gRPC manylinux Python artifacts. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile.template`!!! |
||||
|
||||
FROM quay.io/pypa/manylinux2014_i686:2024-09-09-f386546 |
||||
|
||||
# manylinux_2_17 is the preferred alias of manylinux2014 |
||||
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH |
||||
|
||||
# TODO(jtattermusch): revisit which of the deps are really required |
||||
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel |
||||
|
||||
<%include file="../python_pip_builds.include"/> |
||||
|
||||
<%include file="../ccache.include"/> |
||||
|
||||
|
||||
<%include file="../git_config.include"/> |
@ -0,0 +1,27 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile.template`!!! |
||||
|
||||
FROM quay.io/pypa/musllinux_1_1_x86_64:2024-09-09-f386546 |
||||
|
||||
<%include file="../python_pip_builds.include"/> |
||||
|
||||
<%include file="../ccache.include"/> |
||||
|
||||
<%include file="../git_config.include"/> |
||||
|
||||
RUN apk add openssl openssl-dev |
@ -0,0 +1,25 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
# Copyright 2024 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile.template`!!! |
||||
|
||||
FROM quay.io/pypa/musllinux_1_1_i686:2024-09-09-f386546 |
||||
|
||||
<%include file="../python_pip_builds.include"/> |
||||
|
||||
<%include file="../ccache.include"/> |
||||
|
||||
<%include file="../git_config.include"/> |
@ -0,0 +1,8 @@ |
||||
#=================================== |
||||
# Install Python build requirements |
||||
RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<4.0.0rc1' |
||||
RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<4.0.0rc1' |
||||
RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<4.0.0rc1' |
||||
RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<4.0.0rc1' |
||||
RUN /opt/python/cp312-cp312/bin/pip install --upgrade 'cython<4.0.0rc1' |
||||
RUN /opt/python/cp313-cp313/bin/pip install --upgrade 'cython<4.0.0rc1' |
@ -0,0 +1,147 @@ |
||||
//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//
|
||||
|
||||
#include <gtest/gtest.h> |
||||
|
||||
#include <grpc/impl/grpc_types.h> |
||||
|
||||
#include "src/core/client_channel/client_channel_filter.h" |
||||
#include "src/core/lib/security/context/security_context.h" |
||||
#include "src/core/tsi/transport_security.h" |
||||
#include "test/core/test_util/test_config.h" |
||||
|
||||
namespace grpc_core { |
||||
namespace testing { |
||||
namespace { |
||||
|
||||
absl::string_view GetLocalUnixAddress(grpc_endpoint* /*ep*/) { return "unix:"; } |
||||
|
||||
const grpc_endpoint_vtable kUnixEndpointVtable = { |
||||
nullptr, nullptr, nullptr, nullptr, |
||||
nullptr, nullptr, nullptr, GetLocalUnixAddress, |
||||
nullptr, nullptr}; |
||||
|
||||
absl::string_view GetLocalTcpAddress(grpc_endpoint* /*ep*/) { |
||||
return "ipv4:127.0.0.1:12667"; |
||||
} |
||||
|
||||
const grpc_endpoint_vtable kTcpEndpointVtable = { |
||||
nullptr, nullptr, nullptr, nullptr, |
||||
nullptr, nullptr, nullptr, GetLocalTcpAddress, |
||||
nullptr, nullptr}; |
||||
|
||||
std::string GetSecurityLevelForServer(grpc_local_connect_type connect_type, |
||||
grpc_endpoint& ep) { |
||||
grpc_server_credentials* server_creds = |
||||
grpc_local_server_credentials_create(connect_type); |
||||
ChannelArgs args; |
||||
RefCountedPtr<grpc_server_security_connector> connector = |
||||
server_creds->create_security_connector(args); |
||||
tsi_peer peer; |
||||
CHECK(tsi_construct_peer(0, &peer) == TSI_OK); |
||||
|
||||
RefCountedPtr<grpc_auth_context> auth_context; |
||||
connector->check_peer(peer, &ep, args, &auth_context, nullptr); |
||||
tsi_peer_destruct(&peer); |
||||
auto it = grpc_auth_context_find_properties_by_name( |
||||
auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME); |
||||
const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); |
||||
std::string actual_level; |
||||
if (prop != nullptr) { |
||||
actual_level = std::string(prop->value, prop->value_length); |
||||
} |
||||
connector.reset(); |
||||
auth_context.reset(); |
||||
grpc_server_credentials_release(server_creds); |
||||
return actual_level; |
||||
} |
||||
|
||||
std::string GetSecurityLevelForChannel(grpc_local_connect_type connect_type, |
||||
grpc_endpoint& ep) { |
||||
grpc_channel_credentials* channel_creds = |
||||
grpc_local_credentials_create(connect_type); |
||||
ChannelArgs args; |
||||
args = args.Set((char*)GRPC_ARG_SERVER_URI, (char*)"unix:"); |
||||
RefCountedPtr<grpc_channel_security_connector> connector = |
||||
channel_creds->create_security_connector(nullptr, "unix:", &args); |
||||
tsi_peer peer; |
||||
CHECK(tsi_construct_peer(0, &peer) == TSI_OK); |
||||
RefCountedPtr<grpc_auth_context> auth_context; |
||||
connector->check_peer(peer, &ep, args, &auth_context, nullptr); |
||||
tsi_peer_destruct(&peer); |
||||
auto it = grpc_auth_context_find_properties_by_name( |
||||
auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME); |
||||
const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); |
||||
std::string actual_level; |
||||
if (prop != nullptr) { |
||||
actual_level = std::string(prop->value, prop->value_length); |
||||
} |
||||
connector.reset(); |
||||
auth_context.reset(); |
||||
grpc_channel_credentials_release(channel_creds); |
||||
return actual_level; |
||||
} |
||||
|
||||
TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionServer) { |
||||
grpc_endpoint ep; |
||||
ep.vtable = &kUnixEndpointVtable; |
||||
std::string actual_level = GetSecurityLevelForServer(UDS, ep); |
||||
ASSERT_EQ(actual_level, |
||||
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY)); |
||||
} |
||||
|
||||
TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionServer) { |
||||
grpc_endpoint ep; |
||||
ep.vtable = &kTcpEndpointVtable; |
||||
std::string actual_level = GetSecurityLevelForServer(LOCAL_TCP, ep); |
||||
ASSERT_EQ(actual_level, |
||||
IsLocalConnectorSecureEnabled() |
||||
? tsi_security_level_to_string(TSI_SECURITY_NONE) |
||||
: tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY)); |
||||
} |
||||
|
||||
TEST(LocalSecurityConnectorTest, CheckSecurityLevelOfUdsConnectionChannel) { |
||||
grpc_endpoint ep; |
||||
ep.vtable = &kUnixEndpointVtable; |
||||
std::string actual_level = GetSecurityLevelForChannel(UDS, ep); |
||||
ASSERT_EQ(actual_level, |
||||
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY)); |
||||
} |
||||
|
||||
TEST(LocalSecurityConnectorTest, SecurityLevelOfTcpConnectionChannel) { |
||||
grpc_endpoint ep; |
||||
ep.vtable = &kTcpEndpointVtable; |
||||
std::string actual_level = GetSecurityLevelForChannel(LOCAL_TCP, ep); |
||||
ASSERT_EQ(actual_level, |
||||
IsLocalConnectorSecureEnabled() |
||||
? tsi_security_level_to_string(TSI_SECURITY_NONE) |
||||
: tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY)); |
||||
} |
||||
|
||||
} // namespace
|
||||
} // namespace testing
|
||||
} // namespace grpc_core
|
||||
|
||||
int main(int argc, char** argv) { |
||||
grpc::testing::TestEnvironment env(&argc, argv); |
||||
::testing::InitGoogleTest(&argc, argv); |
||||
grpc_init(); |
||||
int ret = RUN_ALL_TESTS(); |
||||
grpc_shutdown(); |
||||
return ret; |
||||
} |
@ -0,0 +1,33 @@ |
||||
# 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. |
||||
"""Buildgen python version plugin |
||||
|
||||
This parses the list of supported python versions from the yaml build file, and |
||||
creates custom strings for the minimum and maximum supported python versions. |
||||
|
||||
""" |
||||
|
||||
|
||||
def mako_plugin(dictionary): |
||||
"""Expand version numbers: |
||||
- for each language, ensure there's a language_version tag in |
||||
settings (defaulting to the master version tag) |
||||
- expand version strings to major, minor, patch, and tag |
||||
""" |
||||
|
||||
settings = dictionary["settings"] |
||||
|
||||
supported_python_versions = settings["supported_python_versions"] |
||||
settings["min_python_version"] = supported_python_versions[0] |
||||
settings["max_python_version"] = supported_python_versions[-1] |
@ -0,0 +1,25 @@ |
||||
#!/bin/bash |
||||
# Copyright 2024 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. |
||||
|
||||
set -ex |
||||
|
||||
BASEDIR=$(dirname "$0")/../.. |
||||
cd "$BASEDIR"; |
||||
|
||||
# install python all modules |
||||
./tools/distrib/install_all_python_modules.sh |
||||
|
||||
# run python tooling tests |
||||
./tools/distrib/python_tooling_tests.sh |
@ -1,10 +1,12 @@ |
||||
include _parallel_compile_patch.py |
||||
include _spawn_patch.py |
||||
include grpc_version.py |
||||
include python_version.py |
||||
include protoc_deps.py |
||||
include protoc_lib_deps.py |
||||
include README.rst |
||||
include grpc_tools/grpc_version.py |
||||
include grpc_tools/python_version.py |
||||
graft grpc_tools |
||||
graft grpc_root |
||||
graft third_party |
||||
|
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
@ -0,0 +1,20 @@ |
||||
# 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. |
||||
|
||||
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/python_version.py.template`!!! |
||||
|
||||
SUPPORTED_PYTHON_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] |
||||
|
||||
MIN_PYTHON_VERSION = 3.8 |
||||
MAX_PYTHON_VERSION = 3.13 |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue