add nextflow d30e48d
This commit is contained in:
41
nextflow/validation/await.sh
Executable file
41
nextflow/validation/await.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
TIMEOUT=3600 # terminate after one hour
|
||||
KEEPALIVE=480 # time after which print an output to keep alive travis
|
||||
|
||||
# launch main command to await
|
||||
( "$@" | tee stdout.log ) &
|
||||
pid=$!
|
||||
|
||||
# make sure to terminate target command on exit
|
||||
trap "kill $pid" TERM INT USR1 USR2
|
||||
|
||||
# monitor task execution
|
||||
begin=$(date +%s)
|
||||
size=0
|
||||
while kill -0 $pid > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
|
||||
# continue to await if there's a change
|
||||
# in the stdout file
|
||||
### BSD current=$(stat -f%z stdout.log)
|
||||
current=$(stat -c '%s' stdout.log)
|
||||
if [[ $current != $size ]]; then
|
||||
size=$current
|
||||
begin=$(date +%s)
|
||||
continue
|
||||
fi
|
||||
|
||||
# kill the execution if it's taking too
|
||||
# much time without producing any output
|
||||
now=$(date +%s)
|
||||
delta=$((now-begin))
|
||||
if ((delta>=$TIMEOUT)); then
|
||||
echo Taking too long ... killing it!
|
||||
kill $pid
|
||||
exit 1
|
||||
elif ((delta>=$KEEPALIVE)); then
|
||||
echo "[keep alive]"
|
||||
fi
|
||||
done
|
||||
12
nextflow/validation/awsbatch-unstage-fail.config
Normal file
12
nextflow/validation/awsbatch-unstage-fail.config
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* do not include plugin requirements otherwise latest
|
||||
* published version will be downloaded instead of using local build
|
||||
*/
|
||||
|
||||
workDir = 's3://nextflow-ci/work'
|
||||
process.executor = 'awsbatch'
|
||||
process.queue = 'nextflow-ci'
|
||||
process.container = 'quay.io/nextflow/test-aws-unstage-fail:1.0'
|
||||
aws.region = 'eu-west-1'
|
||||
aws.batch.maxTransferAttempts = 3
|
||||
aws.batch.delayBetweenAttempts = '5 sec'
|
||||
13
nextflow/validation/awsbatch.config
Normal file
13
nextflow/validation/awsbatch.config
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* do not include plugin requirements otherwise latest
|
||||
* published version will be downloaded instead of using local build
|
||||
*/
|
||||
|
||||
workDir = 's3://nextflow-ci/work'
|
||||
process.executor = 'awsbatch'
|
||||
process.queue = 'nextflow-ci'
|
||||
process.container = 'quay.io/nextflow/rnaseq-nf:latest'
|
||||
aws.region = 'eu-west-1'
|
||||
aws.batch.cliPath = '/home/ec2-user/miniconda/bin/aws'
|
||||
aws.batch.maxTransferAttempts = 3
|
||||
aws.batch.delayBetweenAttempts = '5 sec'
|
||||
83
nextflow/validation/awsbatch.sh
Normal file
83
nextflow/validation/awsbatch.sh
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
get_abs_filename() {
|
||||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
}
|
||||
|
||||
export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)}
|
||||
|
||||
# Execution should fail ignoring
|
||||
$NXF_CMD run test-aws-unstage-fail.nf -c awsbatch-unstage-fail.config || true
|
||||
[[ `grep -c "Error executing process > 'test (1)'" .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -c " Essential container in task exited" .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -cozP "Command exit status:\n 1" .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -c "Producing a failure in aws" .nextflow.log` == 2 ]] || false
|
||||
|
||||
$NXF_CMD run test-complexpaths.nf -c awsbatch.config
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
rm -rf foo
|
||||
$NXF_CMD run test-complexpaths.nf -resume -c awsbatch.config
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
$NXF_CMD run test-subdirs.nf -c awsbatch.config
|
||||
|
||||
NXF_CLOUDCACHE_PATH=s3://nextflow-ci/cache \
|
||||
$NXF_CMD run nextflow-io/rnaseq-nf \
|
||||
-profile batch \
|
||||
-with-report \
|
||||
-with-trace \
|
||||
-plugins nf-cloudcache
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
|
||||
NXF_CLOUDCACHE_PATH=s3://nextflow-ci/cache \
|
||||
$NXF_CMD run nextflow-io/rnaseq-nf \
|
||||
-profile batch \
|
||||
-with-report \
|
||||
-with-trace \
|
||||
-plugins nf-cloudcache \
|
||||
-resume
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -c 'Cached process > ' .nextflow.log` == 4 ]] || false
|
||||
|
||||
## run with fargate + wave
|
||||
NXF_CLOUDCACHE_PATH=s3://nextflow-ci/cache \
|
||||
$NXF_CMD run nextflow-io/rnaseq-nf \
|
||||
-profile batch \
|
||||
-plugins nf-cloudcache,nf-wave \
|
||||
-c awsfargate.config
|
||||
|
||||
## Test use of job array
|
||||
NXF_CLOUDCACHE_PATH=s3://nextflow-ci/cache \
|
||||
$NXF_CMD run nextflow-io/hello \
|
||||
-process.array 10 \
|
||||
-plugins nf-cloudcache \
|
||||
-c awsbatch.config
|
||||
|
||||
## Test use of job array using Fusion
|
||||
$NXF_CMD run nextflow-io/hello \
|
||||
-process.array 10 \
|
||||
-with-wave \
|
||||
-with-fusion \
|
||||
-c awsbatch.config
|
||||
14
nextflow/validation/awsfargate.config
Normal file
14
nextflow/validation/awsfargate.config
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* do not include plugin requirements otherwise latest
|
||||
* published version will be downloaded instead of using local build
|
||||
*/
|
||||
|
||||
workDir = 's3://nextflow-ci/work'
|
||||
process.executor = 'awsbatch'
|
||||
process.queue = 'nextflow-fg'
|
||||
process.container = 'quay.io/nextflow/rnaseq-nf:latest'
|
||||
aws.region = 'eu-west-1'
|
||||
aws.batch.platformType = 'fargate'
|
||||
aws.batch.jobRole = 'arn:aws:iam::195996028523:role/nf-batchjobrole'
|
||||
aws.batch.executionRole = 'arn:aws:iam::195996028523:role/nf-batchexecutionrole'
|
||||
wave.enabled = true
|
||||
25
nextflow/validation/azure.config
Normal file
25
nextflow/validation/azure.config
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* do not include plugin requirements otherwise latest
|
||||
* published version will be downloaded instead of using local build
|
||||
*/
|
||||
|
||||
process {
|
||||
executor = 'azurebatch'
|
||||
container = 'quay.io/nextflow/rnaseq-nf:v1.1'
|
||||
queue = 'nextflow-ci'
|
||||
}
|
||||
|
||||
workDir = 'az://my-data/work'
|
||||
|
||||
azure {
|
||||
batch {
|
||||
location = 'westeurope'
|
||||
allowPoolCreation = true
|
||||
pools {
|
||||
'nextflow-ci' {
|
||||
autoScale = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
65
nextflow/validation/azure.sh
Normal file
65
nextflow/validation/azure.sh
Normal file
@@ -0,0 +1,65 @@
|
||||
set -e
|
||||
|
||||
get_abs_filename() {
|
||||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
}
|
||||
|
||||
export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)}
|
||||
|
||||
|
||||
[[ $TOWER_ACCESS_TOKEN ]] && OPTS='-with-tower' || OPTS=''
|
||||
set -x
|
||||
$NXF_CMD -C ./azure.config \
|
||||
run ./test-readspair.nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS
|
||||
|
||||
## complex paths test
|
||||
$NXF_CMD -C ./azure.config run ./test-complexpaths.nf
|
||||
# validate
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
rm -rf foo
|
||||
$NXF_CMD -C ./azure.config run ./test-complexpaths.nf -resume
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
## run test-subdirs inputs/outputs
|
||||
$NXF_CMD -C ./azure.config run ./test-subdirs.nf
|
||||
|
||||
NXF_CLOUDCACHE_PATH=az://my-data/cache \
|
||||
$NXF_CMD -C ./azure.config \
|
||||
run nextflow-io/rnaseq-nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS \
|
||||
-plugins nf-cloudcache
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
|
||||
NXF_CLOUDCACHE_PATH=az://my-data/cache \
|
||||
$NXF_CMD -C ./azure.config \
|
||||
run nextflow-io/rnaseq-nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS \
|
||||
-plugins nf-cloudcache \
|
||||
-resume
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -c 'Cached process > ' .nextflow.log` == 4 ]] || false
|
||||
12
nextflow/validation/google.config
Executable file
12
nextflow/validation/google.config
Executable file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* do not include plugin requirements otherwise latest
|
||||
* published version will be downloaded instead of using local build
|
||||
*/
|
||||
params.array_file_path = "gs://nf-test-arrays/file"
|
||||
params.transcriptome = 'gs://rnaseq-nf/data/ggal/transcript.fa'
|
||||
params.reads = 'gs://rnaseq-nf/data/ggal/gut_{1,2}.fq'
|
||||
params.multiqc = 'gs://rnaseq-nf/multiqc'
|
||||
process.executor = 'google-batch'
|
||||
process.container = 'quay.io/nextflow/rnaseq-nf:latest'
|
||||
process.machineType = "n1-standard-1"
|
||||
workDir = 'gs://rnaseq-nf/scratch'
|
||||
80
nextflow/validation/google.sh
Normal file
80
nextflow/validation/google.sh
Normal file
@@ -0,0 +1,80 @@
|
||||
set -e
|
||||
|
||||
get_abs_filename() {
|
||||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
}
|
||||
|
||||
export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)}
|
||||
|
||||
[[ $TOWER_ACCESS_TOKEN ]] && OPTS='-with-tower' || OPTS=''
|
||||
set -x
|
||||
|
||||
$NXF_CMD -C ./google.config -q run ./test-arrays.nf > array_output
|
||||
[[ `grep 'Hi from the nf-test-array bucket!' -c array_output` == 3 ]] && echo OK || { echo 'Failed array tasks' && false; }
|
||||
|
||||
|
||||
$NXF_CMD -C ./google.config \
|
||||
run ./test-readspair.nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS
|
||||
|
||||
## complex paths test
|
||||
$NXF_CMD -C ./google.config run ./test-complexpaths.nf
|
||||
# validate
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
rm -rf foo
|
||||
$NXF_CMD -C ./google.config run ./test-complexpaths.nf -resume
|
||||
[[ -d foo ]] || false
|
||||
[[ -e 'foo/.alpha' ]] || false
|
||||
[[ -e 'foo/01_A(R1).fastq' ]] || false
|
||||
[[ -e 'foo/01_A(R2).fastq' ]] || false
|
||||
[[ -e 'foo/f1.fa' ]] || false
|
||||
[[ -e 'foo/f2.fa' ]] || false
|
||||
[[ -e 'foo/f3.fa' ]] || false
|
||||
[[ -e 'foo/hello.txt' ]] || false
|
||||
[[ -e 'foo/sample.html' ]] || false
|
||||
[[ -e 'foo/sample.zip' ]] || false
|
||||
[[ -e 'foo/sample_(1 2).vcf' ]] || false
|
||||
|
||||
NXF_CLOUDCACHE_PATH=gs://rnaseq-nf/cache \
|
||||
$NXF_CMD -trace nextflow,io.seqera -C ./google.config \
|
||||
run nextflow-io/rnaseq-nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS \
|
||||
-plugins nf-cloudcache
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
|
||||
NXF_CLOUDCACHE_PATH=gs://rnaseq-nf/cache \
|
||||
$NXF_CMD -trace nextflow,io.seqera -C ./google.config \
|
||||
run nextflow-io/rnaseq-nf \
|
||||
-with-report \
|
||||
-with-trace $OPTS \
|
||||
-plugins nf-cloudcache \
|
||||
-resume
|
||||
[[ `grep -c 'Using Nextflow cache factory: nextflow.cache.CloudCacheFactory' .nextflow.log` == 1 ]] || false
|
||||
[[ `grep -c 'Cached process > ' .nextflow.log` == 4 ]] || false
|
||||
|
||||
## Test job array with Fusion
|
||||
$NXF_CMD -C ./google.config \
|
||||
run nextflow-io/hello \
|
||||
-process.array 10 \
|
||||
-with-wave \
|
||||
-with-fusion
|
||||
|
||||
## Test job array
|
||||
$NXF_CMD -C ./google.config \
|
||||
run nextflow-io/hello \
|
||||
-process.array 10
|
||||
|
||||
|
||||
20
nextflow/validation/test-arrays.nf
Normal file
20
nextflow/validation/test-arrays.nf
Normal file
@@ -0,0 +1,20 @@
|
||||
process python_version {
|
||||
array 3
|
||||
input:
|
||||
val x
|
||||
path input_file
|
||||
|
||||
output:
|
||||
stdout
|
||||
|
||||
script:
|
||||
"""
|
||||
echo $x
|
||||
cat $input_file
|
||||
"""
|
||||
}
|
||||
|
||||
workflow {
|
||||
python_version(channel.of(1,2,3), params.array_file_path) | view
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
FROM ubuntu
|
||||
|
||||
RUN apt-get update && apt-get -y install curl unzip && apt-get clean
|
||||
|
||||
|
||||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
|
||||
unzip awscliv2.zip && ./aws/install && rm -rf aws*
|
||||
|
||||
ADD fake_aws /fake_aws
|
||||
|
||||
ENV PATH=/fake_aws/bin/:$PATH
|
||||
9
nextflow/validation/test-aws-unstage-fail-container/fake_aws/bin/aws
Executable file
9
nextflow/validation/test-aws-unstage-fail-container/fake_aws/bin/aws
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$*" == *".command."* ]] || [[ "$*" == *".exitcode"* ]]; then
|
||||
/usr/local/bin/aws $@
|
||||
else
|
||||
>&2 echo "Producing a failure in aws $@"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
16
nextflow/validation/test-aws-unstage-fail.nf
Normal file
16
nextflow/validation/test-aws-unstage-fail.nf
Normal file
@@ -0,0 +1,16 @@
|
||||
process test {
|
||||
input:
|
||||
val i
|
||||
output:
|
||||
file("test${i}")
|
||||
file("test_2_${i}")
|
||||
script:
|
||||
"""
|
||||
dd if=/dev/urandom of=test${i} bs=1K count=90
|
||||
dd if=/dev/urandom of=test_2_${i} bs=1K count=90
|
||||
"""
|
||||
}
|
||||
|
||||
workflow {
|
||||
channel.of(1) | test
|
||||
}
|
||||
43
nextflow/validation/test-complexpaths.nf
Normal file
43
nextflow/validation/test-complexpaths.nf
Normal file
@@ -0,0 +1,43 @@
|
||||
workflow {
|
||||
foo | mix | collect | bar
|
||||
}
|
||||
|
||||
process foo {
|
||||
publishDir 'foo'
|
||||
container 'debian:latest'
|
||||
output:
|
||||
file '*.fa'
|
||||
file 'hello.txt'
|
||||
file '*.{zip,html}'
|
||||
file '01_A(R{1,2}).fastq'
|
||||
file 'sample_(1 2).vcf'
|
||||
file '.alpha'
|
||||
|
||||
script:
|
||||
"""
|
||||
echo A > hello.txt
|
||||
echo B > sample.zip
|
||||
echo C > sample.html
|
||||
echo D > 01_A\\(R1\\).fastq
|
||||
echo E > 01_A\\(R2\\).fastq
|
||||
echo F > sample_\\(1\\ 2\\).vcf
|
||||
echo 1 > f1.fa
|
||||
echo 2 > f2.fa
|
||||
echo 3 > f3.fa
|
||||
mkdir .alpha
|
||||
echo "Hello world!" > .alpha/hello.txt
|
||||
"""
|
||||
}
|
||||
|
||||
process bar {
|
||||
debug true
|
||||
container 'debian:latest'
|
||||
input:
|
||||
file '*'
|
||||
|
||||
script:
|
||||
"""
|
||||
cat .alpha/hello.txt
|
||||
[ `cat * | grep -c ''` == 9 ] || false
|
||||
"""
|
||||
}
|
||||
15
nextflow/validation/test-overwrite.nf
Normal file
15
nextflow/validation/test-overwrite.nf
Normal file
@@ -0,0 +1,15 @@
|
||||
workflow {
|
||||
foo()
|
||||
}
|
||||
|
||||
process foo {
|
||||
container 'quay.io/nextflow/bash'
|
||||
publishDir "gs://rnaseq-nf/scratch/tests", overwrite: true
|
||||
output:
|
||||
path 'hello.txt'
|
||||
|
||||
script:
|
||||
"""
|
||||
touch hello.txt
|
||||
"""
|
||||
}
|
||||
19
nextflow/validation/test-readspair.nf
Normal file
19
nextflow/validation/test-readspair.nf
Normal file
@@ -0,0 +1,19 @@
|
||||
workflow {
|
||||
reads_pair()
|
||||
reads_pair
|
||||
.out.view()
|
||||
.collect()
|
||||
.subscribe { assert it.name == ['test.R1.fastq','test.R2.fastq'] }
|
||||
}
|
||||
|
||||
process reads_pair {
|
||||
output:
|
||||
file("reads/*")
|
||||
|
||||
script:
|
||||
"""
|
||||
mkdir reads
|
||||
touch reads/test.R1.fastq reads/test.R2.fastq
|
||||
"""
|
||||
}
|
||||
|
||||
63
nextflow/validation/test-subdirs.nf
Normal file
63
nextflow/validation/test-subdirs.nf
Normal file
@@ -0,0 +1,63 @@
|
||||
workflow {
|
||||
foo | bar
|
||||
}
|
||||
|
||||
process foo {
|
||||
output:
|
||||
path 'gsfolder/'
|
||||
path 'gsfolder2'
|
||||
path 'gsfolder3'
|
||||
path 'gsfolder4'
|
||||
path 'test5.txt'
|
||||
path 'test6.txt'
|
||||
path 'test7.txt'
|
||||
path 'gsfolder5/sub'
|
||||
|
||||
script:
|
||||
"""
|
||||
mkdir -p gsfolder/sub
|
||||
touch gsfolder/test1.txt
|
||||
touch gsfolder/sub/test1.txt
|
||||
|
||||
mkdir gsfolder2
|
||||
touch gsfolder2/test2.txt
|
||||
|
||||
mkdir gsfolder3
|
||||
touch gsfolder3/test3.txt
|
||||
|
||||
mkdir gsfolder4
|
||||
touch gsfolder4/test4.txt
|
||||
|
||||
echo 'Hello 5'>>test5.txt
|
||||
echo 'Hello 6'>>test6.txt
|
||||
echo 'Hello 7'>>test7.txt
|
||||
|
||||
mkdir -p gsfolder5/sub
|
||||
touch gsfolder5/sub/test8.txt
|
||||
"""
|
||||
}
|
||||
|
||||
process bar {
|
||||
input:
|
||||
path test_folder
|
||||
path test_folder2
|
||||
path 'test-folder3'
|
||||
path 'test-folder4/*'
|
||||
path test5
|
||||
path 'this-is-test-6.txt'
|
||||
path 'test7/foo/*'
|
||||
path 'test8/*'
|
||||
|
||||
script:
|
||||
"""
|
||||
set -x
|
||||
[[ -f $test_folder/test1.txt ]] || false
|
||||
[[ -f $test_folder/sub/test1.txt ]] || false
|
||||
[[ -f $test_folder2/test2.txt ]] || false
|
||||
[[ -f test-folder3/test3.txt ]] || false
|
||||
[[ -f test-folder4/gsfolder4/test4.txt ]] || false
|
||||
[[ \$(cat $test5) = 'Hello 5' ]] || false
|
||||
[[ \$(cat this-is-test-6.txt) = 'Hello 6' ]] || false
|
||||
[[ \$(cat test7/foo/test7.txt) = 'Hello 7' ]] || false
|
||||
"""
|
||||
}
|
||||
126
nextflow/validation/test.sh
Executable file
126
nextflow/validation/test.sh
Executable file
@@ -0,0 +1,126 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
get_abs_filename() {
|
||||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
}
|
||||
|
||||
export NXF_IGNORE_WARN_DSL2=true
|
||||
export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)}
|
||||
# disable ansi log to make log more readable
|
||||
export NXF_ANSI_LOG=false
|
||||
export NXF_DISABLE_CHECK_LATEST=true
|
||||
|
||||
test_integration() {
|
||||
(
|
||||
cd "$1"
|
||||
sudo bash cleanup.sh
|
||||
cd checks
|
||||
bash run.sh
|
||||
)
|
||||
}
|
||||
|
||||
test_e2e() {
|
||||
if [[ $TEST_SMOKE == true ]]; then
|
||||
echo Skipping tests since TEST_SMOKE flag is true
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#
|
||||
# Hello
|
||||
#
|
||||
git clone https://github.com/nextflow-io/hello
|
||||
(
|
||||
cd hello
|
||||
$NXF_CMD run .
|
||||
$NXF_CMD run . -resume
|
||||
)
|
||||
|
||||
#
|
||||
# RNASEQ-NF
|
||||
#
|
||||
echo nextflow-io/rnaseq-nf
|
||||
[[ $TOWER_ACCESS_TOKEN ]] && OPTS='-with-tower' || OPTS=''
|
||||
$NXF_CMD run nextflow-io/rnaseq-nf -with-docker $OPTS
|
||||
$NXF_CMD run nextflow-io/rnaseq-nf -with-docker $OPTS -resume
|
||||
}
|
||||
|
||||
#
|
||||
# Integration tests
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_integration' ]]; then
|
||||
export NXF_SYNTAX_PARSER=v1
|
||||
test_integration ../tests/
|
||||
test_integration ../tests-v1/
|
||||
test_e2e
|
||||
fi
|
||||
|
||||
#
|
||||
# Integration tests (strict syntax)
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_parser_v2' ]]; then
|
||||
export NXF_SYNTAX_PARSER=v2
|
||||
test_integration ../tests/
|
||||
test_e2e
|
||||
fi
|
||||
|
||||
#
|
||||
# Documentation tests
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_docs' ]]; then
|
||||
|
||||
(
|
||||
echo "Documentation tests"
|
||||
cd ../docs/snippets/
|
||||
bash test.sh
|
||||
)
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# AWS Batch tests
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_aws' ]]; then
|
||||
if [ "$AWS_ACCESS_KEY_ID" ]; then
|
||||
echo "AWS batch tests"
|
||||
bash awsbatch.sh
|
||||
else
|
||||
echo "::warning file=$0,line=$LINENO::Missing AWS_ACCESS_KEY_ID variable -- Skipping AWS Batch tests"
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Azure Batch tests
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_azure' ]]; then
|
||||
if [ "$AZURE_BATCH_ACCOUNT_KEY" ]; then
|
||||
echo "Azure batch tests"
|
||||
bash azure.sh
|
||||
else
|
||||
echo "::warning file=$0,line=$LINENO::Missing AZURE_BATCH_ACCOUNT_KEY variable -- Skipping Azure Batch tests"
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Google Batch
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_google' ]]; then
|
||||
if [ "$GOOGLE_SECRET" ]; then
|
||||
echo "Google Batch tests"
|
||||
bash google.sh
|
||||
else
|
||||
echo "::warning file=$0,line=$LINENO::Missing GOOGLE_SECRET variable -- Skipping Google Batch tests"
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
# Wave
|
||||
#
|
||||
if [[ $TEST_MODE == 'test_wave' ]]; then
|
||||
if [ "$TOWER_ACCESS_TOKEN" ]; then
|
||||
echo "Wave tests"
|
||||
bash wave.sh
|
||||
else
|
||||
echo "::warning file=$0,line=$LINENO::Missing TOWER_ACCESS_TOKEN variable -- Skipping Wave tests"
|
||||
fi
|
||||
fi
|
||||
13
nextflow/validation/wave-tests/example1/demo.nf
Normal file
13
nextflow/validation/wave-tests/example1/demo.nf
Normal file
@@ -0,0 +1,13 @@
|
||||
process foo {
|
||||
container 'docker.io/pditommaso/my-secret-container:latest'
|
||||
debug true
|
||||
|
||||
script:
|
||||
"""
|
||||
my-secret-script.sh
|
||||
"""
|
||||
}
|
||||
|
||||
workflow {
|
||||
foo()
|
||||
}
|
||||
4
nextflow/validation/wave-tests/example1/nextflow.config
Normal file
4
nextflow/validation/wave-tests/example1/nextflow.config
Normal file
@@ -0,0 +1,4 @@
|
||||
docker {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
1
nextflow/validation/wave-tests/example1/run.sh
Normal file
1
nextflow/validation/wave-tests/example1/run.sh
Normal file
@@ -0,0 +1 @@
|
||||
$NXF_CMD run demo.nf -with-wave
|
||||
7
nextflow/validation/wave-tests/example2/demo.nf
Normal file
7
nextflow/validation/wave-tests/example2/demo.nf
Normal file
@@ -0,0 +1,7 @@
|
||||
include { hello } from './modules/foo'
|
||||
|
||||
workflow {
|
||||
hello()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
FROM alpine
|
||||
|
||||
RUN apk update && apk add bash cowsay \
|
||||
--update-cache \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/edge/community \
|
||||
--repository https://alpine.global.ssl.fastly.net/alpine/edge/main \
|
||||
--repository https://dl-3.alpinelinux.org/alpine/edge/testing
|
||||
@@ -0,0 +1,8 @@
|
||||
process hello {
|
||||
debug true
|
||||
script:
|
||||
"""
|
||||
cowsay Hello Summit!
|
||||
"""
|
||||
}
|
||||
|
||||
5
nextflow/validation/wave-tests/example2/nextflow.config
Normal file
5
nextflow/validation/wave-tests/example2/nextflow.config
Normal file
@@ -0,0 +1,5 @@
|
||||
docker {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
|
||||
2
nextflow/validation/wave-tests/example2/run.sh
Normal file
2
nextflow/validation/wave-tests/example2/run.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
$NXF_CMD run demo.nf -with-wave
|
||||
|
||||
13
nextflow/validation/wave-tests/example3/demo.nf
Normal file
13
nextflow/validation/wave-tests/example3/demo.nf
Normal file
@@ -0,0 +1,13 @@
|
||||
process cow {
|
||||
debug true
|
||||
conda 'cowpy=1.1.5'
|
||||
|
||||
script:
|
||||
'''
|
||||
echo cowpy 'Hello Spack'
|
||||
'''
|
||||
}
|
||||
|
||||
workflow {
|
||||
cow()
|
||||
}
|
||||
9
nextflow/validation/wave-tests/example3/nextflow.config
Normal file
9
nextflow/validation/wave-tests/example3/nextflow.config
Normal file
@@ -0,0 +1,9 @@
|
||||
wave {
|
||||
enabled = true
|
||||
strategy = ['conda']
|
||||
build.repository = 'docker.io/pditommaso/wave-tests'
|
||||
}
|
||||
|
||||
docker {
|
||||
enabled = true
|
||||
}
|
||||
2
nextflow/validation/wave-tests/example3/run.sh
Normal file
2
nextflow/validation/wave-tests/example3/run.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
$NXF_CMD run demo.nf -with-wave
|
||||
|
||||
13
nextflow/validation/wave-tests/example4/demo.nf
Normal file
13
nextflow/validation/wave-tests/example4/demo.nf
Normal file
@@ -0,0 +1,13 @@
|
||||
process cow {
|
||||
debug true
|
||||
conda 'https://prefix.dev/envs/pditommaso/wave/conda-lock.yml'
|
||||
|
||||
script:
|
||||
'''
|
||||
echo cowpy 'Hello Spack'
|
||||
'''
|
||||
}
|
||||
|
||||
workflow {
|
||||
cow()
|
||||
}
|
||||
2
nextflow/validation/wave-tests/example4/run.sh
Normal file
2
nextflow/validation/wave-tests/example4/run.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
$NXF_CMD run demo.nf -with-wave
|
||||
|
||||
13
nextflow/validation/wave-tests/example6/nextflow.config
Normal file
13
nextflow/validation/wave-tests/example6/nextflow.config
Normal file
@@ -0,0 +1,13 @@
|
||||
docker {
|
||||
enabled = true
|
||||
envWhitelist = 'AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY'
|
||||
}
|
||||
|
||||
fusion {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
wave {
|
||||
build.template = 'conda/pixi:v1'
|
||||
}
|
||||
|
||||
7
nextflow/validation/wave-tests/example6/run-aws.sh
Normal file
7
nextflow/validation/wave-tests/example6/run-aws.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
$NXF_CMD run \
|
||||
rnaseq-nf \
|
||||
-profile batch,s3-data \
|
||||
-with-wave \
|
||||
-with-fusion \
|
||||
-process.scratch false
|
||||
|
||||
7
nextflow/validation/wave-tests/example6/run-gcp.sh
Normal file
7
nextflow/validation/wave-tests/example6/run-gcp.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
$NXF_CMD run \
|
||||
rnaseq-nf \
|
||||
-profile google-batch,gs-data \
|
||||
-with-wave \
|
||||
-with-fusion \
|
||||
-process.scratch false
|
||||
|
||||
5
nextflow/validation/wave-tests/example6/run.sh
Normal file
5
nextflow/validation/wave-tests/example6/run.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
$NXF_CMD run \
|
||||
rnaseq-nf \
|
||||
-with-wave \
|
||||
-w s3://nextflow-ci/wave
|
||||
|
||||
28
nextflow/validation/wave.sh
Normal file
28
nextflow/validation/wave.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
set -e
|
||||
|
||||
get_abs_filename() {
|
||||
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
}
|
||||
|
||||
export NXF_CMD=${NXF_CMD:-$(get_abs_filename ../launch.sh)}
|
||||
|
||||
echo "Test Wave accessing private container repository"
|
||||
(cd wave-tests/example1; bash run.sh)
|
||||
|
||||
echo "Test Wave building a container"
|
||||
(cd wave-tests/example2; bash run.sh)
|
||||
|
||||
echo "Test Wave building from Conda package"
|
||||
(cd wave-tests/example3; bash run.sh)
|
||||
#
|
||||
#echo "Test Wave building from Conda lock file"
|
||||
#(cd wave-tests/example4; bash run.sh)
|
||||
|
||||
echo "Test Wave running rnaseq-nf with Fusion on local executor"
|
||||
(cd wave-tests/example6; bash run.sh)
|
||||
|
||||
echo "Test Wave running rnaseq-nf with Fusion on AWS Batch"
|
||||
(cd wave-tests/example6; bash run-aws.sh)
|
||||
|
||||
echo "Test Wave running rnaseq-nf with Fusion on Google Batch"
|
||||
(cd wave-tests/example6; bash run-gcp.sh)
|
||||
Reference in New Issue
Block a user