argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
15.03k stars 3.2k forks source link

`spec.priority` via argo event Parameterization expects int, gets string #13605

Closed zloof closed 1 month ago

zloof commented 1 month ago

Pre-requisites

What happened? What did you expect to happen?

I am trying to set the spec.priority via "Parameterization" (sensor template) https://argoproj.github.io/argo-events/tutorials/02-parameterization/ the spec.priority expecting only INT but when using the parameter, it only allow to set a STRING

Example of the parameter :

     parameters:
        - src:
            dependencyName: run-workflow
            dataTemplate: '{{ "{{" }} .Input.body.MY_NUMBER  }}'
            value: '9'
          dest: spec.priority 

The Workflow was submitted to the K8S with Failed status: cannot unmarshal spec: unrecognized type: int32

Thank in advance

Version(s)

workflow-controller:v3.5.10,argo-events:v1.9.2

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

Example of the parameter :

     parameters:
        - src:
            dependencyName: run-workflow
            dataTemplate: '{{ "{{" }} .Input.body.MY_NUMBER  }}'
            value: '9'
          dest: spec.priority

Logs from the workflow controller

time="2024-09-16T07:55:34.755Z" level=warning msg="Failed to unmarshal key to workflow object" error="unrecognized type: int32" key=argo-events/gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.755Z" level=info msg="Updated phase  -> Failed" namespace=argo-events workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.755Z" level=info msg="Updated message  -> cannot unmarshall spec: unrecognized type: int32" namespace=argo-events workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.755Z" level=info msg="Marking workflow completed" namespace=argo-events workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.755Z" level=info msg="Marking workflow as pending archiving" namespace=argo-events workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.755Z" level=info msg="Workflow to be dehydrated" Workflow Size=3928
time="2024-09-16T07:55:34.763Z" level=info msg="Workflow update successful" namespace=argo-events phase=Failed resourceVersion=647501756 workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.764Z" level=warning msg="Invalid workflow object" key="&{map[apiVersion:argoproj.io/v1alpha1 kind:Workflow metadata:map[creationTimestamp:2024-09-16T07:55:34Z generateName:gcp-pubsub-workflow- generation:1 labels:map[CI_JOB_ID:7769638904-test LOG_FILE_NAME:Repetition_10_10_2.txt events.argoproj.io/action-timestamp:1726473334738 events.argoproj.io/sensor:pubsub-sensor events.argoproj.io/trigger:gcp-workflow simulation:68e22e61] managedFields:[map[apiVersion:argoproj.io/v1alpha1 fieldsType:FieldsV1 fieldsV1:map[f:metadata:map[f:generateName:map[] f:labels:map[.:map[] f:CI_JOB_ID:map[] f:LOG_FILE_NAME:map[] f:events.argoproj.io/action-timestamp:map[] f:events.argoproj.io/sensor:map[] f:events.argoproj.io/trigger:map[] f:simulation:map[]]] f:spec:map[]] manager:argo-events operation:Update time:2024-09-16T07:55:34Z]] name:gcp-pubsub-workflow-hmbjs namespace:argo-events resourceVersion:647501755 uid:b7d5e712-5c07-489a-8852-8bf61299c6c7] spec:map[activeDeadlineSeconds:36000 arguments:map[parameters:[map[name:IMAGE value:68e22e61423032b8a092625525abb214dadddd5e] map[name:INDEX value:0] map[name:INPUT_FILE_TO_DOWNLOAD value:68e22e61423032b8a092625525abb214dadddd5e_official_V_7_2_0_allExistingOnCart_retest/inputs/Seed/2024_09_05_V_7_2_0_allExistingOnCart/Repetition_10_10_2.runCnfg] map[name:TEST_IDENTIFIER value:68e22e61423032b8a092625525abb214dadddd5e_official_V_7_2_0_allExistingOnCart_retest] map[name:DB_SERVER_PASS value:1] map[name:OMK_KEY value:1] map[name:INPUT_FILE_NAME value:/usr/src/app/Seed/2024_09_05_V_7_2_0_allExistingOnCart/Repetition_10_10_2.runCnfg] map[name:LOG_FILE_NAME value:Repetition_10_10_2.txt] map[name:APP_NAME value:matlab-exec-runner-Repetition_10_10_2] map[name:SIMULATION_BUCKET_NAME value:engine-simulation-tests] map[name:OUTPUT_FOLDER value:/usr/src/app/outputs/] map[name:LOG_PATH value:/usr/src/app/logging/] map[name:ERROR_PATH value:/usr/src/app/errors/]]] entrypoint:run-test nodeSelector:map[node-type:engine-simulation-analysis] podGC:map[strategy:OnPodCompletion] priority:1 serviceAccountName:engine-simulation-analysis templates:[map[container:map[command:[/bin/bash -c npm start --prefix /usr/src/app] env:[map[name:OUTPUT_FOLDER value:{{workflow.parameters.OUTPUT_FOLDER}}] map[name:INDEX value:{{workflow.parameters.INDEX}}] map[name:LOG_LEVEL value:debug] map[name:LOG_MATLAB value:true] map[name:INPUT_FILE value:{{workflow.parameters.INPUT_FILE_NAME}}] map[name:TEST_IDENTIFIER value:{{workflow.parameters.TEST_IDENTIFIER}}] map[name:SIMULATION_BUCKET_NAME value:{{workflow.parameters.SIMULATION_BUCKET_NAME}}] map[name:APP_NAME value:{{workflow.parameters.APP_NAME}}] map[name:MONGO_DB_SERVERS_IPS valueFrom:map[secretKeyRef:map[key:mongodb-connection-string name:engine-simulation-analysis]]] map[name:DB_SERVER_USERNAME value:engine-sim-user] map[name:DB_SERVER_PASS valueFrom:map[secretKeyRef:map[key:sql-password name:engine-simulation-analysis]]] map[name:REST_SERVER_ADDR value:https://api.research.oriient.me/api] map[name:STORAGE_BUCKET_NAME value:session-recordings-research] map[name:ORIIENT_SERVER_ADDRESS value:notLocalDev] map[name:NEED_API_KET_FOR_REST value:true] map[name:CLOUD_PROVIDER value:google] map[name:RUNNING_ENG_SIM value:true] map[name:KUBE_CONFIG_PATH value:/path/to/kubeconfig] map[name:MATLAB_EXEC_STORAGE_NAME value:{{workflow.parameters.TEST_IDENTIFIER}}] map[name:MATLAB_EXEC_PATH value:/matlab_runtime] map[name:OMK_KEY valueFrom:map[secretKeyRef:map[key:admin-api-key name:oriient-admin-api-key]]] map[name:LOG_PATH value:{{workflow.parameters.LOG_PATH}}] map[name:ERROR_PATH value:{{workflow.parameters.ERROR_PATH}}] map[name:LOG_FILE_NAME value:{{workflow.parameters.LOG_FILE_NAME}}]] image:europe-west3-docker.pkg.dev/k8s-cluster-204810/k8s-dev-docker/engine-simulation-analysis3:{{workflow.parameters.IMAGE}} resources:map[limits:map[cpu:20 memory:60000M] requests:map[cpu:3 memory:2500M]]] inputs:map[artifacts:[map[gcs:map[bucket:{{workflow.parameters.SIMULATION_BUCKET_NAME}} key:{{workflow.parameters.INPUT_FILE_TO_DOWNLOAD}}] name:runCnfg path:{{workflow.parameters.INPUT_FILE_NAME}}]] parameters:[map[name:TEST_IDENTIFIER] map[name:INPUT_FILE_TO_DOWNLOAD]]] name:run-test outputs:map[artifacts:[map[archive:map[none:map[]] gcs:map[bucket:{{workflow.parameters.SIMULATION_BUCKET_NAME}} key:{{workflow.parameters.TEST_IDENTIFIER}}/outputs/] name:upload_outputs path:{{workflow.parameters.OUTPUT_FOLDER}}] map[archive:map[none:map[]] gcs:map[bucket:{{workflow.parameters.SIMULATION_BUCKET_NAME}} key:{{workflow.parameters.TEST_IDENTIFIER}}/logging/] name:logs path:{{workflow.parameters.LOG_PATH}}]]] retryStrategy:map[limit:5 retryPolicy:Always] synchronization:map[semaphore:map[configMapKeyRef:map[key:parallels name:engine-simulation-analysis]]]]] tolerations:[map[effect:NoSchedule key:workflow operator:Equal value:true]] ttlStrategy:map[secondsAfterCompletion:10]]]}"
time="2024-09-16T07:55:34.767Z" level=info msg="archiving workflow" namespace=argo-events uid=b7d5e712-5c07-489a-8852-8bf61299c6c7 workflow=gcp-pubsub-workflow-hmbjs
time="2024-09-16T07:55:34.813Z" level=info msg="Queueing Failed workflow argo-events/gcp-pubsub-workflow-hmbjs for delete in 10s due to TTL"
time="2024-09-16T07:55:45.000Z" level=info msg="Deleting garbage collected workflow 'argo-events/gcp-pubsub-workflow-hmbjs'"
time="2024-09-16T07:55:45.007Z" level=info msg="Successfully request 'argo-events/gcp-pubsub-workflow-hmbjs' to be deleted"

Logs from in your workflow's wait container

No resources found in argo-workflow namespace.
jswxstw commented 1 month ago

Similar to #10571 and #13612.

Priority should also be marked as DEPRECATED like #8762.

tooptoop4 commented 1 month ago

deprecated? but its used to make some workflows run ahead of others

jswxstw commented 1 month ago

Sorry I didn't make it clear, I meant the template-level priority.

agilgur5 commented 1 month ago

Closing as duplicate of #10571 per above.

@jswxstw as a Member you have permissions to close issues and add labels now