From c338fc970d4d1b26cd5c92a64c65ed4cdcbef289 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 14 Oct 2022 14:49:36 -0700 Subject: [PATCH] Update the docker images to python 3.10 We do this to take advantage of python 3.10's speed improvements as illustrated by Zuul proper. But also OpenDev would like to drop python 3.8 image builds to make room for python 3.11. We add python3.10 unittesting to prevent regressing the docker images on that version of python. Change-Id: Ib2e39e0c5d09b4fdce40faa072fe51b55c8d7407 --- .zuul.yaml | 16 ++++++++++------ Dockerfile | 4 ++-- zuul_registry/main.py | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 0f7dc5e..47a21eb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -23,10 +23,10 @@ run: playbooks/functional-test/run.yaml post-run: playbooks/functional-test/post.yaml requires: - - python-builder-3.8-bullseye-container-image - - python-base-3.8-bullseye-container-image + - python-builder-3.10-bullseye-container-image + - python-base-3.10-bullseye-container-image provides: zuul-registry-container-image - nodeset: ubuntu-focal + nodeset: ubuntu-jammy vars: &image_vars docker_images: - context: . @@ -44,14 +44,14 @@ allowed-projects: zuul/zuul-registry run: playbooks/functional-test/run.yaml post-run: playbooks/functional-test/post.yaml - nodeset: ubuntu-focal + nodeset: ubuntu-jammy secrets: name: docker_credentials secret: zuul-registry-dockerhub pass-to-parent: true requires: - - python-builder-3.8-bullseye-container-image - - python-base-3.8-bullseye-container-image + - python-builder-3.10-bullseye-container-image + - python-base-3.10-bullseye-container-image provides: zuul-registry-container-image vars: *image_vars @@ -76,12 +76,16 @@ - zuul-registry-build-image - tox-pep8 - tox-py38 + - tox-py310: + nodeset: ubuntu-jammy - build-python-release gate: jobs: - zuul-registry-upload-image - tox-pep8 - tox-py38 + - tox-py310: + nodeset: ubuntu-jammy - build-python-release promote: jobs: diff --git a/Dockerfile b/Dockerfile index 973f070..1fdaa64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,12 @@ # You should have received a copy of the GNU General Public License # along with this software. If not, see . -FROM opendevorg/python-builder:3.8-bullseye as builder +FROM opendevorg/python-builder:3.10-bullseye as builder COPY . /tmp/src RUN assemble -FROM opendevorg/python-base:3.8-bullseye as zuul-registry +FROM opendevorg/python-base:3.10-bullseye as zuul-registry COPY --from=builder /output/ /output RUN /output/install-from-bindep diff --git a/zuul_registry/main.py b/zuul_registry/main.py index 03b3198..076b0db 100644 --- a/zuul_registry/main.py +++ b/zuul_registry/main.py @@ -525,8 +525,8 @@ class RegistryServer: @staticmethod def load_config(path: str, env: typing.Dict[str, str]) -> typing.Any: - """Replace path content value of the form %(ZUUL_ENV_NAME) with environment, - Then return the yaml load result""" + """Replace path content value of the form %(ZUUL_ENV_NAME) with + environment, then return the yaml load result""" with open(path) as f: return yaml.safe_load(functools.reduce( lambda config, env_item: config.replace(