Skip to content

Commit

Permalink
update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Mar 21, 2024
1 parent 1c960ba commit ca92c1b
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 6 deletions.
3 changes: 3 additions & 0 deletions scripts/resources_s3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -e

aws s3 sync resources s3://data-intuitive-tmp/test-nextflow-wave-fusion/resources --delete
54 changes: 54 additions & 0 deletions scripts/run_batch-code_remote-input_s3-output_s3-work_s3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

set -e

script_name=$(basename "$0")
TMPOUT=s3://data-intuitive-tmp/test-nextflow-wave-fusion/output/${script_name%.sh}
OUT=output/${script_name%.sh}
RES=s3://data-intuitive-tmp/test-nextflow-wave-fusion/resources
WORK=s3://data-intuitive-tmp/test-nextflow-wave-fusion/work/${script_name%.sh}
NXF_CONFIG=/tmp/${script_name%.sh}.config

# clear output dir
echo "Clearing output directory"
aws s3 rm $TMPOUT --recursive
[ -d "$OUT" ] && rm -r "$OUT"

# run component
echo "Running component"

cat > $NXF_CONFIG <<EOF
process {
executor = 'awsbatch'
queue = 'di_compute'
container = 'bash:4.0'
}
aws {
region = 'eu-west-1'
batch {
cliPath = '/home/ec2-user/miniconda/bin/aws'
}
}
EOF


NXF_VER=23.10.0 nextflow run \
viash-io/test-nextflow-wave-fusion \
-r main_build \
-main-script target/nextflow/method/main.nf \
-profile docker \
-w $WORK \
-c $NXF_CONFIG \
-latest \
--input $RES/input1.txt \
--multiple_input "$RES/input1.txt;$RES/input2.txt" \
--publish_dir "$TMPOUT"

# sync output
echo "Syncing output"
aws s3 sync $TMPOUT $OUT

# check if output is correct
echo "Checking output"
scripts/verify_output.sh "$OUT"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e

OUT=output/local
script_name=$(basename "$0")
OUT=output/${script_name%.sh}
RES=resources

# clear output dir
[ -d "$OUT" ] && rm -r "$OUT"
Expand All @@ -12,8 +14,8 @@ NXF_VER=23.10.0 nextflow run \
. \
-main-script target/nextflow/method/main.nf \
-profile docker \
--input resources/input1.txt \
--multiple_input "resources/input1.txt;resources/input2.txt" \
--input $RES/input1.txt \
--multiple_input "$RES/input1.txt;$RES/input2.txt" \
--publish_dir "$OUT"

# check if output is correct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e

OUT=output/local_with_remote
script_name=$(basename "$0")
OUT=output/${script_name%.sh}
RES=resources

# clear output dir
[ -d "$OUT" ] && rm -r "$OUT"
Expand All @@ -13,8 +15,9 @@ NXF_VER=23.10.0 nextflow run \
-r main_build \
-main-script target/nextflow/method/main.nf \
-profile docker \
--input resources/input1.txt \
--multiple_input "resources/input1.txt;resources/input2.txt" \
-latest \
--input $RES/input1.txt \
--multiple_input "$RES/input1.txt;$RES/input2.txt" \
--publish_dir "$OUT"

# check if output is correct
Expand Down
24 changes: 24 additions & 0 deletions scripts/run_local-code_remote-input_s3-output_local-work_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -e

script_name=$(basename "$0")
OUT=output/${script_name%.sh}
RES=s3://data-intuitive-tmp/test-nextflow-wave-fusion/resources

# clear output dir
[ -d "$OUT" ] && rm -r "$OUT"

# run component
NXF_VER=23.10.0 nextflow run \
viash-io/test-nextflow-wave-fusion \
-r main_build \
-main-script target/nextflow/method/main.nf \
-profile docker \
-latest \
--input $RES/input1.txt \
--multiple_input "$RES/input1.txt;$RES/input2.txt" \
--publish_dir "$OUT"

# check if output is correct
scripts/verify_output.sh "$OUT"
33 changes: 33 additions & 0 deletions scripts/run_local-code_remote-input_s3-output_s3-work_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

script_name=$(basename "$0")
TMPOUT=s3://data-intuitive-tmp/test-nextflow-wave-fusion/output/${script_name%.sh}
OUT=output/${script_name%.sh}
RES=s3://data-intuitive-tmp/test-nextflow-wave-fusion/resources

# clear output dir
echo "Clearing output directory"
aws s3 rm $TMPOUT --recursive
[ -d "$OUT" ] && rm -r "$OUT"

# run component
echo "Running component"
NXF_VER=23.10.0 nextflow run \
viash-io/test-nextflow-wave-fusion \
-r main_build \
-main-script target/nextflow/method/main.nf \
-profile docker \
-latest \
--input $RES/input1.txt \
--multiple_input "$RES/input1.txt;$RES/input2.txt" \
--publish_dir "$TMPOUT"

# sync output
echo "Syncing output"
aws s3 sync $TMPOUT $OUT

# check if output is correct
echo "Checking output"
scripts/verify_output.sh "$OUT"
File renamed without changes.

0 comments on commit ca92c1b

Please sign in to comment.