Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cloud testing matrix strategy #1378

Merged
merged 12 commits into from
Apr 25, 2024
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"python.linting.flake8Path": "/opt/conda/bin/flake8",
"python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle",
"python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle",
"python.linting.pylintPath": "/opt/conda/bin/pylint"
"python.linting.pylintPath": "/opt/conda/bin/pylint",
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
}
}
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"],
},
},
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
}
106 changes: 106 additions & 0 deletions .github/workflows/awstest.yml
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: nf-core cloud test

on:
release:
types: [created]
workflow_dispatch:
inputs:
test:
description: "-profile test (smaller)"
type: boolean
default: true
somatic:
description: "Somatic full test"
type: boolean
default: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm does this turn of that they are run automatically on release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The whole workflow is triggered by:

  • On release
  • Workflow dispatch (manual)

If manual, there is an inputs item which includes these variables. When it runs, it checks the inputs item for the matrix.test and matrix.cloud key, e.g. if matrix.test = azure, it checks inputs.azure is false, based on manual setting, then negates it. This means if it is true, the test will run. If the workflow is automatically triggered, inputs does not exist and it will not find inputs.azure, therefore the test will run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having said that, I actually have no way of testing this automatically.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then let's merge that, and we'll test

germline:
description: "Germline full test"
type: boolean
default: false
germline_ncbench_agilent:
description: "Germline Agilent NCBench test"
type: boolean
default: false
aws:
description: "AWS Batch"
type: boolean
default: true
azure:
description: "Azure Batch"
type: boolean
default: true

jobs:
trigger-test:
name: launch
runs-on: ubuntu-latest
if: ${{ github.repository == 'nf-core/sarek' }}
strategy:
fail-fast: false
matrix:
include:
- profile: test_aws
test: test
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_azure
test: test
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_aws
test: somatic
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_full_azure
test: somatic
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_germline_aws
test: germline
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS
- profile: test_full_germline_azure
test: germline
cloud: azure
compute_env: TOWER_CE_AZURE_CPU
workdir: TOWER_BUCKET_AZURE
- profile: test_full_germline_ncbench_agilent
test: germline_ncbench_agilent
cloud: aws
compute_env: TOWER_COMPUTE_ENV
workdir: TOWER_BUCKET_AWS

steps:
# Launch workflow on AWS Batch
- name: Launch
uses: seqeralabs/action-tower-launch@v2
# If inputs item exists (i.e. workflow_dispatch), then we find matrix.test and check it is false
# If is false, we negate and run the job
if: ( !contains(inputs[matrix.test], 'false') && !contains(inputs[matrix.cloud], 'false') )
with:
run_name: sarek_${{ matrix.profile }}
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
access_token: ${{ secrets.TOWER_ACCESS_TOKEN }}
compute_env: ${{ secrets[matrix.compute_env] }}
revision: ${{ github.sha }}
workdir: ${{ secrets[matrix.workdir] }}/work/sarek/work-${{ github.sha }}/${{ matrix.profile }}
parameters: |
{
"hook_url": "${{ secrets.MEGATESTS_ALERTS_SLACK_HOOK_URL }}",
"outdir": "${{ secrets[matrix.workdir] }}/sarek/results-${{ github.sha }}/${{ matrix.profile }}/"
}
profiles: ${{ matrix.profile }}

- uses: actions/upload-artifact@v3
name: Save Logs
if: success() || failure()
with:
name: tower-${{ matrix.profile }}-log
path: |
tower_action_*.log
tower_action_*.json
109 changes: 0 additions & 109 deletions .github/workflows/cloudtest.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1351](https://github.com/nf-core/sarek/pull/1351) - Fix params name for test profiles (`bcftools_annotations`)
- [#1357](https://github.com/nf-core/sarek/pull/1364) - Fixed bug where samples were dropped while reconstituting BAM files
- [#1373](https://github.com/nf-core/sarek/pull/1373) - Add `chr` prefix to NCBench bed file & enable trimming
- [#1378](https://github.com/nf-core/sarek/pull/1378) - Improve cloud tests launch workflow to use matrix

### Removed

Expand Down