Common method for command execution #291
Labels
dvc
enhancement
New feature or request
p2-nice-to-have
Low priority
resource-task
iterative_task TF resource
It would be nice1 to have an
Execute
method to run commands in any of the active instances.terraform-provider-iterative/task/task.go
Lines 37 to 47 in 57625b6
Loose ends
[0, parallelism[
and return an error if there aren't enough instances running to satisfy the requested index.Pick a random instance every time.I had to include it. 😂Draft proposal
Execute(instance uint16, input string, command ...string) (Result, error)
instance
represents the instance index in the range[0, parallelism[
; maybe we can use a string identifier instead.input
optionally, the standard input to feed the remote command with;""
will disable this function.command
is the slice of exec–like arguments; “no arguments” can default tosh
orbash
if appropriate.Result
is astruct
containingExecuteTTY(instance uint16, streams Streams, command ...string) error
Same as above but with TTY and interactive streams, so it behaves like an ordinary SSH session. See
kubectl exec
for an example implementation.Footnotes
Not necessary because Integrate task resource #237 eliminates the need of SSH by implementing Standardize on logs and storage for communication #126 ↩
The text was updated successfully, but these errors were encountered: