Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Fix resources requests for AWS Batch plugin (#400)
Browse files Browse the repository at this point in the history
* retrieving resources from container before merging with overrides and defaults

Signed-off-by: Daniel Rammer <[email protected]>

* fixed linter

Signed-off-by: Daniel Rammer <[email protected]>

---------

Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw authored Sep 7, 2023
1 parent 552f145 commit c978638
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/tasks/plugins/array/awsbatch/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ func FlyteTaskToBatchInput(ctx context.Context, tCtx pluginCore.TaskExecutionCon
}

envVars := getEnvVarsForTask(ctx, tCtx.TaskExecutionMetadata().GetTaskExecutionID(), taskTemplate.GetContainer().GetEnv(), cfg.DefaultEnvVars)
res := tCtx.TaskExecutionMetadata().GetOverrides().GetResources()

// compile resources
res, err := flytek8s.ToK8sResourceRequirements(taskTemplate.GetContainer().GetResources())
if err != nil {
return nil, err
}

if overrideResources := tCtx.TaskExecutionMetadata().GetOverrides().GetResources(); overrideResources != nil {
flytek8s.MergeResources(*overrideResources, res)
}

platformResources := tCtx.TaskExecutionMetadata().GetPlatformResources()
if platformResources == nil {
platformResources = &v1.ResourceRequirements{}
Expand Down

0 comments on commit c978638

Please sign in to comment.