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

Fix resources requests for AWS Batch plugin #400

Merged
merged 2 commits into from
Sep 7, 2023
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 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