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

Bump prov from 1.5.1 to 2.0.0 #1

Open
wants to merge 3 commits into
base: docker-gpu
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ def calc_checksum(location: str) -> Optional[str]:

interesting = {
"DockerRequirement",
"DockerGpuRequirement",
"EnvVarRequirement",
"InitialWorkDirRequirement",
"ShellCommandRequirement",
Expand Down Expand Up @@ -940,6 +941,9 @@ def update_status_output_callback(
j.tmpdir = builder.tmpdir
j.stagedir = builder.stagedir

dockerGpuReq, _ = self.get_requirement("DockerGpuRequirement")
j.docker_gpu_flag = (dockerGpuReq is not None)

inplaceUpdateReq, _ = self.get_requirement("InplaceUpdateRequirement")
if inplaceUpdateReq is not None:
j.inplace_update = cast(bool, inplaceUpdateReq["inplaceUpdate"])
Expand Down
2 changes: 2 additions & 0 deletions cwltool/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ def create_runtime(
runtime = [user_space_docker_cmd, "run"]
else:
runtime = ["docker", "run", "-i"]
if getattr(self, 'docker_gpu_flag', False):
runtime.append('--gpus=all')
self.append_volume(
runtime, os.path.realpath(self.outdir), self.builder.outdir, writable=True
)
Expand Down
3 changes: 2 additions & 1 deletion cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def filter(self, record: logging.LogRecord) -> bool:

supportedProcessRequirements = [
"DockerRequirement",
"DockerGpuRequirement",
"SchemaDefRequirement",
"EnvVarRequirement",
"ScatterFeatureRequirement",
Expand Down Expand Up @@ -1055,7 +1056,7 @@ def validate_hints(
strict=strict,
vocab=self.doc_loader.vocab,
)
elif r["class"] in ("NetworkAccess", "LoadListingRequirement"):
elif r["class"] in ("NetworkAccess", "LoadListingRequirement", "DockerGpuRequirement"):
pass
else:
_logger.info(str(sl.makeError("Unknown hint %s" % (r["class"]))))
Expand Down
2 changes: 2 additions & 0 deletions cwltool/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ def create_runtime(
"--ipc",
"--cleanenv",
]
if getattr(self, 'docker_gpu_flag', False):
runtime.append('--nv')
if _singularity_supports_userns():
runtime.append("--userns")
else:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ruamel.yaml>=0.15,<0.17.11
rdflib>=4.2.2,<6.1
shellescape>=3.4.1,<3.9
schema-salad>=8.1.20210627200047,<9
prov==1.5.1
prov==2.0.0
bagit==1.8.1
mypy-extensions
psutil>=5.6.6
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"schema-salad >= 8.1.20210627200047, < 9",
"mypy-extensions",
"psutil >= 5.6.6",
"prov == 1.5.1",
"prov == 2.0.0",
"bagit >= 1.6.4",
"typing-extensions",
"coloredlogs",
Expand Down