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

add env var to allow dashboard http server to serve static files with symlinks #45618

Merged
merged 4 commits into from
May 30, 2024

Conversation

alanwguo
Copy link
Contributor

Why are these changes needed?

New env var is called RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS.

This is an advanced setting that should only be used with special Ray installations
where the dashboard build files are symlinked to a different directory.
This is not recommended for most users and can pose a security risk.
Please reference the aiohttp docs here:
https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static

Related issue number

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

@alanwguo alanwguo requested a review from thomasdesr May 29, 2024 17:09
Copy link
Contributor

@GeneDer GeneDer left a comment

Choose a reason for hiding this comment

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

LGTM!

# Please reference the aiohttp docs here:
# https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static
ENV_VAR_FOLLOW_SYMLINKS = "RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS"
FOLLOW_SYMLINKS_ENABLED = os.environ.get(ENV_VAR_FOLLOW_SYMLINKS, "0") == "1"
Copy link
Contributor

@GeneDer GeneDer May 29, 2024

Choose a reason for hiding this comment

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

Nit: Probably no need to have default "0" as None will not match "1" should still default to false if not set.

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocker: can probably also log a message here if it's enabled to suggest the security risk to the user as well.

Signed-off-by: Alan Guo <[email protected]>
Signed-off-by: Alan Guo <[email protected]>
Signed-off-by: Alan Guo <[email protected]>
@alanwguo alanwguo added the go add ONLY when ready to merge, run all tests label May 30, 2024
@rkooo567 rkooo567 merged commit 480b572 into ray-project:master May 30, 2024
7 checks passed
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
… symlinks (ray-project#45618)

New env var is called RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS.

This is an advanced setting that should only be used with special Ray installations
where the dashboard build files are symlinked to a different directory.
This is not recommended for most users and can pose a security risk.
Please reference the aiohttp docs here:
https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static

Signed-off-by: Ryan O'Leary <[email protected]>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
… symlinks (ray-project#45618)

New env var is called RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS.

This is an advanced setting that should only be used with special Ray installations
where the dashboard build files are symlinked to a different directory.
This is not recommended for most users and can pose a security risk.
Please reference the aiohttp docs here:
https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static

Signed-off-by: Ryan O'Leary <[email protected]>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 7, 2024
… symlinks (ray-project#45618)

New env var is called RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS.

This is an advanced setting that should only be used with special Ray installations
where the dashboard build files are symlinked to a different directory.
This is not recommended for most users and can pose a security risk.
Please reference the aiohttp docs here:
https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static
richardsliu pushed a commit to richardsliu/ray that referenced this pull request Jun 12, 2024
… symlinks (ray-project#45618)

New env var is called RAY_DASHBOARD_BUILD_FOLLOW_SYMLINKS.

This is an advanced setting that should only be used with special Ray installations
where the dashboard build files are symlinked to a different directory.
This is not recommended for most users and can pose a security risk.
Please reference the aiohttp docs here:
https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.UrlDispatcher.add_static

Signed-off-by: Richard Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants