-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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(executor): Minimize the number of Kubernetes API requests made by executors #4954
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
f84fb1a
feat(executor): Remove need for watch
alexec 9a6a1de
feat(executor): Remove need for watch
alexec 64862b4
test: More tests
alexec c04090d
test: More tests
alexec e614705
Merge branch 'more-tests' into now
alexec 146a599
test: More tests
alexec 964db59
Merge branch 'more-tests' into now
alexec b7785e0
feat(executor): Remove need for watch
alexec 4e8736f
Merge branch 'master' into now
alexec e1ea2e9
feat(executor): Remove need for watch
alexec 0cd51e1
feat(executor): Log summary of Kubernetes API requests
alexec d2400a6
remove TODO
alexec b34ce98
feat(executor): Remove need for watch
alexec a786ffa
feat(executor): Log summary of Kubernetes API requests
alexec 80826b0
Merge branch 'log-k8s' into now
alexec a445964
must be 1 not zero
alexec fa0b467
test: Fix TestDeletingRunningPod
alexec fa36044
test: Fix TestDeletingRunningPod
alexec 6b55b95
Merge branch 'master' into log-k8s
alexec e3ddc51
Merge branch 'fix-test' into log-k8s
alexec a019630
Merge branch 'log-k8s' into now
alexec c879e13
Merge branch 'master' into now
alexec a18332f
feat(executor): Log summary of Kubernetes API requests
alexec ef05ccd
Merge branch 'log-k8s' into now
alexec 14842ab
there might not be any sidecars
alexec 50d063e
also update stress test argoexec
alexec 9668016
feat(executor): Remove need for watch
alexec 37fa9ab
feat(executor): Remove need for watch
alexec 8e54372
Merge branch 'master' into now
alexec 42a0181
feat(executor): Remove need for watch
alexec 51ff45e
feat(executor): Remove need for watch
alexec 69baf76
feat(executor): Remove need for watch
alexec 17c53a3
Merge branch 'master' into log-k8s
alexec 625e4e0
feat(executor): Log summary of Kubernetes API requests
alexec 284e9a4
feat(executor): Log summary of Kubernetes API requests
alexec cfeb9a5
Merge branch 'master' into log-k8s
alexec 8657824
Merge branch 'master' into now
alexec 95dd6c4
Merge branch 'log-k8s' into now
alexec a3a60fc
Merge branch 'master' into now
alexec 643d0bc
ignore build images
alexec 5cb9570
feat(executor): Remove need for watch
alexec c214f8e
Merge branch 'master' into now
alexec 1da3726
feat(executor): Remove need for watch
alexec ec5246e
feat(executor): Remove need for watch
alexec 6a56fe2
feat(executor): Remove need for watch
alexec 4b62841
feat(executor): Remove need for watch
alexec ea6f832
Merge branch 'master' into now
alexec a5ae663
feat(executor): Remove need for watch
alexec 42d86ac
feat(executor): Remove need for watch
alexec fefed4c
feat(executor): Remove need for watch
alexec f1ac596
feat(executor): Remove need for watch
alexec 560347d
ignore test
alexec 394a721
ignore test
alexec 94a778b
Merge branch 'master' into now
alexec 2c87588
feat(executor): Remove need for watch
alexec ca47612
feat(executor): Remove need for watch
alexec dbb20c4
Merge branch 'master' into now
alexec b6edcc8
Merge branch 'master' into now
alexec a98f414
feat(executor): Remove need for watch
alexec 48d86c3
Merge branch 'master' into now
alexec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,11 @@ func (woc *wfOperationCtx) createWorkflowPod(ctx context.Context, nodeName strin | |
} | ||
addOutputArtifactsVolumes(pod, tmpl) | ||
|
||
for i, c := range pod.Spec.Containers { | ||
c.Env = append(c.Env, apiv1.EnvVar{Name: common.EnvVarContainerName, Value: c.Name}) // used to identify the container name of the process | ||
pod.Spec.Containers[i] = c | ||
} | ||
|
||
// Set the container template JSON in pod annotations, which executor examines for things like | ||
// artifact location/path. | ||
tmplBytes, err := json.Marshal(tmpl) | ||
|
@@ -428,13 +433,13 @@ func substitutePodParams(pod *apiv1.Pod, globalParams common.Parameters, tmpl *w | |
|
||
func (woc *wfOperationCtx) newInitContainer(tmpl *wfv1.Template) apiv1.Container { | ||
ctr := woc.newExecContainer(common.InitContainerName, tmpl) | ||
ctr.Command = []string{"argoexec", "init"} | ||
ctr.Command = []string{"argoexec", "init", "--loglevel", getExecutorLogLevel()} | ||
return *ctr | ||
} | ||
|
||
func (woc *wfOperationCtx) newWaitContainer(tmpl *wfv1.Template) (*apiv1.Container, error) { | ||
ctr := woc.newExecContainer(common.WaitContainerName, tmpl) | ||
ctr.Command = []string{"argoexec", "wait"} | ||
ctr.Command = []string{"argoexec", "wait", "--loglevel", getExecutorLogLevel()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
switch woc.controller.GetContainerRuntimeExecutor() { | ||
case common.ContainerRuntimeExecutorPNS: | ||
ctr.SecurityContext = &apiv1.SecurityContext{ | ||
|
@@ -459,6 +464,10 @@ func (woc *wfOperationCtx) newWaitContainer(tmpl *wfv1.Template) (*apiv1.Contain | |
return ctr, nil | ||
} | ||
|
||
func getExecutorLogLevel() string { | ||
return log.GetLevel().String() | ||
} | ||
|
||
// hasPrivilegedContainers tests if the main container or sidecars is privileged | ||
func hasPrivilegedContainers(tmpl *wfv1.Template) bool { | ||
if containerIsPrivileged(tmpl.Container) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this code is much cleaner now