mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: Review Request 55191: Add hostname support to the network/cni isolator.
Date Thu, 05 Jan 2017 17:04:12 GMT

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

(Updated Jan. 5, 2017, 5:04 p.m.)


Review request for mesos, Avinash sridharan, Jie Yu, and Jiang Yan Xu.


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


Repository: mesos


Description
-------

Since the task info contains a `hostname` field, allow schedulers to
use this to specify the hostname that is assigned to the container.


Diffs
-----

  src/slave/containerizer/mesos/isolators/network/cni/cni.hpp 276b9003aa2671b9ca819e44fb1cd60ae9dff167

  src/slave/containerizer/mesos/isolators/network/cni/cni.cpp ea91c71fdfac48a2fc1d31a0ee088a73244be367


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


Testing (updated)
-------

make check (Fedora 25)

Manual testing:
```
[jpeach@jpeach mesos-config]$ /opt/mesos/bin/mesos-execute --master=127.0.0.1:5050 --task=file://$(pwd)/sleep-task.json
...
[jpeach@jpeach mesos-config]$ cat sleep-task.json
{
  "name": "sleep",
  "agent_id": { "value": "any" },
  "task_id": {
    "value": "sleep-1"
  },
  "resources": [
    {
      "name": "cpus",
      "type": "SCALAR",
      "scalar": {
        "value": 0.4
      },
      "role": "*"
    },
    {
      "name": "mem",
      "type": "SCALAR",
      "scalar": {
        "value": 32
      },
      "role": "*"
    }
  ],
  "command": {
    "value": "ip link > link; ip addr > addr; ip route > route; sleep 1000",
    "environment": {
        " variables": [
            { "name": "GLOG_v", "value": "2" }
        ]
    }
  },
  "container": {
    "type": "MESOS",
    "hostname": "sleep.jpeach.org",
    "network_infos": {
        "name": "cni-test"
    },
    "mesos": {
      "image": {
        "type": "DOCKER",
        "docker": {
            "name": "gala"
        }
      }
    }
  }
}
...
[root@jpeach jpeach]# nsenter -t 2934 -m -u -i -n -w -r
[root@sleep sandbox]# cat /etc/hostname
sleep.jpeach.org[root@sleep sandbox]# hostname
sleep.jpeach.org
[root@sleep sandbox]#
```

CNI Tests (Fedora 25):
```
[jpeach@jpeach build]$ sudo bin/mesos-tests.sh --gtest_filter=*Cni*
...
[==========] Running 7 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 7 tests from CniIsolatorTest
...
[----------] 7 tests from CniIsolatorTest (16490 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 1 test case ran. (16514 ms total)
[  PASSED  ] 7 tests.
```


Thanks,

James Peach


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message