Skip to content

Commit 8015690

Browse files
committed
enable prerelease docker image
1 parent 43161fc commit 8015690

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

.github/workflows/DockerBuild.NotebookImage.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ on:
2020
description: "Version of ArcGIS API for Python is Latest current release"
2121
type: boolean
2222
default: false
23+
arcgis_wheel_url:
24+
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"
25+
type: string
26+
default: ""
27+
arcgis_mapping_wheel_url:
28+
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"
29+
type: string
30+
default: ""
2331
is_default_supported_python:
2432
description: "Python version is default supported version (i.e. python used by Pro and Enterprise)"
2533
type: boolean
@@ -52,10 +60,10 @@ jobs:
5260
images: |
5361
ghcr.io/esri/arcgis-python-api-notebook
5462
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 }}
63+
type=raw,value=${{ inputs.version }}-python${{ inputs.python_version }}${{ inputs.arcgis_wheel_url != '' && '-prerelease' || '' }}
64+
type=raw,value=${{ inputs.version }},enable=${{ inputs.is_default_supported_python && inputs.arcgis_wheel_url == '' && github.ref_name == github.event.repository.default_branch }}
65+
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 }}
66+
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 }}
5967
6068
- id: docker_build
6169
name: Build image and push to GitHub Container Registry
@@ -67,6 +75,8 @@ jobs:
6775
build-args: |
6876
python_version=${{ inputs.python_version }}
6977
arcgis_version=${{ inputs.version }}
78+
arcgis_wheel_url=${{ inputs.arcgis_wheel_url }}
79+
arcgis_mapping_wheel_url=${{ inputs.arcgis_mapping_wheel_url }}
7080
tags: ${{ steps.meta.outputs.tags }}
7181
provenance: false
7282
platforms: linux/amd64

docker/NotebookImage.Dockerfile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ ARG python_version="3.11"
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 gdal_version="3.11.4"
7+
# If arcgis_wheel_url is provided, the Dockerfile will attempt to install the ArcGIS API for Python from that URL
8+
ARG arcgis_wheel_url=""
9+
ARG arcgis_mapping_wheel_url=""
10+
711
ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
812
ARG githubfolder="arcgis-python-api"
913
ARG env_name=arcgis
@@ -25,17 +29,28 @@ RUN conda install -n ${env_name} -c conda-forge gdal=${gdal_version} -y --quiet
2529
&& conda clean --all -f -y \
2630
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2731

32+
RUN if [ -z "${arcgis_wheel_url}" ]; then \
33+
echo "arcgis==${arcgis_version}.*" > /tmp/arcgis_source.txt; \
34+
else \
35+
echo "${arcgis_wheel_url}" > /tmp/arcgis_source.txt; \
36+
fi;
37+
2838
# Install ArcGIS API for Python from pypi
2939
RUN . activate ${env_name} \
30-
# adding .* ensures the latest patch version is installed
31-
&& python -m pip install "arcgis==${arcgis_version}.*" \
40+
&& python -m pip install "$(cat /tmp/arcgis_source.txt)" \
3241
&& conda clean --all -f -y \
3342
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
3443

44+
RUN if [ -n "${arcgis_mapping_wheel_url}" ]; then \
45+
echo "${arcgis_mapping_wheel_url}" > /tmp/arcgis_mapping_source.txt; \
46+
else \
47+
echo "arcgis-mapping" > /tmp/arcgis_mapping_source.txt; \
48+
fi;
49+
3550
# Install arcgis-mapping if arcgis_version >= 2.4.0
3651
RUN (dpkg --compare-versions $arcgis_version ge 2.4.0 \
3752
&& . activate ${env_name} \
38-
&& python -m pip install arcgis-mapping \
53+
&& python -m pip install "$(cat /tmp/arcgis_mapping_source.txt)" \
3954
&& conda clean --all -f -y \
4055
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
4156
|| echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"

0 commit comments

Comments
 (0)