Hello All, I have a question about character limi...
# ask-metaflow
m
Hello All, I have a question about character limits in Argo Workflows. My understanding was that the limit was 63 for
Workflow
and
WorkflowTemplate
and 52 for
CronWorkflow
resources. (See this issue.) However, the checks in Metaflow seem to indicate it is 253. Are the limits not 63 & 52? Or am I misunderstanding this check?
1
Looking at this document, it seems that these correspond to two different naming requirements. So I guess the question boils down to which one does Argo user for workflow names.
I've asked for clarification on the Argo channel here - https://cloud-native.slack.com/archives/C01QW9QSSSK/p1683037303264739 It does indeed seem that it should be 63 characters. So I guess this is a bug in the Metaflow code, right?
a
Interesting. Let me verify and get back to you. We tested with these limits (253 chars) during the original release.
m
ok, thanks. Argo is complaining on my side fwiw
a
qq - how do you submit to argo - via metaflow's
argo-workflows create
or through a different process? We have had scenarios in the past where manual uploads followed a different Argo code path resulting in inconsistencies with length related errors.
m
In this case via ArgoCD, but I believe the same restrictions hold regardless
I believe it is a K8s naming restriction, so it should hold regardless of how the workflow was created.
a
Here is an example in the Argo universe where some restrictions don't seem to hold depending on how the workflow is submitted - https://cloud-native.slack.com/archives/C01QW9QSSSK/p1652298821097089. Let me reproduce this and get back to you.
m
ok, thanks. I also have the restriction when creating workflowtemplates from the argo UI btw. Sorry, I forgot to mention this before.
a
@mammoth-rainbow-82717 Here is an example of a workflow whose name is more than 63 chars long -
Copy code
from metaflow import FlowSpec, Parameter, step

class AlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlow(FlowSpec):

    alpha = Parameter('alpha',
                    default=10)


    @step
    def start(self):
        print("alpha is %s" % self.alpha)
        self.next(self.end)

    @step
    def end(self):
        from metaflow.integrations import ArgoEvent
        ArgoEvent(name="foo").add_to_payload("beta", self.alpha + 1).publish()



if __name__ == '__main__':
    AlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlowAlphaFlow()
Both
argo-workflows create
and
argo-workflows trigger
work as expected. The workflow template indeed takes a name that can be more than 63 chars. The workflow takes a name that can only be at max 63 chars and
argo-workflow trigger
accounts for that. Depending on how you are using Metaflow with Argo CD, it should be wholly possible to deploy such a workflow in a functioning state.
Successful workflow execution
workflow template with a rather long name which maps with DNS subdomain spec
m
um......I am somewhat confused.
Can you share the workflow manifest for the example, please?
So you believe that workflows can only be 63 characters, workflowtemplates can be more? I tried making a template in the UI and it threw an error for character lengths. I have a suspicion that these different approaches are using different kubectl commands under the hood.
nod 1
Also, have you tried scheduling a Cron from one of the workflow templates with these long names?
a
let me try cron workflows
Looks like the UI doesn't agree with kube api
m
Copy code
argo template create -n mlplatform-example ~/Code/mlplatform-examples-argoworkflows/workflows/toy/workflow_template.yaml
2023/05/02 19:00:22 Failed to create workflow template: workflow template name "workflow-template-submittable-workflow-template-submittable-workflow-template-submittable-workflow-template-submittable" must not be more than 63 characters long (currently 119)
This is when using the Argo Workflow CLI
a
A simple workaround today is to use
argo-workflows --name foo create
m
Copy code
kubectl apply -n mlplatform-example -f ~/Code/mlplatform-examples-argoworkflows/workflows/toy/workflow_template.yaml
<http://workflowtemplate.argoproj.io/workflow-template-submittable-workflow-template-submittable-workflow-template-submittable-workflow-template-submittable|workflowtemplate.argoproj.io/workflow-template-submittable-workflow-template-submittable-workflow-template-submittable-workflow-template-submittable> created
This creates the template and then dies when submitting the template via the UI.
Still not 100% why this works at all though, to be honest.
a
If you submit the workflow through kubectl that will work
that's what metaflow does behind the scenes with
argo-workflows trigger
m
yeah, but it is not clear to me why that works.
a
also, with the
event-triggering
release, metaflow will also create sensors during
argo-workflows create
m
We've got an gitops pipeline set up, so I'll just update how we name the workflows on my side. I was raising more as an FYI because your existing check didn't align with my experience with character limits on Argo.
among us party 1
a
Totally agree - I wouldn't be surprised if there are more undocumented differences between
argo-submit
and
kubectl apply
. We can definitely go through all the edge case scenarios on our side and make sure the generated templates play well with both