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

Set auto-added artifacts optional in recurring run (job) #3041

Merged
merged 2 commits into from
Feb 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions backend/src/apiserver/resource/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,18 @@ func (r *ResourceManager) CreateJob(apiJob *api.Job) (*model.Job, error) {
},
},
}

// Marking auto-added artifacts as optional. Otherwise most older workflows will start failing after upgrade to Argo 2.3.
// TODO: Fix the components to explicitly declare the artifacts they really output.
// TODO: Change the compiler to stop auto-adding those two atrifacts to all tasks.

Choose a reason for hiding this comment

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

IIRC the compiler no longer adds those two artifact to all tasks. @Ark-kun can you correct me if I'm wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. The compiler stopped doing this in SDK v0.1.29: #2046.
Pipelines compiled by older SDKs have the artifacts hardcoded in them.

Copy link
Member

Choose a reason for hiding this comment

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

Does this todo still apply?

Choose a reason for hiding this comment

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

I believe no. That's why I was asking :)

Copy link
Contributor Author

@jingzhang36 jingzhang36 Feb 12, 2020

Choose a reason for hiding this comment

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

Great to know. I'll remove the complier TODO, and also the compiler TODO in the one-time run.

for templateIdx, template := range scheduledWorkflow.Spec.Workflow.Spec.Templates {
for artIdx, artifact := range template.Outputs.Artifacts {
if artifact.Name == "mlpipeline-ui-metadata" || artifact.Name == "mlpipeline-metrics" {
scheduledWorkflow.Spec.Workflow.Spec.Templates[templateIdx].Outputs.Artifacts[artIdx].Optional = true
}
}
}

newScheduledWorkflow, err := r.scheduledWorkflowClient.Create(scheduledWorkflow)
if err != nil {
return nil, util.NewInternalServerError(err, "Failed to create a scheduled workflow for (%s)", scheduledWorkflow.Name)
Expand Down