Skip to content

Commit c0aec36

Browse files
authored
Merge pull request #2392 from Esri/JR/docker-prerelease
enable prerelease for notebook docker image
2 parents 5cdc7af + f9292f1 commit c0aec36

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

.github/workflows/DockerBuild.NotebookImage.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,27 @@ on:
1111
version:
1212
description: "Version of ArcGIS API for Python to install in the image"
1313
type: string
14-
default: "2.4.1"
14+
default: "2.4.2"
15+
arcgis_mapping_version:
16+
description: "Version of arcgis-mapping to install in the image (only used if version >= 2.4.0)"
17+
type: string
18+
default: "4.33.0"
1519
python_version:
1620
description: "Python version to base image on"
1721
type: string
18-
default: "3.11"
22+
default: "3.13"
1923
is_latest_release:
2024
description: "Version of ArcGIS API for Python is Latest current release"
2125
type: boolean
2226
default: false
27+
arcgis_wheel_url:
28+
description: "Use a custom version of ArcGIS API for Python from this wheel URL, if empty, use pypi.org; if provided, `-prerelease` will be appended to the image tag"
29+
type: string
30+
default: ""
31+
arcgis_mapping_wheel_url:
32+
description: "Use a custom version of arcgis-mapping from this wheel URL, if empty, install from pypi.org; if provided, `-prerelease` will be appended to the image tag"
33+
type: string
34+
default: ""
2335
is_default_supported_python:
2436
description: "Python version is default supported version (i.e. python used by Pro and Enterprise)"
2537
type: boolean
@@ -52,10 +64,10 @@ jobs:
5264
images: |
5365
ghcr.io/esri/arcgis-python-api-notebook
5466
tags: |
55-
type=raw,value=${{ inputs.version }}-python${{ inputs.python_version }}
56-
type=raw,value=${{ inputs.version }},enable=${{ inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }}
57-
type=raw,value=latest,enable=${{ inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }}
58-
type=schedule,pattern={{date 'YY.MM'}},enable=${{ inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }}
67+
type=raw,value=${{ inputs.version }}-python${{ inputs.python_version }}${{ inputs.arcgis_wheel_url != '' && '-prerelease' || '' }}
68+
type=raw,value=${{ inputs.version }},enable=${{ inputs.is_default_supported_python && inputs.arcgis_wheel_url == '' && github.ref_name == github.event.repository.default_branch }}
69+
type=raw,value=latest,enable=${{ inputs.arcgis_wheel_url == '' && inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }}
70+
type=schedule,pattern={{date 'YY.MM'}},enable=${{ inputs.arcgis_wheel_url == '' && inputs.is_latest_release && inputs.is_default_supported_python && github.ref_name == github.event.repository.default_branch }}
5971
6072
- id: docker_build
6173
name: Build image and push to GitHub Container Registry
@@ -67,6 +79,9 @@ jobs:
6779
build-args: |
6880
python_version=${{ inputs.python_version }}
6981
arcgis_version=${{ inputs.version }}
82+
arcgis_mapping_version=${{ inputs.arcgis_mapping_version }}
83+
arcgis_wheel_url=${{ inputs.arcgis_wheel_url }}
84+
arcgis_mapping_wheel_url=${{ inputs.arcgis_mapping_wheel_url }}
7085
tags: ${{ steps.meta.outputs.tags }}
7186
provenance: false
7287
platforms: linux/amd64

docker/NotebookImage.Dockerfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
ARG python_version="3.11"
1+
ARG python_version="3.13"
22
FROM quay.io/jupyter/minimal-notebook:python-${python_version}
33

44
ARG python_version
5-
ARG arcgis_version="2.4.1"
6-
ARG gdal_version="3.10.2"
5+
ARG arcgis_version="2.4.2"
6+
ARG arcgis_mapping_version="4.33.0"
7+
ARG gdal_version="3.11.4"
8+
# If arcgis_wheel_url is provided, the Dockerfile will attempt to install the ArcGIS API for Python from that URL
9+
ARG arcgis_wheel_url=""
10+
ARG arcgis_mapping_wheel_url=""
11+
712
ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
813
ARG githubfolder="arcgis-python-api"
914
ARG env_name=arcgis
@@ -25,17 +30,20 @@ RUN conda install -n ${env_name} -c conda-forge gdal=${gdal_version} -y --quiet
2530
&& conda clean --all -f -y \
2631
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2732

33+
RUN echo "${arcgis_wheel_url:-arcgis==${arcgis_version}.*}" > /tmp/arcgis_source.txt
34+
2835
# Install ArcGIS API for Python from pypi
2936
RUN . activate ${env_name} \
30-
# adding .* ensures the latest patch version is installed
31-
&& python -m pip install "arcgis==${arcgis_version}.*" \
37+
&& python -m pip install "$(cat /tmp/arcgis_source.txt)" \
3238
&& conda clean --all -f -y \
3339
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
3440

41+
RUN echo "${arcgis_mapping_wheel_url:-arcgis-mapping==${arcgis_mapping_version}.*}" > /tmp/arcgis_mapping_source.txt
42+
3543
# Install arcgis-mapping if arcgis_version >= 2.4.0
3644
RUN (dpkg --compare-versions $arcgis_version ge 2.4.0 \
3745
&& . activate ${env_name} \
38-
&& python -m pip install arcgis-mapping \
46+
&& python -m pip install "$(cat /tmp/arcgis_mapping_source.txt)" \
3947
&& conda clean --all -f -y \
4048
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
4149
|| echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"

0 commit comments

Comments
 (0)