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
This commit is contained in:
Clark Boylan 2022-10-14 14:49:36 -07:00
parent 8190671962
commit c338fc970d
3 changed files with 14 additions and 10 deletions

View File

@ -23,10 +23,10 @@
run: playbooks/functional-test/run.yaml run: playbooks/functional-test/run.yaml
post-run: playbooks/functional-test/post.yaml post-run: playbooks/functional-test/post.yaml
requires: requires:
- python-builder-3.8-bullseye-container-image - python-builder-3.10-bullseye-container-image
- python-base-3.8-bullseye-container-image - python-base-3.10-bullseye-container-image
provides: zuul-registry-container-image provides: zuul-registry-container-image
nodeset: ubuntu-focal nodeset: ubuntu-jammy
vars: &image_vars vars: &image_vars
docker_images: docker_images:
- context: . - context: .
@ -44,14 +44,14 @@
allowed-projects: zuul/zuul-registry allowed-projects: zuul/zuul-registry
run: playbooks/functional-test/run.yaml run: playbooks/functional-test/run.yaml
post-run: playbooks/functional-test/post.yaml post-run: playbooks/functional-test/post.yaml
nodeset: ubuntu-focal nodeset: ubuntu-jammy
secrets: secrets:
name: docker_credentials name: docker_credentials
secret: zuul-registry-dockerhub secret: zuul-registry-dockerhub
pass-to-parent: true pass-to-parent: true
requires: requires:
- python-builder-3.8-bullseye-container-image - python-builder-3.10-bullseye-container-image
- python-base-3.8-bullseye-container-image - python-base-3.10-bullseye-container-image
provides: zuul-registry-container-image provides: zuul-registry-container-image
vars: *image_vars vars: *image_vars
@ -76,12 +76,16 @@
- zuul-registry-build-image - zuul-registry-build-image
- tox-pep8 - tox-pep8
- tox-py38 - tox-py38
- tox-py310:
nodeset: ubuntu-jammy
- build-python-release - build-python-release
gate: gate:
jobs: jobs:
- zuul-registry-upload-image - zuul-registry-upload-image
- tox-pep8 - tox-pep8
- tox-py38 - tox-py38
- tox-py310:
nodeset: ubuntu-jammy
- build-python-release - build-python-release
promote: promote:
jobs: jobs:

View File

@ -13,12 +13,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>. # along with this software. If not, see <http://www.gnu.org/licenses/>.
FROM opendevorg/python-builder:3.8-bullseye as builder FROM opendevorg/python-builder:3.10-bullseye as builder
COPY . /tmp/src COPY . /tmp/src
RUN assemble 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 COPY --from=builder /output/ /output
RUN /output/install-from-bindep RUN /output/install-from-bindep

View File

@ -525,8 +525,8 @@ class RegistryServer:
@staticmethod @staticmethod
def load_config(path: str, env: typing.Dict[str, str]) -> typing.Any: def load_config(path: str, env: typing.Dict[str, str]) -> typing.Any:
"""Replace path content value of the form %(ZUUL_ENV_NAME) with environment, """Replace path content value of the form %(ZUUL_ENV_NAME) with
Then return the yaml load result""" environment, then return the yaml load result"""
with open(path) as f: with open(path) as f:
return yaml.safe_load(functools.reduce( return yaml.safe_load(functools.reduce(
lambda config, env_item: config.replace( lambda config, env_item: config.replace(