From e85ab6f7463e4400c7ddcd853474809aff1c331d Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 10 Oct 2023 08:03:31 -0700 Subject: [PATCH] Add a debug python base image This adds a python-base:3.11-bookworm-debug image, which is built on the normal python:3.11-bookworm upstream image instead of the slim upstream image. The normal image includes debug symbols for the python interpreter which is compiled during its build phase, so this is the best way to get an opendev python-base image with debug symbols. Change-Id: I1d89ac947cd3bea8a468f3ee022fb4cc93bece1f --- docker/python-base/Dockerfile | 3 +- .../docker-images/python-3.11-bookworm.yaml | 45 +++++++++++++++++++ zuul.d/project.yaml | 3 ++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docker/python-base/Dockerfile b/docker/python-base/Dockerfile index 636773db5b..ff27a2ea17 100644 --- a/docker/python-base/Dockerfile +++ b/docker/python-base/Dockerfile @@ -17,7 +17,8 @@ ARG PYTHON_VERSION=3.11 ARG DEBIAN_VERSION=bullseye -FROM docker.io/library/python:${PYTHON_VERSION}-slim-${DEBIAN_VERSION} +ARG IMAGE_FLAVOR=slim- +FROM docker.io/library/python:${PYTHON_VERSION}-${IMAGE_FLAVOR}${DEBIAN_VERSION} # Necessary to use this var in the RUN below ARG DEBIAN_VERSION diff --git a/zuul.d/docker-images/python-3.11-bookworm.yaml b/zuul.d/docker-images/python-3.11-bookworm.yaml index 5bb79c1e6b..2935a95994 100644 --- a/zuul.d/docker-images/python-3.11-bookworm.yaml +++ b/zuul.d/docker-images/python-3.11-bookworm.yaml @@ -42,6 +42,7 @@ vars: *python-builder_3_11_bookworm_vars files: *python-builder_3_11_bookworm_files +# python-base-3.11-bookworm jobs - job: name: system-config-build-image-python-base-3.11-bookworm description: Build a python-base-3.11-bookworm image. @@ -83,6 +84,50 @@ vars: *python-base_3_11_bookworm_vars files: *python-base_3_11_bookworm_files +# python-base-3.11-bookworm-debug jobs +- job: + name: system-config-build-image-python-base-3.11-bookworm-debug + description: Build a python-base-3.11-bookworm debug image. + parent: system-config-build-image + timeout: 3600 + provides: + - python-base-3.11-bookworm-debug-container-image + vars: &python-base_3_11_bookworm_debug_vars + docker_images: + - context: docker/python-base + repository: opendevorg/python-base + tags: + - 3.11-bookworm-debug + arch: + - linux/amd64 + - linux/arm64 + build_args: + - PYTHON_VERSION=3.11 + - DEBIAN_VERSION=bookworm + # Blank here means not the default of "slim-" + - IMAGE_FLAVOR= + files: &python-base_3_11_bookworm_debug_files + - docker/python-base/ + - docker/python-builder/ + - zuul.d/docker-images/python-3.11-bookworm.yaml + +- job: + name: system-config-upload-image-python-base-3.11-bookworm-debug + description: Build and upload a python-base-3.11-bookworm debug image. + parent: system-config-upload-image + timeout: 3600 + provides: python-base-3.11-bookworm-debug-container-image + vars: *python-base_3_11_bookworm_debug_vars + files: *python-base_3_11_bookworm_debug_files + +- job: + name: system-config-promote-image-python-base-3.11-bookworm-debug + description: Promote a previously published python-base-3.11-bookworm debug image to latest. + parent: system-config-promote-image + vars: *python-base_3_11_bookworm_debug_vars + files: *python-base_3_11_bookworm_debug_files + +# uwsgi-base-3.11-bookworm jobs - job: name: system-config-build-image-uwsgi-base-3.11-bookworm description: Build a uwsgi-base-3.11-bookworm image. diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 26318a5b85..1534c4b011 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -161,6 +161,7 @@ - system-config-build-image-python-base-3.9-bookworm - system-config-build-image-python-base-3.10-bookworm - system-config-build-image-python-base-3.11-bookworm + - system-config-build-image-python-base-3.11-bookworm-debug - system-config-build-image-python-builder-3.9-bookworm - system-config-build-image-python-builder-3.10-bookworm - system-config-build-image-python-builder-3.11-bookworm @@ -320,6 +321,7 @@ - system-config-upload-image-python-base-3.9-bookworm - system-config-upload-image-python-base-3.10-bookworm - system-config-upload-image-python-base-3.11-bookworm + - system-config-upload-image-python-base-3.11-bookworm-debug - system-config-upload-image-python-builder-3.9-bookworm - system-config-upload-image-python-builder-3.10-bookworm - system-config-upload-image-python-builder-3.11-bookworm @@ -356,6 +358,7 @@ - system-config-promote-image-python-base-3.9-bookworm - system-config-promote-image-python-base-3.10-bookworm - system-config-promote-image-python-base-3.11-bookworm + - system-config-promote-image-python-base-3.11-bookworm-debug - system-config-promote-image-python-builder-3.9-bookworm - system-config-promote-image-python-builder-3.10-bookworm - system-config-promote-image-python-builder-3.11-bookworm