Skip to content

Commit

Permalink
feat(executor): default executor to emissary. Fixes #6785 (#6882)
Browse files Browse the repository at this point in the history
Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
  • Loading branch information
tczhao committed Oct 18, 2021
1 parent 67fe87b commit b0d1f65
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ install:
kubectl get ns $(KUBE_NAMESPACE) || kubectl create ns $(KUBE_NAMESPACE)
kubectl config set-context --current --namespace=$(KUBE_NAMESPACE)
@echo "installing PROFILE=$(PROFILE), E2E_EXECUTOR=$(E2E_EXECUTOR)"
kubectl kustomize --load-restrictor=LoadRestrictionsNone test/e2e/manifests/$(PROFILE) | sed 's|quay.io/argoproj/|$(IMAGE_NAMESPACE)/|' | sed 's/containerRuntimeExecutor: docker/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | sed 's/namespace: argo/namespace: $(KUBE_NAMESPACE)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
kubectl kustomize --load-restrictor=LoadRestrictionsNone test/e2e/manifests/$(PROFILE) | sed 's|quay.io/argoproj/|$(IMAGE_NAMESPACE)/|' | sed 's/containerRuntimeExecutor: emissary/containerRuntimeExecutor: $(E2E_EXECUTOR)/' | sed 's/namespace: argo/namespace: $(KUBE_NAMESPACE)/' | kubectl -n $(KUBE_NAMESPACE) apply --prune -l app.kubernetes.io/part-of=argo -f -
ifeq ($(PROFILE),stress)
kubectl -n $(KUBE_NAMESPACE) apply -f test/stress/massive-workflow.yaml
endif
Expand Down
6 changes: 3 additions & 3 deletions cmd/argoexec/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func initExecutor() *executor.WorkflowExecutor {
cre, err = kubelet.NewKubeletExecutor(namespace, podName)
case common.ContainerRuntimeExecutorPNS:
cre, err = pns.NewPNSExecutor(clientset, podName, namespace)
case common.ContainerRuntimeExecutorEmissary:
cre, err = emissary.New()
default:
case common.ContainerRuntimeExecutorDocker:
cre, err = docker.NewDockerExecutor(namespace, podName)
default:
cre, err = emissary.New()
}
checkErr(err)

Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Config struct {
// KubeConfig specifies a kube config file for the wait & init containers
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`

// ContainerRuntimeExecutor specifies the container runtime interface to use, default is docker
// ContainerRuntimeExecutor specifies the container runtime interface to use, default is emissary
ContainerRuntimeExecutor string `json:"containerRuntimeExecutor,omitempty"`

ContainerRuntimeExecutors ContainerRuntimeExecutors `json:"containerRuntimeExecutors,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2229,8 +2229,6 @@ Outputs hold parameters, artifacts, and results from a step

- [`pod-spec-from-previous-step.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/pod-spec-from-previous-step.yaml)

- [`selected-executor-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/selected-executor-workflow.yaml)

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/suspend-template-outputs.yaml)

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)
Expand Down Expand Up @@ -2517,8 +2515,6 @@ Parameter indicate a passed string parameter to a service template with an optio

- [`scripts-python.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/scripts-python.yaml)

- [`selected-executor-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/selected-executor-workflow.yaml)

- [`step-level-timeout.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/step-level-timeout.yaml)

- [`steps.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/steps.yaml)
Expand Down Expand Up @@ -3807,8 +3803,6 @@ ValueFrom describes a location in which to obtain the value to a parameter

- [`secrets.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/secrets.yaml)

- [`selected-executor-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/selected-executor-workflow.yaml)

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/suspend-template-outputs.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)
Expand Down Expand Up @@ -4646,8 +4640,6 @@ _No description available_

- [`secrets.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/secrets.yaml)

- [`selected-executor-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/selected-executor-workflow.yaml)

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/suspend-template-outputs.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)
Expand Down Expand Up @@ -6797,8 +6789,6 @@ EnvVarSource represents a source for the value of an EnvVar.

