Skip to content

[Core/Auth][docs] Document token authentication on by default for all clusters - #67724

Merged
rueian merged 6 commits into
ray-project:masterfrom
MortalHappiness:docs/token-auth-67056-default-on
Nov 3, 2026
Merged

rueian merged 6 commits into
ray-project:masterfrom
MortalHappiness:docs/token-auth-67056-default-on

Conversation

@MortalHappiness

@MortalHappiness MortalHappiness commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

Updates the docs for #67523, which makes token authentication the default for every cluster:

  • ray-security/token-auth.md and core/internals/token-authentication.md: who creates the token, how nodes and clients get it, and the RAY_AUTH_MODE=disabled opt-out.
  • cluster/metrics.md: scraping with the token, and RAY_AUTH_SKIP_METRICS.
  • VM, on-prem, Slurm, YARN, starting-ray.md and Serve deploy-vm.md: create the token before ray start --head. The cluster YAML reference documents the new auth_mode key.
  • conf.py: removes the token-auth banner.

The KubeRay guide is left to #67057.

Related issues

Closes #67056

@MortalHappiness MortalHappiness added the go add ONLY when ready to merge, run all tests label Nov 3, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@MortalHappiness
MortalHappiness marked this pull request as ready for review November 3, 2026 02:00
@MortalHappiness
MortalHappiness requested a review from a team as a code owner November 3, 2026 02:00
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@MortalHappiness
MortalHappiness requested review from a team as code owners November 3, 2026 02:00
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Nov 3, 2026

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @MortalHappiness, this is a style and grammar review from the Ray docs team. Douglas Strodtman ran it with help from Claude Code, and has read and stands behind every comment. It covers prose, grammar, and docs conventions against the Ray documentation style guide. It doesn't cover whether the described behavior is correct. That belongs to the Core maintainers, and @rueian's approval covers it.

This is a clear rewrite. Moving the token steps into the VM, on-prem, Slurm, YARN, and Serve guides is the right call for a change of default, and the mismatch table under "Opt out" is useful. The inline suggestions are mostly sentence structure: comma-wrapped asides, one inline six-item list, and two heading-case fixes in on-premises.md. They don't change any technical claim. The one exception is the comment on token-auth.md L21, which is a question about consistency between two pages in this PR.

Questions

  1. Removing the banner in conf.py. Before Ray 2.61, the banner warned readers that the default was about to change. Once 2.61 ships, this is the release where upgrades start failing for clusters without a token, so a short pointer could still help. For example: "Starting in Ray 2.61, token authentication is on by default for all clusters. Read the setup guide." Did you mean to drop the banner, or replace it? Either way is fine from the docs side. I just want to make sure removing it was intentional.
  2. ray up behavior in three places. The token-shipping description appears in getting-started.md, the auth_mode reference entry, and token-auth.md. They agree today, and the token-auth page links to the getting-started section. If any detail changes later, someone will need to update all three. That's not a blocker, just a note for whoever maintains these pages.

From the docs side, nothing here blocks the PR.

Comment thread doc/source/ray-security/token-auth.md Resolved
Comment thread doc/source/ray-security/token-auth.md Outdated
Starting in Ray 2.61, token authentication is on for every Ray cluster unless you set `RAY_AUTH_MODE=disabled`. Ray authenticates all external APIs and internal communications with the token as a shared secret. Every node in a cluster and every client that connects to it needs the same token.

The process for generating and configuring authentication tokens differs depending on how you launch your Ray cluster. When you start a local instance of Ray using `ray.init()` with token authentication enabled, Ray automatically generates and uses a token.
Only the following create a token when none exists:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question, not a style fix: this list says "Only the following" and names three entry points, but core/internals/token-authentication.md in this same PR names six, adding ray.cluster_utils.Cluster(), ray.cluster_utils.AutoscalingCluster, and C++ and Java drivers that start their own cluster. A reader who compares the two pages sees a contradiction on the word "Only." Would you either drop "Only" here, or say this list covers the common entry points and link to the internals page for the full set? I'll defer to you on which framing is accurate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I dropped "Only" here and added a sentence after the list: Ray's test cluster utilities and C++ and Java drivers that start their own cluster also create a token, with a link to the internals page for the full list. The three entry points shown are the ones most readers use.

Comment thread doc/source/ray-security/token-auth.md Resolved
Comment thread doc/source/ray-security/token-auth.md Resolved
Comment thread doc/source/ray-security/token-auth.md Resolved

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs stamp removes other Ray library CODEOWNER requirements for docs-only PRs.

Approving here to unblock, as it looks like edits in other areas are small. Trusting you to communicate with other library maintainers as necessary on this change.

Thanks!

# The entrypoint (simple-trainer.py) will only run on the head node.
# Create the auth token once. Every node reads it from ~/.ray/auth_token,
# so this assumes the home directory is shared across the job's nodes.
ray get-auth-token --generate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we redirect stdout here: ray get-auth-token --generate > /dev/null? This command prints the token even when it already exists, so every job writes the persistent cluster credential into its Slurm output log

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.


`ray metrics launch-prometheus` needs no change when it runs where the token is. It fails if it finds no token. When `RAY_AUTH_TOKEN` is set, it writes the token into its own config with file mode `0600`. Otherwise, the config reads the token file at `RAY_AUTH_TOKEN_PATH` or `~/.ray/auth_token`. The config is `ray_prometheus.yml` in the Prometheus directory it downloads, such as `./prometheus-<version>.linux-amd64/`.

If you run your own Prometheus, including one that uses the config Ray generates at `/tmp/ray/session_latest/metrics/prometheus/prometheus.yml`, copy the token file to the Prometheus host and add an `authorization` block to the `ray` scrape job:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: could we also update the HTTP service discovery example above to include an authorization block inside http_sd_configs? auth on the scrape job only authenticates metric scrapes. discovery uses a separate HTTP client

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@rueian
rueian enabled auto-merge (squash) November 3, 2026 22:56
@rueian
rueian merged commit 24e1bd2 into ray-project:master Nov 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs][Core/Auth] Document token authentication on by default for all clusters

5 participants