-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Core] Resubmit #47871 & #48030 and Fix the Failed Test for Windows #48054
Conversation
… Configs to Consider temp-dir Signed-off-by: Mengjin Yan <[email protected]>
Signed-off-by: Mengjin Yan <[email protected]>
Signed-off-by: Mengjin Yan <[email protected]>
Signed-off-by: Mengjin Yan <[email protected]>
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.
is this PR ready for review yet?
@@ -1,10 +1,10 @@ | |||
DASHBOARD_PROVISIONING_TEMPLATE = """ | |||
apiVersion: 1 | |||
# DASHBOARD_PROVISIONING_TEMPLATE = """ |
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.
why are these lines commented out?
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.
Thanks for pointing out!
This file and python/ray/dashboard/modules/metrics/grafana_datasource_template.py
should be deleted as I moved the content to the more general template file: python/ray/dashboard/modules/metrics/templates.py
. Something might be wrong when I reapplying the patch from the previous PR #47871. I'll update the PR to remove the files.
The original changes are reverted because a windows test failed due to the change. I did the fix and now waiting for all the CI tests to pass. It will be ready for review after the CI tests passed. |
…mplate file Signed-off-by: Mengjin Yan <[email protected]>
2. Make the test that specifies the temp-dir parameter doesn't run in Windows. This is because the specified path doesn't apply to Windows Signed-off-by: Mengjin Yan <[email protected]>
This is surprising since I thought Python can treat |
@aslonnie The PR passed the Windows test and I made sure the reverted changes are all included in this one so it should be ready to review. |
Thanks! I think there are 2 things we hit in the Windows test:
|
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.
Some style nits if they can be fixed in a separate PR.
# The function assumes the Ray cluster to be monitored by Prometheus uses the | ||
# default configuration with "/tmp/ray" as the default root temporary directory. | ||
# | ||
# This is to support the `ray metrics launch-prometheus` command, when a ray cluster |
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.
...when a Ray cluster...
# default configuration with "/tmp/ray" as the default root temporary directory. | ||
# | ||
# This is to support the `ray metrics launch-prometheus` command, when a ray cluster | ||
# is not started yet and we have no way to get a `--temp-dir` anywhere. So we choose |
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.
hasn't started yet and the user doesn't have a way to.....
shutil.rmtree(grafana_config_output_path) | ||
os.makedirs(os.path.dirname(grafana_config_output_path), exist_ok=True) | ||
shutil.copytree(GRAFANA_CONFIG_INPUT_PATH, grafana_config_output_path) | ||
# Create grafana configuration folder |
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.
Create Grafana configuration folder.
shutil.rmtree(self._grafana_config_output_path) | ||
os.makedirs(self._grafana_config_output_path, exist_ok=True) | ||
|
||
# Overwrite grafana's configuration file |
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.
verwrite Grafana's configuration file.
GRAFANA_INI_TEMPLATE.format( | ||
grafana_provisioning_folder=grafana_prov_folder_with_latest_session | ||
) | ||
) | ||
|
||
# Overwrite grafana's dashboard provisioning directory based on env var |
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.
Overwrite Grafana's dashboard provisioning directory based on env var.
# scrape_timeout is set to the global default (10s). | ||
scrape_configs: | ||
# Scrape from each ray node as defined in the service_discovery.json provided by ray. |
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.
Ray node...provided by Ray.
(capitalize Ray)
def test_prometheus_config_content(): | ||
# Test to make sure the content in the hardcoded file | ||
# (python/ray/dashboard/modules/metrics/export/prometheus/prometheus.yml) will | ||
# always be the same as the template (templates.py) used to generate prometheus |
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.
Prometheus
(capitalize Prometheus)
# Test to make sure the content in the hardcoded file | ||
# (python/ray/dashboard/modules/metrics/export/prometheus/prometheus.yml) will | ||
# always be the same as the template (templates.py) used to generate prometheus | ||
# config file when ray startup |
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.
when Ray starts up.
Why are these changes needed?
test_metrics_folder_and_content
failed because of the different file separator between linux and Windowsos.path.join
to generate the path for validation instead of directly using formatted stringRelated issue number
Closes #48037
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.