Skip to content

Commit af4c27d

Browse files
authored
Merge pull request #188 from GeoscienceAustralia/reformatting
Reformatting
2 parents 65f2825 + 7a26994 commit af4c27d

8 files changed

Lines changed: 183 additions & 148 deletions

File tree

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ standards‑compliant distribution and downstream use.
3434
1. Build the container
3535

3636
```bash
37-
docker build -t sar-pipeline -f Docker/isce3_rtc/Dockerfile .
37+
docker build -t sar-pipeline-isce3-rtc -f Docker/isce3_rtc/Dockerfile .
3838
```
3939

4040
2. Test the image interactively (type `exit` to exit)
4141

4242
```bash
43-
docker run -it --entrypoint /bin/bash sar-pipeline
43+
docker run -it --entrypoint /bin/bash sar-pipeline-isce3-rtc
4444
```
4545

4646
1. Set the following minimum environment credentials in a `.env` file. At minimum we require earthdata *OR* Coperniucs Space Data Ecosystem (CDSE) credentials to download from the Alaska Satelite Facility (ASF) or CDSE respectively. These can be created here for the [ASF](http://urs.earthdata.nasa.gov/) and [CDSE](https://dataspace.copernicus.eu/).
@@ -57,13 +57,13 @@ mkdir data
5757
```
5858

5959
```bash
60-
docker run --env-file .env -v ${PWD}/data:/home/rtc_user/working sar-pipeline \
60+
docker run --env-file .env -v ${PWD}/data:/home/rtc_user/working sar-pipeline-isce3-rtc \
6161
--scene S1A_IW_SLC__1SSH_20220101T124744_20220101T124814_041267_04E7A2_1DAD \
62-
--burst_id_list t070_149815_iw3 \
63-
--skip_upload_to_s3 \
64-
--make_existing_products \
65-
--scene_data_source ASF \
66-
--orbit_data_source ASF
62+
--burst-id-list t070_149815_iw3 \
63+
--skip-upload-to-s3 \
64+
--make-existing-products \
65+
--scene-data-source ASF \
66+
--orbit-data-source ASF
6767
```
6868

6969
Note if there are permission issues writing to the local `./data` folder, the following can be run:
@@ -95,6 +95,10 @@ sudo chmod -R 777 ./data
9595

9696
6. See the [full docs](docs/pipelines/isce3_rtc.md) to see how static layers can created and used.
9797

98+
## Release
99+
100+
GA release information is provided in the [release guide](./docs/development/release_guide.md)
101+
98102
## License
99103

100104
Copyright © 2025 Geoscience Australia.

docs/development/release_guide.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
1-
# AWS Opera/iSCE3 Pipeline
1+
# ISCE3-RTC Pipeline (s1-nrb-pipeline)
22

33
### Steps
44

55
1. Branch off from main to develop new features for a planned release.
66
2. Run the end-to-end tests locally on the branch with proposed changes. Note the local run requires sufficient compute and credentials to be set.
77

88
```bash
9-
# test command line tools
10-
pixi run test-aws-cli
11-
12-
# test docker image build and test run
13-
pixi run test-full-aws-docker-run
9+
# tests that don't require credentials
10+
pixi run test-pipeline-no-creds
11+
# tests to download data from sources. Requires credentials in .env
12+
pixi run test-scene-data-source-queries
13+
# full test of isce3 rtc pipeline. Note may take a few hours as the docker image is
14+
# built and run for a few products. Requires credentials in .env
15+
pixi run test-isce3-rtc
1416
```
17+
1518
3. If successful raise a PR for review and merge branch into main
1619
4. Create new release on GitHub and increment the tag:
1720
- Images prior to an initial release should be of for, `v0.X.X`.
1821
- Test images should be of form `vX.X.X_betaX`
1922
- For small changes the tag should be incremented by `0.0.1`. For example, `v1.0.1` -> `v1.0.2`.
2023
- Major changes should increment the first or second number, depending on the impact of the change.
21-
5. When the release made, the `push-image-to-ecr.yaml` github action will be run. A new image will be built, tagged and pushed to ECR according to the release tag. E.g. `sar_pipeline:v1.0,1`
24+
5. The release should trigger the workflow [push-image-to-ecr](../../.github/workflows/push-image-to-ecr.yaml) that will build and push the updated image to the AWS ECR repository.
25+
6. If the automated build and push fails, manually tag and upload the docker image to the ECR repository:
26+
27+
```bash
28+
# set credentials with write to the ECR repo, or use access tool
29+
# like granted / assume to set credentials
30+
export AWS_ACCESS_KEY_ID=
31+
export AWS_SECRET_ACCESS_KEY=
32+
export AWS_SESSION_TOKEN=
33+
34+
docker build -t sar-pipeline-isce3-rtc -f Docker/isce3_rtc/Dockerfile .
35+
36+
# NOTE - following instructions are for dev account - 451924316694
37+
38+
# tag the local image with the appropriate ECR account tag
39+
docker tag sar-pipeline-isce3-rtc:vX-X-X 451924316694.dkr.ecr.ap-southeast-2.amazonaws.com/dea-dev-s1-nrb-pipeline:vX-X-X
40+
41+
aws ecr get-login-password \
42+
--region ap-southeast-2 | docker login \
43+
--username AWS \
44+
--password-stdin 451924316694.dkr.ecr.ap-southeast-2.amazonaws.com
45+
46+
docker push 451924316694.dkr.ecr.ap-southeast-2.amazonaws.com/dea-dev-s1-nrb-pipeline:vX.X.X
47+
```

docs/pipelines/isce3_rtc.md

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

environment.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
- tomli >=2.2.1
2121
- s1reader >=0.2.4
2222
- aioboto3 ==14.1.0
23+
- s3fs >=2026.3.0,<2027
2324
- python >=3.8
2425
- pip
2526
- pip:
@@ -37,5 +38,9 @@ dependencies:
3738
- dem-handler @ git+https://github.com/GeoscienceAustralia/dem-handler.git@v0.2.6
3839
- odc-stac>=0.5.0, <0.6
3940
- pystac-client>=0.9.0, <0.10
40-
- tqdm>=4.67.1, <5
4141
- sentineleof @ git+https://github.com/scottstanie/sentineleof@v0.11.2
42+
- tqdm>=4.67.1, <5
43+
- black[jupyter]==26.3.1
44+
- ipykernel>=7.2.0, <8
45+
- stac-geoparquet>=0.7.0, <0.8
46+
- docker>=7.1.0, <8

pixi.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"pystac-client>=0.9.0,<0.10",
3333
"sentineleof @ git+https://github.com/scottstanie/sentineleof@v0.11.2",
3434
"tqdm>=4.67.1,<5",
35-
"black[jupyter]>=26.3.1,<27",
35+
"black[jupyter]==26.3.1",
3636
"ipykernel>=7.2.0,<8",
3737
"stac-geoparquet>=0.7.0,<0.8",
3838
"docker>=7.1.0,<8"

scripts/run_isce3_rtc_pipeline.sh

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ while [[ "$#" -gt 0 ]]; do
4444
case $1 in
4545
--scene) scene="$2"; shift 2 ;;
4646
--resolution) resolution="$2"; shift 2 ;;
47-
--output_crs) output_crs="$2"; shift 2 ;;
48-
--dem_type) dem_type="$2"; shift 2 ;;
47+
--output-crs) output_crs="$2"; shift 2 ;;
48+
--dem-type) dem_type="$2"; shift 2 ;;
4949
--product) product="$2"; shift 2 ;;
50-
--backscatter_convention) backscatter_convention="$2"; shift 2 ;;
51-
--static_layer_validity_start_date) static_layer_validity_start_date="$2"; shift 2 ;;
52-
--s3_bucket) s3_bucket="$2"; shift 2 ;;
53-
--s3_project_folder) s3_project_folder="$2"; shift 2 ;;
54-
--collection_number) collection_number="$2"; shift 2 ;;
55-
--make_existing_products) make_existing_products=true; shift ;;
56-
--skip_upload_to_s3) skip_upload_to_s3=true; shift ;;
57-
--link_static_layers) link_static_layers=true; shift ;;
58-
--linked_static_layers_s3_bucket) linked_static_layers_s3_bucket="$2"; shift 2 ;;
59-
--linked_static_layers_collection_number) linked_static_layers_collection_number="$2"; shift 2 ;;
60-
--linked_static_layers_s3_project_folder) linked_static_layers_s3_project_folder="$2"; shift 2 ;;
61-
--processed_scene_tracking_file_s3_folder) processed_scene_tracking_file_s3_folder="$2"; shift 2 ;;
62-
--scene_data_source)
50+
--backscatter-convention) backscatter_convention="$2"; shift 2 ;;
51+
--static-layer-validity-start-date) static_layer_validity_start_date="$2"; shift 2 ;;
52+
--s3-bucket) s3_bucket="$2"; shift 2 ;;
53+
--s3-project-folder) s3_project_folder="$2"; shift 2 ;;
54+
--collection-number) collection_number="$2"; shift 2 ;;
55+
--make-existing-products) make_existing_products=true; shift ;;
56+
--skip-upload-to-s3) skip_upload_to_s3=true; shift ;;
57+
--link-static-layers) link_static_layers=true; shift ;;
58+
--linked-static-layers-s3-bucket) linked_static_layers_s3_bucket="$2"; shift 2 ;;
59+
--linked-static-layers-collection-number) linked_static_layers_collection_number="$2"; shift 2 ;;
60+
--linked-static-layers-s3-project-folder) linked_static_layers_s3_project_folder="$2"; shift 2 ;;
61+
--processed-scene-tracking-file-s3-folder) processed_scene_tracking_file_s3_folder="$2"; shift 2 ;;
62+
--scene-data-source)
6363
scene_data_source=() # clear the default
6464
shift
6565
if [[ $# -eq 1 && -f "$1" ]]; then
@@ -72,7 +72,7 @@ while [[ "$#" -gt 0 ]]; do
7272
done
7373
fi
7474
;;
75-
--orbit_data_source)
75+
--orbit-data-source)
7676
orbit_data_source=() # clear the default
7777
shift
7878
if [[ $# -eq 1 && -f "$1" ]]; then
@@ -85,9 +85,9 @@ while [[ "$#" -gt 0 ]]; do
8585
done
8686
fi
8787
;;
88-
--skip_validate_stac) skip_validate_stac=true; shift ;;
89-
--skip_rtc) skip_rtc=true; shift ;;
90-
--burst_id_list)
88+
--skip-validate-stac) skip_validate_stac=true; shift ;;
89+
--skip-rtc) skip_rtc=true; shift ;;
90+
--burst-id-list)
9191
shift
9292
if [[ $# -eq 1 && -f "$1" ]]; then
9393
burst_id_list=($(cat "$1"))
@@ -125,7 +125,7 @@ if [[ -z "$output_crs" || "${output_crs,,}" == "utm" ]]; then
125125
elif [[ "$output_crs" =~ ^[0-9]+$ ]]; then
126126
epsg_code_msg="EPSG:$output_crs"
127127
else
128-
echo "Error: --output_crs must be empty, 'UTM', 'utm', or an integer corresponding to an EPSG code (e.g. 3031)."
128+
echo "Error: --output-crs must be empty, 'UTM', 'utm', or an integer corresponding to an EPSG code (e.g. 3031)."
129129
exit 1
130130
fi
131131

@@ -139,29 +139,29 @@ fi
139139
echo ""
140140
echo The input variables are:
141141
echo scene : "$scene"
142-
echo burst_id_list : ${burst_id_list[*]}
142+
echo burst-id-list : ${burst_id_list[*]}
143143
echo resolution : "$resolution"
144-
echo output_crs : "$epsg_code_msg"
145-
echo dem_type : "$dem_type"
144+
echo output-crs : "$epsg_code_msg"
145+
echo dem-type : "$dem_type"
146146
echo product : "$product"
147-
echo backscatter_convention : "$backscatter_convention"
148-
echo static_layer_validity_start_date : "$static_layer_validity_start_date"
149-
echo s3_bucket : "$s3_bucket"
150-
echo s3_project_folder : "$s3_project_folder"
151-
echo collection_number : "$collection_number"
152-
echo make_existing_products : "$make_existing_products"
153-
echo skip_upload_to_s3 : "$skip_upload_to_s3"
154-
echo scene_data_source : ${scene_data_source[*]}
155-
echo orbit_data_source : ${orbit_data_source[*]}
156-
echo skip_validate_stac : "$skip_validate_stac"
157-
echo processed_scene_tracking_file_s3_folder : "$processed_scene_tracking_file_s3_folder"
158-
echo skip_rtc : "$skip_rtc"
147+
echo backscatter-convention : "$backscatter_convention"
148+
echo static-layer-validity-start-date : "$static_layer_validity_start_date"
149+
echo s3-bucket : "$s3_bucket"
150+
echo s3-project-folder : "$s3_project_folder"
151+
echo collection-number : "$collection_number"
152+
echo make-existing-products : "$make_existing_products"
153+
echo skip-upload-to-s3 : "$skip_upload_to_s3"
154+
echo scene-data-source : ${scene_data_source[*]}
155+
echo orbit-data-source : ${orbit_data_source[*]}
156+
echo skip-validate-stac : "$skip_validate_stac"
157+
echo processed-scene-tracking-file-s3-folder : "$processed_scene_tracking_file_s3_folder"
158+
echo skip-rtc : "$skip_rtc"
159159

160160
# warn the user about linking static layers
161161
if [[ "$link_static_layers" = true && "$product" = "RTC_S1" ]]; then
162-
echo linked_static_layers_s3_bucket : "$linked_static_layers_s3_bucket"
163-
echo linked_static_layers_collection_number : "$linked_static_layers_collection_number"
164-
echo linked_static_layers_s3_project_folder : "$linked_static_layers_s3_project_folder"
162+
echo linked-static-layers-s3-bucket : "$linked_static_layers_s3_bucket"
163+
echo linked-static-layers-collection-number : "$linked_static_layers_collection_number"
164+
echo linked-static-layers-s3-project-folder : "$linked_static_layers_s3_project_folder"
165165
echo ""
166166
echo 'WARNING: RTC_S1_STATIC layers are being linked to the RTC_S1 products in STAC metadata'
167167
echo 'For more information, see the workflow documentation'
@@ -176,9 +176,9 @@ scratch_folder="/home/rtc_user/working/scratch/$s3_project_folder/$collection_nu
176176

177177
echo ""
178178
echo The container will use these paths for processing:
179-
echo download_folder : "$out_folder"
180-
echo scratch_folder : "$scratch_folder"
181-
echo out_folder : "$out_folder"
179+
echo download-folder : "$out_folder"
180+
echo scratch-folder : "$scratch_folder"
181+
echo out-folder : "$out_folder"
182182
echo ""
183183

184184
# activate conda

tests/sar_pipeline/isce3_rtc/test_full_docker_workflow_run.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
# shared test values
6868
DOCKER_TAG = re.sub(r"[^a-zA-Z0-9_.-]", "-", sar_pipeline.__version__)
69-
# DOCKER_TAG = '0.4.1.dev36-g6eecb22a7.d20250925' # set existing image
69+
# DOCKER_TAG = '0.7.2.dev23-g70bf0da26' # set existing image
7070
RUN_DATETIME = str(datetime.now()).replace(" ", "_").replace(":", "-")
7171
# RUN_DATETIME = '2025-12-04_05-46-40.829598' # set existing datetime
7272
TEST_NAME = Path(__file__).stem
@@ -147,14 +147,14 @@
147147
def build_image():
148148
"""build and tag the docker image for the current codebase to be used in tests"""
149149
logging.info(
150-
f"Building docker image sar-pipeline:{DOCKER_TAG} for testing, this may take a few minutes..."
150+
f"Building docker image sar-pipeline-isce3-rtc:{DOCKER_TAG} for testing, this may take a few minutes..."
151151
)
152152
result = subprocess.run(
153153
[
154154
"docker",
155155
"build",
156156
"-t",
157-
f"sar-pipeline:{DOCKER_TAG}",
157+
f"sar-pipeline-isce3-rtc:{DOCKER_TAG}",
158158
"-f",
159159
"Docker/isce3_rtc/Dockerfile",
160160
".",
@@ -186,7 +186,7 @@ def _run_docker_for_scene(
186186
Parameters
187187
----------
188188
docker_image_tag : str
189-
the docker image tag for sar-pipeline. e.g.
189+
the docker image tag for sar-pipeline-isce3-rtc. e.g.
190190
0.4.1.dev256-g9b7a3f1ea.d20251204
191191
docker_env_list : list
192192
A list of environment variables to be passed
@@ -218,12 +218,12 @@ def _run_docker_for_scene(
218218

219219
# mount the local directory for results
220220
volume_mount_list = ["-v", f"{local_outputs_folder}:/home/rtc_user/working/results"]
221-
# Optional -> mount somewhere to store downloads
221+
# # Optional -> mount somewhere to store downloads
222222
# volume_mount_list += [
223223
# "-v",
224224
# f"/data/working/downloads:/home/rtc_user/working/downloads",
225225
# ]
226-
# Optional -> mount the scratch directory
226+
# # Optional -> mount the scratch directory
227227
# volume_mount_list += ["-v", f"/data/working/scratch:/home/rtc_user/working/scratch"]
228228

229229
cmd = [
@@ -232,20 +232,20 @@ def _run_docker_for_scene(
232232
*volume_mount_list,
233233
"--rm",
234234
*docker_env_list,
235-
f"sar-pipeline:{docker_image_tag}",
235+
f"sar-pipeline-isce3-rtc:{docker_image_tag}",
236236
"--scene",
237237
scene,
238-
"--burst_id_list",
238+
"--burst-id-list",
239239
burst_id,
240240
"--product",
241241
"RTC_S1_STATIC",
242-
"--backscatter_convention",
242+
"--backscatter-convention",
243243
"gamma0",
244-
"--collection_number",
244+
"--collection-number",
245245
"1",
246-
"--s3_bucket",
246+
"--s3-bucket",
247247
s3_bucket,
248-
"--s3_project_folder",
248+
"--s3-project-folder",
249249
s3_project_folder,
250250
]
251251
result = subprocess.run(
@@ -265,27 +265,27 @@ def _run_docker_for_scene(
265265
*volume_mount_list,
266266
"--rm",
267267
*docker_env_list,
268-
f"sar-pipeline:{docker_image_tag}",
268+
f"sar-pipeline-isce3-rtc:{docker_image_tag}",
269269
"--scene",
270270
scene,
271-
"--burst_id_list",
271+
"--burst-id-list",
272272
burst_id,
273273
"--product",
274274
"RTC_S1",
275-
"--backscatter_convention",
275+
"--backscatter-convention",
276276
"gamma0",
277-
"--collection_number",
277+
"--collection-number",
278278
"1",
279-
"--s3_bucket",
279+
"--s3-bucket",
280280
s3_bucket,
281-
"--s3_project_folder",
281+
"--s3-project-folder",
282282
s3_project_folder,
283-
"--link_static_layers",
284-
"--linked_static_layers_s3_bucket",
283+
"--link-static-layers",
284+
"--linked-static-layers-s3-bucket",
285285
s3_bucket,
286-
"--linked_static_layers_s3_project_folder",
286+
"--linked-static-layers-s3-project-folder",
287287
s3_project_folder,
288-
"--linked_static_layers_collection_number",
288+
"--linked-static-layers-collection-number",
289289
"1",
290290
]
291291

0 commit comments

Comments
 (0)