mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: support service.gpus and reservations.devices (#156)
* feat: support compose.yaml `service.gpus` and `service.deploy.resources.reservations.devices` DeviceRequests to Docker container * Fix lint error * Adjust test comments to work with linter * Rename DeviceRequests to DeviceReservations to be more consistent with compose nomenclature * Device reservation changes are immutable and should trigger a container recreate rather than update
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/container"
|
||||
)
|
||||
|
||||
const (
|
||||
MilliCore = 1_000_000
|
||||
Core = 1000 * MilliCore
|
||||
@@ -13,4 +17,6 @@ type ContainerResources struct {
|
||||
// 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.
|
||||
MemoryReservation int64
|
||||
// Device reservations/requests for access to things like GPUs
|
||||
DeviceReservations []container.DeviceRequest
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user