File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Copyright 2025 CS Group
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ set -euo pipefail
17+ set -x
18+
19+ # This is a workaround for https://gitlab.eopf.copernicus.eu/S1/s1-ard-core/-/issues/10
20+ chmod -R a+w /usr/local/lib/python3.11/site-packages/pyproj/proj_dir/share/proj
21+
22+ # Same as s1-ard-core/initialize_env.sh
23+ S1_ARD_PATH=$( python -c " import s1_ard_core;print(s1_ard_core.__path__[0])" )
24+ SARSEN_PATH=$( python -c " import sarsen;print(sarsen.__path__[0])" )
25+ SARPY_PATH=$( python -c " import sarpy;print(sarpy.__path__[0])" )
26+ cp ${S1_ARD_PATH} /patch/sarsen/* py ${SARSEN_PATH} /
27+ cp ${S1_ARD_PATH} /patch/sarpy/sentinel.py ${SARPY_PATH} /io/complex/sentinel.py
Original file line number Diff line number Diff line change 1919# --extra-index-url https://gitlab.eopf.copernicus.eu/api/v4/projects/14/packages/pypi/simple # eopf cpm
2020--extra-index-url https://__token__:${GITLAB_EOPF_TOKEN}@gitlab.eopf.copernicus.eu/api/v4/projects/114/packages/pypi/simple # s1-ard-core
2121
22+ # s1 needs "eopf>=2.5.8" but we have errors with the latest versions.
23+ # So we force this old version which is the same as in the uv.lock file at the root of the git repo.
24+ eopf==2.5.9
25+
26+ # Install s1 v0.2.1.
27+ # WARNING: in case of version change, you should also update post-install-dask-s1ard.sh
28+ # if s1-ard-core/initialize_env.sh has changed.
2229git+https://__token__:${GITLAB_EOPF_TOKEN}@gitlab.eopf.copernicus.eu/vincent.privat/s1-l12-rp@rspy
2330
2431# other python dependencies
32+ proj
2533graphviz
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ USER root
2222
2323COPY ./*.whl ./
2424COPY ./resources/requirements-dask-*.txt /opt/
25+ COPY ./resources/post-install-dask-*.sh /opt/
2526COPY ./resources/layer-cleanup.sh /usr/local/bin/
2627RUN chmod 755 /usr/local/bin/layer-cleanup.sh
2728
@@ -37,7 +38,7 @@ RUN wget -q -P /opt/ "https://raw.githubusercontent.com/dask/dask-gateway/refs/t
3738 pip install --no-cache-dir -r /opt/Dockerfile.requirements.txt && \
3839 layer-cleanup.sh
3940
40- # Install whatever
41+ # pip install the requirements.txt file for the requested image IMAGE2BUILD
4142RUN --mount=type=secret,id=GITLAB_EOPF_TOKEN \
4243 GITLAB_EOPF_TOKEN=$(cat /run/secrets/GITLAB_EOPF_TOKEN) \
4344 RS_SERVER_COMMON_WHEEL=$(find . -maxdepth 1 -type f -name 'rs_server_common-*-py3-none-any.whl' | head -n 1) \
@@ -64,6 +65,11 @@ RUN pip install opentelemetry-distro opentelemetry-exporter-otlp opentelemetry-i
6465RUN if [ "${IMAGE2BUILD}" != "dask-staging" ]; then \
6566 apt update && apt install -y python3-pydot graphviz && layer-cleanup.sh; \
6667 fi
68+
69+ # Run post-install script as root if it exists
70+ RUN [ -f /opt/post-install-${IMAGE2BUILD}.sh ] && /opt/post-install-${IMAGE2BUILD}.sh && layer-cleanup.sh; \
71+ rm -f /opt/post-install-dask-*.sh
72+
6773RUN apt autoremove -y gcc && layer-cleanup.sh
6874
6975# Add a default user
You can’t perform that action at this time.
0 commit comments