Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-25 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 25, 2016, 1:24 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-25 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 25, 2016, 12:33 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-24 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 24, 2016, 5:22 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-24 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 24, 2016, 4:48 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-24 Thread Alexander Rukletsov

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/#review146651
---


Ship it!




Thanks a lot for doing manual testing, Haosdent!


src/docker/executor.cpp (line 87)


We don't need this here, but I'm fine leaving it, because most probably 
we'll have to pass it to the `HealthChecker` library in order to locate a 
wrapper for TCP health checks.


- Alexander Rukletsov


On Aug. 21, 2016, 6:42 p.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49555/
> ---
> 
> (Updated Aug. 21, 2016, 6:42 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón 
> Kleiman, Gilbert Song, Jie Yu, and Timothy Chen.
> 
> 
> Bugs: MESOS-5954
> https://issues.apache.org/jira/browse/MESOS-5954
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We change the mesos-executor to use health check via library way in
> https://reviews.apache.org/r/49389/. To keep consistent, we replace
> health check in mesos-docker-executor from binary way to library way.
> In this patch, we rename `healthCheckDir` to `launcherDir` as well to
> keep consistent with mesos-executor.
> 
> 
> Diffs
> -
> 
>   src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 
> 
> Diff: https://reviews.apache.org/r/49555/diff/
> 
> 
> Testing
> ---
> 
> Test with Marathon locally.
> 
> # 1. Success case.
> 
> I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
> as the health check command.
> 
> According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, 
> could see Marathon receive healthy status.
> 
> ```
> # truncate unnecessary messages
> {
>   "app": {
> "id": "/test-health",
> "cmd": "sleep 200",
> "container": {
>   "type": "DOCKER",
>   "volumes": [],
>   "docker": {
> "image": "ubuntu",
> "network": "HOST"
>   }
> },
> "healthChecks": [
>   {
> "protocol": "COMMAND",
> "command": {
>   "value": "ls /mnt/mesos/sandbox"
> },
> "gracePeriodSeconds": 300,
> "intervalSeconds": 60,
> "timeoutSeconds": 20,
> "maxConsecutiveFailures": 3
>   }
> ],
> "tasksStaged": 0,
> "tasksRunning": 1,
> "tasksHealthy": 1,
> "tasksUnhealthy": 0,
> "tasks": [
>   {
> "id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
> "slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
> "host": "127.0.0.1",
> "startedAt": "2016-08-02T02:55:23.433Z",
> "stagedAt": "2016-08-02T02:55:21.217Z",
> "version": "2016-08-02T02:48:31.054Z",
> "ipAddresses": [
>   {
> "ipAddress": "127.0.0.1",
> "protocol": "IPv4"
>   }
> ],
> "appId": "/test-health",
> "healthCheckResults": [
>   {
> "alive": true,
> "consecutiveFailures": 0,
> "firstSuccess": "2016-08-02T02:55:23.652Z",
> "lastFailure": null,
> "lastSuccess": "2016-08-02T02:55:23.652Z",
> "lastFailureCause": null,
> "taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
>   }
> ]
>   }
> ]
>   }
> }
> ```
> 
> # 2. Failed case.
> 
> Then I start a similar application which use `false` as health check command, 
> could see Marathon receive unhealthy status.
> 
> ```
> # truncate unnecessary messages
> {
>   "app": {
> "id": "/test-unhealth",
> "cmd": "sleep 200",
> "container": {
>   "type": "DOCKER",
>   "volumes": [],
>   "docker": {
> "image": "ubuntu",
> "network": "HOST"
>   }
> },
> "healthChecks": [
>   {
> "protocol": "COMMAND",
> "command": {
>   "value": "false"
> },
> "gracePeriodSeconds": 5,
> "intervalSeconds": 3,
> "timeoutSeconds": 20,
> "maxConsecutiveFailures": 3
>   }
> ],
> "tasksStaged": 0,
> "tasksRunning": 1,
> "tasksHealthy": 0,
> "tasksUnhealthy": 1,
> "tasks": [
>   {
> "id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
> "slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
> "host": "127.0.0.1",
> "startedAt": "2016-08-02T03:07:47.310Z",
> "stagedAt": "2016-08-02T03:07:45.041Z",
> "ipAddresses": [
>   {
> "ipAddress": "127.0.0.1",
> "protocol": "IPv4"
>   }
> ],
> "appId": "/test-unhealth",
> "healthCheckResults": [
>   {
> "alive": false,
> 

Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-21 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 21, 2016, 6:42 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-21 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 21, 2016, 6:21 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description (updated)
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.
In this patch, we rename `healthCheckDir` to `launcherDir` as well to
keep consistent with mesos-executor.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-15 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 15, 2016, 3:41 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Changes
---

Rebase.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang



Re: Review Request 49555: Updated mesos-docker-executor to use health check via library way.

2016-08-14 Thread haosdent huang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49555/
---

(Updated Aug. 14, 2016, 5:03 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Mahler, Gastón Kleiman, 
Gilbert Song, Jie Yu, and Timothy Chen.


Summary (updated)
-

Updated mesos-docker-executor to use health check via library way.


Bugs: MESOS-5954
https://issues.apache.org/jira/browse/MESOS-5954


Repository: mesos


Description (updated)
---

We change the mesos-executor to use health check via library way in
https://reviews.apache.org/r/49389/. To keep consistent, we replace
health check in mesos-docker-executor from binary way to library way.


Diffs (updated)
-

  src/docker/executor.cpp 8d679cd33b6ddf3a5c11bb8c458a97b8809473ac 

Diff: https://reviews.apache.org/r/49555/diff/


Testing
---

Test with Marathon locally.

# 1. Success case.

I start `sleep 200` with the Docker container and use `ls /mnt/mesos/sandbox` 
as the health check command.

According the qurey result of `http://localhost:8080/v2/apps/test-sleep`, could 
see Marathon receive healthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-health",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "ls /mnt/mesos/sandbox"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 1,
"tasksUnhealthy": 0,
"tasks": [
  {
"id": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T02:55:23.433Z",
"stagedAt": "2016-08-02T02:55:21.217Z",
"version": "2016-08-02T02:48:31.054Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-health",
"healthCheckResults": [
  {
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2016-08-02T02:55:23.652Z",
"lastFailure": null,
"lastSuccess": "2016-08-02T02:55:23.652Z",
"lastFailureCause": null,
"taskId": "test-health.8d4ba884-585c-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```

# 2. Failed case.

Then I start a similar application which use `false` as health check command, 
could see Marathon receive unhealthy status.

```
# truncate unnecessary messages
{
  "app": {
"id": "/test-unhealth",
"cmd": "sleep 200",
"container": {
  "type": "DOCKER",
  "volumes": [],
  "docker": {
"image": "ubuntu",
"network": "HOST"
  }
},
"healthChecks": [
  {
"protocol": "COMMAND",
"command": {
  "value": "false"
},
"gracePeriodSeconds": 5,
"intervalSeconds": 3,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3
  }
],
"tasksStaged": 0,
"tasksRunning": 1,
"tasksHealthy": 0,
"tasksUnhealthy": 1,
"tasks": [
  {
"id": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5",
"slaveId": "ec5359a2-9c63-4c2e-86da-3ed8ef94800b-S0",
"host": "127.0.0.1",
"startedAt": "2016-08-02T03:07:47.310Z",
"stagedAt": "2016-08-02T03:07:45.041Z",
"ipAddresses": [
  {
"ipAddress": "127.0.0.1",
"protocol": "IPv4"
  }
],
"appId": "/test-unhealth",
"healthCheckResults": [
  {
"alive": false,
"consecutiveFailures": 1,
"firstSuccess": null,
"lastFailure": "2016-08-02T03:07:53.800Z",
"lastSuccess": null,
"lastFailureCause": "",
"taskId": "test-unhealth.48a6318a-585e-11e6-9fb5-0242e663b1f5"
  }
]
  }
]
  }
}
```


Thanks,

haosdent huang