Skip to content

Commit

Permalink
WX-927 GCP Batch custom mount points tests (#7534)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr committed Sep 11, 2024
1 parent 7176a53 commit b982f6f
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
name: custom_mount_point
testFormat: workflowsuccess

# Error returned to Centaur:
#
# Task custom_mount_point.t:NA:1 failed: Job state is set from RUNNING to FAILED for job projects/blah/locations/us-central1/jobs/job-blah-blah.Job failed due to task failure. Specifically, task with index 0 failed due to the following task event: \"Task state is updated from RUNNING to FAILED on zones/us-central1-b/instances/blah with exit code 125.
#
# Exit code 125 appears to be a Docker invocation error. Seeing the following in the logs which seems to suggest the mount point could not be created:
# docker: Error response from daemon: error while creating mount source path '/some/mnt': mkdir /some: read-only file system.
#
# The /some/mnt volume appears to be mounted read-write:
# "volumes": [
# "/mnt/disks/cromwell_root:/mnt/disks/cromwell_root:rw",
# "/some/mnt:/some/mnt:rw"
# ]

backends: [Papi, GCPBATCH_FAIL]
backends: [Papi, GCPBATCH_ALT]

files {
workflow: custom_mount_point/custom_mount_point.wdl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 1) Mounting a SSD to a custom location and default location with custom disk size
# 2) Write a file to that mount
# 3) Changing directory within a command shouldn't break Cromwell
# 4) Use the file that was written on the mount as an output
# ChrisTM
task t {
String v

command {
echo "bazqux" > some_file

cd /mnt/disks/some
echo "foobar" > some_file
}

output {
String out1 = read_string("some_file")
String out2 = read_string("/mnt/disks/some/some_file")
}

runtime {
docker: "ubuntu:" + v
disks: "local-disk 20 SSD, /mnt/disks/some 20 SSD"
}
}

workflow custom_mount_point {
call t {input: v="latest"}

output {
String o1 = t.out1
String o2 = t.out2
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: draft3_custom_mount_point
testFormat: workflowsuccess
# probably failing similarly to custom_mount_point
backends: [Papi, GCPBATCH_FAIL]
backends: [Papi, GCPBATCH_ALT]

files {
workflow: wdl_draft3/custom_mount_point/custom_mount_point.wdl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: gcpbatch_custom_mount_point
testFormat: workflowsuccess

backends: [GCPBATCH]

files {
workflow: custom_mount_point/gcpbatch_custom_mount_point.wdl
# https://github.com/broadinstitute/cromwell/issues/3998
options: custom_mount_point/custom_mount_point.options
}

metadata {
"calls.custom_mount_point.t.backend": "GCPBATCH"
"calls.custom_mount_point.t.backendStatus": "Success"

"outputs.custom_mount_point.o1": "bazqux"
"outputs.custom_mount_point.o2": "foobar"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: gcpbatch_draft3_custom_mount_point
testFormat: workflowsuccess
backends: [GCPBATCH]

files {
workflow: wdl_draft3/custom_mount_point/gcpbatch_custom_mount_point.wdl
# https://github.com/broadinstitute/cromwell/issues/3998
options: wdl_draft3/custom_mount_point/custom_mount_point.options
}

metadata {
"calls.custom_mount_point.local_and_custom.backend": "GCPBATCH"
"calls.custom_mount_point.local_and_custom.backendStatus": "Success"

"calls.custom_mount_point.local_only.backend": "GCPBATCH"
"calls.custom_mount_point.local_only.backendStatus": "Success"

"calls.custom_mount_point.custom_only.backend": "GCPBATCH"
"calls.custom_mount_point.custom_only.backendStatus": "Success"

"outputs.custom_mount_point.o1": "local disk contents"
"outputs.custom_mount_point.o2": "custom mount contents"
"outputs.custom_mount_point.o3": "local disk contents"
"outputs.custom_mount_point.o4": "custom mount contents"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
version 1.0

task local_and_custom {
input {
String v
}


output {
String out1 = read_string("some_file")
String out2 = read_string("/mnt/disks/some/some_file")
}
command <<<

echo "local disk contents" > some_file

cd /mnt/disks/some
echo "custom mount contents" > some_file

>>>
runtime {
docker: "ubuntu:" + v
disks: "local-disk 20 SSD, /mnt/disks/some 20 SSD"
}

}

task local_only {

input {
String v
}

command {
echo "local disk contents" > some_file
}

runtime {
docker: "ubuntu:" + v
disks: "local-disk 20 SSD"
}

output {
String out = read_string("some_file")
}
}

task custom_only {

input {
String v
}

command {
cd /mnt/disks/some
echo "custom mount contents" > some_file
}

runtime {
docker: "ubuntu:" + v
disks: "/mnt/disks/some 20 SSD"
}

output {
String out = read_string("/mnt/disks/some/some_file")
}
}

workflow custom_mount_point {

call local_and_custom {
input:
v = "latest"
}

call local_only {
input:
v = "latest"
}

call custom_only {
input:
v = "latest"
}

output {
String o1 = local_and_custom.out1
String o2 = local_and_custom.out2
String o3 = local_only.out
String o4 = custom_only.out
}
}
12 changes: 12 additions & 0 deletions docs/backends/GCPBatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ The current default label set automatically applied is:

Any custom labels provided as '`google_labels`' in the [workflow options](../wf_options/Google) are also applied to Google resources by GCP Batch.

### Custom Mount Points

Cromwell's GCP Batch backend supports custom mount points as documented [here](../RuntimeAttributes.md#disks), with the caveat that all custom mount points must be specified under `/mnt/disks`.

e.g. a GCP Batch custom mount point specification should look like:

```
runtime {
disks: "/mnt/disks/my_mnt 30 SSD, /mnt/disks/my_mnt2 500 HDD"
}
```

### Virtual Private Network

Cromwell can arrange for jobs to run in specific GCP private networks via the `config.virtual-private-cloud` stanza of a Batch backend.
Expand Down

0 comments on commit b982f6f

Please sign in to comment.