argo-workflows: Why am I failing to implement the memoize-simple.yaml example?
Hello, I am failing when I try to run the example found here:
https://github.com/argoproj/argo-workflows/blob/master/examples/memoize-simple.yaml
Here is my error msg:
Message: failed to resolve artifact repository: error getting config map for artifact repository ref "default/my-config#whalesay-cache": failed to unmarshall config map key "whalesay-cache" for artifact repository ref "default/my-config#whalesay-cache": error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1alpha1.ArtifactRepository
I am using the suggested configmap (“my-config”) as an artifact-repository, along with a configmap to specify the emissary containerRuntimeExecutor. Both configmaps are applied and can be retrieved. I have tried putting “my-config” (the artifact repository) in both the default and argo namespaces - neither is successful.
Here are my yamls
---
{
"apiVersion": "v1",
"data": {
"containerRuntimeExecutor": "emissary",
"workflowDefaults": "{\"annotations\": {\"workflows.argoproj.io/version\": \">= 3.1.0\"}, \"metadata\": { }, \"spec\": {\"artifactRepositoryRef\": {\"configMap\": \"my-config\", \"key\": \"whalesay-cache\"}, \"entrypoint\": \"entrypoint\", \"parallelism\": 3, \"podGC\": {\"strategy\": \"OnWorkflowSuccess\"}, \"securityContext\": {\"fsGroup\": 2000, \"runAsGroup\": 3000, \"runAsUser\": 1000}, \"ttlStrategy\": {\"secondsAfterSuccess\": 5}}}"
},
"kind": "ConfigMap",
"metadata": {
"name": "workflow-controller-configmap",
"namespace": "argo"
}
}
---
{
"apiVersion": "v1",
"data": {
"whalesay-cache": "whalesay-cache"
},
"kind": "ConfigMap",
"metadata": {
"annotations": {
"workflows.argoproj.io/default-artifact-repository": "whalesay-cache"
},
"name": "my-config",
}
}
...
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: memoized-simple-workflow-
spec:
entrypoint: whalesay
arguments:
parameters:
- name: message
value: test-5
templates:
- name: whalesay
inputs:
parameters:
- name: message
memoize:
key: "{{inputs.parameters.message}}"
maxAge: "10s"
cache:
configMap:
name: my-config
key: whalesay-cache
container:
image: docker/whalesay:latest
command: [sh, -c]
args: ["cowsay {{inputs.parameters.message}} > /tmp/hello_world.txt"]
outputs:
parameters:
- name: hello
valueFrom:
path: /tmp/hello_world.txt
Here are the relevant logs from the workflow controller:
time="2021-10-12T13:25:51.783Z" level=info msg="Watch cronworkflows 200"
time="2021-10-12T13:25:51.805Z" level=info msg="Update leases 200"
time="2021-10-12T13:25:51.806Z" level=info msg="Watch workflows 200"
time="2021-10-12T13:25:51.855Z" level=info msg="Processing workflow" namespace=default workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:51.871Z" level=info msg="Get configmaps 200"
time="2021-10-12T13:25:51.872Z" level=info msg="Updated phase -> Error" namespace=default workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:51.872Z" level=info msg="Updated message -> failed to resolve artifact repository: error getting config map for artifact repository ref \"default/my-config#whalesay-cache\": failed to unmarshall config map key \"whalesay-cache\" for artifact repository ref \"default/my-config#whalesay-cache\": error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type v1alpha1.ArtifactRepository" namespace=default workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:51.872Z" level=info msg="Marking workflow completed" namespace=default workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:51.873Z" level=info msg="Checking daemoned children of " namespace=default workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:51.875Z" level=info msg="Watch workflows 200"
time="2021-10-12T13:25:51.896Z" level=info msg="Create events 201"
time="2021-10-12T13:25:51.897Z" level=info msg="Update workflows 200"
time="2021-10-12T13:25:51.924Z" level=info msg="Workflow update successful" namespace=default phase=Error resourceVersion=1542568 workflow=memoized-simple-workflow-5n6pw
time="2021-10-12T13:25:56.819Z" level=info msg="Get leases 200"
time="2021-10-12T13:25:56.829Z" level=info msg="Update leases 200"
time="2021-10-12T13:26:01.847Z" level=info msg="Get leases 200"
time="2021-10-12T13:26:01.856Z" level=info msg="Update leases 200"
time="2021-10-12T13:26:06.865Z" level=info msg="Get leases 200"
time="2021-10-12T13:26:06.877Z" level=info msg="Update leases 200"
time="2021-10-12T13:26:11.901Z" level=info msg="Get leases 200"
time="2021-10-12T13:26:11.912Z" level=info msg="Update leases 200"
I am running argo: v3.1.13 kubectl v 1.22.2 ubuntu 20.04
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (11 by maintainers)
You are missing update permission on configmaps.
If you edit that configmap
data.test-5.outputs.value
to be something different and run the workflow again, the output of the new workflow will use the new value instead.