mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: add shm_size support in Compose and --shm-size flag for 'uc run' (closes #267)
This commit is contained in:
@@ -177,6 +177,7 @@ func resourcesFromCompose(service types.ServiceConfig) api.ContainerResources {
|
||||
CPU: int64(service.CPUS * 1e9),
|
||||
Memory: int64(service.MemLimit),
|
||||
MemoryReservation: int64(service.MemReservation),
|
||||
SharedMemory: int64(service.ShmSize),
|
||||
Ulimits: ulimitsFromCompose(service.Ulimits),
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ func TestServiceSpecFromCompose(t *testing.T) {
|
||||
CPU: 0.5 * api.Core,
|
||||
Memory: 100 * units.MiB,
|
||||
MemoryReservation: 50 * units.MiB,
|
||||
SharedMemory: 256 * units.MiB,
|
||||
Ulimits: map[string]api.Ulimit{
|
||||
"nofile": {Soft: 20000, Hard: 40000},
|
||||
"nproc": {Soft: 65535, Hard: 65535},
|
||||
|
||||
@@ -34,6 +34,7 @@ services:
|
||||
max-file: 3
|
||||
mem_limit: 100M
|
||||
mem_reservation: 50M
|
||||
shm_size: 268435456
|
||||
privileged: true
|
||||
pull_policy: always
|
||||
scale: 3
|
||||
|
||||
Reference in New Issue
Block a user