Skip to content

Debug Pause

v3.3 and after

Introduction

The debug pause feature makes it possible to pause individual workflow steps for debugging before, after or both and then release the steps from the paused state. Currently this feature is only supported when using the Emissary Executor

In order to pause a container env variables are used:

  • ARGO_DEBUG_PAUSE_AFTER - to pause a step after execution
  • ARGO_DEBUG_PAUSE_BEFORE - to pause a step before execution

Example workflow:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: pause-after-
spec:
  entrypoint: whalesay
  templates:
    - name: whalesay
      container:
        image: argoproj/argosay:v2
        env:
          - name: ARGO_DEBUG_PAUSE_AFTER
            value: 'true'

In order to release a step from a pause state, marker files are used named /var/run/argo/ctr/main/after or /var/run/argo/ctr/main/before corresponding to when the step is paused. Pausing steps can be used together with ephemeral containers when a shell is not available in the used container.

Example

1) Create a workflow where the debug pause env in set, in this example ARGO_DEBUG_PAUSE_AFTER will be set and thus the step will be paused after execution of the user code.

pause-after.yaml

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: pause-after-
spec:
  entrypoint: whalesay
  templates:
    - name: whalesay
      container:
        image: argoproj/argosay:v2
        env:
          - name: ARGO_DEBUG_PAUSE_AFTER
            value: 'true'
argo submit -n argo --watch pause-after.yaml

Create a shell in the container of interest of create a ephemeral container in the pod, in this example ephemeral containers are used.

kubectl debug -n argo -it POD_NAME --image=busybox --target=main --share-processes

In order to have access to the persistence volume used by the workflow step, --share-processes will have to be used.

The ephemeral container can be used to perform debugging operations. When debugging has been completed, create the marker file to allow the workflow step to continue. When using process name space sharing container file systems are visible to other containers in the pod through the /proc/$pid/root link.

touch /proc/1/root/var/run/argo/ctr/main/after

Comments