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

Don't deploy outputs when using workflow_dispatch trigger on main #3643

Closed
4 tasks done
zaneselvans opened this issue May 16, 2024 · 3 comments · Fixed by #3962
Closed
4 tasks done

Don't deploy outputs when using workflow_dispatch trigger on main #3643

zaneselvans opened this issue May 16, 2024 · 3 comments · Fixed by #3962
Assignees
Labels
bug Things that are just plain broken. cloud Stuff that has to do with adapting PUDL to work in cloud computing context. nightly-builds Anything having to do with nightly builds or continuous deployment.

Comments

@zaneselvans
Copy link
Member

zaneselvans commented May 16, 2024

Overview

Due to some faulty logic in our altogether too complex conditionals for deciding when/where to deploy build outputs, running a workflow_dispatch deployment on main results in the outputs being deployed to the following paths:

s3://pudl.catalyst.coop/main/
gs://pudl.catalyst.coop/main/

Tasks

Preview Give feedback
@zaneselvans zaneselvans added bug Things that are just plain broken. cloud Stuff that has to do with adapting PUDL to work in cloud computing context. nightly-builds Anything having to do with nightly builds or continuous deployment. labels May 16, 2024
@zaneselvans zaneselvans moved this from New to Backlog in Catalyst Megaproject May 16, 2024
@jdangerx
Copy link
Member

Poked around at the gcp_pudl_etl.sh. I think there's lots of room for improvement with minimal effort.

I think we want this general structure for the file:

# set BUILD_TYPE to be "nightly", "stable", or "ad-hoc" based on GITHUB_ACTION_TRIGGER, GITHUB_REF, etc, one time

# blah blah function definitions here. we already have most of these

# run ETL
# clean up postgres
# save outputs to internal bucket

if [[ $BUILD_TYPE == "nightly" ]]; then
    # merge tag nightly-yyyy-mm-dd to nightly
    # update datasette
    # distribute parquet
    # clean up outputs
    # distribute to S3 nightly location
    # distribute to GCS nightly location
    # make Zenodo sandbox record
elif [[ $BUILD_TYPE == "stable" ]]; then
    # merge tag v20yy.m.v to stable
    # distribute parquet
    # clean up outputs
    # distribute to S3 versioned location
    # distribute to S3 stable location
    # distribute to GCS versioned location
    # distribute to GCS stable location
    # make Zenodo prod record draft
    # lock GCS versioned outputs
elif [[ $BUILD_TYPE == "ad-hoc" ]]; then
    # throw something in the logs like "ad-hoc build, not distributing anything"
fi

# finish uploading logs
# notify slack based on success

We'd get to take out a lot of the "figure out where we're putting stuff" logic from the various function definitions, too, and just pass the targets in at the call sites, which would make our conditionals a lot simpler too.

Then when something like this pops up, it's most likely an error in the "set $BUILD_TYPE" logic.

If this design seems reasonable, I'm happy to take a crack at it @zaneselvans . Or you can if you're looking for some tech work...

@jdangerx
Copy link
Member

jdangerx commented Jul 1, 2024

Punting this until next sprint since we're not focusing on the build script refactor/quality for this sprint.

@e-belfer
Copy link
Member

Putting this into next sprint, since we'll be doing yet another release in November and this seems to be a problem again.

@zaneselvans zaneselvans moved this from Backlog to In progress in Catalyst Megaproject Nov 17, 2024
@zaneselvans zaneselvans changed the title Builds initiated via workflow dispatch on main deploy inappropriately Do not deploy build outputs when using workflow_dispatch trigger on main Nov 17, 2024
@zaneselvans zaneselvans changed the title Do not deploy build outputs when using workflow_dispatch trigger on main Don't deploy outputs when using workflow_dispatch trigger on main Nov 17, 2024
@zaneselvans zaneselvans self-assigned this Nov 17, 2024
@zaneselvans zaneselvans moved this from In progress to In review in Catalyst Megaproject Nov 18, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Catalyst Megaproject Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that are just plain broken. cloud Stuff that has to do with adapting PUDL to work in cloud computing context. nightly-builds Anything having to do with nightly builds or continuous deployment.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants