Skip to content

Commit

Permalink
Refactor and simplify action
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Feb 21, 2023
1 parent ef6e81d commit 1c2a577
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/tw_launch_hello_world.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Tower Launch Hello World
# The Hello World pipeline will be launched on all Compute Environments in the Tower Workspace.
# This workflow can be triggered manually with the GitHub actions workflow dispatch button.
# Pipeline : https://github.com/nextflow-io/hello
# Workspace: seqeralabs/showcase
# Platforms: AWS, Azure, GCP

on:
workflow_dispatch:
Expand All @@ -13,31 +11,25 @@ jobs:
runs-on: ubuntu-latest
env:
TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }}
strategy:
matrix:
pipeline: [ 'hello' ]
compute-env: [ 'seqera_aws_ireland_fusionv2_nvme', 'seqera_azure_virginia', 'seqera_gcp_london' ]
include:
- compute-env: "seqera_aws_ireland_fusionv2_nvme"
bucket-prefix: "s3"
- compute-env: "seqera_azure_virginia"
bucket-prefix: "az"
- compute-env: "seqera_gcp_london"
bucket-prefix: "gs"
TOWER_WORKSPACE_NAME: seqeralabs/showcase
steps:
- name: Install tw CLI
run: |
wget -L https://github.com/seqeralabs/tower-cli/releases/download/v0.7.3/tw-0.7.3-linux-x86_64
mv tw-* tw
chmod +x tw
sudo mv tw /usr/local/bin/
tw info
- name: Tower Launch Hello World
run: |
tw \
launch \
--workspace=seqeralabs/showcase \
--compute-env=${{ matrix.compute-env }} \
--work-dir=${{ matrix.bucket-prefix }}://seqeralabs-showcase \
${{ matrix.pipeline }}
# Get list of Compute Environments in Workspace
COMPUTE_ENVS=( $( tw -o json compute-envs list --workspace=$TOWER_WORKSPACE_NAME | jq -r '.computeEnvs[].name' ) )
# Loop through Compute Environments
for i in "${!COMPUTE_ENVS[@]}"
do
WORK_DIR=( $( tw compute-envs export --name=${COMPUTE_ENVS[$i]} --workspace=$TOWER_WORKSPACE_NAME | jq -r '.workDir' ) )
# Tower Launch Hello World
tw launch --workspace=$TOWER_WORKSPACE_NAME --compute-env=${COMPUTE_ENVS[$i]} --name="HOLA_${COMPUTE_ENVS[$i]}" --work-dir=$WORK_DIR hello
done

0 comments on commit 1c2a577

Please sign in to comment.