Skip to content

Commit

Permalink
set disk usage
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Dec 18, 2024
1 parent b96debe commit 27e7ead
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/c2d/compute_engine_docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,22 @@ export class C2DEngineDocker extends C2DEngine {
]
}
if (environment != null) {
// TODO the CPU and MEM part is addressed in the PR #799 https://github.com/oceanprotocol/ocean-node/pull/799/
// REMOVE AFTER MERGE
// limit container CPU & Memory usage according to env specs
hostConfig.CpuCount = environment.cpuNumber || 1
// if more than 1 CPU
if (hostConfig.CpuCount > 1) {
hostConfig.CpusetCpus = `0-${hostConfig.CpuCount - 1}`
// hostConfig.CpuCount = environment.cpuNumber || 1
// // if more than 1 CPU
// if (hostConfig.CpuCount > 1) {
// hostConfig.CpusetCpus = `0-${hostConfig.CpuCount - 1}`
// }
// hostConfig.Memory = 0 || convertGigabytesToBytes(environment.ramGB)
// // set swap to same memory value means no swap (otherwise it use like 2X mem)
// hostConfig.MemorySwap = hostConfig.Memory

// storage
hostConfig.StorageOpt = {
size: environment.diskGB > 0 ? `${environment.diskGB}G` : '1G'
}
hostConfig.Memory = 0 || convertGigabytesToBytes(environment.ramGB)
// set swap to same memory value means no swap (otherwise it use like 2X mem)
hostConfig.MemorySwap = hostConfig.Memory
}
// console.log('host config: ', hostConfig)
const containerInfo: ContainerCreateOptions = {
Expand Down

0 comments on commit 27e7ead

Please sign in to comment.