Phylogenetic NCBI #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Phylogenetic NCBI | |
defaults: | |
run: | |
# This is the same as GitHub Action's `bash` keyword as of 20 June 2023: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell | |
# | |
# Completely spelling it out here so that GitHub can't change it out from under us | |
# and we don't have to refer to the docs to know the expected behavior. | |
shell: bash --noprofile --norc -eo pipefail {0} | |
on: | |
workflow_call: | |
inputs: | |
image: | |
description: 'Specific container image to use for phylogenetic workflow (will override the default of "nextstrain build")' | |
required: false | |
type: string | |
workflow_dispatch: | |
inputs: | |
image: | |
description: 'Specific container image to use for ingest workflow (will override the default of "nextstrain build")' | |
required: false | |
type: string | |
trial-name: | |
description: | | |
Trial name for deploying builds. | |
If not set, builds will overwrite existing builds at s3://nextstrain-data/avian-flu* | |
If set, builds will be deployed to s3://nextstrain-staging/avian-flu_trials_<trial_name>_* | |
required: false | |
type: string | |
jobs: | |
summary: | |
runs-on: ubuntu-latest | |
steps: | |
- name: summary_step | |
run: | | |
URL_A="avian-flu/h5n1-cattle-outbreak/genome" | |
URL_B="avian-flu/h5n1-cattle-outbreak/ha" | |
if [[ "$TRIAL_NAME" ]]; then | |
echo "### Trial Build URLs" >> $GITHUB_STEP_SUMMARY | |
URL_BASE="https://nextstrain.org/staging/avian-flu/trials" | |
TRIAL_NAME_URL=$( echo "$TRIAL_NAME" | sed "s|_|/|g" ) | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo " * ${URL_BASE}/${TRIAL_NAME_URL}/${URL_A}" >> $GITHUB_STEP_SUMMARY | |
echo " * ${URL_BASE}/${TRIAL_NAME_URL}/${URL_B}" >> $GITHUB_STEP_SUMMARY | |
echo " * etc" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "### Canonical URLs will be updated by this run" >> $GITHUB_STEP_SUMMARY | |
URL_BASE="https://nextstrain.org" | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo " * ${URL_BASE}/${URL_A}" >> $GITHUB_STEP_SUMMARY | |
echo " * ${URL_BASE}/${URL_B}" >> $GITHUB_STEP_SUMMARY | |
echo " * etc" >> $GITHUB_STEP_SUMMARY | |
fi; | |
echo "" >> $GITHUB_STEP_SUMMARY | |
NOTE="NOTE: These URL paths may be incorrect if you've changed the " | |
NOTE+="snakemake targets in 'config/ncbi-cattle-outbreak.yaml' as part of this PR. " | |
NOTE+="Please update this GitHub Action if so!" | |
echo "> $NOTE" >> $GITHUB_STEP_SUMMARY | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "### Build (meta-)environment" >> $GITHUB_STEP_SUMMARY | |
if [[ "$NEXTSTRAIN_DOCKER_IMAGE" ]]; then | |
echo " * Docker image: $NEXTSTRAIN_DOCKER_IMAGE" >> $GITHUB_STEP_SUMMARY | |
else | |
echo " * Docker image: default (latest)" >> $GITHUB_STEP_SUMMARY | |
fi; | |
echo ' * Git Branch: `'"${BRANCH_NAME}"'`' >> $GITHUB_STEP_SUMMARY | |
env: | |
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }} | |
TRIAL_NAME: ${{ inputs.trial-name }} | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
phylogenetic: | |
permissions: | |
id-token: write | |
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master | |
secrets: inherit | |
with: | |
runtime: aws-batch | |
run: | | |
declare -a config; | |
if [[ "$TRIAL_NAME" ]]; then | |
config+=( | |
deploy_url="s3://nextstrain-staging/avian-flu_trials_${TRIAL_NAME}_" | |
) | |
fi; | |
nextstrain build \ | |
--detach \ | |
--no-download \ | |
--cpus 16 \ | |
--memory 28800mib \ | |
. \ | |
deploy_all \ | |
--configfile config/h5n1-cattle-outbreak.yaml \ | |
--config "${config[@]}" | |
env: | | |
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }} | |
TRIAL_NAME: ${{ inputs.trial-name }} | |
artifact-name: phylogenetic-full-genome-build-output |