blablacar / dgr

Container build and runtime tool
Apache License 2.0
249 stars 21 forks source link

Resource isolators are skipped #211

Closed mark-kubacki closed 7 years ago

mark-kubacki commented 8 years ago

I am using dgr version 77 and rkt 1.19.0, though I believe the latter does not matter.

My aci-manifest.yml:

name: example/minimal:1

aci:
  app:
    isolators:
      - name: resource/memory
        value: {request: 32M, limit: 256M}
      - name: resource/cpu
        value: {request: 125m, limit: 500m}
  dependencies:
    - 'blitznote.com/ubuntu:16.04'

… is translated to (please observe the isolators):

{
  "acKind": "ImageManifest",
  "acVersion": "0.8.1",
  "name": "example/minimal",
  "labels": [
    {"name": "version", "value": "1"},
    {"name": "os", "value": "linux"},
    {"name": "arch", "value": "amd64"}
  ],
  "app": {
    "eventHandlers": [
      {"name": "pre-start", "exec": ["/dgr/bin/prestart"]}
    ],
    "isolators": [
      {
        "name": "resource/memory",
        "value": {"set": null}
      },
      {
        "name": "resource/cpu",
        "value": {"set": null}
      }
    ]
  },
  "dependencies": [
    {"imageName": "blitznote.com/ubuntu", "labels": [{"name": "version", "value": "16.04"}]}
  ]
}

Yet I do expect this:

…
    "isolators": [
      {
        "name": "resource/memory",
        "value": {"request": "32M", "limit": "256M"}
      },
      {
        "name": "resource/cpu",
        "value": {"request": "125m", "limit": "500m"}
      }
    ]
  },
…

See also appc/spec/schema/types/isolator_resources.go.

nyodas commented 8 years ago

Hi It should work with

name: example/minimal:1

aci:
  app:
    isolators:
      - name: resource/memory
        value: {request: 32M, limit: 256M}
      - name: resource/cpu
        value: {request: 125m, limit: 500m}
  dependencies:
    - 'blitznote.com/ubuntu:16.04'
mark-kubacki commented 8 years ago

Thank you, @nyodas, for your hint. Unfortunately I did forget aci.app only in my example, not the original file. In other words, it does not work.

By the way, here is the complete file: wmark/docker-teamspeak3:aci-manifest.yml

n0rad commented 8 years ago

Thanks, it's probably a bug that need to be fixed

n0rad commented 7 years ago

fixed in v78