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

Improve flexibility for publishing options #2964

Merged
merged 15 commits into from
Dec 3, 2023
Merged

Conversation

rousik
Copy link
Collaborator

@rousik rousik commented Oct 20, 2023

This change slightly improves upon the flexibility of publishing outputs to remote destinations.

  1. PUDL_GCS_OUTPUT env variable is introduced to gcp_pudl_etl.sh runner script to possibly override the destination used to publish stuff.
  2. EtlSettings can load publish_destinations from PUDL_PUBLISH_DESTINATIONS env variable to immediately ship outputs after ETL finishes.

Option (2) should eventually replace the logic contained within (1), once we integrate data validation into the ETL or decouple it and do it later on.

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (f456126) 88.7% compared to head (a519e97) 88.6%.
Report is 5 commits behind head on dev.

Files Patch % Lines
src/pudl/ferc_to_sqlite/cli.py 33.3% 6 Missing ⚠️
src/pudl/helpers.py 16.6% 5 Missing ⚠️
src/pudl/cli/etl.py 25.0% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             dev   #2964     +/-   ##
=======================================
- Coverage   88.7%   88.6%   -0.2%     
=======================================
  Files         89      89             
  Lines      11023   11040     +17     
=======================================
+ Hits        9785    9788      +3     
- Misses      1238    1252     +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jdangerx jdangerx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean :) I just wonder if we want to keep the upload in the general cleanup function vs. trigger it on build success.

.github/workflows/build-deploy-pudl.yml Outdated Show resolved Hide resolved
docker/gcp_pudl_etl.sh Outdated Show resolved Hide resolved
@rousik
Copy link
Collaborator Author

rousik commented Nov 27, 2023

Please take another look, I have retained the original behavior of copying to GCS after the ETL finishes, regardless of the outcome.

@rousik
Copy link
Collaborator Author

rousik commented Nov 27, 2023

I have merged dev branch and also added empty success file to output directory when ETL finishes successfully. That way we should be able to tell which builds are successful by looking for that file.

@rousik rousik requested a review from jdangerx December 1, 2023 18:40
docker/gcp_pudl_etl.sh Show resolved Hide resolved
docker/gcp_pudl_etl.sh Show resolved Hide resolved
@@ -109,6 +116,9 @@ if [[ $ETL_SUCCESS == 0 ]]; then
ETL_SUCCESS=${PIPESTATUS[0]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to remove the success file here prior to distribution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we replace success file with, say, json file that has some runtime statistics from how the data was generated, would we want to include it in distributed files, or also not?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a little build metadata file would be worth including. We're distributing the pudl-etl.log file. It would kind of be a structured accessory to that output.

docker/gcp_pudl_etl.sh Outdated Show resolved Hide resolved
Copy link
Member

@zaneselvans zaneselvans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged dev in and added a comment to explain the bash conditional environment variable assignment magic.

@@ -83,6 +85,11 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Determine commit information
run: |-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about the block chomping operator. Does GHA complain when there's an extra newline at the end here?

@@ -109,6 +120,9 @@ if [[ $ETL_SUCCESS == 0 ]]; then
ETL_SUCCESS=${PIPESTATUS[0]}

# Dump outputs to s3 bucket if branch is dev or build was triggered by a tag
# TODO: this behavior should be controlled by on/off switch here and this logic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree - having the action just pass in a switch would be nice. I think at some point we should replace this whole nightly build harness with a Python script that's more robust and that would be a nice time to fix this too.

@zaneselvans zaneselvans merged commit 85c2ea4 into dev Dec 3, 2023
8 of 10 checks passed
@zaneselvans zaneselvans deleted the custom-gcs-output branch December 3, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants