Skip to content

run-archiver

run-archiver #222

Workflow file for this run

---
name: run-archiver
on:
workflow_dispatch:
schedule:
- cron: "21 8 1 * *" # 8:21 AM UTC, first of every month
jobs:
archive-run-small:
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
dataset:
- ferceqr
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Conda environment using mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log the conda environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run archiver for ${{ matrix.dataset }}
env:
ZENODO_SANDBOX_TOKEN_UPLOAD: ${{ secrets.ZENODO_SANDBOX_TOKEN_UPLOAD }}
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }}
EPACEMS_API_KEY: ${{ secrets.EPACEMS_API_KEY }}
ZENODO_TOKEN_UPLOAD: ${{ secrets.ZENODO_TOKEN_UPLOAD }}
ZENODO_TOKEN_PUBLISH: ${{ secrets.ZENODO_TOKEN_PUBLISH }}
run: |
pudl_archiver --datasets ${{ matrix.dataset }} --summary-file ${{ matrix.dataset }}_run_summary.json
- name: Upload run summaries
if: always()
id: upload_summaries
uses: actions/upload-artifact@v4
with:
name: run-summaries-${{ matrix.dataset }}
path: ${{ matrix.dataset }}_run_summary.json
archive-run-large:
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
dataset:
- epacems
fail-fast: false
runs-on:
group: large-runner-group
labels: ubuntu-22.04-4core
steps:
- uses: actions/checkout@v4
- name: Install Conda environment using mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
condarc: |
channels:
- conda-forge
- defaults
channel_priority: strict
- name: Log the conda environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run archiver for ${{ matrix.dataset }}
env:
ZENODO_SANDBOX_TOKEN_UPLOAD: ${{ secrets.ZENODO_SANDBOX_TOKEN_UPLOAD }}
ZENODO_SANDBOX_TOKEN_PUBLISH: ${{ secrets.ZENODO_SANDBOX_TOKEN_PUBLISH }}
EPACEMS_API_KEY: ${{ secrets.EPACEMS_API_KEY }}
ZENODO_TOKEN_UPLOAD: ${{ secrets.ZENODO_TOKEN_UPLOAD }}
ZENODO_TOKEN_PUBLISH: ${{ secrets.ZENODO_TOKEN_PUBLISH }}
run: |
pudl_archiver --datasets ${{ matrix.dataset }} --summary-file ${{ matrix.dataset }}_run_summary.json
- name: Upload run summaries
if: failure() || success()
id: upload_summaries
uses: actions/upload-artifact@v4
with:
name: run-summaries-${{ matrix.dataset }}
path: ${{ matrix.dataset }}_run_summary.json
- name: Upload checkpoints
if: failure() || success()
id: upload_checkpoint
uses: actions/upload-artifact@v4
with:
name: run-checkpoint-${{ matrix.dataset }}
path: .checkpoints/${{ matrix.dataset }}.json
archive-notify:
runs-on: ubuntu-latest
needs:
- archive-run-small
- archive-run-large
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- name: Download summaries
id: download
uses: actions/download-artifact@v4
with:
pattern: run-summaries-*
merge-multiple: true
- name: show summaries
run: ls -R
- name: Munge summaries together
id: all_summaries
run: |
{
echo "SLACK_PAYLOAD<<EOF"
./scripts/make_slack_notification_message.py --summary-files *_run_summary.json | tee slack-payload.json
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Post update to pudl-deployment
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: "C03FHB9N0PQ"
payload: ${{ steps.all_summaries.outputs.SLACK_PAYLOAD }}
env:
SLACK_BOT_TOKEN: ${{ secrets.PUDL_DEPLOY_SLACK_TOKEN }}