Skip to content

Instantly share code, notes, and snippets.

View GJSissons's full-sized avatar

Gord Sissons GJSissons

View GitHub Profile
@GJSissons
GJSissons / tower_gistfile_13
Created July 24, 2023 12:53
Automating Tower workflows 13
workflow.onComplete = {
// any workflow property can be used here
println "Pipeline complete"
println "Command line: $workflow.commandLine"
}
workflow.onError = {
println "Oops .. something when wrong"
}
@GJSissons
GJSissons / tower_gistfile_12
Created July 24, 2023 12:51
Automating Tower workflows 12
$ nextflow run <pipeline name> -N <recipient address>
@GJSissons
GJSissons / tower_gistfile_11
Created July 24, 2023 12:49
Automating Tower workflows 11
process {
errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' }
maxRetries = 3
withLabel:process_low {
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
memory = { check_max( 12.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
}
@GJSissons
GJSissons / tower_gistfile_10
Created July 24, 2023 12:47
Automating Tower workflows 10
$ nextflow ./main.nf -profile docker -resume
@GJSissons
GJSissons / tower_gistfile_9
Created July 24, 2023 12:45
Automating Tower workflows 9
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR TOKEN>" \
https://api.tower.nf/actions/6uVJmV5nHSqoBbGIQopRYZ/launch?workspaceId=215559034546785 \
--data '{"params":{"foo":"Hello world"}}'
@GJSissons
GJSissons / tower_gistfile_8
Last active July 24, 2023 13:19
Automating Tower workflows 8
$ tw actions list --workspace=seqeralabs/verified-pipelines
Actions for <tower-user> user:
ID | Name | Endpoint | Status | Source
------------------------+--------------------+----------------------------------------------------------------------------------------+--------+--------
6uVJmV5nHSqoBbGIQopRYZ | LaunchRNASeqFromS3 | https://api.tower.nf/actions/6uVJmV5nHSqoBbGIQopRYZ/launch?workspaceId=215559034546785 | ACTIVE | tower
7WiIDRY1ymDGUPOnD3IzDN | DemoAction | https://api.tower.nf/actions/7WiIDRY1ymDGUPOnD3IzDN/launch?workspaceId=215559034546785 | ACTIVE | tower
@GJSissons
GJSissons / tower_gistfile_7
Created July 24, 2023 12:41
Automating Tower workflows 7
$ tw actions list –workspace=DataScience/StableDiffusion
@GJSissons
GJSissons / tower_gistfile_6
Created July 24, 2023 12:39
Automating Tower workflows 6
$ tw actions add github \
--name=Stable_Diffusion_Webhook \
--labels=huggingface,webhook \
--workspace=DataScience/StableDiffusion \
--compute-env=AWS_Batch_GPU \
--pipeline=https://github.com/evanfloden/stable-diffusion-nf \
--revision=main \
--work-dir=s3://nextflow-bucket-1234/work/
@GJSissons
GJSissons / tower_gistfile_5
Created July 24, 2023 12:37
Automating Tower workflows 5
Run at [community / showcase] workspace:
General
---------------------+--------------------------------------------
ID | OLFdDfwJP9W7S
Operation ID | 2c1e500d-3d59-4a91-9c39-f22d00c561f4
Run name | ridiculous_galileo
Status | SUCCEEDED
Starting date | Tue, 11 Jul 2023 10:00:41 GMT
Commit ID | 3bec2331cac2b5ff88a1dc71a21fab6529b57a0f
@GJSissons
GJSissons / tower_gistfile_4
Created July 24, 2023 12:33
Automating Tower workflows 4
#!/bin/bash
export TOWER_API_ENDPOINT=https://api.tower.nf
export TOWER_ACCESS_TOKEN=eyJ0aWQiO********dkNzcxMzUz
export WORKSPACE=`tw workspaces list | grep showcase | awk '{print $1}'`
tw launch --wait=SUCCEEDED --workspace=$WORKSPACE nf-core-rnaseq
export RUN_ID=`tw runs list | grep rnaseq | grep <tower-user> | awk '{print $1}'`
tw runs view --id=$RUN_ID