Search code examples
mesosmarathondcos

Create DC/OS app deployment from native executable local file


I'm experimenting with DC/OS I would like to try out the native file running capabilities, run an native executable without using docker, outlined at https://dcos.io/docs/1.8/usage/tutorials/dcos-101/app2/

I can successfully follow the tutorial but I would like to use my own application (a self-contained executable), the online documentation says that the fetch command supports the file:// uri in addition to the https:// uri and others. (https://mesosphere.github.io/marathon/docs/application-basics.html)

So if I use the app deployment manifest from the tutorial as my basis, but I've uploaded my executable to my master node at /home/core/app (in the linux filesystem) and change the uri to "file:///home/core/app" the deployment says

I0127 14:42:06.533756 40159 fetcher.cpp:167] Copying resource with command:cp '/home/core/app' '/var/lib/mesos/slave/slaves/a0ff5689-5816-4812-864b-b3c4b914a272-S0/frameworks/a0ff5689-5816-4812-864b-b3c4b914a272-0000/executors/dcos-101_app2.c641de8d-e49e-11e6-93c4-de7054394bed/runs/f266a00c-1179-48bb-9f1e-251f3eae1272/app' cp: cannot stat '/home/core/app': No such file or directory"

Using DC/OS 1.8 installed on CoreOS with one master and one agent (just for dev test)

I'm sure I'm just missing something fundamental like the mesos filesystem, but I've looked everywhere for a tutorial and they either assume your using docker, or serving via http...nothing for file://

So when using the file:// uri is that a different location than the linux filesystem or am I missing something else.

Little help please for a DC/OS newb

Thanks

EDIT

Here is the app.json file

{
  "id": "/dcos-101/app2",
  "cmd": "chmod u+x app && ./app",
  "args": null,
  "user": null,
  "env": null,
  "instances": 1,
  "cpus": 1,
  "mem": 128,
  "disk": 0,
  "gpus": 0,
  "executor": null,
  "constraints": null,
  "fetch": [
    {
      "uri": "file:///home/core/app"
    }
  ],
  "storeUrls": null,
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "maxLaunchDelaySeconds": 3600,
  "container": null,
  "healthChecks": null,
  "readinessChecks": null,
  "dependencies": null,
  "upgradeStrategy": {
    "minimumHealthCapacity": 1,
    "maximumOverCapacity": 1
  },
  "acceptedResourceRoles": null,
  "ipAddress": null,
  "residency": null,
  "secrets": null,
  "taskKillGracePeriodSeconds": null,
  "portDefinitions": [
    {
      "protocol": "tcp",
      "port": 10000,
      "labels": {
        "VIP_0": "/dcos-101/app2:10000"
      }
    }
  ],
  "labels": {
    "HAPROXY_GROUP": "external"
  },
  "requirePorts": false
}

Solution

  • That won't work, unless /home/core/app exists on each of your Agent nodes or you change it to, say, an external HTTP URL. What fetch does is: it downloads the listed file(s) into the Mesos sandbox, depending on the URI schema in use. Since you're using the file: schema, Mesos tries to download it on the Agent where the task is launched (and not the Master).