Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more methods of WDL task disk specification #5001

Merged
merged 78 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3971be6
better disk logic and add logic to mount specific points
stxue1 Jun 29, 2024
48990d0
cromwell compatibility
stxue1 Jun 29, 2024
e8d223c
Convert from wdl string to normal string
stxue1 Jun 29, 2024
fbe0eef
Merge branch 'master' into issues/4995-disk-spec-wdl
stxue1 Jun 29, 2024
8f7199a
floats
stxue1 Jul 1, 2024
166bf41
Merge branch 'issues/4995-disk-spec-wdl' of github.com:DataBiosphere/…
stxue1 Jul 1, 2024
d7719b9
Satisfy mypy
stxue1 Jul 1, 2024
0c131e0
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 2, 2024
b4714ec
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 10, 2024
4443728
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 11, 2024
8da0d7d
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 16, 2024
9379715
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 17, 2024
85a4df9
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 18, 2024
6aa73b1
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 19, 2024
cc36f71
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 19, 2024
36fd277
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 19, 2024
c7bec56
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 20, 2024
4b4e7f0
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 25, 2024
6bf2a4e
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 25, 2024
31b7e27
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 25, 2024
98bba55
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 25, 2024
25e0e51
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 26, 2024
42fedf6
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 29, 2024
d35d033
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 30, 2024
9d75e4b
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Jul 31, 2024
f752535
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 1, 2024
4ce33d5
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 3, 2024
e9df2f9
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 8, 2024
01b8102
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 14, 2024
2955c4d
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 15, 2024
a364601
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 19, 2024
02d873f
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 19, 2024
b65b315
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 21, 2024
6f30676
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 22, 2024
58196ce
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 22, 2024
66d3e50
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 22, 2024
ea19cb6
Follow new spec
stxue1 Aug 23, 2024
32c65dd
mypy
stxue1 Aug 23, 2024
63b4410
Merge branch 'issues/4995-disk-spec-wdl' of github.com:DataBiosphere/…
stxue1 Aug 23, 2024
a1a8651
Support cromwell disks attributes for backwards compatibility
stxue1 Aug 23, 2024
29ffd3f
Deal with pipes deprecation
stxue1 Aug 23, 2024
7068810
Update md5sum test to be compatible with newer docker/singularity ver…
stxue1 Aug 23, 2024
c090823
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Aug 27, 2024
14e2ee1
Merge branch 'master' of github.com:DataBiosphere/toil into issues/49…
stxue1 Aug 29, 2024
901c4c2
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 3, 2024
aa58e2f
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 10, 2024
8b15af6
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 10, 2024
e04f5c1
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 12, 2024
ae2f169
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 16, 2024
eb56ef9
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 16, 2024
a21fc3a
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 16, 2024
1a098b4
Address comments
stxue1 Sep 17, 2024
ceccb07
Merge branch 'issues/4995-disk-spec-wdl' of github.com:DataBiosphere/…
stxue1 Sep 17, 2024
839e09b
Update src/toil/wdl/wdltoil.py
stxue1 Sep 17, 2024
89ca0d4
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 24, 2024
bf3ca2a
Fix missing reverse iteration loop and make local-disk disambiguation…
stxue1 Sep 24, 2024
4130ab8
move out disk parse into a function
stxue1 Sep 24, 2024
d194edc
Fix issues with cromwell compatibility
stxue1 Sep 24, 2024
f2080a8
Move local-disk into parse and dont convert_units in parse function
stxue1 Sep 24, 2024
f0dbe3f
Fix edge case where only size is requested
stxue1 Sep 24, 2024
e6a9082
Add tests
stxue1 Sep 24, 2024
6fbef8c
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 26, 2024
68fb254
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 26, 2024
8d093dd
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 26, 2024
b184386
Remove redef
stxue1 Sep 27, 2024
67b2554
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Sep 30, 2024
7f4b452
Add docstring and remove dead comment
stxue1 Oct 1, 2024
07d6b31
Merge branch 'master' of github.com:DataBiosphere/toil into issues/49…
stxue1 Oct 2, 2024
f3a3a2f
Add back dropped mount_spec argument
stxue1 Oct 2, 2024
9ab5c9c
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 3, 2024
0f247a6
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 3, 2024
067ee8d
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 3, 2024
a7a1459
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 4, 2024
c7ac131
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 4, 2024
806ff9c
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 7, 2024
acaa894
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 8, 2024
accf831
Merge branch 'master' of github.com:DataBiosphere/toil into issues/49…
stxue1 Oct 9, 2024
a0b65f4
Merge master into issues/4995-disk-spec-wdl
github-actions[bot] Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/toil/provisioners/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
import datetime
import logging
import shlex
from shlex import quote
import socket
import subprocess
import time
Expand Down Expand Up @@ -279,7 +279,7 @@ def coreSSH(self, *args, **kwargs):
commandTokens += ['docker', 'exec', '-i', ttyFlag, 'toil_leader']

