Argo: Is it possible to pass in parallelism via the command line?

Created on 19 Nov 2019  路  6Comments  路  Source: argoproj/argo

Is it possible to pass in parallelism via the command line?

I tried to setup a parameter to do this, but got an error about the value not being a number.

Failed to parse workflow:
error unmarshaling JSON: while decoding JSON: json:
cannot unmarshal string into Go struct field WorkflowSpec.parallelism of type int64

If it's not possible by default to set this for the workflow from the command line, is there a way of coercing a string containing a number into a number?

Edit: Do you have anything like an int filter? I heard you were using Jinja but I can't find it within the codebase.

enhancement

Most helpful comment

I'm also running into this issue when trying to have parallelism be a parameter of a workflow template

All 6 comments

Is it possible to pass in parallelism via the command line?

Currently not possible.

Do you have anything like an int filter? I heard you were using Jinja but I can't find it within the codebase.

Not as far as I know.

If it's not possible by default to set this for the workflow from the command line, is there a way of coercing a string containing a number into a number?

Could you elaborate a bit on this? Are you trying to run dynamically generated Workflows?

If it's not possible by default to set this for the workflow from the command line, is there a way of coercing a string containing a number into a number?

Could you elaborate a bit on this? Are you trying to run dynamically generated Workflows?

I tried this at one point, but it doesn't work:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: global-parallelism-parameter-
spec:
  entrypoint: entrypoint-name
  arguments:
    parameters:
    - name: parallelism
      value: 10
  parallelism: "{{workflow.parameters.parallelism}}"
# ...

I'm not trying to run dynamicly generated workflows. I just wanted to be able to configure the level of parallelism a workflow should be run with at the point of submission.

(FYI, what I'm doing is analogous to this toy workflow but with Cypress E2E test runs instead of computations.)

I see. I don't think we currently support a way to pass in parameters to the Workflow object... only to Template objects within a workflow.

A workaround suggestion I could give you would be to use sed to replace the placeholder value before submitting. Something like this:

$ cat workflow.yaml | sed 's/"{{workflow.parameters.parallelism}}"/10/g' | argo submit --watch -

I'm also running into this issue when trying to have parallelism be a parameter of a workflow template

Hi, we also have this problem using Workflow templates, @alexec what more information is needed?

I don't think any information is needed? The label was removed not added.

I think the solution executed in #3610 could work here too.

Would anyone be interested in submitting a PR?

Was this page helpful?
0 / 5 - 0 ratings