Skip to content

Commit 58f3657

Browse files
authored
Merge pull request #195 from RS-PYTHON/s1-ard-julien
Use S1-ARD processor
2 parents 5d643d3 + 784498e commit 58f3657

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

.github/common/resources/requirements-dask-s1ard.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
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.
2229
git+https://__token__:${GITLAB_EOPF_TOKEN}@gitlab.eopf.copernicus.eu/vincent.privat/s1-l12-rp@rspy
2330

2431
# other python dependencies
32+
proj
2533
graphviz

.github/dask-gateway/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ USER root
2222

2323
COPY ./*.whl ./
2424
COPY ./resources/requirements-dask-*.txt /opt/
25+
COPY ./resources/post-install-dask-*.sh /opt/
2526
COPY ./resources/layer-cleanup.sh /usr/local/bin/
2627
RUN 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
4142
RUN --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
6465
RUN 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+
6773
RUN apt autoremove -y gcc && layer-cleanup.sh
6874

6975
# Add a default user

0 commit comments

Comments
 (0)