From 7f9bc29fe30165e8d53b5dff61eef78434f17b4b Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Wed, 1 Mar 2023 09:11:23 +0530 Subject: [PATCH 1/7] Adds support to run lightweight kubernetes testcontainer using k3s --- k3s/README.rst | 1 + k3s/setup.py | 17 +++++++++ k3s/testcontainers/k3s/__init__.py | 59 ++++++++++++++++++++++++++++++ k3s/tests/test_k3s.py | 8 ++++ requirements.in | 1 + requirements/3.10.txt | 37 ++++++++----------- requirements/3.7.txt | 37 ++++++++----------- requirements/3.8.txt | 39 ++++++++------------ requirements/3.9.txt | 37 ++++++++----------- 9 files changed, 147 insertions(+), 89 deletions(-) create mode 100644 k3s/README.rst create mode 100644 k3s/setup.py create mode 100644 k3s/testcontainers/k3s/__init__.py create mode 100644 k3s/tests/test_k3s.py diff --git a/k3s/README.rst b/k3s/README.rst new file mode 100644 index 00000000..51e4c502 --- /dev/null +++ b/k3s/README.rst @@ -0,0 +1 @@ +.. autoclass:: testcontainers.k3s.K3SContainer diff --git a/k3s/setup.py b/k3s/setup.py new file mode 100644 index 00000000..e2c2519b --- /dev/null +++ b/k3s/setup.py @@ -0,0 +1,17 @@ +from setuptools import setup, find_namespace_packages + +description = "K3S component of testcontainers-python." + +setup( + name="testcontainers-k3s", + version="0.0.1rc1", + packages=find_namespace_packages(), + description=description, + long_description=description, + long_description_content_type="text/x-rst", + url="https://github.com/testcontainers/testcontainers-python", + install_requires=[ + "testcontainers-core", + ], + python_requires=">=3.7", +) diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py new file mode 100644 index 00000000..194a1798 --- /dev/null +++ b/k3s/testcontainers/k3s/__init__.py @@ -0,0 +1,59 @@ +# +# 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 testcontainers.core.config import MAX_TRIES +from testcontainers.core.container import DockerContainer +from testcontainers.core.waiting_utils import wait_for_logs + + +class K3SContainer(DockerContainer): + """ + K3S container. + + Example: + + .. doctest:: + + >>> import json + >>> import urllib + >>> from testcontainers.k3s import K3SContainer + + >>> with K3SContainer() as k3s: + >>> k3s.config_yaml() + """ + + KUBE_SECURE_PORT = 6443 + RANCHER_WEBHOOK_PORT = 8443 + + def __init__(self, image="rancher/k3s:latest", **kwargs) -> None: + super(K3SContainer, self).__init__(image, **kwargs) + self.with_exposed_ports(self.KUBE_SECURE_PORT, self.RANCHER_WEBHOOK_PORT) + self.with_env("K3S_URL", + 'https://localhost:{}'.format(self.KUBE_SECURE_PORT)) + self.with_command("server --disable traefik --tls-san=" + self.get_container_host_ip()) + self.with_kwargs(privileged=True, tmpfs={"/run": "", "/var/run": ""}) + self.with_volume_mapping("/sys/fs/cgroup", "/sys/fs/cgroup", "rw") + + def _connect(self) -> None: + wait_for_logs(self, predicate="Node controller sync successful", timeout=MAX_TRIES) + + def start(self) -> "K3SContainer": + super().start() + self._connect() + return self + + def config_yaml(self) -> str: + output = self.get_wrapped_container().exec_run(['cat', '/etc/rancher/k3s/k3s.yaml']) + config_yaml = output.output.decode('utf-8').replace('https://127.0.0.1:6443', 'https://localhost:{}'.format( + self.get_exposed_port(self.KUBE_SECURE_PORT))) + return config_yaml diff --git a/k3s/tests/test_k3s.py b/k3s/tests/test_k3s.py new file mode 100644 index 00000000..3f90926c --- /dev/null +++ b/k3s/tests/test_k3s.py @@ -0,0 +1,8 @@ +# The versions below were the current supported versions at time of writing (2022-08-11) + +from testcontainers.k3s import K3SContainer + + +def test_docker_run_elasticsearch(): + with K3SContainer() as k3s: + assert 'https://localhost:{}'.format(k3s.get_exposed_port(k3s.KUBE_SECURE_PORT)) in k3s.config_yaml() diff --git a/requirements.in b/requirements.in index 0204fdb8..f4f51d2a 100644 --- a/requirements.in +++ b/requirements.in @@ -21,6 +21,7 @@ -e file:rabbitmq -e file:redis -e file:selenium +-e file:k3s codecov>=2.1.0 cryptography<37 flake8<3.8.0 # 3.8.0 adds a dependency on importlib-metadata which conflicts with other packages. diff --git a/requirements/3.10.txt b/requirements/3.10.txt index 85903304..ea3fd432 100644 --- a/requirements/3.10.txt +++ b/requirements/3.10.txt @@ -24,6 +24,7 @@ # testcontainers-compose # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -43,6 +44,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,10 +93,8 @@ attrs==22.2.0 # pytest # trio azure-core==1.26.3 - # via - # azure-storage-blob - # msrest -azure-storage-blob==12.14.1 + # via azure-storage-blob +azure-storage-blob==12.15.0 # via testcontainers-azurite babel==2.11.0 # via sphinx @@ -106,7 +107,6 @@ cachetools==5.3.0 certifi==2022.12.7 # via # minio - # msrest # opensearch-py # requests # selenium @@ -120,7 +120,7 @@ clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.1.0 +coverage[toml]==7.2.0 # via # codecov # pytest-cov @@ -162,7 +162,7 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.0 +google-auth==2.16.1 # via google-api-core google-cloud-pubsub==1.7.2 # via testcontainers-gcp @@ -175,7 +175,7 @@ greenlet==2.0.2 # via sqlalchemy grpc-google-iam-v1==0.12.6 # via google-cloud-pubsub -grpcio==1.51.1 +grpcio==1.51.3 # via # google-api-core # googleapis-common-protos @@ -198,7 +198,7 @@ importlib-metadata==6.0.0 iniconfig==2.0.0 # via pytest isodate==0.6.1 - # via msrest + # via azure-storage-blob jaraco-classes==3.2.3 # via keyring jeepney==0.8.0 @@ -213,7 +213,7 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 # via jinja2 @@ -225,12 +225,8 @@ minio==7.1.13 # via testcontainers-minio more-itertools==9.0.0 # via jaraco-classes -msrest==0.7.1 - # via azure-storage-blob neo4j==5.5.0 # via testcontainers-neo4j -oauthlib==3.2.2 - # via requests-oauthlib opensearch-py==2.1.1 # via testcontainers-opensearch outcome==1.2.0 @@ -297,7 +293,7 @@ pytest==7.2.1 # pytest-cov pytest-cov==4.0.0 # via -r requirements.in -python-arango==7.5.6 +python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 # via pg8000 @@ -327,16 +323,12 @@ requests==2.28.2 # docker # docker-compose # google-api-core - # msrest # opensearch-py # python-arango # python-keycloak - # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-oauthlib==1.3.1 - # via msrest requests-toolbelt==0.9.1 # via # python-arango @@ -354,7 +346,7 @@ scramp==1.4.4 # via pg8000 secretstorage==3.3.3 # via keyring -selenium==4.8.0 +selenium==4.8.2 # via testcontainers-selenium six==1.16.0 # via @@ -387,7 +379,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.3 +sqlalchemy==2.0.4 # via # testcontainers-mssql # testcontainers-mysql @@ -410,6 +402,7 @@ twine==4.0.2 typing-extensions==4.5.0 # via # azure-core + # azure-storage-blob # sqlalchemy tzdata==2022.7 # via pytz-deprecation-shim @@ -437,7 +430,7 @@ wrapt==1.14.1 # via testcontainers-core wsproto==1.2.0 # via trio-websocket -zipp==3.13.0 +zipp==3.15.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/3.7.txt b/requirements/3.7.txt index 18dd9d49..fc3b7bb9 100644 --- a/requirements/3.7.txt +++ b/requirements/3.7.txt @@ -24,6 +24,7 @@ # testcontainers-compose # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -43,6 +44,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,10 +93,8 @@ attrs==22.2.0 # pytest # trio azure-core==1.26.3 - # via - # azure-storage-blob - # msrest -azure-storage-blob==12.14.1 + # via azure-storage-blob +azure-storage-blob==12.15.0 # via testcontainers-azurite babel==2.11.0 # via sphinx @@ -112,7 +113,6 @@ cachetools==5.3.0 certifi==2022.12.7 # via # minio - # msrest # opensearch-py # requests # selenium @@ -126,7 +126,7 @@ clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.1.0 +coverage[toml]==7.2.0 # via # codecov # pytest-cov @@ -168,7 +168,7 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.0 +google-auth==2.16.1 # via google-api-core google-cloud-pubsub==1.7.2 # via testcontainers-gcp @@ -181,7 +181,7 @@ greenlet==2.0.2 # via sqlalchemy grpc-google-iam-v1==0.12.6 # via google-cloud-pubsub -grpcio==1.51.1 +grpcio==1.51.3 # via # google-api-core # googleapis-common-protos @@ -209,12 +209,12 @@ importlib-metadata==6.0.0 # sphinx # sqlalchemy # twine -importlib-resources==5.10.2 +importlib-resources==5.12.0 # via keyring iniconfig==2.0.0 # via pytest isodate==0.6.1 - # via msrest + # via azure-storage-blob jaraco-classes==3.2.3 # via keyring jeepney==0.8.0 @@ -229,7 +229,7 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 # via jinja2 @@ -241,12 +241,8 @@ minio==7.1.13 # via testcontainers-minio more-itertools==9.0.0 # via jaraco-classes -msrest==0.7.1 - # via azure-storage-blob neo4j==5.5.0 # via testcontainers-neo4j -oauthlib==3.2.2 - # via requests-oauthlib opensearch-py==2.1.1 # via testcontainers-opensearch outcome==1.2.0 @@ -343,16 +339,12 @@ requests==2.28.2 # docker # docker-compose # google-api-core - # msrest # opensearch-py # python-arango # python-keycloak - # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-oauthlib==1.3.1 - # via msrest requests-toolbelt==0.9.1 # via # python-arango @@ -370,7 +362,7 @@ scramp==1.4.4 # via pg8000 secretstorage==3.3.3 # via keyring -selenium==4.8.0 +selenium==4.8.2 # via testcontainers-selenium six==1.16.0 # via @@ -403,7 +395,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.3 +sqlalchemy==2.0.4 # via # testcontainers-mssql # testcontainers-mysql @@ -427,6 +419,7 @@ typing-extensions==4.5.0 # via # async-timeout # azure-core + # azure-storage-blob # h11 # importlib-metadata # markdown-it-py @@ -459,7 +452,7 @@ wrapt==1.14.1 # via testcontainers-core wsproto==1.2.0 # via trio-websocket -zipp==3.13.0 +zipp==3.15.0 # via # importlib-metadata # importlib-resources diff --git a/requirements/3.8.txt b/requirements/3.8.txt index 79810f5a..e8e52e44 100644 --- a/requirements/3.8.txt +++ b/requirements/3.8.txt @@ -24,6 +24,7 @@ # testcontainers-compose # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -43,6 +44,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,10 +93,8 @@ attrs==22.2.0 # pytest # trio azure-core==1.26.3 - # via - # azure-storage-blob - # msrest -azure-storage-blob==12.14.1 + # via azure-storage-blob +azure-storage-blob==12.15.0 # via testcontainers-azurite babel==2.11.0 # via sphinx @@ -110,7 +111,6 @@ cachetools==5.3.0 certifi==2022.12.7 # via # minio - # msrest # opensearch-py # requests # selenium @@ -124,7 +124,7 @@ clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.1.0 +coverage[toml]==7.2.0 # via # codecov # pytest-cov @@ -166,7 +166,7 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.0 +google-auth==2.16.1 # via google-api-core google-cloud-pubsub==1.7.2 # via testcontainers-gcp @@ -179,7 +179,7 @@ greenlet==2.0.2 # via sqlalchemy grpc-google-iam-v1==0.12.6 # via google-cloud-pubsub -grpcio==1.51.1 +grpcio==1.51.3 # via # google-api-core # googleapis-common-protos @@ -200,12 +200,12 @@ importlib-metadata==6.0.0 # keyring # sphinx # twine -importlib-resources==5.10.2 +importlib-resources==5.12.0 # via keyring iniconfig==2.0.0 # via pytest isodate==0.6.1 - # via msrest + # via azure-storage-blob jaraco-classes==3.2.3 # via keyring jeepney==0.8.0 @@ -220,7 +220,7 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 # via jinja2 @@ -232,12 +232,8 @@ minio==7.1.13 # via testcontainers-minio more-itertools==9.0.0 # via jaraco-classes -msrest==0.7.1 - # via azure-storage-blob neo4j==5.5.0 # via testcontainers-neo4j -oauthlib==3.2.2 - # via requests-oauthlib opensearch-py==2.1.1 # via testcontainers-opensearch outcome==1.2.0 @@ -304,7 +300,7 @@ pytest==7.2.1 # pytest-cov pytest-cov==4.0.0 # via -r requirements.in -python-arango==7.5.6 +python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 # via pg8000 @@ -334,16 +330,12 @@ requests==2.28.2 # docker # docker-compose # google-api-core - # msrest # opensearch-py # python-arango # python-keycloak - # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-oauthlib==1.3.1 - # via msrest requests-toolbelt==0.9.1 # via # python-arango @@ -361,7 +353,7 @@ scramp==1.4.4 # via pg8000 secretstorage==3.3.3 # via keyring -selenium==4.8.0 +selenium==4.8.2 # via testcontainers-selenium six==1.16.0 # via @@ -394,7 +386,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.3 +sqlalchemy==2.0.4 # via # testcontainers-mssql # testcontainers-mysql @@ -417,6 +409,7 @@ twine==4.0.2 typing-extensions==4.5.0 # via # azure-core + # azure-storage-blob # rich # sqlalchemy tzdata==2022.7 @@ -445,7 +438,7 @@ wrapt==1.14.1 # via testcontainers-core wsproto==1.2.0 # via trio-websocket -zipp==3.13.0 +zipp==3.15.0 # via # importlib-metadata # importlib-resources diff --git a/requirements/3.9.txt b/requirements/3.9.txt index 7da5249f..f9d6efde 100644 --- a/requirements/3.9.txt +++ b/requirements/3.9.txt @@ -24,6 +24,7 @@ # testcontainers-compose # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -43,6 +44,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,10 +93,8 @@ attrs==22.2.0 # pytest # trio azure-core==1.26.3 - # via - # azure-storage-blob - # msrest -azure-storage-blob==12.14.1 + # via azure-storage-blob +azure-storage-blob==12.15.0 # via testcontainers-azurite babel==2.11.0 # via sphinx @@ -106,7 +107,6 @@ cachetools==5.3.0 certifi==2022.12.7 # via # minio - # msrest # opensearch-py # requests # selenium @@ -120,7 +120,7 @@ clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.1.0 +coverage[toml]==7.2.0 # via # codecov # pytest-cov @@ -162,7 +162,7 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.0 +google-auth==2.16.1 # via google-api-core google-cloud-pubsub==1.7.2 # via testcontainers-gcp @@ -175,7 +175,7 @@ greenlet==2.0.2 # via sqlalchemy grpc-google-iam-v1==0.12.6 # via google-cloud-pubsub -grpcio==1.51.1 +grpcio==1.51.3 # via # google-api-core # googleapis-common-protos @@ -199,7 +199,7 @@ importlib-metadata==6.0.0 iniconfig==2.0.0 # via pytest isodate==0.6.1 - # via msrest + # via azure-storage-blob jaraco-classes==3.2.3 # via keyring jeepney==0.8.0 @@ -214,7 +214,7 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine -markdown-it-py==2.1.0 +markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 # via jinja2 @@ -226,12 +226,8 @@ minio==7.1.13 # via testcontainers-minio more-itertools==9.0.0 # via jaraco-classes -msrest==0.7.1 - # via azure-storage-blob neo4j==5.5.0 # via testcontainers-neo4j -oauthlib==3.2.2 - # via requests-oauthlib opensearch-py==2.1.1 # via testcontainers-opensearch outcome==1.2.0 @@ -298,7 +294,7 @@ pytest==7.2.1 # pytest-cov pytest-cov==4.0.0 # via -r requirements.in -python-arango==7.5.6 +python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 # via pg8000 @@ -328,16 +324,12 @@ requests==2.28.2 # docker # docker-compose # google-api-core - # msrest # opensearch-py # python-arango # python-keycloak - # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-oauthlib==1.3.1 - # via msrest requests-toolbelt==0.9.1 # via # python-arango @@ -355,7 +347,7 @@ scramp==1.4.4 # via pg8000 secretstorage==3.3.3 # via keyring -selenium==4.8.0 +selenium==4.8.2 # via testcontainers-selenium six==1.16.0 # via @@ -388,7 +380,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.3 +sqlalchemy==2.0.4 # via # testcontainers-mssql # testcontainers-mysql @@ -411,6 +403,7 @@ twine==4.0.2 typing-extensions==4.5.0 # via # azure-core + # azure-storage-blob # sqlalchemy tzdata==2022.7 # via pytz-deprecation-shim @@ -438,7 +431,7 @@ wrapt==1.14.1 # via testcontainers-core wsproto==1.2.0 # via trio-websocket -zipp==3.13.0 +zipp==3.15.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: From 87c5c34f3b59d13fd40bfe7478cde242ba8a3d5d Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Wed, 1 Mar 2023 09:34:44 +0530 Subject: [PATCH 2/7] adds document i toctree and updates github workflow to run k3s tests --- .github/workflows/main.yml | 1 + README.rst | 1 + k3s/testcontainers/k3s/__init__.py | 7 ++++--- k3s/tests/test_k3s.py | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15d79b93..b12493ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,7 @@ jobs: - rabbitmq - redis - selenium + - k3s runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/README.rst b/README.rst index 08145687..af5f7387 100644 --- a/README.rst +++ b/README.rst @@ -34,6 +34,7 @@ testcontainers-python facilitates the use of Docker containers for functional an rabbitmq/README redis/README selenium/README + k3s/README Getting Started --------------- diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py index 194a1798..0ab30235 100644 --- a/k3s/testcontainers/k3s/__init__.py +++ b/k3s/testcontainers/k3s/__init__.py @@ -29,7 +29,7 @@ class K3SContainer(DockerContainer): >>> from testcontainers.k3s import K3SContainer >>> with K3SContainer() as k3s: - >>> k3s.config_yaml() + ... config_yaml = k3s.config_yaml() """ KUBE_SECURE_PORT = 6443 @@ -54,6 +54,7 @@ def start(self) -> "K3SContainer": def config_yaml(self) -> str: output = self.get_wrapped_container().exec_run(['cat', '/etc/rancher/k3s/k3s.yaml']) - config_yaml = output.output.decode('utf-8').replace('https://127.0.0.1:6443', 'https://localhost:{}'.format( - self.get_exposed_port(self.KUBE_SECURE_PORT))) + config_yaml = output.output.decode('utf-8') \ + .replace('https://127.0.0.1:{}'.format(self.KUBE_SECURE_PORT), 'https://localhost:{}' + .format(self.get_exposed_port(self.KUBE_SECURE_PORT))) return config_yaml diff --git a/k3s/tests/test_k3s.py b/k3s/tests/test_k3s.py index 3f90926c..133fa340 100644 --- a/k3s/tests/test_k3s.py +++ b/k3s/tests/test_k3s.py @@ -5,4 +5,6 @@ def test_docker_run_elasticsearch(): with K3SContainer() as k3s: - assert 'https://localhost:{}'.format(k3s.get_exposed_port(k3s.KUBE_SECURE_PORT)) in k3s.config_yaml() + exposed_port = k3s.get_exposed_port(k3s.KUBE_SECURE_PORT) + server_url_in_config_yaml = 'https://localhost:{}'.format(exposed_port) + assert server_url_in_config_yaml in k3s.config_yaml() From ea446b8a907075da6087470f0d2962a0fb088cea Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Fri, 10 Mar 2023 09:34:14 +0530 Subject: [PATCH 3/7] incorporates review feedback and updates tests to connect to k8s cluster using python kubernetes --- k3s/setup.py | 1 + k3s/testcontainers/k3s/__init__.py | 18 ++++++---- k3s/tests/test_k3s.py | 10 +++--- requirements/3.10.txt | 56 +++++++++++++++++++++--------- requirements/3.7.txt | 55 ++++++++++++++++++++--------- requirements/3.8.txt | 55 ++++++++++++++++++++--------- requirements/3.9.txt | 56 +++++++++++++++++++++--------- 7 files changed, 174 insertions(+), 77 deletions(-) diff --git a/k3s/setup.py b/k3s/setup.py index e2c2519b..de9b6b08 100644 --- a/k3s/setup.py +++ b/k3s/setup.py @@ -12,6 +12,7 @@ url="https://github.com/testcontainers/testcontainers-python", install_requires=[ "testcontainers-core", + "kubernetes" ], python_requires=">=3.7", ) diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py index 0ab30235..95477abe 100644 --- a/k3s/testcontainers/k3s/__init__.py +++ b/k3s/testcontainers/k3s/__init__.py @@ -29,7 +29,9 @@ class K3SContainer(DockerContainer): >>> from testcontainers.k3s import K3SContainer >>> with K3SContainer() as k3s: - ... config_yaml = k3s.config_yaml() + ... config.load_kube_config_from_dict(yaml.safe_load(k3s.config_yaml())) + ... pod = client.CoreV1Api().list_pod_for_all_namespaces(limit=1) + ... assert len(pod.items) > 0, "Unable to get running nodes from k3s cluster" """ KUBE_SECURE_PORT = 6443 @@ -38,8 +40,7 @@ class K3SContainer(DockerContainer): def __init__(self, image="rancher/k3s:latest", **kwargs) -> None: super(K3SContainer, self).__init__(image, **kwargs) self.with_exposed_ports(self.KUBE_SECURE_PORT, self.RANCHER_WEBHOOK_PORT) - self.with_env("K3S_URL", - 'https://localhost:{}'.format(self.KUBE_SECURE_PORT)) + self.with_env("K3S_URL", f'https://{self.get_container_host_ip()}:{self.KUBE_SECURE_PORT}') self.with_command("server --disable traefik --tls-san=" + self.get_container_host_ip()) self.with_kwargs(privileged=True, tmpfs={"/run": "", "/var/run": ""}) self.with_volume_mapping("/sys/fs/cgroup", "/sys/fs/cgroup", "rw") @@ -53,8 +54,11 @@ def start(self) -> "K3SContainer": return self def config_yaml(self) -> str: - output = self.get_wrapped_container().exec_run(['cat', '/etc/rancher/k3s/k3s.yaml']) - config_yaml = output.output.decode('utf-8') \ - .replace('https://127.0.0.1:{}'.format(self.KUBE_SECURE_PORT), 'https://localhost:{}' - .format(self.get_exposed_port(self.KUBE_SECURE_PORT))) + """This function returns the kubernetes config yaml which can be used + to initialise python client + """ + execution = self.get_wrapped_container().exec_run(['cat', '/etc/rancher/k3s/k3s.yaml']) + config_yaml = execution.output.decode('utf-8') \ + .replace(f'https://127.0.0.1:{self.KUBE_SECURE_PORT}', + f'https://localhost:{self.get_exposed_port(self.KUBE_SECURE_PORT)}') return config_yaml diff --git a/k3s/tests/test_k3s.py b/k3s/tests/test_k3s.py index 133fa340..edff1c6d 100644 --- a/k3s/tests/test_k3s.py +++ b/k3s/tests/test_k3s.py @@ -1,10 +1,12 @@ # The versions below were the current supported versions at time of writing (2022-08-11) +import yaml +from kubernetes import client, config from testcontainers.k3s import K3SContainer -def test_docker_run_elasticsearch(): +def test_docker_run_k3s(): with K3SContainer() as k3s: - exposed_port = k3s.get_exposed_port(k3s.KUBE_SECURE_PORT) - server_url_in_config_yaml = 'https://localhost:{}'.format(exposed_port) - assert server_url_in_config_yaml in k3s.config_yaml() + config.load_kube_config_from_dict(yaml.safe_load(k3s.config_yaml())) + pod = client.CoreV1Api().list_pod_for_all_namespaces(limit=1) + assert len(pod.items) > 0, "Unable to get running nodes from k3s cluster" diff --git a/requirements/3.10.txt b/requirements/3.10.txt index ea3fd432..c58e5ba5 100644 --- a/requirements/3.10.txt +++ b/requirements/3.10.txt @@ -96,7 +96,7 @@ azure-core==1.26.3 # via azure-storage-blob azure-storage-blob==12.15.0 # via testcontainers-azurite -babel==2.11.0 +babel==2.12.1 # via sphinx bcrypt==4.0.1 # via paramiko @@ -106,6 +106,7 @@ cachetools==5.3.0 # via google-auth certifi==2022.12.7 # via + # kubernetes # minio # opensearch-py # requests @@ -114,13 +115,13 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 # via requests clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.2.0 +coverage[toml]==7.2.1 # via # codecov # pytest-cov @@ -132,6 +133,8 @@ cryptography==36.0.2 # secretstorage cx-oracle==8.3.0 # via testcontainers-oracle +deprecation==2.1.0 + # via python-keycloak distro==1.8.0 # via docker-compose dnspython==2.3.0 @@ -162,8 +165,10 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.1 - # via google-api-core +google-auth==2.16.2 + # via + # google-api-core + # kubernetes google-cloud-pubsub==1.7.2 # via testcontainers-gcp googleapis-common-protos[grpc]==1.58.0 @@ -213,6 +218,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine +kubernetes==26.1.0 + # via testcontainers-k3s markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 @@ -223,16 +230,19 @@ mdurl==0.1.2 # via markdown-it-py minio==7.1.13 # via testcontainers-minio -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes -neo4j==5.5.0 +neo4j==5.6.0 # via testcontainers-neo4j -opensearch-py==2.1.1 +oauthlib==3.2.2 + # via requests-oauthlib +opensearch-py==2.2.0 # via testcontainers-opensearch outcome==1.2.0 # via trio packaging==23.0 # via + # deprecation # docker # pytest # sphinx @@ -287,7 +297,7 @@ pyrsistent==0.19.3 # via jsonschema pysocks==1.7.1 # via urllib3 -pytest==7.2.1 +pytest==7.2.2 # via # -r requirements.in # pytest-cov @@ -296,22 +306,26 @@ pytest-cov==4.0.0 python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 - # via pg8000 + # via + # kubernetes + # opensearch-py + # pg8000 python-dotenv==0.21.1 # via docker-compose python-jose==3.3.0 # via python-keycloak -python-keycloak==2.12.0 +python-keycloak==2.13.2 # via testcontainers-keycloak pytz==2022.7.1 # via - # babel # clickhouse-driver # neo4j pytz-deprecation-shim==0.1.0.post0 # via tzlocal pyyaml==5.4.1 - # via docker-compose + # via + # docker-compose + # kubernetes readme-renderer==37.3 # via twine redis==4.5.1 @@ -323,20 +337,24 @@ requests==2.28.2 # docker # docker-compose # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-toolbelt==0.9.1 +requests-oauthlib==1.3.1 + # via kubernetes +requests-toolbelt==0.10.1 # via # python-arango # python-keycloak # twine rfc3986==2.0.0 # via twine -rich==13.3.1 +rich==13.3.2 # via twine rsa==4.9 # via @@ -357,6 +375,8 @@ six==1.16.0 # google-auth # isodate # jsonschema + # kubernetes + # opensearch-py # python-dateutil # websocket-client sniffio==1.3.0 @@ -379,7 +399,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.4 +sqlalchemy==2.0.5.post1 # via # testcontainers-mssql # testcontainers-mysql @@ -411,6 +431,7 @@ tzlocal==4.2 urllib3[socks]==1.26.14 # via # docker + # kubernetes # minio # opensearch-py # python-arango @@ -424,9 +445,10 @@ websocket-client==0.59.0 # via # docker # docker-compose + # kubernetes wheel==0.38.4 # via -r requirements.in -wrapt==1.14.1 +wrapt==1.15.0 # via testcontainers-core wsproto==1.2.0 # via trio-websocket diff --git a/requirements/3.7.txt b/requirements/3.7.txt index fc3b7bb9..b96164e4 100644 --- a/requirements/3.7.txt +++ b/requirements/3.7.txt @@ -96,7 +96,7 @@ azure-core==1.26.3 # via azure-storage-blob azure-storage-blob==12.15.0 # via testcontainers-azurite -babel==2.11.0 +babel==2.12.1 # via sphinx backports-zoneinfo==0.2.1 # via @@ -112,6 +112,7 @@ cachetools==5.3.0 # via google-auth certifi==2022.12.7 # via + # kubernetes # minio # opensearch-py # requests @@ -120,13 +121,13 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 # via requests clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.2.0 +coverage[toml]==7.2.1 # via # codecov # pytest-cov @@ -138,6 +139,8 @@ cryptography==36.0.2 # secretstorage cx-oracle==8.3.0 # via testcontainers-oracle +deprecation==2.1.0 + # via python-keycloak distro==1.8.0 # via docker-compose dnspython==2.3.0 @@ -168,8 +171,10 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.1 - # via google-api-core +google-auth==2.16.2 + # via + # google-api-core + # kubernetes google-cloud-pubsub==1.7.2 # via testcontainers-gcp googleapis-common-protos[grpc]==1.58.0 @@ -229,6 +234,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine +kubernetes==26.1.0 + # via testcontainers-k3s markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 @@ -239,16 +246,19 @@ mdurl==0.1.2 # via markdown-it-py minio==7.1.13 # via testcontainers-minio -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes -neo4j==5.5.0 +neo4j==5.6.0 # via testcontainers-neo4j -opensearch-py==2.1.1 +oauthlib==3.2.2 + # via requests-oauthlib +opensearch-py==2.2.0 # via testcontainers-opensearch outcome==1.2.0 # via trio packaging==23.0 # via + # deprecation # docker # pytest # sphinx @@ -303,7 +313,7 @@ pyrsistent==0.19.3 # via jsonschema pysocks==1.7.1 # via urllib3 -pytest==7.2.1 +pytest==7.2.2 # via # -r requirements.in # pytest-cov @@ -312,12 +322,15 @@ pytest-cov==4.0.0 python-arango==7.5.6 # via testcontainers-arangodb python-dateutil==2.8.2 - # via pg8000 + # via + # kubernetes + # opensearch-py + # pg8000 python-dotenv==0.21.1 # via docker-compose python-jose==3.3.0 # via python-keycloak -python-keycloak==2.12.0 +python-keycloak==2.13.2 # via testcontainers-keycloak pytz==2022.7.1 # via @@ -327,7 +340,9 @@ pytz==2022.7.1 pytz-deprecation-shim==0.1.0.post0 # via tzlocal pyyaml==5.4.1 - # via docker-compose + # via + # docker-compose + # kubernetes readme-renderer==37.3 # via twine redis==4.5.1 @@ -339,20 +354,24 @@ requests==2.28.2 # docker # docker-compose # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-toolbelt==0.9.1 +requests-oauthlib==1.3.1 + # via kubernetes +requests-toolbelt==0.10.1 # via # python-arango # python-keycloak # twine rfc3986==2.0.0 # via twine -rich==13.3.1 +rich==13.3.2 # via twine rsa==4.9 # via @@ -373,6 +392,8 @@ six==1.16.0 # google-auth # isodate # jsonschema + # kubernetes + # opensearch-py # python-dateutil # websocket-client sniffio==1.3.0 @@ -395,7 +416,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.4 +sqlalchemy==2.0.5.post1 # via # testcontainers-mssql # testcontainers-mysql @@ -433,6 +454,7 @@ tzlocal==4.2 urllib3[socks]==1.26.14 # via # docker + # kubernetes # minio # opensearch-py # python-arango @@ -446,9 +468,10 @@ websocket-client==0.59.0 # via # docker # docker-compose + # kubernetes wheel==0.38.4 # via -r requirements.in -wrapt==1.14.1 +wrapt==1.15.0 # via testcontainers-core wsproto==1.2.0 # via trio-websocket diff --git a/requirements/3.8.txt b/requirements/3.8.txt index e8e52e44..5e85b08d 100644 --- a/requirements/3.8.txt +++ b/requirements/3.8.txt @@ -96,7 +96,7 @@ azure-core==1.26.3 # via azure-storage-blob azure-storage-blob==12.15.0 # via testcontainers-azurite -babel==2.11.0 +babel==2.12.1 # via sphinx backports-zoneinfo==0.2.1 # via @@ -110,6 +110,7 @@ cachetools==5.3.0 # via google-auth certifi==2022.12.7 # via + # kubernetes # minio # opensearch-py # requests @@ -118,13 +119,13 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 # via requests clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.2.0 +coverage[toml]==7.2.1 # via # codecov # pytest-cov @@ -136,6 +137,8 @@ cryptography==36.0.2 # secretstorage cx-oracle==8.3.0 # via testcontainers-oracle +deprecation==2.1.0 + # via python-keycloak distro==1.8.0 # via docker-compose dnspython==2.3.0 @@ -166,8 +169,10 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.1 - # via google-api-core +google-auth==2.16.2 + # via + # google-api-core + # kubernetes google-cloud-pubsub==1.7.2 # via testcontainers-gcp googleapis-common-protos[grpc]==1.58.0 @@ -220,6 +225,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine +kubernetes==26.1.0 + # via testcontainers-k3s markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 @@ -230,16 +237,19 @@ mdurl==0.1.2 # via markdown-it-py minio==7.1.13 # via testcontainers-minio -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes -neo4j==5.5.0 +neo4j==5.6.0 # via testcontainers-neo4j -opensearch-py==2.1.1 +oauthlib==3.2.2 + # via requests-oauthlib +opensearch-py==2.2.0 # via testcontainers-opensearch outcome==1.2.0 # via trio packaging==23.0 # via + # deprecation # docker # pytest # sphinx @@ -294,7 +304,7 @@ pyrsistent==0.19.3 # via jsonschema pysocks==1.7.1 # via urllib3 -pytest==7.2.1 +pytest==7.2.2 # via # -r requirements.in # pytest-cov @@ -303,12 +313,15 @@ pytest-cov==4.0.0 python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 - # via pg8000 + # via + # kubernetes + # opensearch-py + # pg8000 python-dotenv==0.21.1 # via docker-compose python-jose==3.3.0 # via python-keycloak -python-keycloak==2.12.0 +python-keycloak==2.13.2 # via testcontainers-keycloak pytz==2022.7.1 # via @@ -318,7 +331,9 @@ pytz==2022.7.1 pytz-deprecation-shim==0.1.0.post0 # via tzlocal pyyaml==5.4.1 - # via docker-compose + # via + # docker-compose + # kubernetes readme-renderer==37.3 # via twine redis==4.5.1 @@ -330,20 +345,24 @@ requests==2.28.2 # docker # docker-compose # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-toolbelt==0.9.1 +requests-oauthlib==1.3.1 + # via kubernetes +requests-toolbelt==0.10.1 # via # python-arango # python-keycloak # twine rfc3986==2.0.0 # via twine -rich==13.3.1 +rich==13.3.2 # via twine rsa==4.9 # via @@ -364,6 +383,8 @@ six==1.16.0 # google-auth # isodate # jsonschema + # kubernetes + # opensearch-py # python-dateutil # websocket-client sniffio==1.3.0 @@ -386,7 +407,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.4 +sqlalchemy==2.0.5.post1 # via # testcontainers-mssql # testcontainers-mysql @@ -419,6 +440,7 @@ tzlocal==4.2 urllib3[socks]==1.26.14 # via # docker + # kubernetes # minio # opensearch-py # python-arango @@ -432,9 +454,10 @@ websocket-client==0.59.0 # via # docker # docker-compose + # kubernetes wheel==0.38.4 # via -r requirements.in -wrapt==1.14.1 +wrapt==1.15.0 # via testcontainers-core wsproto==1.2.0 # via trio-websocket diff --git a/requirements/3.9.txt b/requirements/3.9.txt index f9d6efde..b0cc8a66 100644 --- a/requirements/3.9.txt +++ b/requirements/3.9.txt @@ -96,7 +96,7 @@ azure-core==1.26.3 # via azure-storage-blob azure-storage-blob==12.15.0 # via testcontainers-azurite -babel==2.11.0 +babel==2.12.1 # via sphinx bcrypt==4.0.1 # via paramiko @@ -106,6 +106,7 @@ cachetools==5.3.0 # via google-auth certifi==2022.12.7 # via + # kubernetes # minio # opensearch-py # requests @@ -114,13 +115,13 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.0.1 +charset-normalizer==3.1.0 # via requests clickhouse-driver==0.2.5 # via testcontainers-clickhouse codecov==2.1.12 # via -r requirements.in -coverage[toml]==7.2.0 +coverage[toml]==7.2.1 # via # codecov # pytest-cov @@ -132,6 +133,8 @@ cryptography==36.0.2 # secretstorage cx-oracle==8.3.0 # via testcontainers-oracle +deprecation==2.1.0 + # via python-keycloak distro==1.8.0 # via docker-compose dnspython==2.3.0 @@ -162,8 +165,10 @@ flake8==3.7.9 # via -r requirements.in google-api-core[grpc]==2.11.0 # via google-cloud-pubsub -google-auth==2.16.1 - # via google-api-core +google-auth==2.16.2 + # via + # google-api-core + # kubernetes google-cloud-pubsub==1.7.2 # via testcontainers-gcp googleapis-common-protos[grpc]==1.58.0 @@ -214,6 +219,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==23.13.1 # via twine +kubernetes==26.1.0 + # via testcontainers-k3s markdown-it-py==2.2.0 # via rich markupsafe==2.1.2 @@ -224,16 +231,19 @@ mdurl==0.1.2 # via markdown-it-py minio==7.1.13 # via testcontainers-minio -more-itertools==9.0.0 +more-itertools==9.1.0 # via jaraco-classes -neo4j==5.5.0 +neo4j==5.6.0 # via testcontainers-neo4j -opensearch-py==2.1.1 +oauthlib==3.2.2 + # via requests-oauthlib +opensearch-py==2.2.0 # via testcontainers-opensearch outcome==1.2.0 # via trio packaging==23.0 # via + # deprecation # docker # pytest # sphinx @@ -288,7 +298,7 @@ pyrsistent==0.19.3 # via jsonschema pysocks==1.7.1 # via urllib3 -pytest==7.2.1 +pytest==7.2.2 # via # -r requirements.in # pytest-cov @@ -297,22 +307,26 @@ pytest-cov==4.0.0 python-arango==7.5.7 # via testcontainers-arangodb python-dateutil==2.8.2 - # via pg8000 + # via + # kubernetes + # opensearch-py + # pg8000 python-dotenv==0.21.1 # via docker-compose python-jose==3.3.0 # via python-keycloak -python-keycloak==2.12.0 +python-keycloak==2.13.2 # via testcontainers-keycloak pytz==2022.7.1 # via - # babel # clickhouse-driver # neo4j pytz-deprecation-shim==0.1.0.post0 # via tzlocal pyyaml==5.4.1 - # via docker-compose + # via + # docker-compose + # kubernetes readme-renderer==37.3 # via twine redis==4.5.1 @@ -324,20 +338,24 @@ requests==2.28.2 # docker # docker-compose # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine -requests-toolbelt==0.9.1 +requests-oauthlib==1.3.1 + # via kubernetes +requests-toolbelt==0.10.1 # via # python-arango # python-keycloak # twine rfc3986==2.0.0 # via twine -rich==13.3.1 +rich==13.3.2 # via twine rsa==4.9 # via @@ -358,6 +376,8 @@ six==1.16.0 # google-auth # isodate # jsonschema + # kubernetes + # opensearch-py # python-dateutil # websocket-client sniffio==1.3.0 @@ -380,7 +400,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sqlalchemy==2.0.4 +sqlalchemy==2.0.5.post1 # via # testcontainers-mssql # testcontainers-mysql @@ -412,6 +432,7 @@ tzlocal==4.2 urllib3[socks]==1.26.14 # via # docker + # kubernetes # minio # opensearch-py # python-arango @@ -425,9 +446,10 @@ websocket-client==0.59.0 # via # docker # docker-compose + # kubernetes wheel==0.38.4 # via -r requirements.in -wrapt==1.14.1 +wrapt==1.15.0 # via testcontainers-core wsproto==1.2.0 # via trio-websocket From 639932af13876def1cc8116f51096582153ef163 Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Fri, 10 Mar 2023 09:44:34 +0530 Subject: [PATCH 4/7] fixes failing doctest --- k3s/testcontainers/k3s/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py index 95477abe..0e6cd70a 100644 --- a/k3s/testcontainers/k3s/__init__.py +++ b/k3s/testcontainers/k3s/__init__.py @@ -26,7 +26,9 @@ class K3SContainer(DockerContainer): >>> import json >>> import urllib + >>> import yaml >>> from testcontainers.k3s import K3SContainer + >>> from kubernetes import client, config >>> with K3SContainer() as k3s: ... config.load_kube_config_from_dict(yaml.safe_load(k3s.config_yaml())) From 8e280a7c84f22592d49483c8e59c4cd77fe8c88d Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Sat, 11 Mar 2023 05:18:46 +0530 Subject: [PATCH 5/7] using get_container_host_ip instead of hardcoded localhost --- k3s/testcontainers/k3s/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py index 0e6cd70a..f19498c9 100644 --- a/k3s/testcontainers/k3s/__init__.py +++ b/k3s/testcontainers/k3s/__init__.py @@ -57,10 +57,11 @@ def start(self) -> "K3SContainer": def config_yaml(self) -> str: """This function returns the kubernetes config yaml which can be used - to initialise python client + to initialise k8s client """ execution = self.get_wrapped_container().exec_run(['cat', '/etc/rancher/k3s/k3s.yaml']) config_yaml = execution.output.decode('utf-8') \ .replace(f'https://127.0.0.1:{self.KUBE_SECURE_PORT}', - f'https://localhost:{self.get_exposed_port(self.KUBE_SECURE_PORT)}') + f'https://{self.get_container_host_ip()}:' + f'{self.get_exposed_port(self.KUBE_SECURE_PORT)}') return config_yaml From a343bd03922ebcc8491301507308b5b640c4b685 Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Wed, 29 Nov 2023 00:48:59 +0530 Subject: [PATCH 6/7] Fixing build failures after merge --- k3s/setup.py | 3 ++- k3s/testcontainers/k3s/__init__.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/k3s/setup.py b/k3s/setup.py index de9b6b08..935820d8 100644 --- a/k3s/setup.py +++ b/k3s/setup.py @@ -12,7 +12,8 @@ url="https://github.com/testcontainers/testcontainers-python", install_requires=[ "testcontainers-core", - "kubernetes" + "kubernetes", + "pyyaml" ], python_requires=">=3.7", ) diff --git a/k3s/testcontainers/k3s/__init__.py b/k3s/testcontainers/k3s/__init__.py index f19498c9..48c9d095 100644 --- a/k3s/testcontainers/k3s/__init__.py +++ b/k3s/testcontainers/k3s/__init__.py @@ -24,8 +24,6 @@ class K3SContainer(DockerContainer): .. doctest:: - >>> import json - >>> import urllib >>> import yaml >>> from testcontainers.k3s import K3SContainer >>> from kubernetes import client, config From 1cb8dd8ad29e3f9b7a5e4209aadba434b7b8043a Mon Sep 17 00:00:00 2001 From: Ashay Thorat Date: Wed, 29 Nov 2023 01:04:25 +0530 Subject: [PATCH 7/7] updating requirements file from generated artifacts --- requirements/macos-latest-3.10.txt | 55 ++++++++++++++++++++-------- requirements/ubuntu-latest-3.10.txt | 55 ++++++++++++++++++++-------- requirements/ubuntu-latest-3.11.txt | 53 ++++++++++++++++++++------- requirements/ubuntu-latest-3.7.txt | 55 ++++++++++++++++++++-------- requirements/ubuntu-latest-3.8.txt | 55 ++++++++++++++++++++-------- requirements/ubuntu-latest-3.9.txt | 55 ++++++++++++++++++++-------- requirements/windows-latest-3.10.txt | 55 ++++++++++++++++++++-------- 7 files changed, 279 insertions(+), 104 deletions(-) diff --git a/requirements/macos-latest-3.10.txt b/requirements/macos-latest-3.10.txt index b440bf30..d36feeeb 100644 --- a/requirements/macos-latest-3.10.txt +++ b/requirements/macos-latest-3.10.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,16 +93,17 @@ azure-storage-blob==12.19.0 # via testcontainers-azurite babel==2.13.1 # via sphinx -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -137,7 +141,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -149,7 +153,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -161,20 +167,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -201,6 +207,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -213,11 +221,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -248,7 +260,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -263,7 +275,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -289,6 +301,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -299,6 +312,10 @@ pytz==2023.3.post1 # via # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -308,12 +325,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -327,7 +348,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -338,6 +359,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -395,6 +417,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -403,8 +426,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/ubuntu-latest-3.10.txt b/requirements/ubuntu-latest-3.10.txt index 8bea3419..bc349e7c 100644 --- a/requirements/ubuntu-latest-3.10.txt +++ b/requirements/ubuntu-latest-3.10.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,16 +93,17 @@ azure-storage-blob==12.19.0 # via testcontainers-azurite babel==2.13.1 # via sphinx -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -138,7 +142,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -150,7 +154,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -162,20 +168,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -206,6 +212,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -218,11 +226,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -253,7 +265,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -268,7 +280,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -294,6 +306,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -304,6 +317,10 @@ pytz==2023.3.post1 # via # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -313,12 +330,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -332,7 +353,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -345,6 +366,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -402,6 +424,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -410,8 +433,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/ubuntu-latest-3.11.txt b/requirements/ubuntu-latest-3.11.txt index a3f26f09..6dfda74d 100644 --- a/requirements/ubuntu-latest-3.11.txt +++ b/requirements/ubuntu-latest-3.11.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -88,16 +91,17 @@ azure-storage-blob==12.19.0 # via testcontainers-azurite babel==2.13.1 # via sphinx -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -143,7 +147,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -155,20 +161,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -199,6 +205,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -211,11 +219,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -246,7 +258,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -261,7 +273,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -287,6 +299,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -297,6 +310,10 @@ pytz==2023.3.post1 # via # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -306,12 +323,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -325,7 +346,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -338,6 +359,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -391,6 +413,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -399,8 +422,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/ubuntu-latest-3.7.txt b/requirements/ubuntu-latest-3.7.txt index 2d6bc2c5..c3ebc37b 100644 --- a/requirements/ubuntu-latest-3.7.txt +++ b/requirements/ubuntu-latest-3.7.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -94,16 +97,17 @@ backports-zoneinfo==0.2.1 # via tzlocal bleach==6.0.0 # via readme-renderer -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -142,7 +146,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -154,7 +158,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -166,20 +172,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -219,6 +225,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.1.1 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==2.2.0 # via rich markupsafe==2.1.3 @@ -231,9 +239,13 @@ minio==7.2.0 # via testcontainers-minio more-itertools==9.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -263,7 +275,7 @@ protobuf==4.24.4 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -278,7 +290,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -304,6 +316,7 @@ python-arango==7.5.6 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -315,6 +328,10 @@ pytz==2023.3.post1 # babel # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==37.3 # via twine redis==5.0.1 @@ -324,12 +341,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -343,7 +364,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -357,6 +378,7 @@ six==1.16.0 # bleach # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -416,6 +438,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -426,8 +449,10 @@ urllib3[socks]==1.26.18 webencodings==0.5.1 # via bleach websocket-client==1.6.1 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/ubuntu-latest-3.8.txt b/requirements/ubuntu-latest-3.8.txt index dfe42986..605b3cf1 100644 --- a/requirements/ubuntu-latest-3.8.txt +++ b/requirements/ubuntu-latest-3.8.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -92,16 +95,17 @@ babel==2.13.1 # via sphinx backports-zoneinfo==0.2.1 # via tzlocal -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -140,7 +144,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -152,7 +156,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -164,20 +170,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -211,6 +217,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -223,11 +231,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -258,7 +270,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -273,7 +285,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -299,6 +311,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -310,6 +323,10 @@ pytz==2023.3.post1 # babel # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -319,12 +336,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -338,7 +359,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -351,6 +372,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -403,6 +425,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -411,8 +434,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/ubuntu-latest-3.9.txt b/requirements/ubuntu-latest-3.9.txt index 3659fe21..970a0921 100644 --- a/requirements/ubuntu-latest-3.9.txt +++ b/requirements/ubuntu-latest-3.9.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,16 +93,17 @@ azure-storage-blob==12.19.0 # via testcontainers-azurite babel==2.13.1 # via sphinx -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -138,7 +142,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -150,7 +154,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -162,20 +168,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -207,6 +213,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -219,11 +227,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -254,7 +266,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -269,7 +281,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -295,6 +307,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -305,6 +318,10 @@ pytz==2023.3.post1 # via # clickhouse-driver # neo4j +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -314,12 +331,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -333,7 +354,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -346,6 +367,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -403,6 +425,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -411,8 +434,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core diff --git a/requirements/windows-latest-3.10.txt b/requirements/windows-latest-3.10.txt index 7cdf46d6..b9f41c65 100644 --- a/requirements/windows-latest-3.10.txt +++ b/requirements/windows-latest-3.10.txt @@ -21,6 +21,7 @@ # testcontainers-clickhouse # testcontainers-elasticsearch # testcontainers-gcp + # testcontainers-k3s # testcontainers-kafka # testcontainers-keycloak # testcontainers-localstack @@ -40,6 +41,8 @@ # via -r requirements.in -e file:google # via -r requirements.in +-e file:k3s + # via -r requirements.in -e file:kafka # via -r requirements.in -e file:keycloak @@ -90,16 +93,17 @@ azure-storage-blob==12.19.0 # via testcontainers-azurite babel==2.13.1 # via sphinx -boto3==1.29.1 +boto3==1.33.1 # via testcontainers-localstack -botocore==1.32.1 +botocore==1.33.1 # via # boto3 # s3transfer cachetools==5.3.2 # via google-auth -certifi==2023.7.22 +certifi==2023.11.17 # via + # kubernetes # minio # opensearch-py # requests @@ -142,7 +146,7 @@ ecdsa==0.18.0 # via python-jose entrypoints==0.3 # via flake8 -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # pytest # trio @@ -154,7 +158,9 @@ google-api-core[grpc]==2.14.0 # google-api-core # google-cloud-pubsub google-auth==2.23.4 - # via google-api-core + # via + # google-api-core + # kubernetes google-cloud-pubsub==2.18.4 # via testcontainers-gcp googleapis-common-protos[grpc]==1.61.0 @@ -166,20 +172,20 @@ greenlet==3.0.1 # via sqlalchemy grpc-google-iam-v1==0.12.7 # via google-cloud-pubsub -grpcio==1.59.2 +grpcio==1.59.3 # via # google-api-core # google-cloud-pubsub # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.59.2 +grpcio-status==1.59.3 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via wsproto -idna==3.4 +idna==3.6 # via # requests # trio @@ -206,6 +212,8 @@ kafka-python==2.0.2 # via testcontainers-kafka keyring==24.3.0 # via twine +kubernetes==28.1.0 + # via testcontainers-k3s markdown-it-py==3.0.0 # via rich markupsafe==2.1.3 @@ -218,11 +226,15 @@ minio==7.2.0 # via testcontainers-minio more-itertools==10.1.0 # via jaraco-classes -neo4j==5.14.1 +neo4j==5.15.0 # via testcontainers-neo4j nh3==0.2.14 # via readme-renderer -opensearch-py==2.4.1 +oauthlib==3.2.2 + # via + # kubernetes + # requests-oauthlib +opensearch-py==2.4.2 # via testcontainers-opensearch outcome==1.3.0.post0 # via trio @@ -253,7 +265,7 @@ protobuf==4.25.1 # proto-plus psycopg2-binary==2.9.9 # via testcontainers-postgres -pyasn1==0.5.0 +pyasn1==0.5.1 # via # pyasn1-modules # python-jose @@ -268,7 +280,7 @@ pycryptodome==3.19.0 # via minio pyflakes==2.1.1 # via flake8 -pygments==2.16.1 +pygments==2.17.2 # via # readme-renderer # rich @@ -294,6 +306,7 @@ python-arango==7.8.1 python-dateutil==2.8.2 # via # botocore + # kubernetes # opensearch-py # pg8000 python-jose==3.3.0 @@ -308,6 +321,10 @@ pywin32==306 # via docker pywin32-ctypes==0.2.2 # via keyring +pyyaml==6.0.1 + # via + # kubernetes + # testcontainers-k3s readme-renderer==42.0 # via twine redis==5.0.1 @@ -317,12 +334,16 @@ requests==2.31.0 # azure-core # docker # google-api-core + # kubernetes # opensearch-py # python-arango # python-keycloak + # requests-oauthlib # requests-toolbelt # sphinx # twine +requests-oauthlib==1.3.1 + # via kubernetes requests-toolbelt==1.0.0 # via # python-arango @@ -336,7 +357,7 @@ rsa==4.9 # via # google-auth # python-jose -s3transfer==0.7.0 +s3transfer==0.8.0 # via boto3 scramp==1.4.4 # via pg8000 @@ -347,6 +368,7 @@ six==1.16.0 # azure-core # ecdsa # isodate + # kubernetes # opensearch-py # python-dateutil sniffio==1.3.0 @@ -406,6 +428,7 @@ urllib3[socks]==1.26.18 # via # botocore # docker + # kubernetes # minio # opensearch-py # python-arango @@ -414,8 +437,10 @@ urllib3[socks]==1.26.18 # testcontainers-core # twine websocket-client==1.6.4 - # via docker -wheel==0.41.3 + # via + # docker + # kubernetes +wheel==0.42.0 # via -r requirements.in wrapt==1.16.0 # via testcontainers-core