Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue 769 - c2d docker disk usage/storage limits #800

Merged
merged 4 commits into from
Jan 8, 2025
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
17 changes: 14 additions & 3 deletions src/components/c2d/compute_engine_docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,18 @@ export class C2DEngineDocker extends C2DEngine {
if (job.status === C2DStatusNumber.ConfiguringVolumes) {
// create the volume & create container
// TO DO C2D: Choose driver & size
// get env info
const environment = await this.getJobEnvironment(job)

const volume: VolumeCreateOptions = {
Name: job.jobId + '-volume'
}
// volume
if (environment != null) {
volume.DriverOpts = {
size: environment.diskGB > 0 ? `${environment.diskGB}G` : '1G'
}
}
try {
await this.docker.createVolume(volume)
} catch (e) {
Expand All @@ -503,8 +512,7 @@ export class C2DEngineDocker extends C2DEngine {
await this.db.updateJob(job)
await this.cleanupJob(job)
}
// get env info
const environment = await this.getJobEnvironment(job)

// create the container
const mountVols: any = { '/data': {} }
let hostConfig: HostConfig = {
Expand All @@ -518,7 +526,10 @@ export class C2DEngineDocker extends C2DEngine {
]
}
if (environment != null) {
// limit container CPU & Memory usage according to env specs
// storage (container)
hostConfig.StorageOpt = {
size: environment.diskGB > 0 ? `${environment.diskGB}G` : '1G'
}
hostConfig = {
...hostConfig,
...(await buildCPUAndMemoryConstraints(environment, this.docker))
Expand Down
Loading