Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/pipelines/isce3_rtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ To update this, you can run change the test [settings.py](../../tests/sar_pipeli
pixi run test-isce3-rtc-full-docker-workflow-run
```

Existing benchmark files with the same name are overwritten, but files whose names have changed are not removed. If the product version or set of product files has changed, delete the existing benchmark products from AWS first. Also clear the local `tests/sar_pipeline/isce3_rtc/data/TMP` folder before updating, as results from earlier runs can cause errors. Set `UPDATE_BENCHMARK_TEST_DATA` back to `False` afterwards, as the comparison tests compare the benchmark products to themselves while it is `True`.

This will then re-create the products and upload them to the `BENCHMARK_S3_PROJECT_FOLDER`.

> [!WARNING]
Expand Down
5 changes: 3 additions & 2 deletions tests/sar_pipeline/isce3_rtc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
TEST_S3_BUCKET = "deant-data-public-dev"

# Set this to True to update the benchmark products in the AWS S3 folder
# Existing benchmark products will need to be deleted manually, otherwise the process
# will exit early. See docs in test_full_docker_workflow_run.py for more information.
# Existing files are overwritten, but files whose names have changed are not removed, so
# delete existing benchmark products manually if the product version or set of files has
# changed. See docs in test_full_docker_workflow_run.py for more information.
UPDATE_BENCHMARK_TEST_DATA = False

# single pol test scene
Expand Down
19 changes: 16 additions & 3 deletions tests/sar_pipeline/isce3_rtc/test_full_docker_workflow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
in the BENCHMARK_S3_PROJECT_FOLDER. If planned product changes have been made, these benchmark
comparison products should be updated for future tests. These can be replaced by new products
by setting the UPDATE_BENCHMARK_TEST_DATA to True in the settings.py file and re-running the tests.
NOTE - existing products should be manually deleted from the BENCHMARK_S3_PROJECT_FOLDER prior
to recreating them.
NOTE - existing files with the same name are overwritten, but files whose names have changed are
not removed. If the product version or set of product files has changed, manually delete existing
products from the BENCHMARK_S3_PROJECT_FOLDER and clear the local data/TMP folder prior to
recreating them.
"""

import subprocess
Expand Down Expand Up @@ -106,7 +108,8 @@
if UPDATE_BENCHMARK_TEST_DATA:
logger.warning(
f"Updating the benchmark/persistent data used for the test comparisons. "
" Ensure existing products are deleted."
"Existing products will be overwritten. If the product version or set of product "
"files has changed, ensure existing products are deleted."
)
TEST_S3_PROJECT_FOLDER = BENCHMARK_S3_PROJECT_FOLDER

Expand Down Expand Up @@ -179,6 +182,7 @@ def _run_docker_for_scene(
s3_project_folder: str,
s3_bucket: str,
local_outputs_folder: str,
make_existing_products: bool = UPDATE_BENCHMARK_TEST_DATA,
):
"""Utility function to run the docker image for a given scene
and burst. First, a run will be made to create static layer
Expand Down Expand Up @@ -206,6 +210,9 @@ def _run_docker_for_scene(
The S3 bucket to upload to.
local_outputs_folder : str
Local folder for outputs to be saved.
make_existing_products: bool
if true, existing products in the s3 bucket will be overwritten. This is required
when we are updating the gold standard or benchmark products we compare to.
"""

logging.info(f"Static layers will be produced and linked to backscatter data.")
Expand Down Expand Up @@ -246,6 +253,9 @@ def _run_docker_for_scene(
"--s3-project-folder",
s3_project_folder,
]
if make_existing_products:
# replace the benchmark products
cmd += ["--make-existing-products"]
result = subprocess.run(
cmd,
stdout=sys.stdout,
Expand Down Expand Up @@ -289,6 +299,9 @@ def _run_docker_for_scene(
"1",
]

if make_existing_products:
# replace the benchmark products
cmd += ["--make-existing-products"]
result = subprocess.run(
cmd,
stdout=sys.stdout,
Expand Down
Loading