Skip to content
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

Update logging config #30863

Merged
merged 1 commit into from
Dec 19, 2022
Merged

Conversation

peytondmurray
Copy link
Contributor

@peytondmurray peytondmurray commented Dec 2, 2022

Why are these changes needed?

This PR simplifies some logging configuration in accordance with extended discussions with @xwjiang2010 and @rkooo567. Changes:

  • Avoid an unnecessary binding the 'filelock' logger to a variable in python/ray/autoscaler/_private/local/node_provider.py to discourage use within ray
  • Made a note in logservicer.py (mostly for myself) that the logging configuration there is not to be messed with because it runs in a separate thread
  • Log to a module logger release/ray_release/logger.py, rllib/examples/sumo_env_local.py, and rllib/examples/tune/framework.py, python/ray/_private/runtime_env/_clonevirtualenv.py
  • Remove custom logging configuration in rllib and experimental/raysort/main.py; we will use the global ray logging configuration here moving forward
  • Logging configuration in rllib can no longer be set from AlgorithmConfig; use standard logging configuration routes going forward
  • Added an explanation of logging configuration in kuberay

Anything that runs in a separate process was left unmodified, as per the discussion here: #30005.

Related issue number

Partly addresses #30005.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@peytondmurray peytondmurray force-pushed the update-logging-config branch 2 times, most recently from 0ccb25f to 307167a Compare December 5, 2022 18:42
@peytondmurray peytondmurray changed the title [WIP] Update logging config Update logging config Dec 5, 2022
@peytondmurray peytondmurray marked this pull request as ready for review December 5, 2022 18:46
@rkooo567 rkooo567 self-assigned this Dec 5, 2022
Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

For rllib changes, I think we need rllib folks approval. cc @sven1977 who's the best person who can take a look at this PR?

Comment on lines 47 to 50
# The logging configuration here is for the sidecar container, but we need the
# logs to go to the same place as the head node logs because the autoscaler
# is allowed to communicate with another Ray process (the log monitor) via logs
# in that directory. However, the Ray head container sets up the log directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you split this sentence up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely. I've split it up and reworded it - what do you think now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

LGTM though we still need approval from the rllib. I will ping one of guys there

@rkooo567
Copy link
Contributor

can you also merge the latest master?

@rkooo567
Copy link
Contributor

cc @gjoliver to take a look

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thanks for this cleanup @peytondmurray ! One more thing for RLlib. Since we don't use the AlgorithmConfig.log_level setting anymore, we should properly deprecate it.

In rllib/algorithms/algorithm_config.py, can you:

self.log_level = "WARN" -> self.log_level = DERPECATED_VALUE

...
def debugging()
...
        log_level: Optional[str] = NotProvided, -> log_level=DEPRECATED_VALUE,

...
    # and further down in that same method:
    if log_level != DERECATED_VALUE:
        deprecation_warning(old="config.log_level", help="[describe here, how RLlib users should set their log levels, instead]", error=False)

Thanks so much!

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Dec 15, 2022
@peytondmurray
Copy link
Contributor Author

Thanks @sven1977, I just pushed your requested changes. If the tests pass 🤞 I think we'll be good to merge.

@peytondmurray peytondmurray removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Dec 15, 2022
@rkooo567
Copy link
Contributor

@sven1977 we need your approval for the merge! Thank you!

Signed-off-by: pdmurray <peynmurray@gmail.com>
@rkooo567
Copy link
Contributor

cc @gjoliver @sven1977

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for this PR @peytondmurray !

@sven1977 sven1977 merged commit 608276b into ray-project:master Dec 19, 2022
@peytondmurray peytondmurray deleted the update-logging-config branch December 19, 2022 23:21
AmeerHajAli pushed a commit that referenced this pull request Jan 12, 2023
rkooo567 added a commit to rkooo567/ray that referenced this pull request Jan 23, 2023
rkooo567 added a commit that referenced this pull request Jan 23, 2023
This reverts commit 608276b.

Looks like this breaks the backward compatibility of rllib (it is supposed to print warn first, but it prints the info log).
rkooo567 added a commit that referenced this pull request Jan 24, 2023
This reverts commit 608276b.

Looks like this breaks the backward compatibility of rllib (it is supposed to print warn first, but it prints the info log).
tamohannes pushed a commit to ju2ez/ray that referenced this pull request Jan 25, 2023
Signed-off-by: tmynn <hovhannes.tamoyan@gmail.com>
rkooo567 pushed a commit that referenced this pull request May 19, 2023
Attempts to consolidate logging configuration by introducing reasonable defaults in ray/log.py.
This new logging configuration is done once in ray/__init__.py at the top of the module. Subsequent calls to the configuration are ignored.
A logger for ray.rllib is configured at the WARN level, to address Revert "Simplify logging configuration. (#30863)" #31858. With this change,
Revert "Simplify logging configuration. (#30863)" #31858 can be reverted, again simplifying and consolidating logging configuration.
Modified test_output.py::test_logger_config to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to call ray.init here to check that logging was configured correctly.
Modified python/ray/tune/tests/test_commands.py::test_ls_with_cfg to test the underlying data, not what gets printed to stdout (which has changed with the new logging system).
Modified a logging message in ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete, which in certain cases emits a logging message which tries to format a NoneType into a %f during log message formatting. This was a previously-undetected bug which showed up because the default log level is now INFO. This fixes a test that was failing in test_automl_searcher.py::AutoMLSearcherTest.
scv119 pushed a commit to scv119/ray that referenced this pull request Jun 16, 2023
…ay-project#34182)

Attempts to consolidate logging configuration by introducing reasonable defaults in ray/log.py.
This new logging configuration is done once in ray/__init__.py at the top of the module. Subsequent calls to the configuration are ignored.
A logger for ray.rllib is configured at the WARN level, to address Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858. With this change,
Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858 can be reverted, again simplifying and consolidating logging configuration.
Modified test_output.py::test_logger_config to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to call ray.init here to check that logging was configured correctly.
Modified python/ray/tune/tests/test_commands.py::test_ls_with_cfg to test the underlying data, not what gets printed to stdout (which has changed with the new logging system).
Modified a logging message in ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete, which in certain cases emits a logging message which tries to format a NoneType into a %f during log message formatting. This was a previously-undetected bug which showed up because the default log level is now INFO. This fixes a test that was failing in test_automl_searcher.py::AutoMLSearcherTest.
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…ay-project#34182)

Attempts to consolidate logging configuration by introducing reasonable defaults in ray/log.py.
This new logging configuration is done once in ray/__init__.py at the top of the module. Subsequent calls to the configuration are ignored.
A logger for ray.rllib is configured at the WARN level, to address Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858. With this change,
Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858 can be reverted, again simplifying and consolidating logging configuration.
Modified test_output.py::test_logger_config to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to call ray.init here to check that logging was configured correctly.
Modified python/ray/tune/tests/test_commands.py::test_ls_with_cfg to test the underlying data, not what gets printed to stdout (which has changed with the new logging system).
Modified a logging message in ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete, which in certain cases emits a logging message which tries to format a NoneType into a %f during log message formatting. This was a previously-undetected bug which showed up because the default log level is now INFO. This fixes a test that was failing in test_automl_searcher.py::AutoMLSearcherTest.

Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
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.

4 participants