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

Every Process is now platform-specific (impacts remote caching) #16874

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Sep 14, 2022

First part of #16873, and necessary for #16852

A concrete impact of this for users is that remote cache users can now never share results between different platforms. This was already very likely though due to #12203.

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano added the category:internal CI, fixes for not-yet-released features, etc. label Sep 14, 2022
Copy link
Contributor Author

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Given how unlikely cross-platform caching was to work anyways given #12203, maybe this should be a Plugin API Change rather than User API Change?

@@ -405,7 +398,7 @@ impl ExecuteProcess {
level,
append_only_caches,
jdk_home,
platform_constraint,
platform_constraint: Some(process_config.platform),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could simplify this to no longer be an Option, but I figured maybe it's easier to keep it in place for part 2 of #16873?

@Eric-Arellano Eric-Arellano enabled auto-merge (squash) September 14, 2022 23:47
@Eric-Arellano Eric-Arellano merged commit cc8a190 into pantsbuild:main Sep 15, 2022
@Eric-Arellano Eric-Arellano deleted the always-set-platform branch September 15, 2022 00:39
Eric-Arellano added a commit that referenced this pull request Sep 16, 2022
For Remote Execution, we currently hardcode the platform for the runner:

https://github.com/pantsbuild/pants/blob/ba7566515016ab91668c3610666594844dd5e7db/src/rust/engine/src/context.rs#L204-L206

This won't work as we move to remote execution being a per-environment/process mechanism, such as via #16890. We will add remote execution environment targets, which will allow users to set different platform properties per environment, such as using different Docker images. Thus, each environment target will have a `platform` field because it may be different among them. So, the platform must come from the environment target, not a global hardcoded value.

Our remote command runner doesn't like the platform being optional. In practice, it no longer was optional thanks to #16874, but our types did not reflect that.

When we add back platform-agnostic processes, we will use a new field to indicate this, while still setting the platform. See #16873.

[ci skip-build-wheels]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants