Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Removal of env variables does not trigger deployment #1238

Closed
bobrik opened this issue Feb 24, 2015 · 12 comments
Closed

Removal of env variables does not trigger deployment #1238

bobrik opened this issue Feb 24, 2015 · 12 comments

Comments

@bobrik
Copy link
Contributor

bobrik commented Feb 24, 2015

  1. Deploy app with env variable set.
  2. Remove env section from app definition, deploy again.
  3. No deployment happens.

Changing of env variables triggers deploy as it should.

@drexin
Copy link
Contributor

drexin commented Feb 24, 2015

have you tried setting env to an empty object, i.e. "env": {}?

@bobrik
Copy link
Contributor Author

bobrik commented Feb 24, 2015

Just tried, "env": {} has the same effect as removing env completely.

@ConnorDoyle
Copy link
Contributor

Which version are you seeing this with? Could you add some of your HTTP interactions with the API? For example, in my local marathon-0.8.0:

First, clearing the environment map for an app, yielding a deployment:

PUT /v2/apps/http HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Length: 11
Content-Type: application/json; charset=utf-8
Host: localhost:8080
User-Agent: HTTPie/0.8.0

{
    "env": {}
}
HTTP/1.1 200 OK
Content-Type: application/json
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

{
    "deploymentId": "bb194013-8992-4a11-a4fe-a7329a4129bd", 
    "version": "2015-02-26T06:54:02.187Z"
}

Fetching the app to see the deployment and the soon-to-be-replaced task:

HTTP/1.1 200 OK
Content-Type: application/json
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

{
    "app": {
        "args": null, 
        "backoffFactor": 1.15, 
        "backoffSeconds": 1, 
        "cmd": "python -m SimpleHTTPServer $PORT", 
        "constraints": [], 
        "container": null, 
        "cpus": 0.1, 
        "dependencies": [], 
        "deployments": [
            {
                "id": "bb194013-8992-4a11-a4fe-a7329a4129bd"
            }
        ], 
        "disk": 0.0, 
        "env": {}, 
        "executor": "", 
        "healthChecks": [], 
        "id": "/http", 
        "instances": 1, 
        "labels": {}, 
        "lastTaskFailure": null, 
        "maxLaunchDelaySeconds": 3600, 
        "mem": 50.0, 
        "ports": [
            10000
        ], 
        "requirePorts": false, 
        "storeUrls": [], 
        "tasks": [
            {
                "appId": "/http", 
                "host": "localhost", 
                "id": "http.327db799-bd84-11e4-b0b5-c27fee8cb118", 
                "ports": [
                    31000
                ], 
                "stagedAt": "2015-02-26T06:53:40.840Z", 
                "startedAt": "2015-02-26T06:53:40.908Z", 
                "version": "2015-02-26T06:53:39.367Z"
            }
        ], 
        "tasksRunning": 1, 
        "tasksStaged": 0, 
        "upgradeStrategy": {
            "maximumOverCapacity": 1.0, 
            "minimumHealthCapacity": 1.0
        }, 
        "uris": [], 
        "user": null, 
        "version": "2015-02-26T06:54:02.187Z"
    }
}

Fetching the app once more to observe that the deployment has been completed and the task has been replaced with a new instance.

HTTP/1.1 200 OK
Content-Type: application/json
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

{
    "app": {
        "args": null, 
        "backoffFactor": 1.15, 
        "backoffSeconds": 1, 
        "cmd": "python -m SimpleHTTPServer $PORT", 
        "constraints": [], 
        "container": null, 
        "cpus": 0.1, 
        "dependencies": [], 
        "deployments": [], 
        "disk": 0.0, 
        "env": {}, 
        "executor": "", 
        "healthChecks": [], 
        "id": "/http", 
        "instances": 1, 
        "labels": {}, 
        "lastTaskFailure": null, 
        "maxLaunchDelaySeconds": 3600, 
        "mem": 50.0, 
        "ports": [
            10000
        ], 
        "requirePorts": false, 
        "storeUrls": [], 
        "tasks": [
            {
                "appId": "/http", 
                "host": "localhost", 
                "id": "http.41657b8a-bd84-11e4-b0b5-c27fee8cb118", 
                "ports": [
                    31938
                ], 
                "stagedAt": "2015-02-26T06:54:05.846Z", 
                "startedAt": "2015-02-26T06:54:05.926Z", 
                "version": "2015-02-26T06:54:02.187Z"
            }
        ], 
        "tasksRunning": 1, 
        "tasksStaged": 0, 
        "upgradeStrategy": {
            "maximumOverCapacity": 1.0, 
            "minimumHealthCapacity": 1.0
        }, 
        "uris": [], 
        "user": null, 
        "version": "2015-02-26T06:54:02.187Z"
    }
}

