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

fix: Use execProperties when remoteExecutionProperties is empty #19792

Conversation

stevebarrau
Copy link
Contributor

When defining a platform (for RBE); remote_execution_properties is marked as deprecated, thus we do not set it. If it is not set getPlatformProto does not read the execProperties instead, before defaulting to defaultExecProperties.

@stevebarrau stevebarrau requested a review from a team as a code owner October 11, 2023 10:34
@stevebarrau stevebarrau requested review from sdtwigg and removed request for a team October 11, 2023 10:34
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions labels Oct 11, 2023
Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

This change looks reasonable, but it also changed the behavior in the test //src/test/shell/bazel/remote:remote_execution_test.

Can you please update the tests to make sure they're still covering the same behavior that they were (not just changing the message checks to match the current). You'll probably need to explicitly clear out the exec properties (if that's what's causing the change).

Also can you add tests for these scenarios:

  • exec properties is set and remote execution properties is not
  • exec properties is set and remote execution properties is also set (exec properties should be ignored here)

@stevebarrau stevebarrau requested a review from a team as a code owner October 11, 2023 20:57
@stevebarrau
Copy link
Contributor Author

I am not sure I understand how to modify the exec properties from within those tests @katre ; do you have an example I could follow? I am planning on having tests to check the precedence order as follow:

  1. remote exec properties
  2. exec proporties
  3. default exec properties (this is the current test_platform_default_properties_invalidation IIUC)

@katre
Copy link
Member

katre commented Oct 11, 2023

So, for the existing test failures in remote_execution_test:

  • test_remote_exec_properties: I'm going to guess that your change means the default remote exec properties (from the flag) are not being applied, but that's just a guess. Regardless, the test clearly expects that both builds will succeed, but the second will not be a cache hit, because of the changed properties.
  • test_platform_default_properties_invalidation: Since this test also uses --remote_default_exec_properties, I'm assuming it's the same underlying problem as the above.

As far as new tests, here are some samples to crib from:

That will hopefully get you started, let me know if you have further questions.

@stevebarrau stevebarrau requested a review from katre October 12, 2023 17:24
Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

Thanks so much! The new tests are very useful. I have a few small comments but once you resolve those I'll be happy to get this merged. I really appreciate you working through the review with me and adding the tests.

When defining a platform (for RBE); remote_execution_properties is
marked as deprecated in [^1], thus we do not set it. If it is not set
getPlatformProto does not read the execProperties instead, before
defaulting to defaultExecProperties.

[^1]: https://bazel.build/reference/be/platforms-and-toolchains#platform.remote_execution_properties
@stevebarrau stevebarrau force-pushed the fix/use-execProperties-when-remoteExecutionProperties-is-empty branch from 2a846c7 to 703a830 Compare October 13, 2023 07:01
@stevebarrau
Copy link
Contributor Author

@katre thanks for all the reviews. I pushed many small commits for the review comment for ease of review. I am not familiar with the merge process in this project but the intent here to squash all those into one commit on merge.

Thanks for the pointers into other examples; they really helped in putting those tests together. Other things that helped were:

  • the ability to run bazel under a debugger (with the --host_jvm_debug flag)
  • test filtering to runes specific test. Kudos to the authors of the bash test framework.

I used IDEA JVM remote debugger in combination with the following command to run a single test without sharding; pretty good debug experience!

bazel test \
    --test_output=streamed \
    --test_filter=test_platform_default_properties_invalidation \
    //src/test/shell/bazel/remote:remote_execution_test

@stevebarrau stevebarrau requested a review from katre October 13, 2023 09:10
Copy link
Member

@katre katre left a comment

Choose a reason for hiding this comment

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

This looks good! It will be imported to our external repository for a further review and testing (which our team will handle), and then once submitted there be re-exported to GitHub as a single squashed commit.

@katre katre added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Oct 13, 2023
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Oct 13, 2023
@stevebarrau stevebarrau deleted the fix/use-execProperties-when-remoteExecutionProperties-is-empty branch October 24, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants