refactor: cpu and memory under Resources struct

This commit is contained in:
Pavel Sviderski
2025-04-24 16:40:26 +10:00
parent badb8ecd3c
commit 7db8bba6ea
4 changed files with 148 additions and 161 deletions
+7 -10
View File
@@ -1,14 +1,11 @@
package api
type CPUResources struct {
// Limit is the maximum amount of CPU nanocores (1000000000 = 1 CPU core) the container can use.
Limit int64
}
type MemoryResources struct {
// Limit is the maximum amount of memory (in bytes) the container can use.
Limit int64
// Reservation is the minimum amount of memory (in bytes) the container needs to run efficiently.
type ContainerResources struct {
// CPU is the maximum amount of CPU nanocores (1000000000 = 1 CPU core) the container can use.
CPU int64
// Memory is the maximum amount of memory (in bytes) the container can use.
Memory int64
// MemoryReservation is the minimum amount of memory (in bytes) the container needs to run efficiently.
// TODO: implement a placement constraint that checks available memory on machines.
Reservation int64
MemoryReservation int64
}