Skip to content

Commit

Permalink
bugfix: use env datacenter
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Aguilera <[email protected]>
  • Loading branch information
jagedn committed Jul 3, 2024
1 parent 9b67072 commit 5071403
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 17 deletions.
46 changes: 29 additions & 17 deletions validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Before to run the validation tests you must to "recompile" the plugin using `lat
this command will build and install current code of the plugin with the version name `latest` used by this validation
tests

## Start a cluster
## Start a local "cluster"

open a terminal a execute
open a terminal an execute

```shell
cd validation
Expand Down Expand Up @@ -53,24 +53,36 @@ so Nextflow will use the compiled version
the executor will mount the `scratchdir` volume configured by the `start-nomad.sh` command


### Bactopia
### Test pipelines

A more elaborate example:
You can run a set of predefined pipelines as `hello`, `nf-core/demo`, etc:

In a terminal run `./run-all.sh`

this command will run all these pipelines against your local cluster

__You can force to rebuild latest version of the plugins with the `--build` argument__

__You can skip local tests with `--skiplocal` argument__

### Test remote cluster

We've created a cluster with 3 nodes in azure called `nfazure` and, if you have access to it,
you can test some pipelines from your terminal using the `--nfazure` argument

(`--nfazure` will scp the `az-nomadlab` directory and execute different pipelines using ssh remote command)

### Examples

- `./run-all.sh` use current last version and run pipelines using local cluster

- `./run-all.sh --build --skiplocal` build and deploy last version

- `./run-all.sh --nfazure` run local and remote pipelines

- `./run-all.sh --skiplocal --nfazure` run only remote pipelines

```shell
cd validation
./run-pipeline.sh bactopia/bactopia \
-c basic/nextflow.config \
-profile test,docker \
--outdir $(pwd)/nomad_temp/scratchdir/out \
--accession SRX4563634 \
--coverage 100 \
--genome_size 2800000 \
--max_cpus 2 \
--datasets_cache $(pwd)/nomad_temp/scratchdir/cache
```

See how we set the `datasets_cache` params, so it'll use the shared volume


## Stop the cluster
Expand Down
25 changes: 25 additions & 0 deletions validation/az-nomadlab/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
id 'nf-nomad@latest'
}

process {
executor = "nomad"
}

nomad {

client {
address = "http://10.0.2.6:4646"
}

jobs {
deleteOnCompletion = false
namespace = "nf"
volumes = [
{ type "csi"
name "nextflow-fs-volume"
}
]
}

}
49 changes: 49 additions & 0 deletions validation/run-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

BUILD=0
SKIPLOCAL=0
NFAZURE=0

[[ "$@" =~ '--build' ]] && BUILD=1
[[ -f $HOME/.nextflow/plugins/nf-nomad-latest/ ]] && BUILD=1
[[ "$@" =~ '--skiplocal' ]] && SKIPLOCAL=1
[[ "$@" =~ '--nfazure' ]] && NFAZURE=1

if [ "$BUILD" == 1 ]; then
pushd ..
./gradlew unzipPlugin -x test -P version=latest
popd +0 || exit
else
echo "skip build"
fi

if [ "$SKIPLOCAL" == 0 ]; then

./run-pipeline.sh -c basic/nextflow.config basic/main.nf

./run-pipeline.sh -c basic/nextflow.config nf-core/demo \
-r dev -profile test,docker \
--outdir $(pwd)/nomad_temp/scratchdir/out

./run-pipeline.sh -c basic/nextflow.config bactopia/bactopia \
--accession SRX4563634 --coverage 100 --genome_size 2800000 \
-profile test,docker --outdir $(pwd)/nomad_temp/scratchdir/bactopia/outdir \
--datasets_cache $(pwd)/nomad_temp/scratchdir/bactopia/datasets

else
echo "skip local"
fi

if [ "$NFAZURE" == 1 ]; then
ssh manager@nfazure 'rm -rf ~/.nextflow/plugins/nf-nomad-latest'
rsync -Pr ~/.nextflow/plugins/nf-nomad-latest manager@nfazure:~/.nextflow/plugins/
rsync -Pr az-nomadlab manager@nfazure:~/integration-tests/

ssh manager@nfazure \
'cd ~/integration-tests/az-nomadlab; NXF_ASSETS=/projects/assets nextflow run hello -w /projects/ -c nextflow.config'

ssh manager@nfazure \
'cd ~/integration-tests/az-nomadlab; NXF_ASSETS=/projects/assets nextflow run bactopia/bactopia -c nextflow.config -w /projects -profile test,docker --outdir /projects/bactopia/outdir --accession SRX4563634 --coverage 100 --genome_size 2800000 --datasets_cache /projects/bactopia/datasets'
else
echo "skip nfazure"
fi
5 changes: 5 additions & 0 deletions validation/start-nomad.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
if [ ! -f ./nomad ]; then
curl -O https://releases.hashicorp.com/nomad/1.7.3/nomad_1.7.3_linux_amd64.zip
unzip nomad_1.7.3_linux_amd64.zip
rm -f nomad_1.7.3_linux_amd64.zip
fi

mkdir -p nomad_temp
cd nomad_temp
Expand Down

0 comments on commit 5071403

Please sign in to comment.