mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

Problem launching app when using label MARATHON_SINGLE_INSTANCE_APP #4333

Closed tobilg closed 7 years ago

tobilg commented 8 years ago

As described in https://github.com/mesosphere/universe/pull/678, I can't launch an app (with DC/OS 1.8 EA) which has the label MARATHON_SINGLE_INSTANCE_APP set to "true".

When I try it like this

curl -XPOST http://dcos-master-1:8080/v2/apps -H "Content-Type: application/json" -d '{
  "id": "/marathon-slack",
  "cpus": 0.1,
  "mem": 128,
  "disk": 0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "tobilg/marathon-slack:0.1.3",
      "network": "HOST",
      "privileged": false,
      "parameters": [],
      "forcePullImage": true
    }
  },
  "env": {
    "SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/...",
    "SLACK_CHANNEL": "#dcos-marathon"
  },
  "labels":{
   "MARATHON_SINGLE_INSTANCE_APP": "true"
  },
  "upgradeStrategy": {
    "maximumOverCapacity": 0,
    "minimumHealthCapacity": 0
  }
}'

I see a

{
    "message": "Object is not valid",
    "details": [{
        "path": "/value/upgradeStrategy",
        "errors": ["got 1.0, expected 0.0"]
    }, {
        "path": "/value/isSingleInstance",
        "errors": ["must be false"]
    }]
}

error. Is this a bug, or is there an issue with my app definition? Thanks a lot in advance!

aquamatthias commented 7 years ago

Retested this on current Marathon Master:

➔ pbpaste | http :8080/v2/apps
HTTP/1.1 201 Created
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json; qs=2
Date: Tue, 29 Nov 2016 12:23:25 GMT
Expires: 0
Location: http://localhost:8080/v2/apps/marathon-slack
Marathon-Deployment-Id: 01aa657a-8bc6-48b9-a2ce-b9af4868d3ba
Pragma: no-cache
Server: Jetty(9.3.6.v20151106)
Transfer-Encoding: chunked
X-Marathon-Leader: http://wrk-2.local:8080

{
    "args": null,
    "backoffFactor": 1.15,
    "backoffSeconds": 1,
    "cmd": null,
    "constraints": [],
    "container": {
        "docker": {
            "forcePullImage": true,
            "image": "tobilg/marathon-slack:0.1.3",
            "network": "HOST",
            "parameters": [],
            "portMappings": [],
            "privileged": false
        },
        "type": "DOCKER",
        "volumes": []
    },
    "cpus": 0.1,
    "dependencies": [],
    "deployments": [
        {
            "id": "01aa657a-8bc6-48b9-a2ce-b9af4868d3ba"
        }
    ],
    "disk": 0,
    "env": {
        "SLACK_CHANNEL": "#dcos-marathon",
        "SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/..."
    },
    "executor": "",
    "fetch": [],
    "gpus": 0,
    "healthChecks": [],
    "id": "/marathon-slack",
    "instances": 1,
    "ipAddress": null,
    "labels": {
        "MARATHON_SINGLE_INSTANCE_APP": "true"
    },
    "maxLaunchDelaySeconds": 3600,
    "mem": 128,
    "portDefinitions": [
        {
            "labels": {},
            "port": 0,
            "protocol": "tcp"
        }
    ],
    "ports": [
        0
    ],
    "readinessChecks": [],
    "requirePorts": false,
    "residency": null,
    "secrets": {},
    "storeUrls": [],
    "taskKillGracePeriodSeconds": null,
    "tasks": [],
    "tasksHealthy": 0,
    "tasksRunning": 0,
    "tasksStaged": 0,
    "tasksUnhealthy": 0,
    "upgradeStrategy": {
        "maximumOverCapacity": 0,
        "minimumHealthCapacity": 0
    },
    "uris": [],
    "user": null,
    "version": "2016-11-29T12:23:25.666Z"
}