From 506937d3326751c355bde200dcdf9fd08a044fc3 Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Mon, 25 Mar 2024 12:22:21 -0800 Subject: [PATCH 1/4] add publish option --- .github/workflows/deploy-prod.yml | 1 + .github/workflows/deploy-test.yml | 1 + landsat/cloudformation.yml | 7 +++++++ landsat/src/main.py | 7 ++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 6a33d529..0ee84a5b 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -25,6 +25,7 @@ jobs: LANDSAT_TOPIC_ARN: arn:aws:sns:us-west-2:673253540267:public-c2-notify-v2 HYP3_API: https://hyp3-its-live.asf.alaska.edu LAMBDA_LOGGING_LEVEL: INFO + PUBLISH_BUCKET: its-live-data call-bump-version-workflow: diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index 8b955353..29066731 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -25,3 +25,4 @@ jobs: LANDSAT_TOPIC_ARN: arn:aws:sns:us-west-2:986442313181:its-live-notify-test HYP3_API: https://hyp3-its-live.asf.alaska.edu LAMBDA_LOGGING_LEVEL: DEBUG + PUBLISH_BUCKET: its-live-data-test diff --git a/landsat/cloudformation.yml b/landsat/cloudformation.yml index 59a576e3..995ff619 100644 --- a/landsat/cloudformation.yml +++ b/landsat/cloudformation.yml @@ -19,6 +19,12 @@ Parameters: Type: String NoEcho: true + PublishBucket: + Type: String + AllowedValues: + - its-live-data + - its-live-data-test + Resources: DeadLetterQueue: @@ -80,6 +86,7 @@ Resources: LOGGING_LEVEL: !Ref LambdaLoggingLevel EARTHDATA_USERNAME: !Ref EarthdataUsername EARTHDATA_PASSWORD: !Ref EarthdataPassword + PUBLISH_BUCKET: !Ref PublishBucket LambdaEventSourceMapping: Type: AWS::Lambda::EventSourceMapping diff --git a/landsat/src/main.py b/landsat/src/main.py index b4268f2d..7e1989e2 100644 --- a/landsat/src/main.py +++ b/landsat/src/main.py @@ -128,7 +128,12 @@ def deduplicate_hyp3_pairs(pairs: gpd.GeoDataFrame) -> gpd.GeoDataFrame: def submit_pairs_for_processing(pairs: gpd.GeoDataFrame) -> sdk.Batch: # noqa: D103 prepared_jobs = [] for reference, secondary in pairs[['reference', 'secondary']].itertuples(index=False): - prepared_jobs.append(HYP3.prepare_autorift_job(reference, secondary, name=reference)) + prepared_job = HYP3.prepare_autorift_job(reference, secondary, name=reference) + + if publish_bucket := os.environ.get('PUBLISH_BUCKET', ''): + prepared_job['job_parameters']['publish_bucket'] = publish_bucket + + prepared_jobs.append(prepared_job) log.debug(prepared_jobs) From cc408f22321ebd1ebba0418f3eeed0692e645a2b Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Mon, 25 Mar 2024 12:32:38 -0800 Subject: [PATCH 2/4] add stack parameter to the action --- .github/actions/deploy/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml index e9e31822..f0a1ea0a 100644 --- a/.github/actions/deploy/action.yml +++ b/.github/actions/deploy/action.yml @@ -20,6 +20,8 @@ inputs: required: true EARTHDATA_PASSWORD: required: true + PUBLISH_BUCKET: + required: true runs: using: composite @@ -55,4 +57,5 @@ runs: Hyp3Api=${{ inputs.HYP3_API }} \ LambdaLoggingLevel=${{ inputs.LAMBDA_LOGGING_LEVEL }} \ EarthdataUsername=${{ inputs.EARTHDATA_USERNAME }} \ - EarthdataPassword=${{ inputs.EARTHDATA_PASSWORD }} + EarthdataPassword=${{ inputs.EARTHDATA_PASSWORD }} \ + PublishBucket=${{ inputs.PUBLISH_BUCKET }} From 1a04c8a16728f8af9d0fe629f4f87f604799c0e6 Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Mon, 25 Mar 2024 12:35:31 -0800 Subject: [PATCH 3/4] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e155893..97fe7395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.3] + +### Changed +- HyP3 jobs will now be submitted with the `publish_bucket` job parameter set + ## [0.0.3] ### Changed From 5e980f20c8b5abf24bccac8651df27054f52acb4 Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Mon, 25 Mar 2024 12:37:51 -0800 Subject: [PATCH 4/4] Joe Typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97fe7395..fa91ee9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.0.3] +## [0.0.4] ### Changed - HyP3 jobs will now be submitted with the `publish_bucket` job parameter set