-
Notifications
You must be signed in to change notification settings - Fork 735
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
Add GPU-based tests #6953
Add GPU-based tests #6953
Changes from 3 commits
d946f4d
473857e
09bc2d3
3514f77
88fbfe3
51f66e1
616e0ef
7cb14f4
3a164c9
36897d8
0bdcbb2
18de958
e9d237b
004b9a6
834614a
660d68f
f90f4c2
12115c4
236276d
88494a6
d50b3cb
6fa8d59
b2de5f7
4609f2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: "NF Test Action" | ||
description: "Runs nf-test with common setup steps" | ||
inputs: | ||
path: | ||
description: "Path to test" | ||
required: true | ||
profile: | ||
description: "Profile to use" | ||
required: true | ||
runners: | ||
description: "Runners to use" | ||
required: false | ||
default: "self-hosted" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Setup Nextflow | ||
uses: nf-core/setup-nextflow@v2 | ||
|
||
- name: Install nf-test | ||
uses: nf-core/setup-nf-test@v1 | ||
with: | ||
version: "0.9.2" | ||
install-pdiff: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Setup apptainer | ||
if: ${{ inputs.profile == 'singularity' }} | ||
uses: eWaterCycle/setup-apptainer@main | ||
|
||
- name: Set up Singularity | ||
if: ${{ inputs.profile == 'singularity' }} | ||
shell: bash | ||
run: | | ||
mkdir -p $NXF_SINGULARITY_CACHEDIR | ||
mkdir -p $NXF_SINGULARITY_LIBRARYDIR | ||
|
||
- name: Conda setup | ||
if: ${{inputs.profile == 'conda'}} | ||
shell: bash | ||
with: | ||
miniconda-version: "23.5.1" | ||
auto-update-conda: true | ||
conda-solvers: libmamba | ||
run: | | ||
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH | ||
echo $(realpath python) >> $GITHUB_PATH | ||
|
||
# Set up secrets | ||
- name: Set up nextflow secrets | ||
# TODO Only run if the tag includes `sentieon` | ||
if: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} != null && ${{ secrets.SENTIEON_LICENSE_MESSAGE }} != null | ||
shell: bash | ||
run: | | ||
nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "${{ secrets.SENTIEON_ENCRYPTION_KEY }}" --message "${{ secrets.SENTIEON_LICENSE_MESSAGE }}") | ||
|
||
- name: Run nf-test | ||
shell: bash | ||
env: | ||
SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }} | ||
SENTIEON_AUTH_MECH: "GitHub Actions - token" | ||
run: | | ||
if [ "${{ inputs.profile }}" == "docker" ]; then | ||
PROFILE="docker_self_hosted" | ||
else | ||
PROFILE=${{ inputs.profile }} | ||
fi | ||
|
||
NFT_WORKDIR=~ \ | ||
nf-test test \ | ||
--profile=${{ inputs.profile }} \ | ||
--tap=test.tap \ | ||
--verbose \ | ||
${{ inputs.path }} | ||
|
||
- uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1 | ||
if: ${{ inputs.path != '' }} | ||
with: | ||
path: >- | ||
test.tap | ||
|
||
- name: Clean up | ||
if: always() | ||
shell: bash | ||
run: | | ||
sudo rm -rf /home/ubuntu/tests/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,10 @@ if ("$PROFILE" == "singularity") { | |
podman.enabled = true | ||
podman.userEmulation = true | ||
podman.runOptions = "--runtime crun --platform linux/x86_64 --systemd=always" | ||
} else if ("$PROFILE" == "gpu") { | ||
mashehu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
docker.runOptions = '-u $(id -u):$(id -g) --gpus all' | ||
mashehu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
apptainer.runOptions = '--nv' | ||
singularity.runOptions = '--nv' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer this stuff to go in the configuration of the individual tools, so it can function as a reference implementation for users. Adding it here feels too "secret sauce" that will be hard for other people to follow. Plus we should use Or we could add
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 for label There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we handle the singularity/apptainer option |
||
} else { | ||
docker.enabled = true | ||
docker.userEmulation = false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this trigger tests for these three modules whenever
if: ( needs.nf-test-changes.outputs.paths != '[]' )
is true.