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

[remote] Respect whether the server supports action cache updates #16624

Closed

Conversation

Yannic
Copy link
Contributor

@Yannic Yannic commented Nov 1, 2022

Only a subset of users may be allowed to update the action cache (e.g., only CI but not devs).

Today, there are 2 ways to achive the desired behavior:

  • GetCapabilities returning that all users are allowed to update, and UpdateActionResult returning an error that Bazel prints and ignores, or
  • have the users that are not allowed to update the action cache set --remote_upload_local_results=false.

Why don't we instead respect whether the remote cache supports uploading action results?

Note that this requires support from the remote system to fully work (i.e., it needs to return update_enabled = false for users that don't have permission). Otherwise, Bazel's behavior will be the same as before this change: failed UpdateActionResult do not cause the build to fail. The only change this introduces is that Bazel will no longer error if --remote_upload_local_results=true and GetCapabilities returning update_enabled = false.

Only a subset of users may be allowed to update the action cache
(e.g., only CI but not devs).

Today, there are 2 ways to achive the desired behavior:
  - `GetCapabilities` returning that all users are allowed to update,
    and `UpdateActionResult` returning an error that Bazel prints and
    ignores, or
  - have the users that are not allowed to update the action cache
    set `--remote_upload_local_results=false`.

Why don't we instead respect whether the remote cache supports
uploading action results?

Note that this requires support from the remote system to fully work
(i.e., it needs to return `update_enabled = false` for users that
don't have permission). Otherwise, Bazel's behavior will be the
same as before this change: failed `UpdateActionResult` do not cause
the build to fail. The only change this introduces is that Bazel
will no longer error if `--remote_upload_local_results=true`
and `GetCapabilities` returning `update_enabled = false`.
@Yannic Yannic requested a review from a team as a code owner November 1, 2022 13:37
@bduffany
Copy link
Contributor

bduffany commented Nov 1, 2022

@Yannic what do you think about printing an info- or warning-level message if remote_upload_local_results=true but the server returns update_enabled=false? Maybe something like "INFO: remote cache has disabled action result uploads, so --remote_upload_local_results setting will be ignored."

Asking because users might be confused by action uploads silently not working, especially if they are intentionally passing --remote_upload_local_results at the command line (though I understand the messaging might be considered "noise" if users don't care whether their results are uploaded or not). "Why wasn't <X> a cache hit?" is one of our most common support requests, so just want to minimize confusion there.

@sgowroji sgowroji added the team-Remote-Exec Issues and PRs for the Execution (Remote) team label Nov 1, 2022
@Yannic
Copy link
Contributor Author

Yannic commented Nov 1, 2022

@bduffany That sounds reasonable, at least for a transition period. It's also known server-side, so it would be possible to add a warning server-side for that (e.g., on the result page).

@Yannic Yannic marked this pull request as draft November 1, 2022 20:52
@Yannic Yannic marked this pull request as ready for review November 7, 2022 19:01
@Yannic
Copy link
Contributor Author

Yannic commented Nov 7, 2022

@coeuvre @meisterT PTAL

@Yannic
Copy link
Contributor Author

Yannic commented Nov 7, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Nov 7, 2022
@Yannic
Copy link
Contributor Author

Yannic commented Nov 7, 2022

I'd like to get this into 6.0.0 if at all possible

@coeuvre coeuvre added the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Nov 8, 2022
@copybara-service copybara-service bot closed this in 128d833 Nov 8, 2022
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Nov 8, 2022
@Yannic Yannic deleted the yannic-remotecache-respect-server-caps branch November 8, 2022 18:40
Yannic added a commit to EngFlow/bazel that referenced this pull request Nov 9, 2022
…ates

Only a subset of users may be allowed to update the action cache (e.g., only CI but not devs).

Today, there are 2 ways to achive the desired behavior:
  - `GetCapabilities` returning that all users are allowed to update, and `UpdateActionResult` returning an error that Bazel prints and ignores, or
  - have the users that are not allowed to update the action cache set `--remote_upload_local_results=false`.

Why don't we instead respect whether the remote cache supports uploading action results?

Note that this requires support from the remote system to fully work (i.e., it needs to return `update_enabled = false` for users that don't have permission). Otherwise, Bazel's behavior will be the same as before this change: failed `UpdateActionResult` do not cause the build to fail. The only change this introduces is that Bazel will no longer error if `--remote_upload_local_results=true` and `GetCapabilities` returning `update_enabled = false`.

Closes bazelbuild#16624.

PiperOrigin-RevId: 486901751
Change-Id: I0991f6891e21711df1e23ae0998a8bc95e2389bc
meteorcloudy pushed a commit that referenced this pull request Nov 10, 2022
…ates (#16724)

Only a subset of users may be allowed to update the action cache (e.g., only CI but not devs).

Today, there are 2 ways to achive the desired behavior:
  - `GetCapabilities` returning that all users are allowed to update, and `UpdateActionResult` returning an error that Bazel prints and ignores, or
  - have the users that are not allowed to update the action cache set `--remote_upload_local_results=false`.

Why don't we instead respect whether the remote cache supports uploading action results?

Note that this requires support from the remote system to fully work (i.e., it needs to return `update_enabled = false` for users that don't have permission). Otherwise, Bazel's behavior will be the same as before this change: failed `UpdateActionResult` do not cause the build to fail. The only change this introduces is that Bazel will no longer error if `--remote_upload_local_results=true` and `GetCapabilities` returning `update_enabled = false`.

Closes #16624.

PiperOrigin-RevId: 486901751
Change-Id: I0991f6891e21711df1e23ae0998a8bc95e2389bc
@meteorcloudy meteorcloudy removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants