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 }} 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/CHANGELOG.md b/CHANGELOG.md index 0e155893..fa91ee9b 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.4] + +### Changed +- HyP3 jobs will now be submitted with the `publish_bucket` job parameter set + ## [0.0.3] ### Changed 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)