-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Harrli/python3.12 and automation (#2247)
* python 3.12 integration * updated baseimage tag * added dockerfiles and tests * fixed build issue * python version update * BUG FIX * issue fix * python 3.12 sdk * updated package version * python 3.12 issue fix * python pip issue fix in binaries * updated python binary fix * issue fix * minor bug fix * pip req_set file issue fix * quick fix * test * python version in the image fix * testing the container * python 3.12 changes * updated baseimage tag * addressed PR comments. * Fixed Python 3.12 pipeline failure * Added required dependencies for lxml package * Fixing lxml build issue * Fixing missed gcc * Update orjson version * Modified orjson version * Pipeline failure fix * Added cargo to resolve pipeline error * Temporarily remove orjson from python 3.12 runtime * Addressed comments and enabled new Python test * Added django-utils-six manually * Removed incompatible integration test for Python 3.12 --------- Co-authored-by: Wali Bhuiyan <[email protected]>
- Loading branch information
1 parent
97e1254
commit 07b7587
Showing
22 changed files
with
302 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1219,6 +1219,7 @@ | |
- 3.11.0b1 | ||
- 3.11.0 | ||
- 3.11.6 | ||
- 3.12.0 | ||
|
||
### buster | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
ARG DEBIAN_FLAVOR | ||
# Startup script generator | ||
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.18-${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.0 | ||
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.0 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 \ | ||
&& apt-get update \ | ||
&& apt-get upgrade --assume-yes \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /tmp/oryx | ||
|
||
COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
ARG DEBIAN_FLAVOR | ||
# Startup script generator | ||
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.19-${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-bullseye as main | ||
ARG DEBIAN_FLAVOR | ||
ARG IMAGES_DIR=/tmp/oryx/images | ||
ARG BUILD_DIR=/tmp/oryx/build | ||
ARG SDK_STORAGE_BASE_URL_VALUE | ||
ENV DEBIAN_FLAVOR=${DEBIAN_FLAVOR} | ||
ENV ORYX_SDK_STORAGE_BASE_URL=${SDK_STORAGE_BASE_URL_VALUE} | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y --no-install-recommends \ | ||
xz-utils \ | ||
# Install gcc due to error installing viztracer returning gcc not found | ||
gcc \ | ||
&& 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.0 | ||
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 | ||
|
||
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 $DEBIAN_FLAVOR | ||
|
||
RUN set -ex \ | ||
&& cd /opt/python/ \ | ||
&& ln -s 3.12.0 3.12 \ | ||
&& ln -s 3.12 3 \ | ||
&& echo /opt/python/3/lib >> /etc/ld.so.conf.d/python.conf \ | ||
&& ldconfig \ | ||
&& if [ "3" = "3" ]; then cd /opt/python/3/bin \ | ||
&& ln -nsf idle3 idle \ | ||
&& ln -nsf pydoc3 pydoc \ | ||
&& ln -nsf python3-config python-config; fi \ | ||
&& 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} | ||
#Bake in client certificate path into image to avoid downloading it | ||
ENV PATH_CA_CERTIFICATE="/etc/ssl/certs/ca-certificate.crt" | ||
|
||
# Oryx++ Builder variables | ||
ENV CNB_STACK_ID="oryx.stacks.skeleton" | ||
LABEL io.buildpacks.stack.id="oryx.stacks.skeleton" | ||
|
||
RUN ${IMAGES_DIR}/runtime/python/install-dependencies.sh | ||
RUN pip install --upgrade pip \ | ||
&& pip install gunicorn \ | ||
&& pip install debugpy \ | ||
&& pip install viztracer==0.15.6 \ | ||
&& pip install vizplugins==0.1.3 \ | ||
# Removing orjson only for 3.12 due to build errors | ||
&& if [ "3.12" != "3.12" ]; then pip install orjson==3.8.10; fi \ | ||
&& if [ "3.12" = "3.7" ] || [ "3.12" = "3.8" ]; then curl -LO http://ftp.de.debian.org/debian/pool/main/libf/libffi/libffi6_3.2.1-9_amd64.deb \ | ||
&& dpkg -i libffi6_3.2.1-9_amd64.deb \ | ||
&& rm libffi6_3.2.1-9_amd64.deb; fi \ | ||
&& ln -s /opt/startupcmdgen/startupcmdgen /usr/local/bin/oryx \ | ||
&& apt-get update \ | ||
&& apt-get upgrade --assume-yes \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /tmp/oryx | ||
|
||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US.UTF-8" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
COPY --from=startupCmdGen /opt/startupcmdgen/startupcmdgen /opt/startupcmdgen/startupcmdgen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.