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
Docker bridge #621
Docker bridge #621
Conversation
- Adds AppDefinition.containerHostPorts() - Adds test cases to GroupManagerTest
Looking pretty good so far! GET /v2/apps/bridged-webapp/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Host: mesos.vm:8080
User-Agent: HTTPie/0.8.0 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": "python3 -m http.server 8080",
"constraints": [],
"container": {
"docker": {
"image": "python:3",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 8080,
"hostPort": 0,
"protocol": "tcp"
},
{
"containerPort": 161,
"hostPort": 0,
"protocol": "udp"
}
]
},
"type": "DOCKER",
"volumes": []
},
"cpus": 0.5,
"dependencies": [],
"deployments": [],
"disk": 0.0,
"env": {},
"executor": "",
"healthChecks": [
{
"command": null,
"gracePeriodSeconds": 5,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3,
"path": "/",
"portIndex": 0,
"protocol": "HTTP",
"timeoutSeconds": 20
}
],
"id": "/bridged-webapp",
"instances": 2,
"mem": 64.0,
"ports": [
10000,
10001
],
"requirePorts": false,
"storeUrls": [],
"tasks": [
{
"appId": "/bridged-webapp",
"healthCheckResults": [
{
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2014-09-25T02:47:40.805Z",
"lastFailure": null,
"lastSuccess": "2014-09-25T02:51:21.025Z",
"taskId": "bridged-webapp.4d5e55dc-445e-11e4-b90b-56847afe9799"
}
],
"host": "10.141.141.10",
"id": "bridged-webapp.4d5e55dc-445e-11e4-b90b-56847afe9799",
"ports": [
31004,
31005
],
"stagedAt": "2014-09-25T02:47:34.361Z",
"startedAt": "2014-09-25T02:51:01.661Z",
"version": "2014-09-25T02:26:59.256Z"
},
{
"appId": "/bridged-webapp",
"healthCheckResults": [
{
"alive": true,
"consecutiveFailures": 0,
"firstSuccess": "2014-09-25T02:39:20.314Z",
"lastFailure": null,
"lastSuccess": "2014-09-25T02:51:21.026Z",
"taskId": "bridged-webapp.1d63944b-445d-11e4-b90b-56847afe9799"
}
],
"host": "10.141.141.10",
"id": "bridged-webapp.1d63944b-445d-11e4-b90b-56847afe9799",
"ports": [
31002,
31003
],
"stagedAt": "2014-09-25T02:39:04.369Z",
"startedAt": "2014-09-25T02:51:01.673Z",
"version": "2014-09-25T02:26:59.256Z"
}
],
"tasksRunning": 2,
"tasksStaged": 0,
"upgradeStrategy": {
"minimumHealthCapacity": 1.0
},
"uris": [],
"user": null,
"version": "2014-09-25T02:26:59.256Z"
}
} and Docker agrees:
|
@drexin @michaeljin ready for review 🔍 |
|
||
val mappingsWithAssignedRandoms = mappings.map { | ||
case PortMapping(containerPort, 0, protocol) => | ||
PortMapping(containerPort, availablePorts.next, protocol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if availablePorts
is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, will modify this to surface any throwables wrapped by the Try
-- in fact, will probably change the method signature to just return the Try
.
LGTM, except for the 2 comments |
@drexin thanks for reviewing! Bringing the 🔨 down on the big shiny merge button. |
Fixes #587 (Docker bridged networking mode)
For initial review.
ports
attribute works as expected