Skip to content

Commit 1379dfe

Browse files
committed
refactor: support pid shared
Signed-off-by: thxCode <[email protected]>
1 parent 323cc2f commit 1379dfe

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

gpustack_runtime/deployer/__types__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ class WorkloadPlan(WorkloadSecurity):
630630
Labels for the workload.
631631
host_network (bool):
632632
Indicates if the workload uses the host network.
633+
633634
shm_size (int | str | None):
634635
Configure shared memory size for the workload.
635636
run_as_user (int | None):
@@ -659,6 +660,10 @@ class WorkloadPlan(WorkloadSecurity):
659660
"""
660661
Indicates if the workload uses the host network.
661662
"""
663+
pid_shared: bool = False
664+
"""
665+
Indicates if the workload shares the PID namespace.
666+
"""
662667
shm_size: int | str | None = None
663668
"""
664669
Configure shared memory size for the workload.

gpustack_runtime/deployer/docker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ def _create_containers(
643643
if not workload.host_network:
644644
create_params["hostname"] = c.name
645645

646+
if workload.pid_shared:
647+
create_params["pid_mode"] = "container:{workload.name}-pause"
648+
646649
if workload.shm_size:
647650
create_params["shm_size"] = workload.shm_size
648651

0 commit comments

Comments
 (0)