Re: Review Request 33109: Allow setting environment variables in mesos-execute
On May 11, 2015, 10:58 p.m., Adam B wrote: src/cli/execute.cpp, lines 203-204 https://reviews.apache.org/r/33109/diff/5-6/?file=939687#file939687line203 You can keep this as one statement, just wrap with the '=' at the start of the newline. Correction... wrap after the '='. (Sorry for the confusion) - Adam --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33109/#review83358 --- On April 25, 2015, 2:11 a.m., haosdent huang wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33109/ --- (Updated April 25, 2015, 2:11 a.m.) Review request for mesos and Adam B. Bugs: MESOS-2023 https://issues.apache.org/jira/browse/MESOS-2023 Repository: mesos Description --- Allow setting environment variables in mesos-execute Diffs - include/mesos/type_utils.hpp cdf5864389a72002b538c263d70bcade2bdffa45 src/cli/execute.cpp 84f70dccbc2c5dd43f68105d967f4488c82f582b src/common/parse.hpp 547b32041f39f0ff0c38179b66a32b2239134abc Diff: https://reviews.apache.org/r/33109/diff/ Testing --- ### Test without env ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' ``` The log from mesos, we could see the output is empty ``` Registered executor on localhostI0423 01:27:37.180140 14061 slave.cpp:1540] Sending queued task 'test' to executor 'test' of framework 20150423-012731-16777343-5050-14024- Starting task test Forked command at 14133 sh -c 'echo $a' I0423 01:27:37.183823 14064 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: be8664ab-a4ca-409e-87e4-de3756506c4a) for task test of framework 20150423-012731-16777343-5050-14024- from executor(1)@127.0.0.1:33700 ``` ### Test with env from command ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' --env={\a\: \stdin\} ``` The log from mesos, we could see the output is stdin ``` Registered executor on localhost Starting task test sh -c 'echo $a' Forked command at 14783 stdin I0423 01:30:41.750128 14063 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: e8b6cf52-9635-4393-94de-b16869e50c91) for task test of framework 20150423-012731-16777343-5050-14024-0001 from executor(1)@127.0.0.1:40051 ``` ### Test with env from file ``` $ cat /tmp/env {a: file} ``` ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' --env=file:///tmp/env ``` The log from mesos, we could see the output is file ``` Registered executor on localhost Starting task testsh -c 'echo $a' Forked command at 15258 file I0423 01:32:49.817705 14065 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: 9e8945d0-4921-41e8-a8e2-d64ec36eea16) for task test of framework 20150423-012731-16777343-5050-14024-0002 from executor(1)@127.0.0.1:56334 ``` Thanks, haosdent huang
Re: Review Request 33109: Allow setting environment variables in mesos-execute
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33109/ --- (Updated May 12, 2015, 6:24 a.m.) Review request for mesos and Adam B. Bugs: MESOS-2023 https://issues.apache.org/jira/browse/MESOS-2023 Repository: mesos Description --- Allow setting environment variables in mesos-execute Diffs (updated) - .clang-format PRE-CREATION .gitignore-template 934cad71a370d5c64d9a0994f775f39db74f5851 3rdparty/libprocess/3rdparty/stout/README.md 588f7393c43d528834aab8b6a14e4aee281417f3 3rdparty/libprocess/3rdparty/stout/include/Makefile.am 79239d738d0607364f8c3d7addfd54a642bdffc0 3rdparty/libprocess/3rdparty/stout/include/stout/format.hpp abe1a1d43659bda8e6af4f76c0ae4d1ad4b1c8c5 3rdparty/libprocess/3rdparty/stout/include/stout/hashset.hpp 21b059937f55927644ac3b19e1b5ccb1b45b6237 3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp 8784e76d79c7fb8d1a88dda4b0d5cbf6cdb12772 3rdparty/libprocess/3rdparty/stout/include/stout/lambda.hpp 6cbb2ac50dd23d78465e8690112fc01114ada07b 3rdparty/libprocess/3rdparty/stout/include/stout/memory.hpp dfaef77fa1af857c13e5d8705505dd86f5108578 3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp ea79b501d9ed7b7da9636ce9c9c590738a586993 3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp d72b4c19573be6f4eebfadef3c36cff350312bbb 3rdparty/libprocess/3rdparty/stout/include/stout/os/pstree.hpp 9426895f2bf3f77a5ba7ec87b97a2cbfe79adbf4 3rdparty/libprocess/3rdparty/stout/include/stout/tuple.hpp PRE-CREATION 3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp 60c0336082caf30b2d7943d85ef3bb7a534648d8 3rdparty/libprocess/configure.ac c5106cd09901781ca77d8c02c73919553a085876 3rdparty/libprocess/include/Makefile.am 8aab0593f296c7aae71289f9bd6cf3eb3578a721 3rdparty/libprocess/include/process/c++11/defer.hpp PRE-CREATION 3rdparty/libprocess/include/process/c++11/deferred.hpp PRE-CREATION 3rdparty/libprocess/include/process/c++11/delay.hpp PRE-CREATION 3rdparty/libprocess/include/process/c++11/dispatch.hpp PRE-CREATION 3rdparty/libprocess/include/process/c++11/executor.hpp PRE-CREATION 3rdparty/libprocess/include/process/collect.hpp c713c1bbc13ee50ae8c9773ee971a1b565be50f4 3rdparty/libprocess/include/process/defer.hpp 7c04736a3d29bf2c87057efb393ab3f9bdaa10eb 3rdparty/libprocess/include/process/deferred.hpp 3746d692f2c9a42f7865f83b74ed64b847181ffa 3rdparty/libprocess/include/process/delay.hpp 29e353246e270f853ed33c1fb677d35cdfcf41ca 3rdparty/libprocess/include/process/dispatch.hpp 617fd43394074fa3e1f0e656ff175e651137c86c 3rdparty/libprocess/include/process/event.hpp ad4a8f4f1de1f78f9af89954fd9c038eb2756ce4 3rdparty/libprocess/include/process/executor.hpp 157a1d29fa6e64f823b0ab40ec51889bf8947f60 3rdparty/libprocess/include/process/future.hpp c22d6c85cd52f7b91e47b6aee3dc4ed62978d245 3rdparty/libprocess/include/process/http.hpp 058fa02eeecdf31023db731734257a924d770079 3rdparty/libprocess/include/process/metrics/counter.hpp f9cab39907a7c5643576214c5dc00858808d1a56 3rdparty/libprocess/include/process/metrics/gauge.hpp 7d02cd5c2947b382b67fedc4ee912281a0c78b3b 3rdparty/libprocess/include/process/metrics/metric.hpp a7be2d793b75d6bf1f28ddd8d5360540323228f4 3rdparty/libprocess/include/process/metrics/timer.hpp b6f9fbd51279a702aa6875587311c06f6b6c5720 3rdparty/libprocess/include/process/mutex.hpp 99dd14f2883658e483807a4323d85bf80e05e7cb 3rdparty/libprocess/include/process/owned.hpp 054111316d6874026ac84496aa3f66fece11f861 3rdparty/libprocess/include/process/queue.hpp df8efc0752197a3fef2121e4355e128ff22a19db 3rdparty/libprocess/include/process/run.hpp a0d7286ce8470c2513258a2d6167a4a258a3f7bf 3rdparty/libprocess/include/process/shared.hpp d80fb7f236ffe12ede40b56668f0e992d41f8aec 3rdparty/libprocess/include/process/subprocess.hpp 37cab7755d2890619b64e1ca09e0b7ad0e72cf76 3rdparty/libprocess/include/process/timeseries.hpp ec0ac67bed5563bd85694d9ce9230450823f3b49 3rdparty/libprocess/src/http.cpp 67983ee4daf0601202c9360fe40ed28e9ef74755 3rdparty/libprocess/src/io.cpp 4944e2873ea858401cec592305e92f49cdfcb2a5 3rdparty/libprocess/src/libev_poll.cpp 6191be3bb9f5df80ae21c2d5da8e575f7df00e84 3rdparty/libprocess/src/process.cpp 588bd3e40a0b350ceca15bb8f3f78290ba41d173 3rdparty/libprocess/src/tests/http_tests.cpp d29cd29d8c0544671a09d204ca8ba4f24340e2de 3rdparty/libprocess/src/tests/process_tests.cpp 67e582cc250a9767a389e2bd0cc68985477f3ffb CHANGELOG f8d998dd31018546ae1ec646aeb128b9fb708f8d bootstrap 779b33cdcb88b2417769bb046a17b47cd6042f2d configure.ac fa53bbd416dffc3987f8ec28bd9a8ce2b32d6831 docs/clang-format.md 909a253b699fca37ae4ea0f8c9d680c9a5f012ed docs/mesos-c++-style-guide.md 13312f6f4fe1788791479bd768f60df0a8e80e69
Re: Review Request 33109: Allow setting environment variables in mesos-execute
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33109/ --- (Updated April 25, 2015, 9:11 a.m.) Review request for mesos and Adam B. Bugs: MESOS-2023 https://issues.apache.org/jira/browse/MESOS-2023 Repository: mesos Description --- Allow setting environment variables in mesos-execute Diffs (updated) - include/mesos/type_utils.hpp cdf5864389a72002b538c263d70bcade2bdffa45 src/cli/execute.cpp 84f70dccbc2c5dd43f68105d967f4488c82f582b src/common/parse.hpp 547b32041f39f0ff0c38179b66a32b2239134abc Diff: https://reviews.apache.org/r/33109/diff/ Testing --- ### Test without env ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' ``` The log from mesos, we could see the output is empty ``` Registered executor on localhostI0423 01:27:37.180140 14061 slave.cpp:1540] Sending queued task 'test' to executor 'test' of framework 20150423-012731-16777343-5050-14024- Starting task test Forked command at 14133 sh -c 'echo $a' I0423 01:27:37.183823 14064 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: be8664ab-a4ca-409e-87e4-de3756506c4a) for task test of framework 20150423-012731-16777343-5050-14024- from executor(1)@127.0.0.1:33700 ``` ### Test with env from command ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' --env={\a\: \stdin\} ``` The log from mesos, we could see the output is stdin ``` Registered executor on localhost Starting task test sh -c 'echo $a' Forked command at 14783 stdin I0423 01:30:41.750128 14063 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: e8b6cf52-9635-4393-94de-b16869e50c91) for task test of framework 20150423-012731-16777343-5050-14024-0001 from executor(1)@127.0.0.1:40051 ``` ### Test with env from file ``` $ cat /tmp/env {a: file} ``` ``` $ ./src/mesos-execute --master=127.0.0.1:5050 --name=test --command='echo $a' --env=file:///tmp/env ``` The log from mesos, we could see the output is file ``` Registered executor on localhost Starting task testsh -c 'echo $a' Forked command at 15258 file I0423 01:32:49.817705 14065 slave.cpp:2507] Handling status update TASK_RUNNING (UUID: 9e8945d0-4921-41e8-a8e2-d64ec36eea16) for task test of framework 20150423-012731-16777343-5050-14024-0002 from executor(1)@127.0.0.1:56334 ``` Thanks, haosdent huang