logger.debug('Node %s: %s', self.effectiveIP, ' '.join(args))
args = list(map(shlex.quote, args))
args = list(map(quote, args))
commandTokens += args
logger.debug('Full command %s', ' '.join(commandTokens))
process = subprocess.Popen(commandTokens, **kwargs)
Expand Down
9 changes: 5 additions & 4 deletions src/toil/test/wdl/md5sum/md5sum.1.0.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ task md5 {
input {
File inputFile
}
command {
/bin/my_md5sum ${inputFile}
}
command <<<
set -euf -o pipefail
md5sum ~{inputFile} | awk '{print $1}' > md5sum.txt
>>>

output {
File value = "md5sum.txt"
}

runtime {
docker: "quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4"
docker: "ubuntu:22.04"
cpu: 1
memory: "512 MB"
disks: "local-disk 10 HDD"
Expand Down
38 changes: 37 additions & 1 deletion src/toil/test/wdl/wdltoil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
needs_wdl,
slow, integrative)
from toil.version import exactPython
from toil.wdl.wdltoil import WDLSectionJob, WDLWorkflowGraph, remove_common_leading_whitespace
from toil.wdl.wdltoil import WDLSectionJob, WDLWorkflowGraph, remove_common_leading_whitespace, parse_disks

import WDL.Expr
import WDL.Error
Expand Down Expand Up @@ -733,6 +733,42 @@ def test_uri_packing(self):

self.assertEqual(unpacked[3], file_basename)

def test_disk_parse(self):
"""
Test to make sure the disk parsing is correct
"""
# Test cromwell compatibility
spec = "local-disk 5 SSD"
specified_mount_point, part_size, part_suffix = parse_disks(spec, spec)
self.assertEqual(specified_mount_point, None)
self.assertEqual(part_size, 5)
self.assertEqual(part_suffix, "GB")

# Test spec conformance
# https://github.com/openwdl/wdl/blob/e43e042104b728df1f1ad6e6145945d2b32331a6/SPEC.md?plain=1#L5072-L5082
spec = "10"
specified_mount_point, part_size, part_suffix = parse_disks(spec, spec)
self.assertEqual(specified_mount_point, None)
self.assertEqual(part_size, 10)
self.assertEqual(part_suffix, "GiB") # WDL spec default

spec = "1 MB"
specified_mount_point, part_size, part_suffix = parse_disks(spec, spec)
self.assertEqual(specified_mount_point, None)
self.assertEqual(part_size, 1)
self.assertEqual(part_suffix, "MB")

spec = "MOUNT_POINT 3"
specified_mount_point, part_size, part_suffix = parse_disks(spec, spec)
self.assertEqual(specified_mount_point, "MOUNT_POINT")
self.assertEqual(part_size, 3)
self.assertEqual(part_suffix, "GiB")

spec = "MOUNT_POINT 2 MB"
specified_mount_point, part_size, part_suffix = parse_disks(spec, spec)
self.assertEqual(specified_mount_point, "MOUNT_POINT")
self.assertEqual(part_size, 2)
self.assertEqual(part_suffix, "MB")


if __name__ == "__main__":
Expand Down
Loading