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

fix(executor): Do not make unneeded get pod when no sidecars #5161

Merged
merged 4 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ dist/kustomize:
dist/kustomize version

# generates several installation files
manifests/install.yaml: $(CRDS) dist/kustomize
manifests/install.yaml: $(MANIFESTS) dist/kustomize
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixes make codegen not making manifests when changed

./hack/update-image-tags.sh manifests/base $(VERSION)
dist/kustomize build --load_restrictor=none manifests/cluster-install | ./hack/auto-gen-msg.sh > manifests/install.yaml
dist/kustomize build --load_restrictor=none manifests/namespace-install | ./hack/auto-gen-msg.sh > manifests/namespace-install.yaml
Expand Down Expand Up @@ -386,10 +386,12 @@ install: $(MANIFESTS) $(E2E_MANIFESTS) dist/kustomize
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
@echo "installing PROFILE=$(PROFILE) VERSION=$(VERSION), E2E_EXECUTOR=$(E2E_EXECUTOR)"
dist/kustomize build --load_restrictor=none test/e2e/manifests/$(PROFILE) | sed 's/argoproj\//$(IMAGE_NAMESPACE)\//' | sed 's/:latest/:$(VERSION)/' | sed 's/containerRuntimeExecutor: docker/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
ifeq ($(PROFILE),stress)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't need these unless we're running stress and this makes make start faster and more robust

kubectl -n $(KUBE_NAMESPACE) apply -f test/stress/massive-workflow.yaml
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy workflow-controller
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy argo-server
kubectl -n $(KUBE_NAMESPACE) rollout restart deploy minio
endif
ifeq ($(RUN_MODE),kubernetes)
# scale to 2 replicas so we touch upon leader election
kubectl -n $(KUBE_NAMESPACE) scale deploy/workflow-controller --replicas 2
Expand Down
2 changes: 1 addition & 1 deletion hack/test-examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu -o pipefail

kubectl delete wf -l workflows.argoproj.io/test
./dist/argo delete -l workflows.argoproj.io/test
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 make make test-examples more robust


grep -lR 'workflows.argoproj.io/test' examples/* | while read f ; do
./dist/argo submit --watch --verify $f
Expand Down
3 changes: 3 additions & 0 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,9 @@ func (we *WorkflowExecutor) monitorDeadline(ctx context.Context, containerNames
// KillSidecars kills any sidecars to the main container
func (we *WorkflowExecutor) KillSidecars(ctx context.Context) error {
sidecarNames := we.Template.GetSidecarNames()
if len(sidecarNames) == 0 {
return nil // exit early as GetTerminationGracePeriodDuration performs `get pod`
}
log.Infof("Killing sidecars %s", strings.Join(sidecarNames, ","))
terminationGracePeriodDuration, _ := we.GetTerminationGracePeriodDuration(ctx)
return we.RuntimeExecutor.Kill(ctx, sidecarNames, terminationGracePeriodDuration)
Expand Down