@bobrik
Copy link
Contributor Author

bobrik commented Feb 26, 2015

I'm running e6cd021 (that was master at Tue Feb 17 17:52:21 2015 -0800) + patch from @sttts: #1082 (comment)

Since Timestamp issue is fixed in master, I can rebuild and give it a try.

web488 ~ # curl -H "Content-type: application/json" -X PUT http://web488:8080/v2/apps/topface/lenny -d 'app-json-definition'

Here's how app-json-definition looks like:

{
  "container": {
    "docker": {
      "image": "myimage"
    },
    "type": "DOCKER"
  },
  "mem": 64,
  "backoffSeconds": 5,
  "cmd": "exec /bin/lenny -something something",
  "cpus": 0.2,
  "id": "/topface/lenny",
  "instances": 18,
  "healthChecks": [
    {
      "protocol": "HTTP",
      "timeoutSeconds": 5,
      "intervalSeconds": 2,
      "gracePeriodSeconds": 15,
      "maxConsecutiveFailures": 3,
      "path": "/?n=marathon_healthcheck"
    }
  ],
  "backoffFactor": 1,
  "ports": [
    12001
  ],
  "constraints": [
    [
      "hostname",
      "UNIQUE"
    ]
  ]
}

Here's what I get in return:

{"version":"2015-02-26T07:55:40.424Z","deploymentId":"aafc289f-ee4f-48cf-bd8a-6d3629d93706"}

After a minute or so I check my app:

{
  "app": {
    "id": "/topface/lenny",
    "cmd": "exec /bin/lenny -something something",
    "args": null,
    "user": null,
    "env": {
      "TZ2": "Europe/Moscow"
    },
    "instances": 18,
    "cpus": 0.2,
    "mem": 64,
    "disk": 0,
    "executor": "",
    "constraints": [
      [
        "hostname",
        "UNIQUE"
      ]
    ],
    "uris": [],
    "storeUrls": [],
    "ports": [
      12001
    ],
    "requirePorts": false,
    "backoffSeconds": 5,
    "backoffFactor": 1,
    "maxLaunchDelaySeconds": 3600,
    "container": {
      "type": "DOCKER",
      "volumes": [],
      "docker": {
        "image": "myimage",
        "privileged": false,
        "parameters": []
      }
    },
    "healthChecks": [
      {
        "path": "/?n=marathon_healthcheck",
        "protocol": "HTTP",
        "portIndex": 0,
        "gracePeriodSeconds": 15,
        "intervalSeconds": 2,
        "timeoutSeconds": 5,
        "maxConsecutiveFailures": 3
      }
    ],
    "dependencies": [],
    "upgradeStrategy": {
      "minimumHealthCapacity": 1,
      "maximumOverCapacity": 1
    },
    "labels": {},
    "version": "2015-02-24T15:22:12.826Z",
    "tasksStaged": 0,
    "tasksRunning": 18,
    "tasksHealthy": 18,
    "tasksUnhealthy": 0,
    "deployments": [],
    "tasks": [
      {
        "id": "topface_lenny.e8bbce63-bc38-11e4-b191-56847afe9799",
        "host": "web452",
        "ports": [
          31126
        ],
        "startedAt": "2015-02-24T15:22:20.295Z",
        "stagedAt": "2015-02-24T15:22:13.678Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.053Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bbce63-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bc6aa5-bc38-11e4-b191-56847afe9799",
        "host": "web385",
        "ports": [
          31850
        ],
        "startedAt": "2015-02-24T15:22:19.463Z",
        "stagedAt": "2015-02-24T15:22:13.681Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.052Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bc6aa5-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bc1c84-bc38-11e4-b191-56847afe9799",
        "host": "web14",
        "ports": [
          31915
        ],
        "startedAt": "2015-02-24T15:22:17.784Z",
        "stagedAt": "2015-02-24T15:22:13.680Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.038Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bc1c84-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8ba6ecf-bc38-11e4-b191-56847afe9799",
        "host": "web305",
        "ports": [
          31880
        ],
        "startedAt": "2015-02-24T15:22:18.504Z",
        "stagedAt": "2015-02-24T15:22:13.668Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.035Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.715Z",
            "taskId": "topface_lenny.e8ba6ecf-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.f002e78b-bc38-11e4-b191-56847afe9799",
        "host": "web572",
        "ports": [
          31525
        ],
        "startedAt": "2015-02-24T15:22:26.925Z",
        "stagedAt": "2015-02-24T15:22:25.887Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:27.143Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.f002e78b-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8b9ab7c-bc38-11e4-b191-56847afe9799",
        "host": "web221",
        "ports": [
          31003
        ],
        "startedAt": "2015-02-24T15:22:19.418Z",
        "stagedAt": "2015-02-24T15:22:13.663Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.052Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8b9ab7c-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bc91b6-bc38-11e4-b191-56847afe9799",
        "host": "web386",
        "ports": [
          31821
        ],
        "startedAt": "2015-02-24T15:22:18.778Z",
        "stagedAt": "2015-02-24T15:22:13.683Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.038Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bc91b6-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8b8e829-bc38-11e4-b191-56847afe9799",
        "host": "web220",
        "ports": [
          31994
        ],
        "startedAt": "2015-02-24T15:22:17.101Z",
        "stagedAt": "2015-02-24T15:22:13.659Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.035Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8b8e829-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bdf14a-bc38-11e4-b191-56847afe9799",
        "host": "web169",
        "ports": [
          31356
        ],
        "startedAt": "2015-02-24T15:22:20.240Z",
        "stagedAt": "2015-02-24T15:22:13.691Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.052Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bdf14a-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bda329-bc38-11e4-b191-56847afe9799",
        "host": "web399",
        "ports": [
          31824
        ],
        "startedAt": "2015-02-24T15:22:19.262Z",
        "stagedAt": "2015-02-24T15:22:13.690Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.052Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bda329-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8ba20ae-bc38-11e4-b191-56847afe9799",
        "host": "web388",
        "ports": [
          31515
        ],
        "startedAt": "2015-02-24T15:22:17.487Z",
        "stagedAt": "2015-02-24T15:22:13.667Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.035Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8ba20ae-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8b9364b-bc38-11e4-b191-56847afe9799",
        "host": "web368",
        "ports": [
          31963
        ],
        "startedAt": "2015-02-24T15:22:18.680Z",
        "stagedAt": "2015-02-24T15:22:13.661Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.037Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8b9364b-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8b90f3a-bc38-11e4-b191-56847afe9799",
        "host": "web319",
        "ports": [
          31801
        ],
        "startedAt": "2015-02-24T15:22:18.054Z",
        "stagedAt": "2015-02-24T15:22:13.660Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.036Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8b90f3a-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8ba95e0-bc38-11e4-b191-56847afe9799",
        "host": "web351",
        "ports": [
          31796
        ],
        "startedAt": "2015-02-24T15:22:23.095Z",
        "stagedAt": "2015-02-24T15:22:13.669Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:25.093Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8ba95e0-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bd06e7-bc38-11e4-b191-56847afe9799",
        "host": "web182",
        "ports": [
          31992
        ],
        "startedAt": "2015-02-24T15:22:21.598Z",
        "stagedAt": "2015-02-24T15:22:13.686Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:23.080Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bd06e7-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bd5508-bc38-11e4-b191-56847afe9799",
        "host": "web317",
        "ports": [
          31119
        ],
        "startedAt": "2015-02-24T15:22:22.460Z",
        "stagedAt": "2015-02-24T15:22:13.687Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:23.082Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bd5508-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8bba752-bc38-11e4-b191-56847afe9799",
        "host": "web324",
        "ports": [
          31364
        ],
        "startedAt": "2015-02-24T15:22:19.410Z",
        "stagedAt": "2015-02-24T15:22:13.676Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:21.053Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8bba752-bc38-11e4-b191-56847afe9799"
          }
        ]
      },
      {
        "id": "topface_lenny.e8b9d28d-bc38-11e4-b191-56847afe9799",
        "host": "web217",
        "ports": [
          31987
        ],
        "startedAt": "2015-02-24T15:22:17.513Z",
        "stagedAt": "2015-02-24T15:22:13.665Z",
        "version": "2015-02-24T15:22:12.826Z",
        "appId": "/topface/lenny",
        "healthCheckResults": [
          {
            "alive": true,
            "consecutiveFailures": 0,
            "firstSuccess": "2015-02-24T15:22:19.039Z",
            "lastFailure": null,
            "lastSuccess": "2015-02-26T07:56:46.714Z",
            "taskId": "topface_lenny.e8b9d28d-bc38-11e4-b191-56847afe9799"
          }
        ]
      }
    ],
    "lastTaskFailure": {
      "appId": "/topface/lenny",
      "host": "web450",
      "message": "Abnormal executor termination",
      "state": "TASK_FAILED",
      "taskId": "topface_lenny.19929f55-bc37-11e4-b191-56847afe9799",
      "timestamp": "2015-02-24T15:09:17.960Z",
      "version": "2015-02-24T15:09:15.350Z"
    }
  }
}

@bobrik
Copy link
Contributor Author

bobrik commented Feb 26, 2015

Here's a simple app that reproduces the issue:

{"container": {"docker": {"image": "busybox:ubuntu-14.04"}, "type": "DOCKER"}, "mem": 64, "cmd": "tail -f /etc/hosts", "cpus": 0.1, "env": {"SOMETHING": "IS_WRONG"}, "id": "/wtf"}

@drexin
Copy link
Contributor

drexin commented Feb 26, 2015

I am not able to reproduce this with current master and your app definition.

@bobrik
Copy link
Contributor Author

bobrik commented Feb 26, 2015

I just deployed current master and problem is still there:

web488 ~ # curl -H "Content-type: application/json" -X PUT http://web488:8080/v2/apps/wtf -d '{"container": {"docker": {"image": "busybox:ubuntu-14.04"}, "type": "DOCKER"}, "mem": 64, "cmd": "tail -f /etc/hosts", "cpus": 0.1, "env": {"SOMETHING": "IS_WRONG"}, "id": "/wtf"}' && echo
{"version":"2015-02-26T10:37:47.650Z","deploymentId":"eaab6362-520c-47eb-9d82-477497f8d680"}
web488 ~ # curl http://web488:8080/v2/apps/wtf/versions && echo
{"versions":["2015-02-26T10:37:47.650Z"]}
web488 ~ # curl -H "Content-type: application/json" -X PUT http://web488:8080/v2/apps/wtf -d '{"container": {"docker": {"image": "busybox:ubuntu-14.04"}, "type": "DOCKER"}, "mem": 64, "cmd": "tail -f /etc/hosts", "cpus": 0.1, "id": "/wtf"}' && echo
{"version":"2015-02-26T10:38:01.843Z","deploymentId":"1e59eb92-f607-4124-8aa7-a4cae50c22f9"}
web488 ~ # curl http://web488:8080/v2/apps/wtf/versions && echo
{"versions":["2015-02-26T10:37:47.650Z"]}

Relevant log lines:

[2015-02-26 10:37:47,739] INFO 192.168.1.232 -  -  [26/Feb/2015:10:37:47 +0000] "PUT /v2/apps/wtf HTTP/1.1" 201 92 "-" "curl/7.26.0" (mesosphere.chaos.http.ChaosRequestLog:15)
[INFO] [02/26/2015 10:37:47.819] [marathon-akka.actor.default-dispatcher-4] [akka://marathon/user/MarathonScheduler/$a/UpgradeManager/eaab6362-520c-47eb-9d82-477497f8d680/$a] Successfully started 0 instances of /wtf
[2015-02-26 10:37:54,490] INFO 192.168.1.232 -  -  [26/Feb/2015:10:37:54 +0000] "GET /v2/apps/wtf/versions HTTP/1.1" 200 41 "-" "curl/7.26.0" (mesosphere.chaos.http.ChaosRequestLog:15)
[2015-02-26 10:38:01,952] INFO 192.168.1.232 -  -  [26/Feb/2015:10:38:01 +0000] "PUT /v2/apps/wtf HTTP/1.1" 200 92 "-" "curl/7.26.0" (mesosphere.chaos.http.ChaosRequestLog:15)
[2015-02-26 10:38:06,956] INFO 192.168.1.232 -  -  [26/Feb/2015:10:38:06 +0000] "GET /v2/apps/wtf/versions HTTP/1.1" 200 41 "-" "curl/7.26.0" (mesosphere.chaos.http.ChaosRequestLog:15)
[2015-02-26 10:38:41,388] INFO Received status update for task wtf.81a599ae-bda3-11e4-ae84-56847afe9799: TASK_RUNNING () (mesosphere.marathon.MarathonScheduler:148)
[INFO] [02/26/2015 10:38:41.395] [marathon-akka.actor.default-dispatcher-3] [akka://marathon/user/MarathonScheduler/$a/UpgradeManager/eaab6362-520c-47eb-9d82-477497f8d680/$b] New task wtf.81a599ae-bda3-11e4-ae84-56847afe9799 now running during app /wtf scaling, 0 more to go
[INFO] [02/26/2015 10:38:41.395] [marathon-akka.actor.default-dispatcher-3] [akka://marathon/user/MarathonScheduler/$a/UpgradeManager/eaab6362-520c-47eb-9d82-477497f8d680/$b] Successfully started 1 instances of /wtf
[2015-02-26 10:39:18,608] INFO Already running 1 instances of /wtf. Not scaling. (mesosphere.marathon.SchedulerActions:554)
[2015-02-26 10:39:18,643] INFO Received status update for task wtf.81a599ae-bda3-11e4-ae84-56847afe9799: TASK_RUNNING (Reconciliation: Latest task state) (mesosphere.marathon.MarathonScheduler:148)
[2015-02-26 10:39:18,675] INFO Received status update for task wtf.81a599ae-bda3-11e4-ae84-56847afe9799: TASK_RUNNING (Reconciliation: Latest task state) (mesosphere.marathon.MarathonScheduler:148)

@drexin
Copy link
Contributor

drexin commented Feb 26, 2015

This is what I get:

λ curl -H "Content-Type: application/json" -XPUT localhost:8080/v2/apps/wtf?force=true -d '{"container": {"docker": {"image": "busybox:ubuntu-14.04"}, "type": "DOCKER"}, "mem": 64, "cmd": "tail -f /etc/hosts", "cpus": 0.1, "env": {"SOMETHING": "IS_WRONG"}, "id": "/wtf"}'
{"version":"2015-02-26T10:54:37.622Z","deploymentId":"4e92a196-6867-4645-8080-025fe1e2ea61"}
λ curl localhost:8080/v2/apps/wtf/versions
{"versions":["2015-02-26T10:54:37.622Z"]}
λ curl -H "Content-Type: application/json" -XPUT localhost:8080/v2/apps/wtf?force=true -d '{"container": {"docker": {"image": "busybox:ubuntu-14.04"}, "type": "DOCKER"}, "mem": 64, "cmd": "tail -f /etc/hosts", "cpus": 0.1, "env": {}, "id": "/wtf"}'
{"version":"2015-02-26T10:54:48.914Z","deploymentId":"f7b73c5a-67fc-4dc2-b620-21f5134a7a54"}
λ curl localhost:8080/v2/apps/wtf/versions
{"versions":["2015-02-26T10:54:48.914Z","2015-02-26T10:54:37.622Z"]}

@bobrik
Copy link
Contributor Author

bobrik commented Feb 26, 2015

You used "env":{}, I removed it completely. Looks like in current master empty object works as expected.

Is omitting means "keep it as it was" in PUT /v2/apps?

@drexin
Copy link
Contributor

drexin commented Feb 26, 2015

Yes, the PUT works more like a PATCH. We have been discussing this for quite some time and it may change in the future.

@bobrik
Copy link
Contributor Author

bobrik commented Feb 26, 2015

Then feel free to close this issue if there's another one.

@drexin drexin closed this as completed Feb 26, 2015
@ConnorDoyle
Copy link
Contributor

Yes, rather unfortunately our PUT behaves like a badly implemented PATCH. That's what allows you to only supply values that change in the JSON.

On Feb 26, 2015, at 03:20, Ian Babrou notifications@github.com wrote:

You used "env":{}, I removed it completely. Looks like in current master empty object works as expected.

Is omitting means "keep it as it was" in PUT /v2/apps?


Reply to this email directly or view it on GitHub.

@d2iq-archive d2iq-archive locked and limited conversation to collaborators Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants