-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from nextstrain/gh-action-phylo
Add GH Action for NCBI phylogenetic workflow
- Loading branch information
Showing
6 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Phylogenetic Fauna | ||
|
||
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_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: | ||
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 \ | ||
--config "${config[@]}" | ||
env: | | ||
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }} | ||
TRIAL_NAME: ${{ inputs.trial-name }} | ||
artifact-name: phylogenetic-fauna-build-output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
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_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: | ||
phylogenetic: | ||
permissions: | ||
id-token: write | ||
uses: nextstrain/.github/.github/workflows/pathogen-repo-build.yaml@master | ||
secrets: inherit | ||
with: | ||
runtime: docker | ||
run: | | ||
declare -a config; | ||
config+=( | ||
s3_src="s3://nextstrain-data/files/workflows/avian-flu/h5n1" | ||
); | ||
if [[ "$TRIAL_NAME" ]]; then | ||
config+=( | ||
deploy_url="s3://nextstrain-staging/avian-flu_trials_${TRIAL_NAME}_" | ||
) | ||
fi; | ||
nextstrain build \ | ||
. \ | ||
deploy_all \ | ||
--snakefile Snakefile.genome \ | ||
--config "${config[@]}" | ||
env: | | ||
NEXTSTRAIN_DOCKER_IMAGE: ${{ inputs.image }} | ||
TRIAL_NAME: ${{ inputs.trial-name }} | ||
artifact-name: phylogenetic-full-genome-build-output |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
DEPLOY_URL = config.get('deploy_url', "s3://nextstrain-data") | ||
|
||
|
||
rule deploy_all: | ||
""" | ||
Upload all builds to AWS S3 | ||
Depends on indendent Snakemake workflow's defined `all` rule | ||
""" | ||
input: rules.all.input | ||
params: | ||
s3_dst = DEPLOY_URL | ||
shell: | ||
""" | ||
nextstrain remote upload {params.s3_dst:q} {input} | ||
""" |