Open minzhang28 opened 7 years ago
For what it's worth, compose v2 backported memory reservation, which ends up looking like:
version: '2'
services:
memcached:
image: memcached
mem_limit: 128m
mem_reservation: 64m
I'd be happy to take a stab at this but probably won't get to it for a few weeks, if someone else has the time. I only really work with Compose/ECS, so I'm not 100% sure what the comparables are in K8/Marathon/Chronos/systemd either, but I'm sure I can kinda muck through it.
@antinescience that'd be great if you have time to work on it. I haven't had time to do much OSS lately, but I know k8s has has limits/requests
any update on this? I'm also waiting for this feature
Seems there is a pull request for it only its failing on test coverage percentage threshold.
Moreover, i think the compose transformer supports v1 and v2 but outputs only version: '2'. Should it be splitted in 3 different transformers to ouput v1 v2 and v3 outputs?
@liorchen took a crack at memory reservation and has a pull request in, but it's failing a couple of tests. If I get a chance, I'll see if I can address those, but I wanted to bring them up here in case somebody else can get to them first. Here's an example:
cat container_transform/tests/marathon-group.json | container-transform --input-type marathon --output-type compose | tail -18 | head -9
prometheus:
cpu_shares: 512.0
image: micahhausler/prometheus-mesos
mem_limit: 134217728b
mem_reservation: '[{''uri'': ''https://gist.githubusercontent.com/you/hash/raw/hash/config.yml'',
''extract'': False, ''executable'': False, ''cache'': False}]b'
network_mode: bridge
ports:
- 9090:9090
currently this project only supports docker compose v2 and doesn't tallow us to specify the soft memory limitation.
suggestion: adding supports to docker compose file v3 resource section, which supports both hard and soft limitation