Skip to content
Merged
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: 3 additions & 1 deletion torchx/components/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def sh(
env: Optional[Dict[str, str]] = None,
max_retries: int = 0,
mounts: Optional[List[str]] = None,
entrypoint: Optional[str] = None,
) -> specs.AppDef:
"""
Runs the provided command via sh. Currently sh does not support
Expand All @@ -100,6 +101,7 @@ def sh(
max_retries: the number of scheduler retries allowed
mounts: mounts to mount into the worker environment/container (ex. type=<bind/volume>,src=/host,dst=/job[,readonly]).
See scheduler documentation for more info.
entrypoint: the entrypoint to use for the command (defaults to sh)
"""

escaped_args = " ".join(shlex.quote(arg) for arg in args)
Expand All @@ -113,7 +115,7 @@ def sh(
specs.Role(
name="sh",
image=image,
entrypoint="sh",
entrypoint=entrypoint or "sh",
args=["-c", escaped_args],
num_replicas=num_replicas,
resource=specs.resource(cpu=cpu, gpu=gpu, memMB=memMB, h=h),
Expand Down
Loading