Skip to content

Commit

Permalink
fix(backend): randomizing output uri path to avoid overwriting. Fixes #…
Browse files Browse the repository at this point in the history
…10186 (#11243)

Signed-off-by: b4sus <jurob19@gmail.com>
  • Loading branch information
b4sus authored Oct 3, 2024
1 parent 374b18b commit 219725d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/v2/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand All @@ -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(),
},
Expand Down

0 comments on commit 219725d

Please sign in to comment.