Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAS-2214 Add NSIDC IceSAT2 Regression Tests #92

Merged
merged 44 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9c6e03c
DAS-2214: Skeleton changes to begin nsidc-icesat2 tests
flamingbear Aug 13, 2024
c3e88fb
DAS-2214: Updates Dockerfile to optionally include shared_utils dir
flamingbear Aug 15, 2024
46868e8
DAS-2214: Adds configuration for first sets of tests
flamingbear Aug 15, 2024
545892a
DAS-2214: Adds xarray to requirements.
flamingbear Aug 15, 2024
6734645
DAS-2214: Adds tests for subset_bounding_box.
flamingbear Aug 16, 2024
78517dd
DAS-2214: delete unused .flake8 file.
flamingbear Aug 19, 2024
12edb03
DAS-2214: Adds regression files for NSIDC BBox Subset tests.
flamingbear Aug 19, 2024
496ce93
Merge remote-tracking branch 'origin/main' into mhs/DAS-2214/nsidc-re…
flamingbear Aug 19, 2024
df7dbd9
DAS-2214: Adds First Temporal Subsetting Test
flamingbear Aug 19, 2024
ab651f3
DAS-2214: Adds reference file for ATL04 temporal range tests
flamingbear Aug 19, 2024
f956735
DAS-2214: Adds Iceland Shapefile test.
flamingbear Aug 26, 2024
23d6557
DAS-2214: Adds ATL06 shapefile reference file.
flamingbear Aug 26, 2024
5f65e1e
DAS-2214: remove noqa pragma
flamingbear Aug 26, 2024
d3644e6
DAS-2214: Adds ATL10 and ATL12 BBox test
flamingbear Aug 26, 2024
3bd883b
DAS-2214: Add reference files Subset bounding box ATL10 and ATL12
flamingbear Aug 28, 2024
0d5c348
DAS-2214: Adds ATL13 BBox test
flamingbear Aug 28, 2024
80ae48b
DAS-2214: Adds ATL13 BBox reference file.
flamingbear Aug 28, 2024
0150f51
DAS-2214: Adds ATL09 ATL10 shapefile tests
flamingbear Aug 28, 2024
123bc10
DAS-2214: Adds ATL09 ATL10 shapefile reference files
flamingbear Aug 28, 2024
0c0df95
DAS-2214: Adds ATL09 ATL10 shapefiles
flamingbear Aug 28, 2024
4bb88af
DAS-2214: reformat geojsons
flamingbear Aug 28, 2024
c549396
DAS-2214: Adds ATL08 shapefile test
flamingbear Aug 28, 2024
92a42e6
DAS-2214: Adds ATL08 shapefile reference file
flamingbear Aug 28, 2024
f2d1bb2
DAS-2214: Updates ATL06 test to use zip shapefile
flamingbear Aug 28, 2024
75e9254
DAS-2214: Add note about Trajectory Subsetter bug blocker
flamingbear Aug 28, 2024
2686508
DAS-2214: Use Temporary Directory for cleanup
flamingbear Aug 29, 2024
a69794b
DAS-2214: Update Changelog
flamingbear Aug 29, 2024
6f81251
DAS-2214: Update Dockerfile to include git
flamingbear Aug 29, 2024
2f95815
DAS-2214: Clean up comments for NSIDC regression test notebook.
flamingbear Sep 3, 2024
d515823
Merge branch 'main' into mhs/DAS-2214/nsidc-regressions
flamingbear Sep 4, 2024
fdf6c6e
DAS-2214: PR feedback: typo
flamingbear Sep 5, 2024
9ef0540
DAS-2214: PR feedback: wording
flamingbear Sep 5, 2024
193644d
DAS-2214: PR feedback: typo
flamingbear Sep 5, 2024
89cae89
DAS-2214: swap os.replace -> shutil.move
flamingbear Sep 5, 2024
55f0c04
Update test/nsidc-icesat2/NSIDC-ICESAT2_Regression.ipynb
flamingbear Sep 9, 2024
aaddf43
DAS-2214: Fix suggestion
flamingbear Sep 9, 2024
b1d9295
DAS-2214: replace pinned Xarray with 2024.9.0
flamingbear Sep 11, 2024
6b23cd2
DAS-2214: Reverts Reference File commits
flamingbear Sep 24, 2024
1bafa61
DAS-2214: Adds back reference files under gitlfs.
flamingbear Sep 24, 2024
3a80c91
DAS-2214: Attempts to enable LFS for NSIDC's regression tests
flamingbear Sep 24, 2024
ffa8af8
DAS-2214: Update github actions to include shared_utils for nsidc-ice…
flamingbear Sep 25, 2024
095ab92
DAS-2214: Update changelog and readme
flamingbear Sep 25, 2024
1111423
DAS-2214: Final tweaks to workflows and README
flamingbear Sep 25, 2024
3c6cea5
DAS-2214: Fix dangling thought
flamingbear Sep 25, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/build-all-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
-
image: "n2z"
notebook: "N2Z_Regression.ipynb"
-
image: "nsidc-icesat2"
notebook: "NSIDC-ICESAT2_Regression.ipynb"
-
image: "regridder"
notebook: "Regridder_Regression.ipynb"
Expand Down
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ versioning. Rather than a static releases, this repository contains of a number
of regression tests that are each semi-independent. This CHANGELOG file should be used
to document pull requests to this repository.

