-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use bash to run dm commands #111
Conversation
This allows for more debugging when running data movement commands. For instance: ``` time mpirun ... ``` Signed-off-by: Blake Devcich <[email protected]>
@bdevcich-hpe, do I need to wait for this to be deployed? Or is this something that I may run locally somehow? Please advise |
@@ -273,7 +273,7 @@ func (r *DataMovementReconciler) Reconcile(ctx context.Context, req ctrl.Request | |||
log.Info("MPI Hostfile preview", "first line", peekMpiHostfile(mpiHostfile)) | |||
} | |||
|
|||
cmd := exec.CommandContext(ctxCancel, cmdArgs[0], cmdArgs[1:]...) | |||
cmd := exec.CommandContext(ctxCancel, "/bin/bash", "-c", strings.Join(cmdArgs, " ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, how are arguments combined via strings.Join
here? Space-separated I would guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of strings.Join() then needs to be sandwiched between single or double quotes; maybe single quotes so people can't dip into environment variables.
@mcfadden8 You can deploy this branch using |
@@ -273,7 +273,7 @@ func (r *DataMovementReconciler) Reconcile(ctx context.Context, req ctrl.Request | |||
log.Info("MPI Hostfile preview", "first line", peekMpiHostfile(mpiHostfile)) | |||
} | |||
|
|||
cmd := exec.CommandContext(ctxCancel, cmdArgs[0], cmdArgs[1:]...) | |||
cmd := exec.CommandContext(ctxCancel, "/bin/bash", "-c", strings.Join(cmdArgs, " ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of strings.Join() then needs to be sandwiched between single or double quotes; maybe single quotes so people can't dip into environment variables.
This allows for more debugging when running data movement commands. For instance: