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

Specify acceptable optimizations for input roots #216

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EricBurnett
Copy link
Collaborator

Clarify semantics for how files in the input root should appear to actions, and how implementations may deviate from this ideal for performance reasons.

This wording is proposed as one possible direction we could specify, for further discussion following conversation at the Remote Execution WG monthly.

@EdSchouten please go ahead and propose your preferred alternative. This is not intended to be committed until/unless we've had a chance to see the alternatives and attain consensus here.

Clarify semantics for how files in the input root should appear to actions, and how implementations may deviate from this ideal for performance reasons.
EdSchouten added a commit to EdSchouten/remote-apis that referenced this pull request Apr 12, 2022
This change acts as a counter proposal to PR bazelbuild#216. Instead of globally
stating whether files should be hardlinked or not, it adds the ability
to let clients control whether files are aliased.

It achieves this by adding a salt field to FileNode. If two files have
the same salt and all other (non-name) properties match, they SHOULD get
constructed in the form of hardlinks.
@jmillikin
Copy link
Contributor

Related: bazelbuild/bazel#10299 is a Bazel issue that requests the ability to mark files as non-symlinkable, to be more compatible with JavaScript ecosystem tools. The workaround I used in that case was inelegant: forcing non-symlink placement for any files that are executable or end in .js.

It would be nice if clients could tag specific files as needing special treatment, even if that tag were as general-purpose as "do not optimize placement or storage of this file at all".

EdSchouten added a commit to EdSchouten/remote-apis that referenced this pull request Apr 12, 2022
This change acts as a counter proposal to PR bazelbuild#216. Instead of globally
stating whether files should be hardlinked or not, it adds the ability
to let clients control whether files are aliased.

It achieves this by adding a salt field to FileNode. If two files have
the same salt and all other (non-name) properties match, they SHOULD get
constructed in the form of hardlinks.
EdSchouten added a commit to EdSchouten/remote-apis that referenced this pull request Apr 12, 2022
This change acts as a counter proposal to PR bazelbuild#216. Instead of globally
stating whether files should be hardlinked or not, it adds the ability
to let clients control whether files are aliased.

It achieves this by adding a salt field to FileNode. If two files have
the same salt and all other (non-name) properties match, they SHOULD get
constructed in the form of hardlinks.
@ulfjack
Copy link
Collaborator

ulfjack commented Apr 16, 2022

It might make sense to have more of a discussion around what the options and expectations are:

  1. There are four ways of making files appear: symlink, hardlink, copy, and clonefile (not all of these are available on all platforms or file systems).
  2. There are also questions around permissions (are files read-only or read-write? who owns the files?), which aren't covered so far.

I think most people would expect that the files are standalone (copy or clonefile), and that they can be modified. However, in our experience, copy is the slowest option, and hardlinked files have to be read-only to avoid corruption. We have an undocumented platform option to select between these options as an escape hatch (can be set on a per-action basis), but haven't actually needed it so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants