-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Refactor command line argument parsing with gflags #4676
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
Refactor command line argument parsing with gflags #4676
Conversation
6f186f9 to
1a82e84
Compare
|
Test PASSed. |
|
Test PASSed. |
|
Test FAILed. |
|
Nice, this is much cleaner. Shall we use |
|
@robertnishihara The purpose of this PR is to implement this with minimizing dependencies. |
6cc00e6 to
c7de75d
Compare
Refine Enable in worker runner. Fix Fix sh scripts/format.sh Add doc comment. Fix lint
c7de75d to
ccf6728
Compare
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test FAILed. |
|
Test FAILed. |
python/ray/services.py
Outdated
| "-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), |
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.
worker command contains spaces, will this be an issue?
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.
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.
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.
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), |
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.
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?
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.
gflags supports double dashes too.
src/ray/raylet/main.cc
Outdated
| 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."); |
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.
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.
|
Test FAILed. |
|
Test PASSed. |
|
Test PASSed. |
|
Test FAILed. |
|
Test FAILed. |
|
Using |
|
I think gflags is good to use, it is already linked in because of gtest as far as I know. |
|
Thanks @pcmoritz and @robertnishihara . I have already switched to gflags. |
raulchen
left a comment
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.
Lint check failed
|
Test PASSed. |
|
Test PASSed. |
BUILD.bazel
Outdated
| exclude = [ | ||
| "src/ray/util/logging_test.cc", | ||
| "src/ray/util/signal_test.cc", | ||
| "src/ray/util/util_test.cc", |
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.
This no longer exists, right?
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.
Nice catch!
|
Test PASSed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
What do these changes do?
Integrate
gflagsand refine the command line arguments parsing. This can make us more easily to add a option to raylet.Related Issue
This can close #2280.
scripts/format.shto lint the changes in this PR.