Start making 3.8 python images

base and builder are currently pinned to 3.7, which makes it hard
to consider upgrading to python-3.8. To help with that, make
python-3.7 and python-3.8 images, but point latest as 3.7 for the
time being. Then add version-specific provides and FROM lines
so that we can start being deliberate and clear about our version
choice.

Change-Id: Ibf1d846d5c4a005547785124567ce2900e272a7a
This commit is contained in:
Monty Taylor 2020-03-23 16:28:23 -05:00
parent 643623ba8a
commit 650392c700
6 changed files with 148 additions and 57 deletions

View File

@ -56,7 +56,7 @@
name: system-config-build-image-jinja-init name: system-config-build-image-jinja-init
description: Build a jinja-init image. description: Build a jinja-init image.
parent: system-config-build-image parent: system-config-build-image
requires: python-base-container-image requires: python-base-3.7-container-image
provides: jinja-init-container-image provides: jinja-init-container-image
vars: &jinja-init_vars vars: &jinja-init_vars
docker_images: docker_images:
@ -71,7 +71,7 @@
name: system-config-upload-image-jinja-init name: system-config-upload-image-jinja-init
description: Build and upload a jinja-init image. description: Build and upload a jinja-init image.
parent: system-config-upload-image parent: system-config-upload-image
requires: python-base-container-image requires: python-base-3.7-container-image
provides: jinja-init-container-image provides: jinja-init-container-image
vars: *jinja-init_vars vars: *jinja-init_vars
files: *jinja-init_files files: *jinja-init_files
@ -150,7 +150,7 @@
name: system-config-build-image-haproxy-statsd name: system-config-build-image-haproxy-statsd
description: Build a haproxy-statsd image. description: Build a haproxy-statsd image.
parent: system-config-build-image parent: system-config-build-image
requires: python-base-container-image requires: python-base-3.7-container-image
vars: &haproxy-statsd_vars vars: &haproxy-statsd_vars
docker_images: docker_images:
- context: docker/haproxy-statsd - context: docker/haproxy-statsd
@ -164,7 +164,7 @@
name: system-config-upload-image-haproxy-statsd name: system-config-upload-image-haproxy-statsd
description: Build and upload a haproxy-statsd image. description: Build and upload a haproxy-statsd image.
parent: system-config-upload-image parent: system-config-upload-image
requires: python-base-container-image requires: python-base-3.7-container-image
vars: *haproxy-statsd_vars vars: *haproxy-statsd_vars
files: *haproxy-statsd_files files: *haproxy-statsd_files
@ -511,63 +511,146 @@
vars: *gerrit_vars_master vars: *gerrit_vars_master
files: *gerrit_files_master files: *gerrit_files_master
# python-builder jobs # python-builder-3.7 jobs
- job: - job:
name: system-config-build-image-python-builder name: system-config-build-image-python-builder-3.7
description: Build a python-builder image. description: Build a python-builder-3.7 image.
parent: system-config-build-image parent: system-config-build-image
provides: python-builder-container-image provides:
vars: &python-builder_vars - python-builder-container-image
- python-builder-3.7-container-image
vars: &python-builder_3_7_vars
docker_images: docker_images:
- context: docker/python-builder - context: docker/python-builder
repository: opendevorg/python-builder repository: opendevorg/python-builder
files: &python-builder_files tags:
- 3.7
- latest
build_args:
- PYTHON_VERSION=3.7
files: &python-builder_3_7_files
- docker/python-base/.* - docker/python-base/.*
- docker/python-builder/.* - docker/python-builder/.*
- job: - job:
name: system-config-upload-image-python-builder name: system-config-upload-image-python-builder-3.7
description: Build and upload a python-builder image. description: Build and upload a python-builder-3.7 image.
parent: system-config-upload-image parent: system-config-upload-image
provides: python-builder-container-image provides:
vars: *python-builder_vars - python-builder-container-image
files: *python-builder_files - python-builder-3.7-container-image
vars: *python-builder_3_7_vars
files: *python-builder_3_7_files
- job: - job:
name: system-config-promote-image-python-builder name: system-config-promote-image-python-builder-3.7
description: Promote a previously published python-builder image to latest. description: Promote a previously published python-builder-3.7 image to latest.
parent: system-config-promote-image parent: system-config-promote-image
vars: *python-builder_vars vars: *python-builder_3_7_vars
files: *python-builder_files files: *python-builder_3_7_files
# python-base jobs # python-builder-3.8 jobs
- job: - job:
name: system-config-build-image-python-base name: system-config-build-image-python-builder-3.8
description: Build a python-base image. description: Build a python-builder-3.8 image.
parent: system-config-build-image parent: system-config-build-image
provides: python-base-container-image provides:
vars: &python-base_vars - python-builder-3.8-container-image
vars: &python-builder_3_8_vars
docker_images:
- context: docker/python-builder
repository: opendevorg/python-builder
tags:
- 3.8
build_args:
- PYTHON_VERSION=3.8
files: &python-builder_3_8_files
- docker/python-base/.*
- docker/python-builder/.*
- job:
name: system-config-upload-image-python-builder-3.8
description: Build and upload a python-builder-3.8 image.
parent: system-config-upload-image
provides: python-builder-3.8-container-image
vars: *python-builder_3_8_vars
files: *python-builder_3_8_files
- job:
name: system-config-promote-image-python-builder-3.8
description: Promote a previously published python-builder-3.8 image to latest.
parent: system-config-promote-image
vars: *python-builder_3_8_vars
files: *python-builder_3_8_files
# python-base-3.7 jobs
- job:
name: system-config-build-image-python-base-3.7
description: Build a python-base-3.7 image.
parent: system-config-build-image
provides:
- python-base-container-image
- python-base-3.7-container-image
vars: &python-base-3_7_vars
docker_images: docker_images:
- context: docker/python-base - context: docker/python-base
repository: opendevorg/python-base repository: opendevorg/python-base
files: &python-base_files tags:
- 3.7
- latest
build_args:
- PYTHON_VERSION=3.7
files: &python-base-3_7_files
- docker/python-base/.* - docker/python-base/.*
- docker/python-builder/.* - docker/python-builder/.*
- job: - job:
name: system-config-upload-image-python-base name: system-config-upload-image-python-base-3.7
description: Build and upload a python-base image. description: Build and upload a python-base-3.7 image.
parent: system-config-upload-image parent: system-config-upload-image
provides: python-base-container-image provides: python-base-3.7-container-image
vars: *python-base_vars vars: *python-base-3_7_vars
files: *python-base_files files: *python-base-3_7_files
- job: - job:
name: system-config-promote-image-python-base name: system-config-promote-image-python-base-3.7
description: Promote a previously published python-base image to latest. description: Promote a previously published python-base-3.7 image to latest.
parent: system-config-promote-image parent: system-config-promote-image
vars: *python-base_vars vars: *python-base-3_7_vars
files: *python-base_files files: *python-base-3_7_files
# python-base-3.8 jobs
- job:
name: system-config-build-image-python-base-3.8
description: Build a python-base-3.8 image.
parent: system-config-build-image
provides: python-base-3.8-container-image
vars: &python-base-3_8_vars
docker_images:
- context: docker/python-base
repository: opendevorg/python-base
tags:
- 3.8
build_args:
- PYTHON_VERSION=3.8
files: &python-base-3_8_files
- docker/python-base/.*
- docker/python-builder/.*
- job:
name: system-config-upload-image-python-base-3.8
description: Build and upload a python-base-3.8 image.
parent: system-config-upload-image
provides: python-base-3.8-container-image
vars: *python-base-3_8_vars
files: *python-base-3_8_files
- job:
name: system-config-promote-image-python-base-3.8
description: Promote a previously published python-base-3.8 image to latest.
parent: system-config-promote-image
vars: *python-base-3_8_vars
files: *python-base-3_8_files
# gerrit-base jobs # gerrit-base jobs
- job: - job:
@ -577,7 +660,7 @@
required-projects: &gerrit_base_projects required-projects: &gerrit_base_projects
- opendev/jeepyb - opendev/jeepyb
- opendev/system-config - opendev/system-config
requires: python-builder-container-image requires: python-builder-3.7-container-image
provides: gerrit-base-container-image provides: gerrit-base-container-image
vars: &gerrit-base_vars vars: &gerrit-base_vars
docker_images: docker_images:
@ -591,7 +674,7 @@
name: system-config-upload-image-gerrit-base name: system-config-upload-image-gerrit-base
description: Build and upload a gerrit-base image. description: Build and upload a gerrit-base image.
parent: system-config-upload-image parent: system-config-upload-image
requires: python-builder-container-image requires: python-builder-3.7-container-image
provides: gerrit-base-container-image provides: gerrit-base-container-image
required-projects: *gerrit_base_projects required-projects: *gerrit_base_projects
vars: *gerrit-base_vars vars: *gerrit-base_vars
@ -1316,12 +1399,12 @@
- system-config-build-image-gerrit-base: - system-config-build-image-gerrit-base:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-build-image-python-builder - name: system-config-build-image-python-builder-3.7
soft: true soft: true
- system-config-build-image-gerrit-2.13: - system-config-build-image-gerrit-2.13:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-build-image-python-builder - name: system-config-build-image-python-builder-3.7
soft: true soft: true
- name: system-config-build-image-gerrit-base - name: system-config-build-image-gerrit-base
soft: true soft: true
@ -1351,12 +1434,12 @@
- system-config-upload-image-gerrit-base: - system-config-upload-image-gerrit-base:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-upload-image-python-builder - name: system-config-upload-image-python-builder-3.7
soft: true soft: true
- system-config-upload-image-gerrit-2.13: - system-config-upload-image-gerrit-2.13:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-upload-image-python-builder - name: system-config-upload-image-python-builder-3.7
soft: true soft: true
- name: system-config-upload-image-gerrit-base - name: system-config-upload-image-gerrit-base
soft: true soft: true
@ -1424,7 +1507,7 @@
- system-config-build-image-jinja-init: - system-config-build-image-jinja-init:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-build-image-python-base - name: system-config-build-image-python-base-3.7
soft: true soft: true
- system-config-build-image-gitea-init: - system-config-build-image-gitea-init:
dependencies: dependencies:
@ -1435,10 +1518,12 @@
- system-config-build-image-haproxy-statsd: - system-config-build-image-haproxy-statsd:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-build-image-python-base - name: system-config-build-image-python-base-3.7
soft: true soft: true
- system-config-build-image-python-base - system-config-build-image-python-base-3.7
- system-config-build-image-python-builder - system-config-build-image-python-base-3.8
- system-config-build-image-python-builder-3.7
- system-config-build-image-python-builder-3.8
check-arm64: check-arm64:
jobs: jobs:
- system-config-run-mirror-arm64 - system-config-run-mirror-arm64
@ -1473,7 +1558,7 @@
- system-config-upload-image-jinja-init: - system-config-upload-image-jinja-init:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-upload-image-python-base - name: system-config-upload-image-python-base-3.7
soft: true soft: true
- system-config-upload-image-gitea-init: - system-config-upload-image-gitea-init:
dependencies: dependencies:
@ -1484,18 +1569,22 @@
- system-config-upload-image-haproxy-statsd: - system-config-upload-image-haproxy-statsd:
dependencies: dependencies:
- name: opendev-buildset-registry - name: opendev-buildset-registry
- name: system-config-upload-image-python-base - name: system-config-upload-image-python-base-3.7
soft: true soft: true
- system-config-upload-image-python-base - system-config-upload-image-python-base-3.7
- system-config-upload-image-python-builder - system-config-upload-image-python-base-3.8
- system-config-upload-image-python-builder-3.7
- system-config-upload-image-python-builder-3.8
promote: promote:
jobs: jobs:
- system-config-promote-image-jinja-init - system-config-promote-image-jinja-init
- system-config-promote-image-gitea-init - system-config-promote-image-gitea-init
- system-config-promote-image-gitea - system-config-promote-image-gitea
- system-config-promote-image-haproxy-statsd - system-config-promote-image-haproxy-statsd
- system-config-promote-image-python-base - system-config-promote-image-python-base-3.7
- system-config-promote-image-python-builder - system-config-promote-image-python-base-3.8
- system-config-promote-image-python-builder-3.7
- system-config-promote-image-python-builder-3.8
periodic: periodic:
jobs: jobs:
- developer-openstack-goaccess-report - developer-openstack-goaccess-report

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM docker.io/opendevorg/python-builder as builder FROM docker.io/opendevorg/python-builder:3.7 as builder
COPY . /tmp/src COPY . /tmp/src
RUN assemble RUN assemble

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM docker.io/opendevorg/python-base FROM docker.io/opendevorg/python-base:3.7
COPY haproxy-statsd.py /usr/local/bin COPY haproxy-statsd.py /usr/local/bin
RUN pip install statsd RUN pip install statsd

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
FROM docker.io/opendevorg/python-base as build FROM docker.io/opendevorg/python-base:3.7 as build
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
git \ git \
@ -25,7 +25,7 @@ WORKDIR /src/jinja-init
RUN git checkout 8c13a44124a5a363519df787b1cd0abd1198b8df RUN git checkout 8c13a44124a5a363519df787b1cd0abd1198b8df
FROM docker.io/opendevorg/python-base as jinja-init FROM docker.io/opendevorg/python-base:3.7 as jinja-init
RUN pip install jinja2 RUN pip install jinja2

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM docker.io/library/python:3.7-slim ARG PYTHON_VERSION=3.7
FROM docker.io/library/python:${PYTHON_VERSION}-slim
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends

View File

@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM docker.io/library/python:3.7-slim as fake-python ARG PYTHON_VERSION=3.7
FROM docker.io/library/python:${PYTHON_VERSION}-slim as fake-python
WORKDIR /tmp WORKDIR /tmp
RUN apt-get update \ RUN apt-get update \
@ -22,7 +23,7 @@ RUN apt-get update \
COPY python3-dev.control /tmp/python3-dev.control COPY python3-dev.control /tmp/python3-dev.control
RUN equivs-build /tmp/python3-dev.control RUN equivs-build /tmp/python3-dev.control
FROM docker.io/library/python:3.7-slim FROM docker.io/library/python:${PYTHON_VERSION}-slim
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends