Skip to content

Conversation

@jovany-wang
Copy link
Contributor

@jovany-wang jovany-wang commented Apr 20, 2019

What do these changes do?

Integrate gflags and refine the command line arguments parsing. This can make us more easily to add a option to raylet.

Related Issue

This can close #2280.

  • I've run scripts/format.sh to lint the changes in this PR.

@jovany-wang jovany-wang force-pushed the command_line_args_parser branch 2 times, most recently from 6f186f9 to 1a82e84 Compare April 22, 2019 12:12
@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/549/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/550/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13908/
Test FAILed.

@robertnishihara
Copy link
Collaborator

Nice, this is much cleaner. Shall we use gflags? Some discussion in #2280.

@jovany-wang
Copy link
Contributor Author

jovany-wang commented Apr 23, 2019

@robertnishihara The purpose of this PR is to implement this with minimizing dependencies.
If you don't think gflag is heavy, I'd also like to using it.

@jovany-wang jovany-wang force-pushed the command_line_args_parser branch from 6cc00e6 to c7de75d Compare April 23, 2019 03:53
Refine

Enable in worker runner.

Fix

Fix

sh scripts/format.sh

Add doc comment.

Fix lint
@jovany-wang jovany-wang force-pushed the command_line_args_parser branch from c7de75d to ccf6728 Compare April 23, 2019 03:54
@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/557/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/558/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/559/
Test PASSed.

@jovany-wang jovany-wang changed the title [WIP] Refactor command line argument parsing of raylet Refactor command line argument parsing with gflags Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@ray-project ray-project deleted a comment from AmplabJenkins Apr 23, 2019
@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/561/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13923/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13924/
Test FAILed.

"-static_resource_list={}".format(resource_argument),
"-config_list={}".format(config_str),
"-python_worker_command={}".format(start_worker_command),
"-java_worker_command={}".format(java_worker_command),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worker command contains spaces, will this be an issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that we can pass "-java_worker_command" and java_worker_command as 2 separate args, then we don't need to worry about spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine. The value of java_worker_command can be passed into raylet smoothly in this way.(The reason is similar to the 2 separated args you mentioned.)

buildPythonWorkerCommand(), // python worker command
buildWorkerCommandRaylet(), // java worker command
redisPasswordOption
String.format("-raylet_socket_name=%s", rayConfig.rayletSocketName),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the convention is to use double dashes for full names (--raylet_socket_name). why does gflag use single dash? Does gflag also support double?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gflags supports double dashes too.

DEFINE_bool(disable_stats, false, "Whether disable the stats.");
DEFINE_string(stat_address, "127.0.0.1:8888", "The address that we report metrics to.");
DEFINE_bool(disable_stdout_exporter, true,
"Whether disable the stdout exporter for stats.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this to enable_stdout_exporter with default value false. Then we can just use --enable_std_exporter, instead of --disable_stdout_exporter=false.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13926/
Test FAILed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/566/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/567/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13932/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13931/
Test FAILed.

@robertnishihara
Copy link
Collaborator

Using gflags seems ok to me. Is it particularly heavyweight? If it turns out to be an issue, then we can switch.

@pcmoritz
Copy link
Contributor

I think gflags is good to use, it is already linked in because of gtest as far as I know.

@jovany-wang
Copy link
Contributor Author

Thanks @pcmoritz and @robertnishihara . I have already switched to gflags.

Copy link
Contributor

@raulchen raulchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint check failed

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/575/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/576/
Test PASSed.

BUILD.bazel Outdated
exclude = [
"src/ray/util/logging_test.cc",
"src/ray/util/signal_test.cc",
"src/ray/util/util_test.cc",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer exists, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-Perf-Integration-PRB/577/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13941/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13943/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/13942/
Test FAILed.

@raulchen raulchen merged commit f39b674 into ray-project:master Apr 24, 2019
@raulchen raulchen deleted the command_line_args_parser branch April 24, 2019 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using gflags or similar for argument parsing

5 participants