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

add publish option #35

Merged
merged 4 commits into from
Mar 25, 2024
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
5 changes: 4 additions & 1 deletion .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ inputs:
required: true
EARTHDATA_PASSWORD:
required: true
PUBLISH_BUCKET:
required: true

runs:
using: composite
Expand Down Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions landsat/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Parameters:
Type: String
NoEcho: true

PublishBucket:
Type: String
AllowedValues:
- its-live-data
- its-live-data-test

Resources:

DeadLetterQueue:
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion landsat/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''):
jhkennedy marked this conversation as resolved.
Show resolved Hide resolved
prepared_job['job_parameters']['publish_bucket'] = publish_bucket

prepared_jobs.append(prepared_job)

log.debug(prepared_jobs)

Expand Down
Loading