Skip to content

Run models

Run models #1362

Workflow file for this run

name: Run models
on:
repository_dispatch:
types:
- run-models
workflow_dispatch:
inputs:
slack_channel:
description: 'Slack channel to push update alerts. Default channel is nextstrain-counts-updates.'
required: false
trial_name:
description: 'Short name for a trial run that does not send Slack notifications. WARNING: without this we will overwrite files in s3://nextstrain-data/files/workflows/forecasts-ncov'
required: false
data_provenance:
description: 'Data provenance of data inputs for model: gisaid or open. Will run both if left empty.'
required: false
jobs:
set_config_overrides:
runs-on: ubuntu-latest
steps:
- id: s3_dst
run: |
S3_DST=s3://nextstrain-data/files/workflows/forecasts-ncov
if [[ -n "$TRIAL_NAME" ]]; then
S3_DST+=/trial/"$TRIAL_NAME"
fi
echo "s3_dst=$S3_DST" >> "$GITHUB_OUTPUT"
env:
TRIAL_NAME: ${{ inputs.trial_name }}
- id: data_provenances
run: |
DATA_PROVENANCES='["gisaid", "open"]'
if [[ -n "$INPUT_DATA_PROVENANCE" ]]; then
DATA_PROVENANCES="$INPUT_DATA_PROVENANCE"
fi
echo "data_provenances=$DATA_PROVENANCES" >> "$GITHUB_OUTPUT"
env:
INPUT_DATA_PROVENANCE: ${{ inputs.data_provenance }}
outputs:
s3_dst: ${{ steps.s3_dst.outputs.s3_dst }}
data_provenances: ${{ steps.data_provenances.outputs.data_provenances }}
run_models:
needs: [set_config_overrides]
permissions:
id-token: write
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master
secrets: inherit
with:
runtime: aws-batch
run: |
nextstrain build \
--aws-batch \
--detach \
--no-download \
--image nextstrain/base \
--cpus 8 \
--memory 16GiB \
--env AWS_DEFAULT_REGION \
--env GITHUB_RUN_ID \
--env SLACK_TOKEN \
--env SLACK_CHANNELS \
. \
--configfile config/config.yaml config/optional.yaml \
--config s3_dst="$S3_DST" data_provenances="$DATA_PROVENANCES" \
--keep-going
env: |
DATA_PROVENANCES: ${{ needs.set_config_overrides.outputs.data_provenances }}
GITHUB_RUN_ID: ${{ github.run_id }}
SLACK_CHANNELS: ${{ github.event.inputs.slack_channel || vars.SLACK_CHANNELS }}
S3_DST: ${{ needs.set_config_overrides.outputs.s3_dst }}