Skip to content

Commit

Permalink
Set the max parallelism on the execution model correctly when trigger…
Browse files Browse the repository at this point in the history
…ed by launch plan (#6266)

* Set the max parallelism on the execution model correctly

Signed-off-by: Jason Parraga <[email protected]>

* lint

Signed-off-by: Jason Parraga <[email protected]>

---------

Signed-off-by: Jason Parraga <[email protected]>
  • Loading branch information
Sovietaced authored Feb 26, 2025
1 parent 9225677 commit d609017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flyteadmin/pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,9 @@ func (m *ExecutionManager) launchExecution(
notificationsSettings = make([]*admin.Notification, 0)
}

// Set the max parallelism based on the execution config (calculated based on multiple levels of settings)
requestSpec.MaxParallelism = executionConfig.GetMaxParallelism()

createExecModelInput := transformers.CreateExecutionModelInput{
WorkflowExecutionID: workflowExecutionID,
RequestSpec: requestSpec,
Expand Down
4 changes: 4 additions & 0 deletions flyteadmin/pkg/manager/impl/execution_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const (
principal = "principal"
rawOutput = "raw_output"
executionClusterLabel = "execution_cluster_label"
launchPlanParallelism = int32(42)
)

var spec = testutils.GetExecutionRequest().GetSpec()
Expand Down Expand Up @@ -179,6 +180,8 @@ func getMockExecutionsConfigProvider() runtimeInterfaces.Configuration {

func setDefaultLpCallbackForExecTest(repository interfaces.Repository) {
lpSpec := testutils.GetSampleLpSpecForTest()

lpSpec.MaxParallelism = launchPlanParallelism
lpSpec.Labels = &admin.Labels{
Values: map[string]string{
"label1": "1",
Expand Down Expand Up @@ -319,6 +322,7 @@ func TestCreateExecution(t *testing.T) {
assert.True(t, proto.Equal(spec.GetClusterAssignment(), &clusterAssignment))
assert.Equal(t, "launch_plan", input.LaunchEntity)
assert.Equal(t, spec.GetMetadata().GetSystemMetadata().GetNamespace(), "project-domain")
assert.Equal(t, launchPlanParallelism, spec.GetMaxParallelism())
return nil
})
setDefaultLpCallbackForExecTest(repository)
Expand Down

0 comments on commit d609017

Please sign in to comment.