@@ -170,8 +170,10 @@ class ContainerExecution(ContainerSecurity):
170170 Attributes:
171171 working_dir (str | None):
172172 Working directory for the container.
173- entrypoint (str | None):
174- Entrypoint content for the container,
173+ command (list[str] | None):
174+ Command to run in the container.
175+ command_script (str | None):
176+ Command(in form of script) for the container,
175177 only work if `readonly_rootfs` is False.
176178 When it is set, it will override the `command` field.
177179 For example,
@@ -182,8 +184,6 @@ class ContainerExecution(ContainerSecurity):
182184 echo "Hello, World!"
183185 exec /path/to/bin "$@"
184186 ```
185- command (list[str] | None):
186- Command to run in the container.
187187 args (list[str] | None):
188188 Arguments to pass to the command.
189189 run_as_user (int | None):
@@ -204,9 +204,13 @@ class ContainerExecution(ContainerSecurity):
204204 """
205205 Working directory for the container.
206206 """
207- entrypoint : str | None = None
207+ command : list [str ] | None = None
208+ """
209+ Command to run in the container.
210+ """
211+ command_script : str | None = None
208212 """
209- Entrypoint content for the container,
213+ Command(in form of script) for the container,
210214 only work if `readonly_rootfs` is False.
211215 When it is set, it will override the `command` field.
212216 For example,
@@ -218,10 +222,6 @@ class ContainerExecution(ContainerSecurity):
218222 exec /path/to/bin "$@"
219223 ```
220224 """
221- command : list [str ] | None = None
222- """
223- Command to run in the container.
224- """
225225 args : list [str ] | None = None
226226 """
227227 Arguments to pass to the command.
@@ -1001,22 +1001,22 @@ def validate_and_default(self):
10011001 c .restart_policy = ContainerRestartPolicyEnum .NEVER
10021002 elif not c .restart_policy :
10031003 c .restart_policy = ContainerRestartPolicyEnum .ALWAYS
1004- # Mutate container entrypoint .
1005- if c .execution and c .execution .entrypoint :
1004+ # Mutate container command .
1005+ if c .execution and c .execution .command_script :
10061006 if c .execution .readonly_rootfs :
1007- msg = f"Readonly rootfs Container '{ c .name } ' cannot have an entrypoint ."
1007+ msg = f"Readonly rootfs Container '{ c .name } ' cannot configure `command_script` ."
10081008 raise ValueError (msg )
1009- entrypoint_script_name = f"/gpustack-entrypoint -{ fnv1a_32_hex (c .name )} "
1010- entrypoint_file = ContainerFile (
1011- path = entrypoint_script_name ,
1009+ command_script_name = f"/gpustack-command -{ fnv1a_32_hex (c .name )} "
1010+ command_script = ContainerFile (
1011+ path = command_script_name ,
10121012 mode = 0o755 ,
1013- content = c .execution .entrypoint ,
1013+ content = c .execution .command_script ,
10141014 )
10151015 if not c .files :
10161016 c .files = []
1017- c .files .append (entrypoint_file )
1018- c .execution .command = [entrypoint_script_name ] # Override command.
1019- c .execution .entrypoint = None
1017+ c .files .append (command_script )
1018+ c .execution .command = [command_script_name ] # Override command.
1019+ c .execution .command_script = None
10201020 # Add default registry if needed.
10211021 if (
10221022 envs .GPUSTACK_RUNTIME_DEPLOY_DEFAULT_REGISTRY
0 commit comments