From a68001d31fc4c2d55686a29abe7ace8f0bdf4644 Mon Sep 17 00:00:00 2001 From: Jesse Suen Date: Tue, 24 Oct 2017 17:44:46 -0700 Subject: [PATCH] Add debug tools to argoexec image. Remove privileged mode from sidekick. Disable linting --- Dockerfile-argoexec | 4 ++++ Makefile | 2 +- workflow/controller/workflowpod.go | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile-argoexec b/Dockerfile-argoexec index 67c3fc5d9b60..63737eb3a732 100644 --- a/Dockerfile-argoexec +++ b/Dockerfile-argoexec @@ -1,5 +1,9 @@ FROM debian:9.1 +RUN apt-get update && \ + apt-get install -y curl jq procps && \ + rm -rf /var/lib/apt/lists/* + COPY dist/argoexec /bin/ ENTRYPOINT [ "/bin/argoexec" ] diff --git a/Makefile b/Makefile index 3a214c9213fa..c9f1d612c071 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ IMAGE_PREFIX=${IMAGE_NAMESPACE}/ endif # Build the project -all: lint cli-linux cli-darwin workflow-image apiserver-image argoexec-image +all: cli-linux cli-darwin workflow-image apiserver-image argoexec-image builder: docker build -t ${BUILDER_IMAGE} -f Dockerfile-builder . diff --git a/workflow/controller/workflowpod.go b/workflow/controller/workflowpod.go index 52ad9a6df8ab..7334587aef30 100644 --- a/workflow/controller/workflowpod.go +++ b/workflow/controller/workflowpod.go @@ -166,7 +166,7 @@ func (wfc *WorkflowController) newInitContainer(tmpl *wfv1.Template) (*corev1.Co } func (wfc *WorkflowController) newWaitContainer(tmpl *wfv1.Template) (*corev1.Container, error) { - ctr := wfc.newExecContainer(common.WaitContainerName, true) + ctr := wfc.newExecContainer(common.WaitContainerName, false) ctr.Command = []string{"sh", "-c"} argoExecCmd := fmt.Sprintf("echo sleeping; cat %s; sleep 10; echo done", common.PodMetadataAnnotationsPath) ctr.Args = []string{argoExecCmd} @@ -238,6 +238,12 @@ func addInputArtifactVolumes(pod *corev1.Pod, tmpl *wfv1.Template) error { mainCtr = &ctr break } + if ctr.Name == common.WaitContainerName { + // HACK: debug purposes. sleep to experiment with wait container artifacts + ctr.Command = []string{"sh", "-c"} + ctr.Args = []string{"sleep 999999; echo done"} + pod.Spec.Containers[i] = ctr + } } if mainCtr == nil { errors.InternalError("Could not find main container in pod spec")