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

Argo-workflows with name > 52 characters fail if run as CronWorkflows #1818

Open
shrinandj opened this issue Apr 29, 2024 · 1 comment
Open

Comments

@shrinandj
Copy link
Contributor

If name > 52 characters, the workflow fails to start anyway. The workflow controller fails with:

time="2024-04-29T19:07:01.554Z" level=error msg="invalid cron workflow" cronWorkflow=jobs-default/nbcreditscorev4d5mx.prod.main.eventtrainnbcswithfixeddata error="cron workflow name \"abcreditscorev4d5mx.prod.main.eventtrainabcspqrfixederty\" must not be more than 52 characters long (currently 57)"

Would be easy if the user got this error (or similar) at the time of creating the workflow itself.

@shrinandj shrinandj changed the title Argo-workflows create command should fail if name > 52 characters Argo-workflows with name > 52 characters fail if run as CronWorkflows May 17, 2024
@shrinandj
Copy link
Contributor Author

The user experience is quite tricky here because the permissible name length for regular Argo workflows is greater than for Cron workflows.

So,

  • The user creates a flow and run python flow.py argo-workflows create. This creates the workflow template without any error
  • The user is able to run this flow either via python flow.py argo-wokflows trigger or via the Argo UI and it works just fine.
  • The user then adds @schedule decorator and run python argo-workflows create. This creates the workflow template and the CronWorkflow. No errors.
  • But if the name > 52 characters, the actual flows don't run on the cron schedule. The only way to identify the problem is to look at the argo-workflows-controller logs as shown above and see the error.

What's needed here is the following.

When a user creates a flow with @schedule:

  • Construct the name as it is done today. If the name length < 52 chars, create the template, cronworkflow.
  • If the name length > 52 chars:
    • check if there is a previously created cronworkflow object. If so, delete it (since it wouldn't be running anyway).
    • create a name such that it is < 52 characters. e.g. take all characters > 46 and construct a 6 byte has to fit into 52 chars
  • Create the new cronworkflow

/cc @savingoyal @saikonen

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

1 participant