----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58337/#review172067 -----------------------------------------------------------
Fix it, then Ship it! Need to update `docs/configuration.md` as well. I could fix these when commit it, please take a look. src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp Lines 150-152 (patched) <https://reviews.apache.org/r/58337/#comment245140> I think pass a `vector<cgroups::devices::Entry> whitelistDeviceEntries` contains default and additional entries would be more simple. src/slave/flags.hpp Lines 102 (patched) <https://reviews.apache.org/r/58337/#comment245138> Perfer `cgroups_whitelist_devices` to keep consistent with `DEFAULT_WHITELIST_ENTRIES`. src/slave/flags.cpp Lines 456 (patched) <https://reviews.apache.org/r/58337/#comment245139> `devcies` seems no necessary. Let's use array here directly. ``` add(&Flags::cgroups_whitelist_devices, "cgroups_whitelist_devices", "JSON array representing the devices that will be additionally\n" "whitelisted by cgroups devices subsystem. This will take effect\n" "only when `cgroups/devices` is set in `--isolation` flag.\n" "Example:\n" "[\n" " {\n" " \"path\": \"/path/to/device\",\n" " \"read_access\": true,\n" " \"write_access\": false,\n" " \"mknod_access\": false\n" " }\n" "]\n" ); ``` - haosdent huang On April 17, 2017, 3:51 a.m., Zhongbo Tian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58337/ > ----------------------------------------------------------- > > (Updated April 17, 2017, 3:51 a.m.) > > > Review request for mesos and haosdent huang. > > > Bugs: MESOS-6791 > https://issues.apache.org/jira/browse/MESOS-6791 > > > Repository: mesos > > > Description > ------- > > Add allowed devices whitelist for cgroups/devices isolator. > > > Diffs > ----- > > src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.hpp > ca2727142a9f257168f3cae0958f7b4665b63cf6 > src/slave/containerizer/mesos/isolators/cgroups/subsystems/devices.cpp > 9b5cf83093796b0c0cc5057b612f80bc8b8ba72f > src/slave/flags.hpp 171f67e44518e858049d002fcf037715021da265 > src/slave/flags.cpp 9365da2c8462a4375a99a86210b9d6ec628510fe > > > Diff: https://reviews.apache.org/r/58337/diff/3/ > > > Testing > ------- > > For simple test: > > - Launch without additional devices: > 1. Start agent with `sudo mesos-agent --master=127.0.0.1:5050 > --work_dir=/tmp/mesos --isolation=cgroups/devices` > 2. try open `/dev/rtc0` and failed with permission denied. `sudo > mesos-execute --master=127.0.0.1:5050 --name=test --command="head -c 0 > /dev/rtc0"` > > > - Launch with additional devices: > 1. Start agent with `sudo mesos-agent --master=127.0.0.1:5050 > --work_dir=/tmp/mesos --isolation=cgroups/devices > --cgroups_whitelist_devices=[{'"path":"/dev/rtc0", "mknod_access":true, > "ad_access":true, "write_access":true}]'` > 2. open `/dev/rtc0` successfully. `sudo mesos-execute > --master=127.0.0.1:5050 --name=test --command="head -c 0 /dev/rtc0"` > > > Thanks, > > Zhongbo Tian > >
