Skip to content

Commit

Permalink
fix(runner): compute CPU & memory allocations properly
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Apr 16, 2024
1 parent dc213a1 commit eaedbed
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/main/java/io/kestra/plugin/aws/runner/AwsBatchTaskRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,20 @@ public RunnerResult run(RunContext runContext, TaskCommands taskCommands, List<S
);
}

int sideContainersMemoryAllocations = hasS3Bucket ? baseSideContainerMemory * 2 : 0;
float sideContainersCpuAllocations = hasS3Bucket ? baseSideContainerCpu * 2 : 0;
int sideContainersAmount = 0;
if (outputDirectoryEnabled) {
sideContainersAmount = 2;
} else {
if (hasFilesToUpload) {
sideContainersAmount++;
}

if (hasFilesToDownload) {
sideContainersAmount++;
}
}
int sideContainersMemoryAllocations = baseSideContainerMemory * sideContainersAmount;
float sideContainersCpuAllocations = baseSideContainerCpu * sideContainersAmount;

boolean needsOutputFilesContainer = hasFilesToDownload || outputDirectoryEnabled;
TaskContainerProperties.Builder mainContainerBuilder = withResources(
Expand Down

0 comments on commit eaedbed

Please sign in to comment.