Skip to content
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

feat(controller) Emissary executor. #4925

Merged
merged 21 commits into from
Feb 24, 2021
Merged

feat(controller) Emissary executor. #4925

merged 21 commits into from
Feb 24, 2021

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Jan 21, 2021

docs/workflow-executors.md Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
}
volumeMountVarArgo = apiv1.VolumeMount{
Name: volumeVarArgo.Name,
MountPath: "/var/run/argo",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving to a constant (similarly for other strings)?

workflow/controller/workflowpod.go Outdated Show resolved Hide resolved
if len(c.Command) == 0 {
c.Command = woc.getCommandFor(c.Image)
}
if len(c.Command) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readability suggestion: consider checking length of woc.getCommandFor(c.Image) instead so that these two same if conditions can be merged.

}
}

func (e emissary) isComplete(containerNames []string) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (e emissary) isComplete(containerNames []string) bool {
func (e emissary) isCompleted(containerNames []string) bool {

func (e emissary) CopyFile(_ string, sourcePath string, destPath string, _ int) error {
// this implementation is very different, because we expect the emissary binary has already compressed the file
// so no compression can or needs to be implemented here
// TODO - warn the user we ignored compression?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can perhaps just add a note on this in the executor documentation

command.Env = os.Environ()
command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}

stdout, err := os.Create(varArgo + "/ctr/" + containerName + "/stdout")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware we only need to capture stdout for (a) main containers and (b) if there our outputs - v1.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use ioutil.Discard for that

}
}
} else {
println("not saving outputs - not main container")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be mingled with the containers logs, it might be good to make it conventional, e.g.

#argo msg=not saving outputs

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is something missing in the implementation. As far as I can tell, we can infer an image's entrypoint with the configmap setting but we are not able to infer the image's args.

Based on past experience, the interplay between command and args is nuanced. e.g. "If you supply a command but no args for a Container, only the supplied command is used". So we would need to replicate this behavior in the emissary. See kubernetes docs:

https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes

manifests/quick-start-minimal.yaml Outdated Show resolved Hide resolved
@alexec
Copy link
Contributor Author

alexec commented Feb 23, 2021

@jessesuen I've updated this PR to allow you to specify both command and args in the config. Arguments are only actually need under the scenario when the command is missing. I worked through the 4 rules to determine this.

Comment on lines 138 to 146
# The command for each image, needed when the command is not specified and the emissary executor is used.
# https://argoproj.github.io/argo-workflows/workflow-executors/#image-command-index
images: |
argoproj/argosay:v1: [cowsay]
argoproj/argosay:v2: [/argosay]
docker/whalesay:latest: [cowsay]
python:alpine3.6: [python3]


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doc needs to be corrected.

@alexec
Copy link
Contributor Author

alexec commented Feb 24, 2021

Let's do this!!!

@alexec alexec merged commit ab36166 into argoproj:master Feb 24, 2021
@alexec alexec deleted the emissary branch February 24, 2021 03:31
@terrytangyuan
Copy link
Member

Hooray! Thanks for your work on this! @alexec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants