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

[minor][bugfix] Remove redundant generateName #305

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

cloudw
Copy link
Collaborator

@cloudw cloudw commented Aug 19, 2024

When creating a workflow with a specific name using python <flow.py> create --name <name>, the compiled workflow template manifest contains both generateName and name under metadata field.

For example, the output template of a recent pipeline https://gitlab.zgtools.net/analytics/artificial-intelligence/ai-platform/aip-infrastructure/integration-tests/aip-workflow-example/-/jobs/42159367 has manifest that looks like the following:

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  generateName: exampleflow-
  name: example-flow-95623b8e
  annotations: {}
  labels: {
    metaflow.org/flow_name: ExampleFlow,
    metaflow.org/tag_project-name: aip-workflow-example,
    metaflow.org/tag_pipeline-id: '6821369',
    metaflow.org/tag_commit-sha: 95623b8eb6146e5c33e526dfbcbc946828565541,
    zodiac.zillowgroup.net/owner: None,
    zodiac.zillowgroup.net/product: batch
  }
... (more fields below)

where the name: example-flow-95623b8e is expected (as flow name + commit sha) but the generateName: exampleflow- is redundant.

Further looking into the code, it looks like when a specific --name is provided, the current logic prevent generateName from being popped out.

@cloudw cloudw self-assigned this Aug 19, 2024
Copy link

@cavandervoort cavandervoort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. The logic results in the same name being generated, but taking the .pop() of generateName outside of the if/else section ensures that .pop() is run.

@cloudw cloudw merged commit 350e017 into feature/aip Aug 20, 2024
4 checks passed
@cloudw cloudw deleted the yunw/remove-redundant-generatename branch August 20, 2024 20:02
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

Successfully merging this pull request may close these issues.

2 participants