Skip to content
Closed
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: 10 additions & 2 deletions src/components/c2d/compute_engine_docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,16 @@ export class C2DEngineDocker extends C2DEngine {

if (envConfig.resources) {
for (const res of envConfig.resources) {
// allow user to add other resources
if (res.id !== 'cpu' && res.id !== 'ram') {
if (res.id === 'cpu' || res.id === 'ram') {
// allow config to override cpu/ram per env
const existing = this.envs[0].resources.find((r) => r.id === res.id)
if (existing) {
if (res.total != null) existing.total = res.total
if (res.max != null) existing.max = res.max
else if (res.total != null) existing.max = res.total
if (res.min != null) existing.min = res.min
}
} else {
if (!res.max) res.max = res.total
if (!res.min) res.min = 0
this.envs[0].resources.push(res)
Expand Down
Loading