Skip to content

Commit 48c2a85

Browse files
authored
Allow running shell script from fbpkg
Differential Revision: D69951935 Pull Request resolved: #1010
1 parent 7254961 commit 48c2a85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchx/components/utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def sh(
8383
env: Optional[Dict[str, str]] = None,
8484
max_retries: int = 0,
8585
mounts: Optional[List[str]] = None,
86+
entrypoint: Optional[str] = None,
8687
) -> specs.AppDef:
8788
"""
8889
Runs the provided command via sh. Currently sh does not support
@@ -100,6 +101,7 @@ def sh(
100101
max_retries: the number of scheduler retries allowed
101102
mounts: mounts to mount into the worker environment/container (ex. type=<bind/volume>,src=/host,dst=/job[,readonly]).
102103
See scheduler documentation for more info.
104+
entrypoint: the entrypoint to use for the command (defaults to sh)
103105
"""
104106

105107
escaped_args = " ".join(shlex.quote(arg) for arg in args)
@@ -113,7 +115,7 @@ def sh(
113115
specs.Role(
114116
name="sh",
115117
image=image,
116-
entrypoint="sh",
118+
entrypoint=entrypoint or "sh",
117119
args=["-c", escaped_args],
118120
num_replicas=num_replicas,
119121
resource=specs.resource(cpu=cpu, gpu=gpu, memMB=memMB, h=h),

0 commit comments

Comments
 (0)