Skip to content

Commit 8bdf0ef

Browse files
Add bookworm support for PHP (build) and Python (build + runtime) (#2337)
Co-authored-by: REDMOND\williamhe <[email protected]>
1 parent 9948d91 commit 8bdf0ef

File tree

28 files changed

+675
-74
lines changed

28 files changed

+675
-74
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ paket-files/
255255
# Python cache
256256
*.pyc
257257

258+
# .NET global.json for SDK versioning
259+
global.json
260+
258261
# Node and .NET Core runtime Dockerfiles, that are auto generated
259262
images/runtime/node/*/Dockerfile
260263
images/runtime/node/*/buster.Dockerfile

build/__pythonVersions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file was auto-generated from 'constants.yaml'. Changes may be overridden.
22

3-
PYTHON_RUNTIME_BASE_TAG='20231208.1'
3+
PYTHON_RUNTIME_BASE_TAG='20240110.3'
44
PIP_VERSION='21.2.4'
55
PYTHON27_VERSION='2.7.18'
66
PYTHON36_VERSION='3.6.15'

build/constants.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
file-name-prefix: __
150150
- name: python-versions
151151
constants:
152-
python-runtime-base-tag: 20231208.1
152+
python-runtime-base-tag: 20240110.3
153153
pip-version: 21.2.4
154154
python27-version: 2.7.18
155155
python36-version: 3.6.15
@@ -162,13 +162,18 @@
162162
runtime-versions:
163163
- 3.7-debian-bullseye
164164
- 3.7-debian-buster
165+
- 3.8-debian-bookworm
165166
- 3.8-debian-bullseye
166167
- 3.8-debian-buster
168+
- 3.9-debian-bookworm
167169
- 3.9-debian-bullseye
168170
- 3.9-debian-buster
171+
- 3.10-debian-bookworm
169172
- 3.10-debian-bullseye
170173
- 3.10-debian-buster
174+
- 3.11-debian-bookworm
171175
- 3.11-debian-bullseye
176+
- 3.12-debian-bookworm
172177
- 3.12-debian-bullseye
173178
- dynamic-debian-buster
174179
outputs:

doc/supportedPlatformVersions.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@
829829

830830
## php composer
831831

832+
### bookworm
833+
834+
- 2.6.2
835+
832836
### bullseye
833837

834838
- 1.9.2
@@ -993,6 +997,11 @@
993997

994998
## php
995999

1000+
### bookworm
1001+
1002+
- 8.1.22
1003+
- 8.2.9
1004+
9961005
### bullseye
9971006

9981007
- 7.4.9
@@ -1212,6 +1221,14 @@
12121221

12131222
## python
12141223

1224+
### bookworm
1225+
1226+
- 3.8.18
1227+
- 3.9.18
1228+
- 3.10.13
1229+
- 3.11.7
1230+
- 3.12.1
1231+
12151232
### bullseye
12161233

12171234
- 3.7.9
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ARG DEBIAN_FLAVOR
2+
# Startup script generator
3+
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen
4+
# GOPATH is set to "/go" in the base image
5+
WORKDIR /go/src
6+
COPY src/startupscriptgenerator/src .
7+
ARG GIT_COMMIT=unspecified
8+
ARG BUILD_NUMBER=unspecified
9+
ARG RELEASE_TAG_NAME=unspecified
10+
ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME}
11+
ENV GIT_COMMIT=${GIT_COMMIT}
12+
ENV BUILD_NUMBER=${BUILD_NUMBER}
13+
#Bake in client certificate path into image to avoid downloading it
14+
ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt"
15+
RUN ./build.sh python /opt/startupcmdgen/startupcmdgen
16+
17+
FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main
18+
ARG DEBIAN_FLAVOR
19+
ARG IMAGES_DIR=/tmp/oryx/images
20+
ARG BUILD_DIR=/tmp/oryx/build
21+
ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR}
22+
23+
RUN apt-get update \
24+
&& apt-get upgrade -y \
25+
&& apt-get install -y --no-install-recommends \
26+
xz-utils \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
ADD images ${IMAGES_DIR}
30+
ADD build ${BUILD_DIR}
31+
RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
32+
RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
33+
34+
ENV PYTHON_VERSION 3.10.13
35+
RUN true
36+
COPY build/__pythonVersions.sh ${BUILD_DIR}
37+
RUN true
38+
COPY platforms/__common.sh /tmp/
39+
RUN true
40+
COPY platforms/python/prereqs/build.sh /tmp/
41+
RUN true
42+
COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/
43+
RUN true
44+
COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh
45+
RUN true
46+
47+
RUN chmod +x /tmp/receiveGpgKeys.sh
48+
RUN chmod +x /tmp/build.sh && \
49+
apt-get update && \
50+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
51+
build-essential \
52+
tk-dev \
53+
uuid-dev \
54+
libgeos-dev
55+
56+
RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \
57+
set -e \
58+
&& export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \
59+
&& ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION
60+
61+
RUN set -ex \
62+
&& cd /opt/python/ \
63+
&& ln -s 3.10.13 3.10 \
64+
&& ln -s 3.10 3 \
65+
&& echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \
66+
&& ldconfig \
67+
&& cd /opt/python/3/bin \
68+
&& ln -nsf idle3 idle \
69+
&& ln -nsf pydoc3 pydoc \
70+
&& ln -nsf python3-config python-config \
71+
&& rm -rf /var/lib/apt/lists/*
72+
73+
ENV PATH="/opt/python/3/bin:${PATH}"
74+
75+
# Bake Application Insights key from pipeline variable into final image
76+
ARG AI_CONNECTION_STRING
77+
ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING}
78+
79+
RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh
80+
RUN pip install --upgrade pip \
81+
&& pip install gunicorn \
82+
&& pip install debugpy \
83+
&& pip install viztracer \
84+
&& pip install vizplugins \
85+
&& pip install orjson \
86+
&& ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \
87+
&& rm -rf /var/lib/apt/lists/* \
88+
&& rm -rf /tmp/oryx
89+
90+
COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
ARG DEBIAN_FLAVOR
2+
# Startup script generator
3+
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen
4+
# GOPATH is set to "/go" in the base image
5+
WORKDIR /go/src
6+
COPY src/startupscriptgenerator/src .
7+
ARG GIT_COMMIT=unspecified
8+
ARG BUILD_NUMBER=unspecified
9+
ARG RELEASE_TAG_NAME=unspecified
10+
ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME}
11+
ENV GIT_COMMIT=${GIT_COMMIT}
12+
ENV BUILD_NUMBER=${BUILD_NUMBER}
13+
RUN ./build.sh python /opt/startupcmdgen/startupcmdgen
14+
15+
FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main
16+
ARG DEBIAN_FLAVOR
17+
ARG IMAGES_DIR=/tmp/oryx/images
18+
ARG BUILD_DIR=/tmp/oryx/build
19+
ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR}
20+
21+
RUN apt-get update \
22+
&& apt-get upgrade -y \
23+
&& apt-get install -y --no-install-recommends \
24+
xz-utils \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
ADD images ${IMAGES_DIR}
28+
ADD build ${BUILD_DIR}
29+
RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
30+
RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
31+
32+
ENV PYTHON_VERSION 3.11.7
33+
RUN true
34+
COPY build/__pythonVersions.sh ${BUILD_DIR}
35+
RUN true
36+
COPY platforms/__common.sh /tmp/
37+
RUN true
38+
COPY platforms/python/prereqs/build.sh /tmp/
39+
RUN true
40+
COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/
41+
RUN true
42+
COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh
43+
RUN true
44+
45+
RUN chmod +x /tmp/receiveGpgKeys.sh
46+
RUN chmod +x /tmp/build.sh && \
47+
apt-get update && \
48+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
49+
build-essential \
50+
tk-dev \
51+
uuid-dev \
52+
libgeos-dev
53+
54+
RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \
55+
set -e \
56+
&& export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \
57+
&& ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION
58+
59+
RUN set -ex \
60+
&& cd /opt/python/ \
61+
&& ln -s 3.11.7 3.11 \
62+
&& ln -s 3.11 3 \
63+
&& echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \
64+
&& ldconfig \
65+
&& cd /opt/python/3/bin \
66+
&& ln -nsf idle3 idle \
67+
&& ln -nsf pydoc3 pydoc \
68+
&& ln -nsf python3-config python-config \
69+
&& rm -rf /var/lib/apt/lists/*
70+
71+
ENV PATH="/opt/python/3/bin:${PATH}"
72+
73+
# Bake Application Insights key from pipeline variable into final image
74+
ARG AI_CONNECTION_STRING
75+
ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING}
76+
77+
RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh
78+
RUN pip install --upgrade pip \
79+
&& pip install gunicorn \
80+
&& pip install debugpy \
81+
&& pip install viztracer \
82+
&& pip install vizplugins \
83+
&& pip install orjson \
84+
&& ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \
85+
&& rm -rf /var/lib/apt/lists/* \
86+
&& rm -rf /tmp/oryx
87+
88+
COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ARG DEBIAN_FLAVOR
2+
# Startup script generator
3+
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.20-${DEBIAN_FLAVOR} as startupCmdGen
4+
# GOPATH is set to "/go" in the base image
5+
WORKDIR /go/src
6+
COPY src/startupscriptgenerator/src .
7+
ARG GIT_COMMIT=unspecified
8+
ARG BUILD_NUMBER=unspecified
9+
ARG RELEASE_TAG_NAME=unspecified
10+
ENV RELEASE_TAG_NAME=${RELEASE_TAG_NAME}
11+
ENV GIT_COMMIT=${GIT_COMMIT}
12+
ENV BUILD_NUMBER=${BUILD_NUMBER}
13+
RUN ./build.sh python /opt/startupcmdgen/startupcmdgen
14+
15+
FROM oryxdevmcr.azurecr.io/private/oryx/oryx-run-base-${DEBIAN_FLAVOR} as main
16+
ARG DEBIAN_FLAVOR
17+
ARG IMAGES_DIR=/tmp/oryx/images
18+
ARG BUILD_DIR=/tmp/oryx/build
19+
ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR}
20+
21+
RUN apt-get update \
22+
&& apt-get upgrade -y \
23+
&& apt-get install -y --no-install-recommends \
24+
xz-utils \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
ADD images ${IMAGES_DIR}
28+
ADD build ${BUILD_DIR}
29+
RUN find ${IMAGES_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
30+
RUN find ${BUILD_DIR} -type f -iname "*.sh" -exec chmod +x {} \;
31+
32+
ENV PYTHON_VERSION 3.12.1
33+
RUN true
34+
COPY build/__pythonVersions.sh ${BUILD_DIR}
35+
RUN true
36+
COPY platforms/__common.sh /tmp/
37+
RUN true
38+
COPY platforms/python/prereqs/build.sh /tmp/
39+
RUN true
40+
COPY platforms/python/versions/${DEBIAN_FLAVOR}/versionsToBuild.txt /tmp/
41+
RUN true
42+
COPY images/receiveGpgKeys.sh /tmp/receiveGpgKeys.sh
43+
RUN true
44+
45+
RUN chmod +x /tmp/receiveGpgKeys.sh
46+
RUN chmod +x /tmp/build.sh && \
47+
apt-get update && \
48+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
49+
build-essential \
50+
tk-dev \
51+
uuid-dev \
52+
libgeos-dev
53+
54+
RUN --mount=type=secret,id=oryx_sdk_storage_account_access_token \
55+
set -e \
56+
&& export ORYX_SDK_STORAGE_ACCOUNT_ACCESS_TOKEN_PATH="/run/secrets/oryx_sdk_storage_account_access_token" \
57+
&& ${BUILD_DIR}/buildPythonSdkByVersion.sh $PYTHON_VERSION
58+
59+
RUN set -ex \
60+
&& cd /opt/python/ \
61+
&& ln -s 3.12.1 3.12 \
62+
&& ln -s 3.12 3 \
63+
&& echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \
64+
&& ldconfig \
65+
&& cd /opt/python/3/bin \
66+
&& ln -nsf idle3 idle \
67+
&& ln -nsf pydoc3 pydoc \
68+
&& ln -nsf python3-config python-config \
69+
&& rm -rf /var/lib/apt/lists/*
70+
71+
ENV PATH="/opt/python/3/bin:${PATH}"
72+
73+
# Bake Application Insights key from pipeline variable into final image
74+
ARG AI_CONNECTION_STRING
75+
ENV ORYX_AI_CONNECTION_STRING=${AI_CONNECTION_STRING}
76+
77+
RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh
78+
79+
RUN pip install --upgrade pip \
80+
&& pip install gunicorn \
81+
&& pip install debugpy \
82+
&& pip install viztracer \
83+
&& pip install vizplugins \
84+
&& pip install orjson \
85+
&& ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \
86+
&& rm -rf /var/lib/apt/lists/* \
87+
&& rm -rf /tmp/oryx
88+
89+
COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen

images/runtime/python/generateDockerfiles.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ declare -r ORYX_PYTHON_IMAGE_BASE_PLACEHOLDER="%BASE_TAG%"
2222
source "$PYTHON_VERSIONS_PATH"
2323

2424
# Please make sure that any changes to debian flavors supported here are also reflected in build/constants.yaml
25-
declare -r PYTHON_BOOKWORM_VERSION_ARRAY=()
25+
declare -r PYTHON_BOOKWORM_VERSION_ARRAY=($PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION $PYTHON311_VERSION $PYTHON312_VERSION)
2626
declare -r PYTHON_BULLSEYE_VERSION_ARRAY=($PYTHON37_VERSION $PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION $PYTHON311_VERSION $PYTHON312_VERSION)
2727
declare -r PYTHON_BUSTER_VERSION_ARRAY=($PYTHON37_VERSION $PYTHON38_VERSION $PYTHON39_VERSION $PYTHON310_VERSION)
2828
ImageDebianFlavor="$1"

platforms/php/buildPhp.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ buildPhpComposer() {
116116
# a version here.
117117
docker build \
118118
-f "$phpPlatformDir/composer/Dockerfile" \
119-
--build-arg PHP_VERSION="$PHP73_VERSION" \
119+
--build-arg PHP_VERSION="$PHP81_VERSION" \
120120
--build-arg DEBIAN_FLAVOR=$debianFlavor \
121-
--build-arg PHP_SHA256="$PHP73_TAR_SHA256" \
122-
--build-arg GPG_KEYS="$PHP73_KEYS" \
121+
--build-arg PHP_SHA256="$PHP81_TAR_SHA256" \
122+
--build-arg GPG_KEYS="$PHP81_KEYS" \
123123
--build-arg COMPOSER_VERSION="$version" \
124124
--build-arg COMPOSER_SETUP_SHA384="$COMPOSER_SETUP_SHA384" \
125125
-t $imageName \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2

0 commit comments

Comments
 (0)