How is Argo resourceDuration for CPU and memory calculated

322 Views Asked by At

I have an argo workflow with a single step where the following resources defined:

        resources:
          limits:
            cpu: "6"
          requests:
            cpu: "3"
            memory: 120Mi

After the workflow is executed and has completed successfully, I retrieved the run specifications, where the time duration for each pod and resource usage for CPU and memory can be found:

status:
  artifactRepositoryRef:
    artifactRepository:
      archiveLogs: true
    configMap: artifact-repositories
    key: default-v1
    namespace: argo
  conditions:
  - status: "False"
    type: PodRunning
  - status: "True"
    type: Completed
  finishedAt: "2022-12-18T11:13:25Z"
  nodes:
    test-cpu-usageszprm:
      children:
      - test-cpu-usageszprm-4131026553
      displayName: test-cpu-usageszprm
      finishedAt: "2022-12-18T11:13:25Z"
      id: test-cpu-usageszprm
      name: test-cpu-usageszprm
      phase: Succeeded
      progress: 1/1
      resourcesDuration:
        cpu: 173
        memory: 79
      startedAt: "2022-12-18T11:12:30Z"
      templateName: main
      templateScope: local/test-cpu-usageszprm
      type: Retry
    test-cpu-usageszprm-1944147306:
      boundaryID: test-cpu-usageszprm-4131026553
      children:
      - test-cpu-usageszprm-2680509841
      displayName: step1
      finishedAt: "2022-12-18T11:13:25Z"
      id: test-cpu-usageszprm-1944147306
      name: test-cpu-usageszprm(0).step1
      outputs:
        artifacts:
        - name: main-logs
          s3:
            key: test-cpu-usageszprm/test-cpu-usageszprm-2680509841/main.log
        exitCode: "0"
      phase: Succeeded
      progress: 1/1
      resourcesDuration:
        cpu: 173
        memory: 79
      startedAt: "2022-12-18T11:12:30Z"
      templateName: step1
      templateScope: local/test-cpu-usageszprm
      type: Retry
    test-cpu-usageszprm-2680509841:
      boundaryID: test-cpu-usageszprm-4131026553
      displayName: step1(0)
      finishedAt: "2022-12-18T11:13:15Z"
      hostNodeName: center03-blade06
      id: test-cpu-usageszprm-2680509841
      name: test-cpu-usageszprm(0).step1(0)
      outputs:
        artifacts:
        - name: main-logs
          s3:
            key: test-cpu-usageszprm/test-cpu-usageszprm-2680509841/main.log
        exitCode: "0"
      phase: Succeeded
      progress: 1/1
      resourcesDuration:
        cpu: 173
        memory: 79
      startedAt: "2022-12-18T11:12:30Z"
      templateName: step1
      templateScope: local/test-cpu-usageszprm
      type: Pod
    test-cpu-usageszprm-4131026553:
      children:
      - test-cpu-usageszprm-1944147306
      displayName: test-cpu-usageszprm(0)
      finishedAt: "2022-12-18T11:13:25Z"
      id: test-cpu-usageszprm-4131026553
      name: test-cpu-usageszprm(0)
      outboundNodes:
      - test-cpu-usageszprm-2680509841
      phase: Succeeded
      progress: 1/1
      resourcesDuration:
        cpu: 173
        memory: 79
      startedAt: "2022-12-18T11:12:30Z"
      templateName: main
      templateScope: local/test-cpu-usageszprm
      type: DAG
  phase: Succeeded
  progress: 1/1
  resourcesDuration:
    cpu: 173
    memory: 79
  startedAt: "2022-12-18T11:12:30Z"

Knowing that resources for CPU and memory are set for each pod, I would like to know how resourceDuration CPU (173) and memory (79) are calculated.

I found this document (https://argoproj.github.io/argo-workflows/resource-duration/#example) which describes the calculation for the resourceDuration for CPU and memory however I am not able to get 173, and 79 for cpu and memory reosurce duration respectively based on the pods time duration and resource limits and requests.

Does anyone know how resourceDuration is calculated?

0

There are 0 best solutions below