## 2024-08-30
## 2024-09-04 ([#92](https://github.com/nasa/harmony-regression-tests/pull/92))

- Adds NSIDC ICESat2 Regression test suite.

- Adds `shared_utils` functionality. This directory contains routines that are commonly used in regression tests and limits code duplication. To include the `shared_utils` directory in your docker container, update the Makefile to add a shared_utils build arg. E.g. `--build-arg shared_utils=true` (see the nsidc-icesat2-image target)

flamingbear marked this conversation as resolved.
Show resolved Hide resolved
## 2024-08-30 ([#94](https://github.com/nasa/harmony-regression-tests/pull/94))

Add regression test for net2cog

## 2024-08-05 ([#86](https://github.com/nasa/harmony-regression-tests/pull/86))

Adds this file to capture changes to the repository.
- Adds this file to capture changes to the repository.

Adds pre-commit.ci behavior to the repository. This setup ensures consistent code style, catches common errors, and maintains file hygiene across the project.
- Adds pre-commit.ci behavior to the repository. This setup ensures consistent code style, catches common errors, and maintains file hygiene across the project.

Updates the base image for all regression tests to `mambaorg/micromamba:1.5.8-jammy`
- Updates the base image for all regression tests to `mambaorg/micromamba:1.5.8-jammy`
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ environment before installing from the environment.yml.
is simplest to use the same string for the subdirectory name and the suite
name.
1. Update the `test/Makefile` to be able to build a Docker image for the new
test suite:
test suite optionally including the shared utility directory:

```
<new-suite-name>-image
docker build -t ghcr.io/nasa/regression-tests-<new-suite-name>:latest -f ./Dockerfile --build-arg notebook=<new-test-notebook-name> --build-arg sub_dir=<new-suite-subdirectory> .
docker build -t ghcr.io/nasa/regression-tests-<new-suite-name>:latest -f ./Dockerfile --build-arg notebook=<new-test-notebook-name> --build-arg sub_dir=<new-suite-subdirectory> [--build-arg shared_utils=true] .
flamingbear marked this conversation as resolved.
Show resolved Hide resolved
```

1. If you would like to use shared utilities to help ease the coding you can include a build arg in
flamingbear marked this conversation as resolved.
Show resolved Hide resolved

1. Update the `make images` rule to include building the new image.

