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 all commits
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: 11 additions & 1 deletion backend/src/apiserver/resource/resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ func (r *ResourceManager) CreateRun(apiRun *api.Run) (*model.RunDetail, 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.
for templateIdx, template := range workflow.Workflow.Spec.Templates {
for artIdx, artifact := range template.Outputs.Artifacts {
if artifact.Name == "mlpipeline-ui-metadata" || artifact.Name == "mlpipeline-metrics" {
Expand Down Expand Up @@ -535,6 +534,17 @@ 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.
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