From aa16076736391dfc41a5e457276693aab13a4391 Mon Sep 17 00:00:00 2001 From: b4sus Date: Tue, 24 Sep 2024 11:41:36 +0200 Subject: [PATCH] Added uuid to outputs uri path to avoid overwriting artifacts Signed-off-by: b4sus --- backend/src/v2/driver/driver.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/v2/driver/driver.go b/backend/src/v2/driver/driver.go index aeeda9b6a48..12d7a377182 100644 --- a/backend/src/v2/driver/driver.go +++ b/backend/src/v2/driver/driver.go @@ -272,7 +272,7 @@ func Container(ctx context.Context, opts Options, mlmd *metadata.Client, cacheCl execution.Condition = &willTrigger } if execution.WillTrigger() { - executorInput.Outputs = provisionOutputs(pipeline.GetPipelineRoot(), opts.Task.GetTaskInfo().GetName(), opts.Component.GetOutputDefinitions()) + executorInput.Outputs = provisionOutputs(pipeline.GetPipelineRoot(), opts.Task.GetTaskInfo().GetName(), opts.Component.GetOutputDefinitions(), uuid.NewString()) } ecfg, err := metadata.GenerateExecutionConfig(executorInput) @@ -1227,7 +1227,7 @@ func resolveInputs(ctx context.Context, dag *metadata.DAG, iterationIndex *int, return inputs, nil } -func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.ComponentOutputsSpec) *pipelinespec.ExecutorInput_Outputs { +func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.ComponentOutputsSpec, outputUriSalt string) *pipelinespec.ExecutorInput_Outputs { outputs := &pipelinespec.ExecutorInput_Outputs{ Artifacts: make(map[string]*pipelinespec.ArtifactList), Parameters: make(map[string]*pipelinespec.ExecutorInput_OutputParameter), @@ -1239,7 +1239,7 @@ func provisionOutputs(pipelineRoot, taskName string, outputsSpec *pipelinespec.C { // Do not preserve the query string for output artifacts, as otherwise // they'd appear in file and artifact names. - Uri: metadata.GenerateOutputURI(pipelineRoot, []string{taskName, name}, false), + Uri: metadata.GenerateOutputURI(pipelineRoot, []string{taskName, outputUriSalt, name}, false), Type: artifact.GetArtifactType(), Metadata: artifact.GetMetadata(), },