```
Expand Down
2 changes: 1 addition & 1 deletion script/test-in-bamboo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ echo "harmony host url: ${harmony_host_url}"
## e.g. if REGRESSION_TESTS_N2Z_IMAGE environment was set, the value would be used instead of the default.

image_names=()
all_tests=(harmony harmony-regression hoss hga n2z swath-projector trajectory-subsetter variable-subsetter regridder hybig geoloco net2cog)
all_tests=(harmony harmony-regression hoss hga n2z nsidc-icesat2 swath-projector trajectory-subsetter variable-subsetter regridder hybig geoloco net2cog)
owenlittlejohns marked this conversation as resolved.
Show resolved Hide resolved
for image in "${all_tests[@]}"; do
image_names+=($(image_name "$image" true))
done
Expand Down
4 changes: 0 additions & 4 deletions test/.flake8

This file was deleted.

17 changes: 17 additions & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ USER root

ARG sub_dir
ARG notebook
ARG shared_utils=false
ENV env_sub_dir=$sub_dir
ENV env_notebook=$notebook


ENV AWS_SECRET_ACCESS_KEY=no-access
ENV AWS_ACCESS_KEY_ID=no-access
ENV AWS_SESSION_TOKEN=no-access
Expand All @@ -20,9 +22,24 @@ COPY build-netrc.sh notebook-entrypoint.sh ./
RUN mkdir ./${sub_dir}
COPY ${sub_dir}/environment.yaml ./${sub_dir}

# Shared util temporary solution: because datatree is not released we are using
# a pinned version from the git repo and need to have git installed to install
# xarray
RUN if [ "$shared_utils" = "true" ]; then \
apt-get update && apt-get install -y git; \
fi

RUN micromamba create -y -f ${sub_dir}/environment.yaml \
&& micromamba clean --all --force-pkgs-dirs --yes

# Include shared utility functions if requested. This is a bit awkward, it
# always copies the shared utils directory to the image, but then deletes it if
# you didn't want it.
COPY shared_utils ./shared_utils
RUN if [ "$shared_utils" = "false" ]; then \
rm -rf ./shared_utils; \
fi
flamingbear marked this conversation as resolved.
Show resolved Hide resolved

COPY ${sub_dir} ./${sub_dir}

ENTRYPOINT /bin/bash ./notebook-entrypoint.sh
54 changes: 41 additions & 13 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,65 @@
harmony-image: Dockerfile harmony/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-harmony:latest -f ./Dockerfile --build-arg notebook=Harmony.ipynb --build-arg sub_dir=harmony .
docker build -t ghcr.io/nasa/regression-tests-harmony:latest -f ./Dockerfile \
--build-arg notebook=Harmony.ipynb --build-arg sub_dir=harmony .

harmony-regression-image: Dockerfile harmony-regression/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-harmony-regression:latest -f ./Dockerfile --build-arg notebook=HarmonyRegression.ipynb --build-arg sub_dir=harmony-regression .
docker build -t ghcr.io/nasa/regression-tests-harmony-regression:latest -f ./Dockerfile \
--build-arg notebook=HarmonyRegression.ipynb --build-arg sub_dir=harmony-regression .

hga-image: Dockerfile hga/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-hga:latest -f ./Dockerfile --build-arg notebook=HGA_Regression.ipynb --build-arg sub_dir=hga .
docker build -t ghcr.io/nasa/regression-tests-hga:latest -f ./Dockerfile \
--build-arg notebook=HGA_Regression.ipynb --build-arg sub_dir=hga .

hoss-image: Dockerfile hoss/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-hoss:latest -f ./Dockerfile --build-arg notebook=HOSS_Regression.ipynb --build-arg sub_dir=hoss .
docker build -t ghcr.io/nasa/regression-tests-hoss:latest -f ./Dockerfile \
--build-arg notebook=HOSS_Regression.ipynb --build-arg sub_dir=hoss .

hybig-image: Dockerfile hybig/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-hybig:latest -f ./Dockerfile --build-arg notebook=HyBIG_Regression.ipynb --build-arg sub_dir=hybig .
docker build -t ghcr.io/nasa/regression-tests-hybig:latest -f ./Dockerfile \
--build-arg notebook=HyBIG_Regression.ipynb --build-arg sub_dir=hybig .

n2z-image: Dockerfile n2z/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-n2z:latest -f ./Dockerfile --build-arg notebook=N2Z_Regression.ipynb --build-arg sub_dir=n2z .
docker build -t ghcr.io/nasa/regression-tests-n2z:latest -f ./Dockerfile \
--build-arg notebook=N2Z_Regression.ipynb --build-arg sub_dir=n2z .

nsidc-icesat2-image: Dockerfile nsidc-icesat2/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-nsidc-icesat2:latest -f ./Dockerfile \
--build-arg notebook=NSIDC-ICESAT2_Regression.ipynb --build-arg sub_dir=nsidc-icesat2 --build-arg shared_utils=true .

regridder-image: Dockerfile regridder/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-regridder:latest -f ./Dockerfile --build-arg notebook=Regridder_Regression.ipynb --build-arg sub_dir=regridder .
docker build -t ghcr.io/nasa/regression-tests-regridder:latest -f ./Dockerfile \
--build-arg notebook=Regridder_Regression.ipynb --build-arg sub_dir=regridder .

swath-projector-image: Dockerfile swath-projector/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-swath-projector:latest -f ./Dockerfile --build-arg notebook=SwathProjector_Regression.ipynb --build-arg sub_dir=swath-projector .
docker build -t ghcr.io/nasa/regression-tests-swath-projector:latest -f ./Dockerfile \
--build-arg notebook=SwathProjector_Regression.ipynb --build-arg sub_dir=swath-projector .

trajectory-subsetter-image: Dockerfile trajectory-subsetter/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-trajectory-subsetter:latest -f ./Dockerfile --build-arg notebook=TrajectorySubsetter_Regression.ipynb --build-arg sub_dir=trajectory-subsetter .
docker build -t ghcr.io/nasa/regression-tests-trajectory-subsetter:latest -f ./Dockerfile \
--build-arg notebook=TrajectorySubsetter_Regression.ipynb --build-arg sub_dir=trajectory-subsetter .

variable-subsetter-image: Dockerfile variable-subsetter/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-variable-subsetter:latest -f ./Dockerfile --build-arg notebook=VariableSubsetter_Regression.ipynb --build-arg sub_dir=variable-subsetter .
docker build -t ghcr.io/nasa/regression-tests-variable-subsetter:latest -f ./Dockerfile \
--build-arg notebook=VariableSubsetter_Regression.ipynb --build-arg sub_dir=variable-subsetter .

geoloco-image: Dockerfile geoloco/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-geoloco:latest -f ./Dockerfile --build-arg notebook=Geoloco_Regression.ipynb --build-arg sub_dir=geoloco .
docker build -t ghcr.io/nasa/regression-tests-geoloco:latest -f ./Dockerfile \
--build-arg notebook=Geoloco_Regression.ipynb --build-arg sub_dir=geoloco .

net2cog-image: Dockerfile net2cog/environment.yaml
docker build -t ghcr.io/nasa/regression-tests-net2cog:latest -f ./Dockerfile --build-arg notebook=net2cog_Regression.ipynb --build-arg sub_dir=net2cog .
docker build -t ghcr.io/nasa/regression-tests-net2cog:latest -f ./Dockerfile \
--build-arg notebook=net2cog_Regression.ipynb --build-arg sub_dir=net2cog .

images: harmony-image harmony-regression-image hga-image hoss-image hybig-image n2z-image regridder-image swath-projector-image trajectory-subsetter-image variable-subsetter-image geoloco-image net2cog-image
images: harmony-image \
harmony-regression-image \
hga-image \
hoss-image \
hybig-image \
n2z-image \
nsidc-icesat2-image \
regridder-image \
swath-projector-image \
trajectory-subsetter-image \
variable-subsetter-image \
geoloco-image \
net2cog-image
Loading