diff --git a/.gitignore b/.gitignore index a09403b8a1..5b2428ef3e 100644 --- a/.gitignore +++ b/.gitignore @@ -255,6 +255,9 @@ paket-files/ # Python cache *.pyc +# .NET global.json for SDK versioning +global.json + # Node and .NET Core runtime Dockerfiles, that are auto generated images/runtime/node/*/Dockerfile images/runtime/node/*/buster.Dockerfile diff --git a/build/__pythonVersions.sh b/build/__pythonVersions.sh index e388fb9ba4..feeeeb0c46 100755 --- a/build/__pythonVersions.sh +++ b/build/__pythonVersions.sh @@ -1,6 +1,6 @@ # This file was auto-generated from 'constants.yaml'. Changes may be overridden. -PYTHON_RUNTIME_BASE_TAG='20231208.1' +PYTHON_RUNTIME_BASE_TAG='20240110.3' PIP_VERSION='21.2.4' PYTHON27_VERSION='2.7.18' PYTHON36_VERSION='3.6.15' diff --git a/build/constants.yaml b/build/constants.yaml index d105f8fed0..bca8fe4cf6 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -149,7 +149,7 @@ file-name-prefix: __ - name: python-versions constants: - python-runtime-base-tag: 20231208.1 + python-runtime-base-tag: 20240110.3 pip-version: 21.2.4 python27-version: 2.7.18 python36-version: 3.6.15 @@ -162,13 +162,18 @@ runtime-versions: - 3.7-debian-bullseye - 3.7-debian-buster + - 3.8-debian-bookworm - 3.8-debian-bullseye - 3.8-debian-buster + - 3.9-debian-bookworm - 3.9-debian-bullseye - 3.9-debian-buster + - 3.10-debian-bookworm - 3.10-debian-bullseye - 3.10-debian-buster + - 3.11-debian-bookworm - 3.11-debian-bullseye + - 3.12-debian-bookworm - 3.12-debian-bullseye - dynamic-debian-buster outputs: diff --git a/doc/supportedPlatformVersions.md b/doc/supportedPlatformVersions.md index 5baf39e35a..4091433118 100644 --- a/doc/supportedPlatformVersions.md +++ b/doc/supportedPlatformVersions.md @@ -829,6 +829,10 @@ ## php composer +### bookworm + +- 2.6.2 + ### bullseye - 1.9.2 @@ -993,6 +997,11 @@ ## php +### bookworm + +- 8.1.22 +- 8.2.9 + ### bullseye - 7.4.9 @@ -1212,6 +1221,14 @@ ## python +### bookworm + +- 3.8.18 +- 3.9.18 +- 3.10.13 +- 3.11.7 +- 3.12.1 + ### bullseye - 3.7.9 diff --git a/images/runtime/python/3.10/base.bookworm.Dockerfile b/images/runtime/python/3.10/base.bookworm.Dockerfile new file mode 100644 index 0000000000..0b2ca50a9b --- /dev/null +++ b/images/runtime/python/3.10/base.bookworm.Dockerfile @@ -0,0 +1,90 @@ +ARG DEBIAN_FLAVOR +# Startup script generator +FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen +# GOPATH is set to "/go" in the base image +WORKDIR /go/src +COPY src/startupscriptgenerator/src . +ARG GIT_COMMIT=unspecified +ARG BUILD_NUMBER=unspecified +ARG RELEASE_TAG_NAME=unspecified +ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} +ENV GIT_COMMIT=${GIT_COMMIT} +ENV BUILD_NUMBER=${BUILD_NUMBER} +#Bake in client certificate path into image to avoid downloading it +ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" +RUN ./build.sh python /opt/startupcmdgen/startupcmdgen + +FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main +ARG DEBIAN_FLAVOR +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR} + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +ENV PYTHON_VERSION 3.10.13 +RUN true +COPY build/__pythonVersions.sh ${BUILD_DIR} +RUN true +COPY platforms/__common.sh /tmp/ +RUN true +COPY platforms/python/prereqs/build.sh /tmp/ +RUN true +COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/ +RUN true +COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh +RUN true + +RUN chmod +x /tmp/receiveGpgKeys.sh +RUN chmod +x /tmp/build.sh && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + tk-dev \ + uuid-dev \ + libgeos-dev + +RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \ + set -e \ + && export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \ + && ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION + +RUN set -ex \ + && cd /opt/python/ \ + && ln -s 3.10.13 3.10 \ + && ln -s 3.10 3 \ + && echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \ + && ldconfig \ + && cd /opt/python/3/bin \ + && ln -nsf idle3 idle \ + && ln -nsf pydoc3 pydoc \ + && ln -nsf python3-config python-config \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH="/opt/python/3/bin:${PATH}" + +# Bake Application Insights key from pipeline variable into final image +ARG AI_CONNECTION_STRING +ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} + +RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh +RUN pip install --upgrade pip \ + && pip install gunicorn \ + && pip install debugpy \ + && pip install viztracer \ + && pip install vizplugins \ + && pip install orjson \ + && ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/oryx + +COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen diff --git a/images/runtime/python/3.11/base.bookworm.Dockerfile b/images/runtime/python/3.11/base.bookworm.Dockerfile new file mode 100644 index 0000000000..757a86c42e --- /dev/null +++ b/images/runtime/python/3.11/base.bookworm.Dockerfile @@ -0,0 +1,88 @@ +ARG DEBIAN_FLAVOR +# Startup script generator +FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen +# GOPATH is set to "/go" in the base image +WORKDIR /go/src +COPY src/startupscriptgenerator/src . +ARG GIT_COMMIT=unspecified +ARG BUILD_NUMBER=unspecified +ARG RELEASE_TAG_NAME=unspecified +ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} +ENV GIT_COMMIT=${GIT_COMMIT} +ENV BUILD_NUMBER=${BUILD_NUMBER} +RUN ./build.sh python /opt/startupcmdgen/startupcmdgen + +FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main +ARG DEBIAN_FLAVOR +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR} + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +ENV PYTHON_VERSION 3.11.7 +RUN true +COPY build/__pythonVersions.sh ${BUILD_DIR} +RUN true +COPY platforms/__common.sh /tmp/ +RUN true +COPY platforms/python/prereqs/build.sh /tmp/ +RUN true +COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/ +RUN true +COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh +RUN true + +RUN chmod +x /tmp/receiveGpgKeys.sh +RUN chmod +x /tmp/build.sh && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + tk-dev \ + uuid-dev \ + libgeos-dev + +RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \ + set -e \ + && export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \ + && ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION + +RUN set -ex \ + && cd /opt/python/ \ + && ln -s 3.11.7 3.11 \ + && ln -s 3.11 3 \ + && echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \ + && ldconfig \ + && cd /opt/python/3/bin \ + && ln -nsf idle3 idle \ + && ln -nsf pydoc3 pydoc \ + && ln -nsf python3-config python-config \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH="/opt/python/3/bin:${PATH}" + +# Bake Application Insights key from pipeline variable into final image +ARG AI_CONNECTION_STRING +ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} + +RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh +RUN pip install --upgrade pip \ + && pip install gunicorn \ + && pip install debugpy \ + && pip install viztracer \ + && pip install vizplugins \ + && pip install orjson \ + && ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/oryx + +COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen diff --git a/images/runtime/python/3.12/base.bookworm.Dockerfile b/images/runtime/python/3.12/base.bookworm.Dockerfile new file mode 100644 index 0000000000..3ba1040821 --- /dev/null +++ b/images/runtime/python/3.12/base.bookworm.Dockerfile @@ -0,0 +1,89 @@ +ARG DEBIAN_FLAVOR +# Startup script generator +FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen +# GOPATH is set to "/go" in the base image +WORKDIR /go/src +COPY src/startupscriptgenerator/src . +ARG GIT_COMMIT=unspecified +ARG BUILD_NUMBER=unspecified +ARG RELEASE_TAG_NAME=unspecified +ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME} +ENV GIT_COMMIT=${GIT_COMMIT} +ENV BUILD_NUMBER=${BUILD_NUMBER} +RUN ./build.sh python /opt/startupcmdgen/startupcmdgen + +FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main +ARG DEBIAN_FLAVOR +ARG IMAGES_DIR=/tmp/oryx/images +ARG BUILD_DIR=/tmp/oryx/build +ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR} + +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + xz-utils \ + && rm -rf /var/lib/apt/lists/* + +ADD images ${IMAGES_DIR} +ADD build ${BUILD_DIR} +RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \; +RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \; + +ENV PYTHON_VERSION 3.12.1 +RUN true +COPY build/__pythonVersions.sh ${BUILD_DIR} +RUN true +COPY platforms/__common.sh /tmp/ +RUN true +COPY platforms/python/prereqs/build.sh /tmp/ +RUN true +COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/ +RUN true +COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh +RUN true + +RUN chmod +x /tmp/receiveGpgKeys.sh +RUN chmod +x /tmp/build.sh && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + tk-dev \ + uuid-dev \ + libgeos-dev + +RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \ + set -e \ + && export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \ + && ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION + +RUN set -ex \ + && cd /opt/python/ \ + && ln -s 3.12.1 3.12 \ + && ln -s 3.12 3 \ + && echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \ + && ldconfig \ + && cd /opt/python/3/bin \ + && ln -nsf idle3 idle \ + && ln -nsf pydoc3 pydoc \ + && ln -nsf python3-config python-config \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH="/opt/python/3/bin:${PATH}" + +# Bake Application Insights key from pipeline variable into final image +ARG AI_CONNECTION_STRING +ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING} + +RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh + +RUN pip install --upgrade pip \ + && pip install gunicorn \ + && pip install debugpy \ + && pip install viztracer \ + && pip install vizplugins \ + && pip install orjson \ + && ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/oryx + +COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen diff --git a/images/runtime/python/generateDockerfiles.sh b/images/runtime/python/generateDockerfiles.sh index cab0ae87ce..3938717d2f 100755 --- a/images/runtime/python/generateDockerfiles.sh +++ b/images/runtime/python/generateDockerfiles.sh @@ -22,7 +22,7 @@ declare -r ORYX_PYTHON_IMAGE_BASE_PLACEHOLDER="%BASE_TAG%" source "$PYTHON_VERSIONS_PATH" # Please make sure that any changes to debian flavors supported here are also reflected in build/constants.yaml -declare -r PYTHON_BOOKWORM_VERSION_ARRAY=() +declare -r PYTHON_BOOKWORM_VERSION_ARRAY=($PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION $PYTHON311_VERSION $PYTHON312_VERSION) declare -r PYTHON_BULLSEYE_VERSION_ARRAY=($PYTHON37_VERSION $PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION $PYTHON311_VERSION $PYTHON312_VERSION) declare -r PYTHON_BUSTER_VERSION_ARRAY=($PYTHON37_VERSION $PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION) ImageDebianFlavor="$1" diff --git a/platforms/php/buildPhp.sh b/platforms/php/buildPhp.sh index 3405362260..e0a02f7bf5 100755 --- a/platforms/php/buildPhp.sh +++ b/platforms/php/buildPhp.sh @@ -116,10 +116,10 @@ buildPhpComposer() { # a version here. docker build \ -f "$phpPlatformDir/composer/Dockerfile" \ - --build-arg PHP_VERSION="$PHP73_VERSION" \ + --build-arg PHP_VERSION="$PHP81_VERSION" \ --build-arg DEBIAN_FLAVOR=$debianFlavor \ - --build-arg PHP_SHA256="$PHP73_TAR_SHA256" \ - --build-arg GPG_KEYS="$PHP73_KEYS" \ + --build-arg PHP_SHA256="$PHP81_TAR_SHA256" \ + --build-arg GPG_KEYS="$PHP81_KEYS" \ --build-arg COMPOSER_VERSION="$version" \ --build-arg COMPOSER_SETUP_SHA384="$COMPOSER_SETUP_SHA384" \ -t $imageName \ diff --git a/platforms/php/composer/versions/bookworm/defaultVersion.txt b/platforms/php/composer/versions/bookworm/defaultVersion.txt new file mode 100644 index 0000000000..0cfbf08886 --- /dev/null +++ b/platforms/php/composer/versions/bookworm/defaultVersion.txt @@ -0,0 +1 @@ +2 diff --git a/platforms/php/composer/versions/bookworm/versionsToBuild.txt b/platforms/php/composer/versions/bookworm/versionsToBuild.txt new file mode 100644 index 0000000000..3b9657e63e --- /dev/null +++ b/platforms/php/composer/versions/bookworm/versionsToBuild.txt @@ -0,0 +1,2 @@ +# version +2.6.2 \ No newline at end of file diff --git a/platforms/php/prereqs/Dockerfile b/platforms/php/prereqs/Dockerfile index 6712bffe4c..36cf8bcb5b 100644 --- a/platforms/php/prereqs/Dockerfile +++ b/platforms/php/prereqs/Dockerfile @@ -26,5 +26,6 @@ RUN if [ "${DEBIAN_FLAVOR}" = "buster" ]; then \ libncurses5 \ --no-install-recommends && rm -r /var/lib/apt/lists/* ; \ else \ + export DEBIAN_FLAVOR=${DEBIAN_FLAVOR} ; \ . /php/installPrereqs.sh ; \ fi diff --git a/platforms/php/prereqs/installPrereqs.sh b/platforms/php/prereqs/installPrereqs.sh index bfd5ed6df0..c25d68245e 100755 --- a/platforms/php/prereqs/installPrereqs.sh +++ b/platforms/php/prereqs/installPrereqs.sh @@ -14,6 +14,16 @@ set -eux echo 'Pin-Priority: -1'; } > /etc/apt/preferences.d/no-debian-php +# Create the sources.list file for bookworm since it doesn't exist in the buildpack-deps image +if [ "$DEBIAN_FLAVOR" = bookworm ] +then + { + echo 'deb http://deb.debian.org/debian bookworm main'; + echo 'deb http://deb.debian.org/debian-security bookworm-security main'; + echo 'deb http://deb.debian.org/debian bookworm-updates main'; + } > /etc/apt/sources.list +fi + # dependencies required for running "phpize" # (see persistent deps below) PHPIZE_DEPS="autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c" @@ -21,8 +31,12 @@ PHPIZE_DEPS="autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c" # persistent / runtime deps # libcurl3 and libcurl4 both needs to be supported in ubuntu focal for php # https://github.com/xapienz/curl-debian-scripts -add-apt-repository ppa:xapienz/curl34 -y \ -&& apt-get update \ +if [ "$DEBIAN_FLAVOR" = focal ] +then + add-apt-repository ppa:xapienz/curl34 -y +fi + +apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ $PHPIZE_DEPS \ diff --git a/platforms/php/versions/bookworm/defaultVersion.txt b/platforms/php/versions/bookworm/defaultVersion.txt new file mode 100644 index 0000000000..cc40bca69a --- /dev/null +++ b/platforms/php/versions/bookworm/defaultVersion.txt @@ -0,0 +1 @@ +8.0 diff --git a/platforms/php/versions/bookworm/versionsToBuild.txt b/platforms/php/versions/bookworm/versionsToBuild.txt new file mode 100644 index 0000000000..b8f099767a --- /dev/null +++ b/platforms/php/versions/bookworm/versionsToBuild.txt @@ -0,0 +1,4 @@ +# version, sha, gpg keys, dockerfile +8.1.22, 9ea4f4cfe775cb5866c057323d6b320f3a6e0adb1be41a068ff7bfec6f83e71d, 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E 39B641343D8C104B2B146DC3F9C39DC0B9698544, + +8.2.9, 1e6cb77f997613864ab3127fbfc6a8c7fdaa89a95e8ed6167617b913b4de4765, 1198C0117593497A5EC5C199286AF1F9897469DC 39B641343D8C104B2B146DC3F9C39DC0B9698544, \ No newline at end of file diff --git a/platforms/python/versions/bookworm/defaultVersion.txt b/platforms/python/versions/bookworm/defaultVersion.txt new file mode 100644 index 0000000000..cc1923a40b --- /dev/null +++ b/platforms/python/versions/bookworm/defaultVersion.txt @@ -0,0 +1 @@ +3.8 diff --git a/platforms/python/versions/bookworm/versionsToBuild.txt b/platforms/python/versions/bookworm/versionsToBuild.txt new file mode 100644 index 0000000000..0c07bdb65e --- /dev/null +++ b/platforms/python/versions/bookworm/versionsToBuild.txt @@ -0,0 +1,8 @@ + +# NOTE: Make sure to set the default version in 'defaultVersion.txt' file +# version, gpg keys, dockerfile +3.8.18, E3FF2839C048B25C084DEBE9B26995E310250568, +3.9.18, E3FF2839C048B25C084DEBE9B26995E310250568, +3.10.13, A035C8C19219BA821ECEA86B64E628F8D684696D, +3.11.7, A035C8C19219BA821ECEA86B64E628F8D684696D, +3.12.1, 7169605F62C751356D054A26A821E680E5FA6305, diff --git a/src/BuildScriptGenerator/PythonVersions.cs b/src/BuildScriptGenerator/PythonVersions.cs index 2f0f6b7883..fbf101f240 100644 --- a/src/BuildScriptGenerator/PythonVersions.cs +++ b/src/BuildScriptGenerator/PythonVersions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator.Common { public static class PythonVersions { - public const string PythonRuntimeBaseTag = "20231208.1"; + public const string PythonRuntimeBaseTag = "20240110.3"; public const string PipVersion = "21.2.4"; public const string Python27Version = "2.7.18"; public const string Python36Version = "3.6.15"; @@ -16,6 +16,6 @@ public static class PythonVersions public const string Python310Version = "3.10.13"; public const string Python311Version = "3.11.7"; public const string Python312Version = "3.12.1"; - public static readonly List RuntimeVersions = new List { "3.7-debian-bullseye", "3.7-debian-buster", "3.8-debian-bullseye", "3.8-debian-buster", "3.9-debian-bullseye", "3.9-debian-buster", "3.10-debian-bullseye", "3.10-debian-buster", "3.11-debian-bullseye", "3.12-debian-bullseye", "dynamic-debian-buster" }; + public static readonly List RuntimeVersions = new List { "3.7-debian-bullseye", "3.7-debian-buster", "3.8-debian-bookworm", "3.8-debian-bullseye", "3.8-debian-buster", "3.9-debian-bookworm", "3.9-debian-bullseye", "3.9-debian-buster", "3.10-debian-bookworm", "3.10-debian-bullseye", "3.10-debian-buster", "3.11-debian-bookworm", "3.11-debian-bullseye", "3.12-debian-bookworm", "3.12-debian-bullseye", "dynamic-debian-buster" }; } } \ No newline at end of file diff --git a/tests/BuildScriptGenerator.Tests/DefaultDockerfileGeneratorTest.cs b/tests/BuildScriptGenerator.Tests/DefaultDockerfileGeneratorTest.cs index 68be1db5e0..63fd9d70d3 100644 --- a/tests/BuildScriptGenerator.Tests/DefaultDockerfileGeneratorTest.cs +++ b/tests/BuildScriptGenerator.Tests/DefaultDockerfileGeneratorTest.cs @@ -63,7 +63,7 @@ public void GenerateDockerfile_Throws_IfNoPlatformIsCompatible() [InlineData("php", "7.3", "7.3", "debian-buster-stable", "7.3")] [InlineData("python", "2.7", "2.7", "debian-buster-stable", "2.7")] [InlineData("python", "3.7", "3.7", "debian-bullseye-stable", "3.7-debian-bullseye")] - [InlineData("python", "3.8", "3.8", "debian-bullseye-stable", "3.8-debian-bullseye")] + [InlineData("python", "3.8", "3.8", "debian-bookworm-stable", "3.8-debian-bookworm")] public void GenerateDockerfile_GeneratesBuildTagAndRuntime_ForProvidedPlatformAndVersion( string platformName, string detectedPlatformVersion, @@ -124,12 +124,12 @@ public void GenerateDockerfile_GeneratesBuildTagAndRuntime_ForProvidedPlatformAn [InlineData("php", "7.4", "debian-bullseye-stable", "7.4-debian-bullseye")] [InlineData("php", "8.0", "debian-bullseye-stable", "8.0-debian-bullseye")] [InlineData("php", "8.2", "debian-bullseye-stable", "8.2-debian-bullseye")] - [InlineData("python", "3.9", "debian-bullseye-stable", "3.9-debian-bullseye")] - [InlineData("python", "3.10", "debian-bullseye-stable", "3.10-debian-bullseye")] - [InlineData("python", "3.11", "debian-bullseye-stable", "3.11-debian-bullseye")] - [InlineData("python", "3.12", "debian-bullseye-stable", "3.12-debian-bullseye")] + [InlineData("python", "3.9", "debian-bookworm-stable", "3.9-debian-bookworm")] + [InlineData("python", "3.10", "debian-bookworm-stable", "3.10-debian-bookworm")] + [InlineData("python", "3.11", "debian-bookworm-stable", "3.11-debian-bookworm")] + [InlineData("python", "3.12", "debian-bookworm-stable", "3.12-debian-bookworm")] [InlineData("python", "3.6", "debian-buster-stable", "dynamic-debian-buster")] // 3.6.x not currently a runtime, use dynamic - [InlineData("python", "3.8.1", "debian-bullseye-stable", "3.8-debian-bullseye")] + [InlineData("python", "3.8.1", "debian-bookworm-stable", "3.8-debian-bookworm")] public void GenerateDockerfile_GeneratesBuildTagAndRuntime_ForProvidedPlatform( string platformName, string detectedPlatformVersion, @@ -186,12 +186,12 @@ public void GenerateDockerfile_GeneratesBuildTagAndRuntime_ForProvidedPlatform( [InlineData("php", "7.4", "debian-bullseye-stable", "7.4-debian-bullseye")] [InlineData("php", "8.0", "debian-bullseye-stable", "8.0-debian-bullseye")] [InlineData("php", "8.2", "debian-bullseye-stable", "8.2-debian-bullseye")] - [InlineData("python", "3.9", "debian-bullseye-stable", "3.9-debian-bullseye")] - [InlineData("python", "3.10", "debian-bullseye-stable", "3.10-debian-bullseye")] - [InlineData("python", "3.11", "debian-bullseye-stable", "3.11-debian-bullseye")] - [InlineData("python", "3.12", "debian-bullseye-stable", "3.12-debian-bullseye")] + [InlineData("python", "3.9", "debian-bookworm-stable", "3.9-debian-bookworm")] + [InlineData("python", "3.10", "debian-bookworm-stable", "3.10-debian-bookworm")] + [InlineData("python", "3.11", "debian-bookworm-stable", "3.11-debian-bookworm")] + [InlineData("python", "3.12", "debian-bookworm-stable", "3.12-debian-bookworm")] [InlineData("python", "3.6", "debian-buster-stable", "dynamic-debian-buster")] // 3.6.x not currently a runtime, use dynamic - [InlineData("python", "3.8.1", "debian-bullseye-stable", "3.8-debian-bullseye")] + [InlineData("python", "3.8.1", "debian-bookworm-stable", "3.8-debian-bookworm")] public void GenerateDockerfile_GeneratesBuildTagAndRuntime_ForNoProvidedPlatform( string platformName, string detectedPlatformVersion, diff --git a/tests/Oryx.Integration.Tests/Php/PhpDynamicInstallationTest.cs b/tests/Oryx.Integration.Tests/Php/PhpDynamicInstallationTest.cs index 63ca5ecf41..d0656d7aea 100644 --- a/tests/Oryx.Integration.Tests/Php/PhpDynamicInstallationTest.cs +++ b/tests/Oryx.Integration.Tests/Php/PhpDynamicInstallationTest.cs @@ -25,33 +25,75 @@ public PhpDynamicInstallationTest(ITestOutputHelper output, TestTempDirTestFixtu // because our agents currently a space limit of 10GB. [Fact, Trait("category", "php-8.2")] [Trait("build-image", "github-actions-debian-buster")] - public async Task PipelineTestInvocationsPhp82Async() + public async Task PipelineTestInvocationsPhp82_WithBusterEnvironmentAsync() { - await CanBuildAndRunAppAsync("8.2", ImageTestHelperConstants.OsTypeDebianBullseye); + await CanBuildAndRunAppAsync("8.2", ImageTestHelperConstants.OsTypeDebianBuster, ImageTestHelperConstants.GitHubActionsBuster); + } + + [Fact, Trait("category", "php-8.2")] + [Trait("build-image", "github-actions-debian-bullseye")] + public async Task PipelineTestInvocationsPhp82_WithBullseyeEnvironmentAsync() + { + await CanBuildAndRunAppAsync("8.2", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); + } + + [Fact, Trait("category", "php-8.2")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task PipelineTestInvocationsPhp82_WithBookwormEnvironmentAsync() + { + await CanBuildAndRunAppAsync("8.2", ImageTestHelperConstants.OsTypeDebianBookworm, ImageTestHelperConstants.GitHubActionsBookworm); } [Fact, Trait("category", "php-8.1")] [Trait("build-image", "github-actions-debian-buster")] - public async Task PipelineTestInvocationsPhp81Async() + public async Task PipelineTestInvocationsPhp81_WithBusterEnvironmentAsync() + { + await CanBuildAndRunAppAsync("8.1", ImageTestHelperConstants.OsTypeDebianBuster, ImageTestHelperConstants.GitHubActionsBuster); + } + + [Fact, Trait("category", "php-8.1")] + [Trait("build-image", "github-actions-debian-bullseye")] + public async Task PipelineTestInvocationsPhp81_WithBullseyeEnvironmentAsync() { - await CanBuildAndRunAppAsync("8.1", ImageTestHelperConstants.OsTypeDebianBullseye); + await CanBuildAndRunAppAsync("8.1", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); + } + + [Fact, Trait("category", "php-8.1")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task PipelineTestInvocationsPhp81_WithBookwormEnvironmentAsync() + { + await CanBuildAndRunAppAsync("8.1", ImageTestHelperConstants.OsTypeDebianBookworm, ImageTestHelperConstants.GitHubActionsBookworm); } [Fact, Trait("category", "php-8.0")] [Trait("build-image", "github-actions-debian-buster")] - public async Task PipelineTestInvocationsPhp80Async() + public async Task PipelineTestInvocationsPhp80_WithBusterEnvironmentAsync() + { + await CanBuildAndRunAppAsync("8.0", ImageTestHelperConstants.OsTypeDebianBuster, ImageTestHelperConstants.GitHubActionsBuster); + } + + [Fact, Trait("category", "php-8.0")] + [Trait("build-image", "github-actions-debian-bullseye")] + public async Task PipelineTestInvocationsPhp80_WithBullseyeEnvironmentAsync() { - await CanBuildAndRunAppAsync("8.0", ImageTestHelperConstants.OsTypeDebianBullseye); + await CanBuildAndRunAppAsync("8.0", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); } [Fact, Trait("category", "php-7.4")] [Trait("build-image", "github-actions-debian-buster")] - public async Task PipelineTestInvocationsPhp74Async() + public async Task PipelineTestInvocationsPhp74_WithBusterEnvironmentAsync() + { + await CanBuildAndRunAppAsync("7.4", ImageTestHelperConstants.OsTypeDebianBuster, ImageTestHelperConstants.GitHubActionsBuster); + } + + [Fact, Trait("category", "php-7.4")] + [Trait("build-image", "github-actions-debian-bullseye")] + public async Task PipelineTestInvocationsPhp74_WithBullseyeEnvironmentAsync() { - await CanBuildAndRunAppAsync("7.4", ImageTestHelperConstants.OsTypeDebianBullseye); + await CanBuildAndRunAppAsync("7.4", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); } - private async Task CanBuildAndRunAppAsync(string phpVersion, string osType) + private async Task CanBuildAndRunAppAsync(string phpVersion, string osType, string buildImageTag) { // Arrange var exifImageTypePng = "3"; @@ -76,7 +118,7 @@ await EndToEndTestHelper.BuildRunAndAssertAppAsync( appName, _output, new[] { volume, appOutputDirVolume }, - _imageHelper.GetGitHubActionsBuildImage(ImageTestHelperConstants.GitHubActionsBuster), + _imageHelper.GetGitHubActionsBuildImage(buildImageTag), "/bin/sh", new[] { "-c", buildScript }, _imageHelper.GetRuntimeImage("php", phpVersion, osType), ContainerPort, diff --git a/tests/Oryx.Integration.Tests/Python/PythonDynamicInstallationTest.cs b/tests/Oryx.Integration.Tests/Python/PythonDynamicInstallationTest.cs index 1d2afc102f..21bee3acf7 100644 --- a/tests/Oryx.Integration.Tests/Python/PythonDynamicInstallationTest.cs +++ b/tests/Oryx.Integration.Tests/Python/PythonDynamicInstallationTest.cs @@ -86,37 +86,73 @@ public async Task CanBuildAndRunPython39App_UsingGitHubActionsBuildImage_AndDyna [Trait("build-image", "github-actions-debian-bullseye")] public async Task CanBuildAndRunPython310App_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync() { - await CanBuildAndRunPythonApp_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync( + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( "3.10", "django-app", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); } + [Fact] + [Trait("category", "python-3.10")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task CanBuildAndRunPython310App_UsingGitHubActionsBookwormBuildImage_AndDynamicRuntimeInstallationAsync() + { + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( + "3.10", + "django-app", + ImageTestHelperConstants.OsTypeDebianBookworm, + ImageTestHelperConstants.GitHubActionsBookworm); + } + [Fact] [Trait("category", "python-3.11")] [Trait("build-image", "github-actions-debian-bullseye")] public async Task CanBuildAndRunPython311App_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync() { - await CanBuildAndRunPythonApp_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync( + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( "3.11", "django-app", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); } + [Fact] + [Trait("category", "python-3.11")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task CanBuildAndRunPython311App_UsingGitHubActionsBookwormBuildImage_AndDynamicRuntimeInstallationAsync() + { + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( + "3.11", + "django-app", + ImageTestHelperConstants.OsTypeDebianBookworm, + ImageTestHelperConstants.GitHubActionsBookworm); + } + [Fact] [Trait("category", "python-3.12")] [Trait("build-image", "github-actions-debian-bullseye")] public async Task CanBuildAndRunPython312App_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync() { - await CanBuildAndRunPythonApp_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync( + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( "3.12", "django42-app", ImageTestHelperConstants.OsTypeDebianBullseye, ImageTestHelperConstants.GitHubActionsBullseye); } + [Fact] + [Trait("category", "python-3.12")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task CanBuildAndRunPython312App_UsingGitHubActionsBookwormBuildImage_AndDynamicRuntimeInstallationAsync() + { + await CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( + "3.12", + "django42-app", + ImageTestHelperConstants.OsTypeDebianBookworm, + ImageTestHelperConstants.GitHubActionsBookworm); + } + [Fact] [Trait("category", "python-3.7")] [Trait("build-image", "github-actions-debian-bullseye")] @@ -174,44 +210,6 @@ await EndToEndTestHelper.BuildRunAndAssertAppAsync( } private async Task CanBuildAndRunPythonApp_UsingGitHubActionsBuildImage_AndDynamicRuntimeInstallationAsync( - string pythonVersion, - string debianFlavor = null) - { - // Arrange - var appName = "flask-app"; - var volume = CreateAppVolume(appName); - var appDir = volume.ContainerDir; - var appOutputDirVolume = CreateAppOutputDirVolume(); - var appOutputDir = appOutputDirVolume.ContainerDir; - var buildScript = new ShellScriptBuilder() - .AddCommand(GetSnippetToCleanUpExistingInstallation()) - .AddCommand( - $"oryx build {appDir} -i /tmp/int -o {appOutputDir} " + - $"--platform {PythonConstants.PlatformName} --platform-version {pythonVersion}") - .ToString(); - var runScript = new ShellScriptBuilder() - .AddCommand($"oryx create-script -appPath {appOutputDir} -bindPort {ContainerPort}") - .AddCommand(DefaultStartupFilePath) - .ToString(); - - await EndToEndTestHelper.BuildRunAndAssertAppAsync( - appName, - _output, - new[] { volume, appOutputDirVolume }, - _imageHelper.GetGitHubActionsBuildImage(debianFlavor), - "/bin/bash", new[] { "-c", buildScript }, - _imageHelper.GetRuntimeImage("python", "dynamic", ImageTestHelperConstants.OsTypeDebianBuster), - ContainerPort, - "/bin/bash", - new[] { "-c", runScript }, - async (hostPort) => - { - var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); - Assert.Contains("Hello World!", data); - }); - } - - private async Task CanBuildAndRunPythonApp_UsingGitHubActionsBullseyeBuildImage_AndDynamicRuntimeInstallationAsync( string pythonVersion, string appName, string osType, diff --git a/tests/Oryx.Integration.Tests/Python/PythonEndToEndTests.cs b/tests/Oryx.Integration.Tests/Python/PythonEndToEndTests.cs index 3adfd51542..af52e02164 100644 --- a/tests/Oryx.Integration.Tests/Python/PythonEndToEndTests.cs +++ b/tests/Oryx.Integration.Tests/Python/PythonEndToEndTests.cs @@ -71,7 +71,7 @@ await EndToEndTestHelper.BuildRunAndAssertAppAsync( [Fact] [Trait("category", "python-3.11")] [Trait("build-image", "github-actions-debian-bullseye")] - public async Task CanBuildAndRun_DjangoRegex() + public async Task CanBuildAndRun_DjangoRegex_OnBullseyeBuildImage() { // Arrange var version = "3.11"; @@ -116,10 +116,58 @@ await EndToEndTestHelper.BuildRunAndAssertAppAsync( }); } + [Fact] + [Trait("category", "python-3.11")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task CanBuildAndRun_DjangoRegex_OnBookwormBuildImage() + { + // Arrange + var version = "3.11"; + var osType = ImageTestHelperConstants.OsTypeDebianBookworm; + var appName = "django-regex-example-app"; + var volume = CreateAppVolume(appName); + var appDir = volume.ContainerDir; + var appOutputDirVolume = CreateAppOutputDirVolume(); + var appOutputDir = appOutputDirVolume.ContainerDir; + var buildScript = new ShellScriptBuilder() + .AddCommand($"oryx build {appDir} -i /tmp/int -o {appOutputDir} " + + $"--platform {PythonConstants.PlatformName} --platform-version {PythonVersions.Python311Version}") + .ToString(); + var runScript = new ShellScriptBuilder() + .AddCommand($"oryx create-script -appPath {appOutputDir} -bindPort {ContainerPort}") + .AddCommand(DefaultStartupFilePath) + .ToString(); + + await EndToEndTestHelper.BuildRunAndAssertAppAsync( + appName, + _output, + new[] { volume, appOutputDirVolume }, + _imageHelper.GetGitHubActionsBuildImage(ImageTestHelperConstants.GitHubActionsBookworm), + "/bin/bash", + new[] + { + "-c", + buildScript + }, + _imageHelper.GetRuntimeImage("python", version, osType), + ContainerPort, + "/bin/bash", + new[] + { + "-c", + runScript + }, + async (hostPort) => + { + var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); + Assert.Contains("Hello world from Django!", data); + }); + } + [Fact] [Trait("category", "python-3.12")] [Trait("build-image", "github-actions-debian-bullseye")] - public async Task CanBuildAndRun_DjangoRegex_Python12() + public async Task CanBuildAndRun_DjangoRegex_Python12_OnBullseyeBuildImage() { // Arrange var version = "3.12"; @@ -164,6 +212,54 @@ await EndToEndTestHelper.BuildRunAndAssertAppAsync( }); } + [Fact] + [Trait("category", "python-3.12")] + [Trait("build-image", "github-actions-debian-bookworm")] + public async Task CanBuildAndRun_DjangoRegex_Python12_OnBookwormBuildImage() + { + // Arrange + var version = "3.12"; + var osType = ImageTestHelperConstants.OsTypeDebianBookworm; + var appName = "django-regex-example-app"; + var volume = CreateAppVolume(appName); + var appDir = volume.ContainerDir; + var appOutputDirVolume = CreateAppOutputDirVolume(); + var appOutputDir = appOutputDirVolume.ContainerDir; + var buildScript = new ShellScriptBuilder() + .AddCommand($"oryx build {appDir} -i /tmp/int -o {appOutputDir} " + + $"--platform {PythonConstants.PlatformName} --platform-version {PythonVersions.Python312Version}") + .ToString(); + var runScript = new ShellScriptBuilder() + .AddCommand($"oryx create-script -appPath {appOutputDir} -bindPort {ContainerPort}") + .AddCommand(DefaultStartupFilePath) + .ToString(); + + await EndToEndTestHelper.BuildRunAndAssertAppAsync( + appName, + _output, + new[] { volume, appOutputDirVolume }, + _imageHelper.GetGitHubActionsBuildImage(ImageTestHelperConstants.GitHubActionsBookworm), + "/bin/bash", + new[] + { + "-c", + buildScript + }, + _imageHelper.GetRuntimeImage("python", version, osType), + ContainerPort, + "/bin/bash", + new[] + { + "-c", + runScript + }, + async (hostPort) => + { + var data = await _httpClient.GetStringAsync($"http://localhost:{hostPort}/"); + Assert.Contains("Hello world from Django!", data); + }); + } + [Theory] [Trait("category", "python-3.7")] [Trait("build-image", "debian-stretch")] diff --git a/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs b/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs index 66b60f58cc..6087a4b8c1 100644 --- a/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs +++ b/tests/Oryx.RuntimeImage.Tests/Python/PythonImagesTests.cs @@ -100,6 +100,47 @@ public void PythonBullseyeRuntimeImage_Contains_VersionAndCommit_Information(str result.GetDebugInfo()); } + [SkippableTheory] + [Trait("category", "runtime-bookworm")] + [InlineData("3.8")] + [InlineData("3.9")] + [InlineData("3.10")] + [InlineData("3.11")] + [InlineData("3.12")] + public void PythonBookwormRuntimeImage_Contains_VersionAndCommit_Information(string version) + { + // we cant always rely on gitcommitid as env variable in case build context is not correctly passed + // so we should check agent_os environment variable to know if the build is happening in azure devops agent + // or locally, locally we need to skip this test + var agentOS = Environment.GetEnvironmentVariable("AGENT_OS"); + Skip.If(string.IsNullOrEmpty(agentOS)); + + // Arrange + var gitCommitID = GitHelper.GetCommitID(); + var buildNumber = Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER"); + var expectedOryxVersion = string.Concat(Settings.OryxVersion, buildNumber); + + // Act + var result = _dockerCli.Run(new DockerRunArguments + { + ImageId = _imageHelper.GetRuntimeImage("python", version, ImageTestHelperConstants.OsTypeDebianBookworm), + CommandToExecuteOnRun = "oryx", + CommandArguments = new[] { "version" } + }); + + // Assert + RunAsserts( + () => + { + Assert.True(result.IsSuccess); + Assert.NotNull(result.StdErr); + Assert.DoesNotContain(".unspecified, Commit: unspecified", result.StdOut); + Assert.Contains(gitCommitID, result.StdOut); + Assert.Contains(expectedOryxVersion, result.StdOut); + }, + result.GetDebugInfo()); + } + [Theory] [Trait("category", "runtime-buster")] [InlineData("3.7")] @@ -160,6 +201,65 @@ public void JamSpell_CanBe_InstalledInBullseyeRunTimeImage(string version) result.GetDebugInfo()); } + [Theory] + [Trait("category", "runtime-bookworm")] + [InlineData("3.8")] + [InlineData("3.9")] + [InlineData("3.10")] + [InlineData("3.11")] + [InlineData("3.12")] + public void JamSpell_CanBe_InstalledInBookwormRunTimeImage(string version) + { + // Arrange + var expectedPackage = "jamspell"; + // Act + var result = _dockerCli.Run(new DockerRunArguments + { + ImageId = _imageHelper.GetRuntimeImage("python", version, ImageTestHelperConstants.OsTypeDebianBookworm), + CommandToExecuteOnRun = "/bin/bash", + CommandArguments = new[] { "-c", $"wget -O - https://pypi.org/simple/ | grep -i {expectedPackage}" } + }); + + // Assert + var actualOutput = result.StdOut.ReplaceNewLine(); + RunAsserts( + () => + { + Assert.True(result.IsSuccess); + Assert.Contains(expectedPackage, actualOutput); + }, + result.GetDebugInfo()); + } + + [Theory] + [Trait("category", "runtime-bookworm")] + [InlineData("3.8", "Python " + PythonVersions.Python38Version)] + [InlineData("3.9", "Python " + PythonVersions.Python39Version)] + [InlineData("3.10", "Python " + PythonVersions.Python310Version)] + [InlineData("3.11", "Python " + PythonVersions.Python311Version)] + [InlineData("3.12", "Python " + PythonVersions.Python312Version)] + [Trait(TestConstants.Category, TestConstants.Release)] + public void PythonVersionMatchesBookwormImageName(string pythonVersion, string expectedOutput) + { + // Arrange & Act + var result = _dockerCli.Run(new DockerRunArguments + { + ImageId = _imageHelper.GetRuntimeImage("python", pythonVersion, ImageTestHelperConstants.OsTypeDebianBookworm), + CommandToExecuteOnRun = "python", + CommandArguments = new[] { "--version" } + }); + + // Assert + var actualOutput = result.StdOut.ReplaceNewLine(); + RunAsserts( + () => + { + Assert.True(result.IsSuccess); + Assert.Equal(expectedOutput, actualOutput); + }, + result.GetDebugInfo()); + } + [Theory] [Trait("category", "runtime-bullseye")] [InlineData("3.7", "Python " + PythonVersions.Python37Version)] diff --git a/vsts/pipelines/PlatformBinaries/php.yml b/vsts/pipelines/PlatformBinaries/php.yml index 079d8e4c1f..290d45beec 100644 --- a/vsts/pipelines/PlatformBinaries/php.yml +++ b/vsts/pipelines/PlatformBinaries/php.yml @@ -10,6 +10,19 @@ parameters: stages: - stage: Build jobs: + - job: Php_Bookworm_SDK + timeoutInMinutes: 1440 + pool: + name: AzurePipelines-EO + demands: + - ImageOverride -equals AzurePipelinesUbuntu20.04compliant + steps: + - template: ../templates/_platformBinariesTemplate.yml + parameters: + platformName: 'php' + debianFlavor: 'bookworm' + destinationSdkStorageAccountName: '${{ parameters.destinationStorageAccountName }}' + - job: Php_Bullseye_SDK timeoutInMinutes: 1440 pool: diff --git a/vsts/pipelines/PlatformBinaries/python.yml b/vsts/pipelines/PlatformBinaries/python.yml index 0dc7813541..48378035cf 100644 --- a/vsts/pipelines/PlatformBinaries/python.yml +++ b/vsts/pipelines/PlatformBinaries/python.yml @@ -10,6 +10,19 @@ parameters: stages: - stage: Build jobs: + - job: Python_Bookworm_SDK + timeoutInMinutes: 250 + pool: + name: AzurePipelines-EO + demands: + - ImageOverride -equals AzurePipelinesUbuntu20.04compliant + steps: + - template: ../templates/_platformBinariesTemplate.yml + parameters: + platformName: 'python' + debianFlavor: 'bookworm' + destinationSdkStorageAccountName: '${{ parameters.destinationStorageAccountName }}' + - job: Python_Bullseye_SDK timeoutInMinutes: 250 pool: diff --git a/vsts/pipelines/baseImages/python.yml b/vsts/pipelines/baseImages/python.yml index 8133e0b94a..c6b377d507 100644 --- a/vsts/pipelines/baseImages/python.yml +++ b/vsts/pipelines/baseImages/python.yml @@ -19,9 +19,19 @@ jobs: artifactsFileName: python-runtimeimage-bases-bullseye.txt jobName: Build_Bullseye_BaseImages +- template: ../templates/_buildimageBasesJobTemplate.yml + parameters: + displayName: Build python runtime bookworm base images + scriptPath: ./build/buildRunTimeImageBases.sh + imageDir: python + imageDebianFlavor: bookworm + artifactsFileName: python-runtimeimage-bases-bookworm.txt + jobName: Build_Bookworm_BaseImages + - job: Release_PythonRuntimeBaseImage dependsOn: - Build_Bullseye_BaseImages + - Build_Bookworm_BaseImages displayName: Push images to MCR timeoutInMinutes: 250 pool: diff --git a/vsts/pipelines/templates/integrationTests/_pythonIntegrationJobTemplate.yml b/vsts/pipelines/templates/integrationTests/_pythonIntegrationJobTemplate.yml index acf780215d..19a76fc930 100644 --- a/vsts/pipelines/templates/integrationTests/_pythonIntegrationJobTemplate.yml +++ b/vsts/pipelines/templates/integrationTests/_pythonIntegrationJobTemplate.yml @@ -21,8 +21,12 @@ parameters: buildTag: 'github-actions-debian-bullseye' - category: '3.11' buildTag: 'github-actions-debian-bullseye' + - category: '3.11' + buildTag: 'github-actions-debian-bookworm' - category: '3.12' buildTag: 'github-actions-debian-bullseye' + - category: '3.12' + buildTag: 'github-actions-debian-bookworm' jobs: - ${{ each mapping in parameters.testMappings }}: diff --git a/vsts/scripts/tagBaseImagesForRelease.sh b/vsts/scripts/tagBaseImagesForRelease.sh index 24bc3c6e3b..923caf30b5 100644 --- a/vsts/scripts/tagBaseImagesForRelease.sh +++ b/vsts/scripts/tagBaseImagesForRelease.sh @@ -76,6 +76,7 @@ then echo "" echo $imageName retagImageWithStagingRepository python-runtimeimage-bases-bullseye.txt $imageName bullseye + retagImageWithStagingRepository python-runtimeimage-bases-bookworm.txt $imageName bookworm elif [ "$imageName" == "php-build" ] then echo ""