Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scape $ on variable substitution to deploy app json to marathon #13

Closed
kikicarbonell opened this issue Feb 25, 2016 · 3 comments
Closed
Labels

Comments

@kikicarbonell
Copy link

I'm trying to deploy one app to marathon and my json has some internal variable managed by marathon like: $HOST, $PORT0 and $PORT1, but depcon try to replace with instance variable when upload file and show some errors....I need a way to scape these variable...

My app.json:

{
  "id": "appname",
  "cpus": "0.1",
  "mem": "256",
  "instances": 1,
  "cmd": "./bin/spark-class org.apache.spark.deploy.mesos.MesosClusterDispatcher --master zk://localhost:2181/mesos --zk localhost:2181 --host $HOST --port $PORT0 --webui-port $PORT1 --name spark_marathon_framework_name",
  "env": {
    "SPARK_USER": "root",
    "HADOOP_HOME": "/usr/lib/hadoop"
  },
  "ports": [
    32000,
    0
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "registry/myimage:latest",
      "network": "HOST"
    },
    "volumes": [
      {
        "containerPath": "/etc/localtime",
        "hostPath": "/etc/localtime",
        "mode": "RO"
      },
      {
        "containerPath": "/etc/hadoop/conf",
        "hostPath": "spark_marathon_hadoop_conf_dir",
        "mode": "RO"
      },
      {
        "containerPath": "/usr/lib/hadoop",
        "hostPath": "/usr/lib/hadoop",
        "mode": "RO"
      }
    ]
  },
  "healthChecks": [
    {
      "path": "/",
      "portIndex": 1,
      "protocol": "HTTP",
      "gracePeriodSeconds": 5,
      "intervalSeconds": 60,
      "timeoutSeconds": 10,
      "maxConsecutiveFailures": 3
    }
  ], "_hack": null
}
@gondor gondor added the bug label Feb 25, 2016
@gondor
Copy link
Member

gondor commented Feb 25, 2016

Good find. Since depcon uses ${PARAM} format your correct. We should treat $PARAM without the {} as a non-depcon param (leave as is). Will look into addressing this in the next 24 hours.

@gondor
Copy link
Member

gondor commented Feb 26, 2016

Ok, should be fixed. I updated the binaries now version 0.5. Also the ^^ JSON above is malformed, found another bug in not reporting this. The CPU and Mem are numeric and should have "0.1" in quotes.

Let me know if this fix works for you for issue closure

@kikicarbonell
Copy link
Author

ok, all work fine...thks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants