Skip to content

Commit

Permalink
docs: Update memoization.md (argoproj#10992)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Eri <adam.eri@blackmirror.media>
Co-authored-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
Adam Eri and terrytangyuan committed May 10, 2023
1 parent fb890a1 commit 992773f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/memoization.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ This allows you to easily manipulate cache entries manually through `kubectl` an

## Using Memoization

Memoization is set at the template level. You must specify a key, which can be static strings but more often depend on inputs.
You must also specify a name for the config-map cache.
Memoization is set at the template level. You must specify a `key`, which can be static strings but more often depend on inputs.
You must also specify a name for the `config-map` cache.
Optionally you can set a `maxAge` in seconds or hours (e.g. `180s`, `24h`) to define how long should it be considered valid. If an entry is older than the `maxAge`, it will be ignored.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand All @@ -29,11 +30,14 @@ spec:
- name: whalesay
memoize:
key: "{{inputs.parameters.message}}"
maxAge: "10s"
cache:
configMap:
name: whalesay-cache
```
[Find a simple example for memoization here](https://github.com/argoproj/argo-workflows/blob/master/examples/memoize-simple.yaml).
!!! Note
In order to use memoization it is necessary to add the verbs `create` and `update` to the `configmaps` resource for the appropriate (cluster) roles. In the case of a cluster install the `argo-cluster-role` cluster role should be updated, whilst for a namespace install the `argo-role` role should be updated.

Expand Down

0 comments on commit 992773f

Please sign in to comment.