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

fix(ds, mm): hard code disk per core #1134

Closed
Show file tree
Hide file tree
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
16 changes: 3 additions & 13 deletions svc/pkg/ds/src/workflows/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ async fn submit_job(ctx: &ActivityCtx, input: &SubmitJobInput) -> GlobalResult<S
// Nomad configures CPU based on MHz, not millicores. We havel to calculate the CPU share
// by knowing how many MHz are on the client.
CPU: if tier.rivet_cores_numerator < tier.rivet_cores_denominator {
Some((tier.cpu - util_job::TASK_CLEANUP_CPU as u64).try_into()?)
Some(tier.cpu.try_into()?)
} else {
None
},
Expand All @@ -486,20 +486,10 @@ async fn submit_job(ctx: &ActivityCtx, input: &SubmitJobInput) -> GlobalResult<S
} else {
None
},
memory_mb: Some(
(TryInto::<i64>::try_into(memory)? / (1024 * 1024)
- util_job::TASK_CLEANUP_MEMORY as i64)
.try_into()?,
),
memory_mb: Some(tier.memory.try_into()?),
// Allow oversubscribing memory by 50% of the reserved
// memory if using less than the node's total memory
memory_max_mb: None,
// Some(
// (TryInto::<i64>::try_into(memory_max)? / (1024 * 1024)
// - util_job::TASK_CLEANUP_MEMORY as i64)
// .try_into()?,
// ),
disk_mb: Some(tier.disk as i32), // TODO: Is this deprecated?
memory_max_mb: Some(tier.memory_max.try_into()?),
..Resources::new()
};

Expand Down
3 changes: 2 additions & 1 deletion svc/pkg/linode/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const RESERVE_LB_MEMORY: u64 = 512;
const RESERVE_MEMORY: u64 = RESERVE_SYSTEM_MEMORY + RESERVE_LB_MEMORY;

const CPU_PER_CORE: u64 = 1999;
const DISK_PER_CORE: u64 = 8192;

/// Provider agnostic hardware specs.
#[derive(Debug)]
Expand Down Expand Up @@ -53,7 +54,7 @@ impl JobNodeConfig {
}

pub fn disk_per_core(&self) -> u64 {
self.disk / self.cpu_cores
DISK_PER_CORE
}

pub fn bandwidth_per_core(&self) -> u64 {
Expand Down
1 change: 0 additions & 1 deletion svc/pkg/mm/worker/src/workers/lobby_create/nomad_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ pub fn gen_lobby_docker_job(
// Allow oversubscribing memory by 50% of the reserved
// memory if using less than the node's total memory
memory_max_mb: Some(tier.memory_max.try_into()?),
disk_mb: Some(tier.disk as i32), // TODO: Is this deprecated?
..Resources::new()
};

Expand Down
Loading