Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing arguments to workflow inside a cronworkflow #3154

Closed
manpreet1994 opened this issue Jun 3, 2020 · 13 comments
Closed

Passing arguments to workflow inside a cronworkflow #3154

manpreet1994 opened this issue Jun 3, 2020 · 13 comments

Comments

@manpreet1994
Copy link

Summary

How can I pass arguments/parameters to a workflow running in a cronworkflow?

Motivation

I'm working on a scenario where, a workflow which requires input parameters from env file, needs to be scheduled also.

@samath117
Copy link

My usual approach is to have the workflow load the input parameters from a file in my artifact repository, which I update when necessary.

@alexec
Copy link
Contributor

alexec commented Jun 3, 2020

@simster7 FYI
@samath117 do you have an example we could add to docs?

@samath117
Copy link

Nah, it's really just the same as the standard input artifact importing examples, like this one. You have to write a processing step to unpack those variables, and decide what process you want to write to that file (another CronWorkflow, manually-submitted Workflows, uploading directly, etc).

@manpreet1994
Copy link
Author

@samath117
Thanks for input. I'm using azure blob storage, however, it seems azure blob storage artifact is not supported yet. Any workarounds?

@samath117
Copy link

I'm not aware of any if S3 artifacts don't work for you. Others probably are better suited to answer that question, though.

@simster7
Copy link
Member

simster7 commented Jun 5, 2020

FYI: Opened #3173 to add Azure Blob Storage

@manpreet1994
Copy link
Author

@simster7 @samath117
I used kubernetes secrets to achieve what i was looking for. (https://kubernetes.io/docs/concepts/configuration/secret/)

I created a secret from env file and referred this newly created secret from cronworkflow.

It will be helpful if this can be added in the argo documentation

@omarzouk
Copy link

omarzouk commented Jun 22, 2020

@alexec is there a design reason behind this not being supported in the CronWorkflow spec? Being able to pass parameters to a WorkflowTemplateRef sounds like a very reasonable way to use a template

Example usecases include things like being able to deploy similar CronWorkflows to different environments with different schedules, but then also be able to pass some environment information to the underlying workflow via its parameters

@simster7
Copy link
Member

@omarzouk It is possible to pass in parameters to a WorkflowTemplateRef. See this example: https://github.com/argoproj/argo/blob/master/examples/workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml

@samath117
Copy link

Yes, but you can't set those parameters from the CLI in argo cron create. This seems like a reasonable suggestion to me, similar to #3194.

@simster7
Copy link
Member

Ah I see. Yes, that is a reasonable request. Is this what you meant @omarzouk?

@simster7 simster7 self-assigned this Jun 22, 2020
@omarzouk
Copy link

omarzouk commented Jun 22, 2020

@simster7 I was actually referring to something like this: #2556 (comment)

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
  name: hello-world
spec:
  schedule: "* * * * *"
  workflowSpec:
    workflowTemplateRef:
      name: workflow-template-name
    arguments:
      parameters:
        - name: message
          value: "Hello, world"

but I guess this is coming out in 2.9 right? (btw, is there a release date expected for 2.9? I see the milestone has 3 close-able tickets remaining)

however being able to pass them in the command line would be a good thing too!

Thanks for your quick response!

@simster7 simster7 removed their assignment Jul 10, 2020
@stale
Copy link

stale bot commented Sep 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 9, 2020
@stale stale bot closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants