-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only mount reference disks if requested [WX-925]
- Loading branch information
Showing
5 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...n/resources/standardTestCases/reference_disk/reference_disk_mounted_only_if_requested.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version 1.0 | ||
|
||
|
||
workflow ReferenceDiskMountedOnlyIfRequested { | ||
call MentionsNirvanaReference {} | ||
output { | ||
Boolean disk_mounted = MentionsNirvanaReference.disk_mounted | ||
} | ||
} | ||
|
||
|
||
task MentionsNirvanaReference { | ||
input { | ||
# Tiny 116 byte reference file, certainly not worth attaching a 55 GiB Nirvana reference disk for this. | ||
File mention = | ||
"gs://broad-public-datasets/gvs/vat-annotations/Nirvana/3.18.1/SupplementaryAnnotation/GRCh38/MITOMAP_20200819.nsa.idx" | ||
} | ||
command <<< | ||
PS4='\D{+%F %T} \w $ ' | ||
set -o nounset -o xtrace | ||
|
||
# Debug output | ||
lsblk | ||
|
||
CANDIDATE_MOUNT_POINT=$(lsblk | sed -E -n 's!.*(/mnt/[a-f0-9]+).*!\1!p') | ||
|
||
if [[ ! -z ${CANDIDATE_MOUNT_POINT} ]]; then | ||
echo "Found unexpected mounted disk, investigating further." | ||
find ${CANDIDATE_MOUNT_POINT} -print | tee find.out | ||
|
||
if grep -i nirvana find.out; then | ||
echo "Found what appears to be a Nirvana reference disk." | ||
else | ||
echo "Found unknown volume mounted, see 'find.out' for manifest." | ||
fi | ||
echo true > disk_mounted.out | ||
else | ||
echo false > disk_mounted.out | ||
fi | ||
>>> | ||
runtime { | ||
docker: "ubuntu:latest" | ||
backend: "Papiv2-Reference-Disk-Localization" | ||
} | ||
output { | ||
Boolean disk_mounted = read_boolean("disk_mounted.out") | ||
File? find_out = "find.out" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../src/main/resources/standardTestCases/reference_disk_mounted_only_if_requested_false.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: reference_disk_mounted_only_if_requested_false | ||
testFormat: workflowsuccess | ||
backends: [Papiv2-Reference-Disk-Localization] | ||
|
||
files { | ||
workflow: reference_disk/reference_disk_mounted_only_if_requested.wdl | ||
options: reference_disk/reference_disk_test_false.options.json | ||
} | ||
|
||
metadata { | ||
workflowName: ReferenceDiskMountedOnlyIfRequested | ||
status: Succeeded | ||
"outputs.ReferenceDiskMountedOnlyIfRequested.disk_mounted": false | ||
} |
14 changes: 14 additions & 0 deletions
14
...r/src/main/resources/standardTestCases/reference_disk_mounted_only_if_requested_true.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: reference_disk_mounted_only_if_requested_true | ||
testFormat: workflowsuccess | ||
backends: [Papiv2-Reference-Disk-Localization] | ||
|
||
files { | ||
workflow: reference_disk/reference_disk_mounted_only_if_requested.wdl | ||
options: reference_disk/reference_disk_test_true.options.json | ||
} | ||
|
||
metadata { | ||
workflowName: ReferenceDiskMountedOnlyIfRequested | ||
status: Succeeded | ||
"outputs.ReferenceDiskMountedOnlyIfRequested.disk_mounted": true | ||
} |
14 changes: 14 additions & 0 deletions
14
...ain/resources/standardTestCases/reference_disk_mounted_only_if_requested_unspecified.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: reference_disk_mounted_only_if_requested_unspecified | ||
testFormat: workflowsuccess | ||
backends: [Papiv2-Reference-Disk-Localization] | ||
|
||
files { | ||
workflow: reference_disk/reference_disk_mounted_only_if_requested.wdl | ||
options: reference_disk/reference_disk_test_unspecified.options.json | ||
} | ||
|
||
metadata { | ||
workflowName: ReferenceDiskMountedOnlyIfRequested | ||
status: Succeeded | ||
"outputs.ReferenceDiskMountedOnlyIfRequested.disk_mounted": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters