From 35c64c05a331e068914fdae564212b0a2c2f4e6a Mon Sep 17 00:00:00 2001 From: Zane Selvans Date: Thu, 19 Oct 2023 22:12:56 -0600 Subject: [PATCH 1/2] Add new workflow to default branch. --- .github/workflows/update-lockfile.yml | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/update-lockfile.yml diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml new file mode 100644 index 0000000000..42d9ec0393 --- /dev/null +++ b/.github/workflows/update-lockfile.yml @@ -0,0 +1,57 @@ +--- +name: update-lockfile + +on: + workflow_dispatch: + # schedule: + # At 5:28am UTC Monday and Thursday + # - cron: 28 5 * * MON,THU + +jobs: + conda-lock: + # Don't run scheduled job on forks. + if: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name != 'schedule') + defaults: + run: + # Ensure the environment is activated + # + shell: bash -l {0} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environments/conda-lock.yml + environment-name: pudl-dev + + - name: Install pudl from branch + run: pip install --editable "./[dev,docs,test,datasette]" + + - name: Run conda-lock to recreate lockfile from scratch + run: | + rm environments/conda-lock.yml + conda-lock \ + --file=environments/dev-environment.yml \ + --file=pyproject.toml \ + --lockfile=environments/conda-lock.yml + - name: Open a pull request + uses: peter-evans/create-pull-request@v5 + with: + # # The default GITHUB_TOKEN doesn't allow other workflows to trigger. + # # Thus if there are tests to be run, they won't be run. For more info, + # # see the note under + # # . + # # One possible workaround is to specify a Personal Access Token (PAT). + # # This PAT should have read-write permissions for "Pull Requests" + # # and read-write permissions for "Contents". + # token: ${{ secrets.GH_PAT_FOR_PR }} + commit-message: Update lockfile + title: Update Lockfile + body: > + This pull request relocks the dependencies with conda-lock. + It is triggered by [update-lockfile](https://github.com/catalyst-cooperative/pudl/blob/main/.github/workflows/update-lockfile.yml). + branch: update-lockfile + labels: dependencies, conda-lock + reviewers: zaneselvans + delete-branch: true From c83108097e2d1c3c5f74eb688747e7c4323e65cd Mon Sep 17 00:00:00 2001 From: bendnorman Date: Fri, 3 Nov 2023 15:13:47 -0800 Subject: [PATCH 2/2] Add dagster postgres env vars to build-deploy-build.yaml --- .github/workflows/build-deploy-pudl.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-deploy-pudl.yml b/.github/workflows/build-deploy-pudl.yml index 6bdf750377..141dc76681 100644 --- a/.github/workflows/build-deploy-pudl.yml +++ b/.github/workflows/build-deploy-pudl.yml @@ -85,6 +85,8 @@ jobs: # Deploy PUDL image to GCE - name: Deploy + env: + DAGSTER_PG_PASSWORD: ${{ secrets.DAGSTER_PG_PASSWORD }} run: |- gcloud compute instances add-metadata "$GCE_INSTANCE" \ --zone "$GCE_INSTANCE_ZONE" \ @@ -110,6 +112,11 @@ jobs: --container-env AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ --container-env AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ --container-env AWS_DEFAULT_REGION=${{ secrets.AWS_DEFAULT_REGION }} \ + --container-env DAGSTER_PG_USERNAME="postgres" \ + --container-env DAGSTER_PG_PASSWORD="$DAGSTER_PG_PASSWORD" \ + --container-env DAGSTER_PG_HOST="104.154.182.24" \ + --container-env DAGSTER_PG_DB="dagster-storage" \ + --container-env PUDL_SETTINGS_YML="/home/catalyst/src/pudl/package_data/settings/etl_full.yml" \ # Start the VM - name: Start the deploy-pudl-vm