Skip to content

GISAID fetch and ingest #1745

GISAID fetch and ingest

GISAID fetch and ingest #1745

name: GISAID fetch and ingest
on:
# Manually triggered using `./vendored/trigger nextstrain/ncov-ingest gisaid/fetch-and-ingest`
repository_dispatch:
types:
- gisaid/fetch-and-ingest
- fetch-and-ingest
# Manually triggered using GitHub's UI
workflow_dispatch:
inputs:
trial_name:
description: >-
Short name for a trial run.
If provided, files will be uploaded to s3://nextstrain-ncov-private/trial/${TRIAL_NAME}/
and downstream ncov and forecasts-ncov workflows will not be triggered.
WARNING: without the trial name, workflow will upload files to s3://nextstrain-ncov-private/
required: false
fetch_from_database:
description: >-
Whether the workflow should fetch from upstream database.
If not selected (false), the workflow will start from existing data on S3.
type: boolean
required: false
default: true
image:
description: >-
Specific container image to use for build.
This will override the default image (nextstrain/ncov-ingest).
required: false
jobs:
set_config_overrides:
runs-on: ubuntu-latest
steps:
- id: config
name: Set config overrides
env:
TRIAL_NAME: ${{ inputs.trial_name }}
FETCH_FROM_DATABASE: ${{ github.event_name != 'workflow_dispatch' && true || inputs.fetch_from_database }}
run: |
config="--config"
config+=" trigger_rebuild=False"
config+=" trigger_counts=False"
if [[ "$FETCH_FROM_DATABASE" == true ]]; then
config+=" fetch_from_database=True"
else
config+=" fetch_from_database=False"
fi
if [[ "$TRIAL_NAME" ]]; then
config+=" s3_dst=s3://nextstrain-ncov-private/trial/${TRIAL_NAME}"
else
config+=" s3_archive_dst=s3://nextstrain-archive/ncov"
fi
echo "config=$config" >> "$GITHUB_OUTPUT"
outputs:
config_overrides: ${{ steps.config.outputs.config }}
fetch_and_ingest:
needs: [set_config_overrides]
permissions:
id-token: write
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master
secrets: inherit
with:
runtime: aws-batch
env: |
CONFIG_OVERRIDES: ${{ needs.set_config_overrides.outputs.config_overrides }}
GITHUB_RUN_ID: ${{ github.run_id }}
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image || 'nextstrain/ncov-ingest' }}
SLACK_CHANNELS: ${{ inputs.trial_name && vars.TEST_SLACK_CHANNEL || vars.NCOV_GISAID_SLACK_CHANNEL }}
run: |
nextstrain build \
--aws-batch \
--aws-batch-queue nextstrain-job-queue-c7a-12xlarge \
--detach \
--no-download \
--cpus 48 \
--memory 90GiB \
--env GITHUB_RUN_ID \
--env SLACK_TOKEN \
--env SLACK_CHANNELS \
--env PAT_GITHUB_DISPATCH="$GH_TOKEN_NEXTSTRAIN_BOT_WORKFLOW_DISPATCH" \
. \
--configfile config/gisaid.yaml \
$CONFIG_OVERRIDES