Skip to content

Commit

Permalink
Fix service image Python 3.12+ issues (#782)
Browse files Browse the repository at this point in the history
* Use `ensurepip` to make sure pip bundled with 3.12 is compatible

* Add `ensurepip --upgrade` to install_python.sh

* Downgrade WAML due to Azure ML Python 3.12 incompatibility
  • Loading branch information
ianpittwood committed May 29, 2024
1 parent 7a1c227 commit c69133c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ variable WORKBENCH_GOOGLE_CLOUD_WORKSTATION_BUILD_MATRIX {
variable WORKBENCH_MICROSOFT_AZURE_ML_BUILD_MATRIX {
default = {
builds = [
{os = "ubuntu2204", r_primary = "4.4.0", r_alternate = "4.3.3", py_primary = "3.12.1", py_alternate = "3.11.7"},
{os = "ubuntu2204", r_primary = "4.2.3", r_alternate = "4.1.3", py_primary = "3.9.17", py_alternate = "3.8.17"},
]
}
}
Expand Down
1 change: 1 addition & 0 deletions product/base/scripts/ubuntu/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ install_python() {
apt-get install $APT_ARGS "/tmp/python-${PYTHON_VERSION}.deb"
rm "/tmp/python-${PYTHON_VERSION}.deb"
# Upgrade pip and setuptools to latest version
$PYTHON_BIN -m ensurepip --upgrade
$PYTHON_BIN -m pip install -U setuptools
$PYTHON_BIN -m pip install -U pip
}
Expand Down
2 changes: 2 additions & 0 deletions workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ RUN curl -O https://cdn.rstudio.com/python/ubuntu-2204/pkgs/python-${PYTHON_VERS
&& apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION_ALT}_1_amd64.deb \
&& rm -rf python-${PYTHON_VERSION}_1_amd64.deb \
&& rm -rf python-${PYTHON_VERSION_ALT}_1_amd64.deb \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m ensurepip --upgrade \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install 'virtualenv<20' \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade setuptools \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade pip \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m ensurepip --upgrade \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install 'virtualenv<20' \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade setuptools \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade pip \
Expand Down

0 comments on commit c69133c

Please sign in to comment.