- [`secrets.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/secrets.yaml)

- [`selected-executor-workflow.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/selected-executor-workflow.yaml)

- [`suspend-template-outputs.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/suspend-template-outputs.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)
Expand Down
12 changes: 8 additions & 4 deletions docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ data:
# Specifies the container runtime interface to use (default: docker)
# Specifies the container runtime interface to use (default: emissary)
# must be one of: docker, kubelet, k8sapi, pns, emissary
# It has lower precedence than either `--container-runtime-executor` and `containerRuntimeExecutors`.
containerRuntimeExecutor: docker
containerRuntimeExecutor: emissary

# Specifies the executor to use.
#
Expand All @@ -156,10 +156,14 @@ data:
# The list is in order of precedence; the first matching executor is used.
# This has precedence over `containerRuntimeExecutor`.
containerRuntimeExecutors: |
- name: k8sapi
- name: emissary
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: k8sapi
workflows.argoproj.io/container-runtime-executor: emissary
- name: pns
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: pns
# Specifies the location of docker.sock on the host for docker executor (default: /var/run/docker.sock)
# (available since Argo v2.4)
Expand Down
16 changes: 6 additions & 10 deletions examples/selected-executor-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
labels:
# run this workflow as a part of our test suite
workflows.argoproj.io/test: "true"
# use the k8sapi executor, rather than the default (typically docker)
workflows.argoproj.io/container-runtime-executor: k8sapi
# use the pns executor, rather than the default (typically emissary)
workflows.argoproj.io/container-runtime-executor: pns
annotations:
workflows.argoproj.io/description: |
Expand All @@ -19,17 +19,13 @@ metadata:
# this workflow will only run on workflows version v3.0.0
workflows.argoproj.io/version: ">= 3.0.0"

# this workflow will fail because the k8sapi executor does not support base-layer outputs
# this workflow will success because contrary to the default emissary executor,
# the pns executor doesn't require an explicit command defined
workflows.argoproj.io/verify.py: |
assert status["phase"] == "Failed"
assert status["phase"] == "Succeeded"
spec:
entrypoint: main
templates:
- name: main
container:
image: argoproj/argosay:v2
outputs:
parameters:
- name: out-0
valueFrom:
path: /not-allowed
image: docker/whalesay
10 changes: 5 additions & 5 deletions manifests/quick-start-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,16 @@ data:
secretKeySecret:
name: my-minio-cred
key: secretkey
containerRuntimeExecutor: docker
containerRuntimeExecutor: emissary
containerRuntimeExecutors: |
- name: k8sapi
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: k8sapi
- name: emissary
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: emissary
- name: pns
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: pns
executor: |
resources:
requests:
Expand Down
10 changes: 5 additions & 5 deletions manifests/quick-start-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,16 @@ data:
secretKeySecret:
name: my-minio-cred
key: secretkey
containerRuntimeExecutor: docker
containerRuntimeExecutor: emissary
containerRuntimeExecutors: |
- name: k8sapi
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: k8sapi
- name: emissary
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: emissary
- name: pns
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: pns
executor: |
resources:
requests:
Expand Down
10 changes: 5 additions & 5 deletions manifests/quick-start-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,16 @@ data:
secretKeySecret:
name: my-minio-cred
key: secretkey
containerRuntimeExecutor: docker
containerRuntimeExecutor: emissary
containerRuntimeExecutors: |
- name: k8sapi
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: k8sapi
- name: emissary
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: emissary
- name: pns
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: pns
executor: |
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ data:
requests:
cpu: 10m
memory: 64Mi
containerRuntimeExecutor: docker
containerRuntimeExecutor: emissary
containerRuntimeExecutors: |
- name: k8sapi
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: k8sapi
- name: emissary
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: emissary
- name: pns
selector:
matchLabels:
workflows.argoproj.io/container-runtime-executor: pns
images: |
argoproj/argosay:v1:
command: [cowsay]
Expand Down

0 comments on commit b0d1f65

Please sign in to comment.