Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
880db75d
Unverified
Commit
880db75d
authored
Feb 27, 2026
by
Julien Mancuso
Committed by
GitHub
Feb 27, 2026
Browse files
fix: shell-quote Ray leader args (#6693)
Signed-off-by:
Julien Mancuso
<
jmancuso@nvidia.com
>
parent
d8b7d394
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
8 deletions
+37
-8
deploy/operator/internal/dynamo/backend_vllm.go
deploy/operator/internal/dynamo/backend_vllm.go
+10
-6
deploy/operator/internal/dynamo/backend_vllm_test.go
deploy/operator/internal/dynamo/backend_vllm_test.go
+21
-0
deploy/operator/internal/dynamo/utils.go
deploy/operator/internal/dynamo/utils.go
+6
-2
No files found.
deploy/operator/internal/dynamo/backend_vllm.go
View file @
880db75d
...
@@ -207,12 +207,16 @@ func injectMpDistributedLaunchFlags(container *corev1.Container, role Role, serv
...
@@ -207,12 +207,16 @@ func injectMpDistributedLaunchFlags(container *corev1.Container, role Role, serv
func
injectRayDistributedLaunchFlags
(
container
*
corev1
.
Container
,
role
Role
,
serviceName
string
,
multinodeDeployer
MultinodeDeployer
)
{
func
injectRayDistributedLaunchFlags
(
container
*
corev1
.
Container
,
role
Role
,
serviceName
string
,
multinodeDeployer
MultinodeDeployer
)
{
switch
role
{
switch
role
{
case
RoleLeader
:
case
RoleLeader
:
fullCommand
:=
strings
.
Join
(
container
.
Command
,
" "
)
quotedCmd
:=
make
([]
string
,
len
(
container
.
Command
))
originalArgs
:=
strings
.
Join
(
container
.
Args
,
" "
)
for
i
,
tok
:=
range
container
.
Command
{
// Use Ray executor for multi-node vLLM deployments.
quotedCmd
[
i
]
=
shellQuoteForBashC
(
tok
)
// vLLM will create a placement group spanning all Ray nodes and spawn workers automatically.
}
// DO NOT pass --nnodes or --node-rank - these are only for mp backend.
fullCommand
:=
strings
.
Join
(
quotedCmd
,
" "
)
// The Ray executor handles multi-node distribution via placement groups.
quotedArgs
:=
make
([]
string
,
len
(
container
.
Args
))
for
i
,
arg
:=
range
container
.
Args
{
quotedArgs
[
i
]
=
shellQuoteForBashC
(
arg
)
}
originalArgs
:=
strings
.
Join
(
quotedArgs
,
" "
)
vllmMultinodeFlags
:=
"--distributed-executor-backend ray"
vllmMultinodeFlags
:=
"--distributed-executor-backend ray"
container
.
Args
=
[]
string
{
fmt
.
Sprintf
(
"ray start --head --port=%s && %s %s %s"
,
VLLMPort
,
fullCommand
,
originalArgs
,
vllmMultinodeFlags
)}
container
.
Args
=
[]
string
{
fmt
.
Sprintf
(
"ray start --head --port=%s && %s %s %s"
,
VLLMPort
,
fullCommand
,
originalArgs
,
vllmMultinodeFlags
)}
case
RoleWorker
:
case
RoleWorker
:
...
...
deploy/operator/internal/dynamo/backend_vllm_test.go
View file @
880db75d
...
@@ -48,6 +48,27 @@ func TestVLLMBackend_UpdateContainer(t *testing.T) {
...
@@ -48,6 +48,27 @@ func TestVLLMBackend_UpdateContainer(t *testing.T) {
expectedArgs
:
[]
string
{
fmt
.
Sprintf
(
"ray start --head --port=%s && python3 -m dynamo.vllm --model test %s 8 --distributed-executor-backend ray"
,
VLLMPort
,
tensorParallelSizeFlag
)},
expectedArgs
:
[]
string
{
fmt
.
Sprintf
(
"ray start --head --port=%s && python3 -m dynamo.vllm --model test %s 8 --distributed-executor-backend ray"
,
VLLMPort
,
tensorParallelSizeFlag
)},
expectProbesRemoved
:
true
,
expectProbesRemoved
:
true
,
},
},
{
name
:
"multinode leader uses ray with JSON args (no annotations = legacy)"
,
numberOfNodes
:
3
,
role
:
RoleLeader
,
component
:
&
v1alpha1
.
DynamoComponentDeploymentSharedSpec
{},
multinodeDeployer
:
&
GroveMultinodeDeployer
{},
initialContainer
:
&
corev1
.
Container
{
Command
:
[]
string
{
"python3"
,
"-m"
,
"dynamo.vllm"
},
Args
:
[]
string
{
"--model"
,
"test"
,
tensorParallelSizeFlag
,
"8"
,
"--kv-transfer-config"
,
`{"kv_connector": "NixlConnector", "kv_role": "kv_both"}`
,
},
},
gpuCount
:
4
,
expectedArgs
:
[]
string
{
fmt
.
Sprintf
(
`ray start --head --port=%s && python3 -m dynamo.vllm --model test %s 8 --kv-transfer-config "{\"kv_connector\": \"NixlConnector\", \"kv_role\": \"kv_both\"}" --distributed-executor-backend ray`
,
VLLMPort
,
tensorParallelSizeFlag
,
)},
expectProbesRemoved
:
true
,
},
{
{
name
:
"multinode worker uses ray (no annotations = legacy)"
,
name
:
"multinode worker uses ray (no annotations = legacy)"
,
numberOfNodes
:
3
,
numberOfNodes
:
3
,
...
...
deploy/operator/internal/dynamo/utils.go
View file @
880db75d
...
@@ -48,9 +48,13 @@ func injectFlagsIntoContainerCommand(container *corev1.Container, flags string,
...
@@ -48,9 +48,13 @@ func injectFlagsIntoContainerCommand(container *corev1.Container, flags string,
// Direct python command case
// Direct python command case
if
needsShell
{
if
needsShell
{
// Transform to shell wrapper for env var interpretation.
// Transform to shell wrapper for env var interpretation.
// Quote each
original arg
individually so
JSON and othe
r special
// Quote each
token
individually so
paths with spaces o
r special
// characters survive shell interpretation.
// characters survive shell interpretation.
fullCommand
:=
strings
.
Join
(
container
.
Command
,
" "
)
quotedCmd
:=
make
([]
string
,
len
(
container
.
Command
))
for
i
,
tok
:=
range
container
.
Command
{
quotedCmd
[
i
]
=
shellQuoteForBashC
(
tok
)
}
fullCommand
:=
strings
.
Join
(
quotedCmd
,
" "
)
quotedArgs
:=
make
([]
string
,
len
(
container
.
Args
))
quotedArgs
:=
make
([]
string
,
len
(
container
.
Args
))
for
i
,
arg
:=
range
container
.
Args
{
for
i
,
arg
:=
range
container
.
Args
{
quotedArgs
[
i
]
=
shellQuoteForBashC
(
arg
)
quotedArgs
[
i
]
=
shellQuoteForBashC
(
arg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment