Skip to content

Separate downloads from action execution to provide more download options #12665

@coeuvre

Description

@coeuvre

In the current implementation of remote execution, outputs can only be downloaded when an action executes. We should
separate downloads from action execution so that we can provide more download options to users. For example:

  1. Provide a download API so that other code can download outputs of previously executed actions when necessary. Use cases:
    • Currently, we download the outputs after executed an action remotely and wait for the downloads to complete before starting execution of other actions. We can change to download the outputs of current action and start executing next action in the same time. This will improve the performance of full-downloads mode a lot.
    • Some files downloaded by the minimal/toplevel mode are symlink pointing to files we didn't download. There are some issues root-caused by this behavior. We can provide options to download the actual files when reading the symlink. This will fix most of bugs related to symlink produced by remote execution.
    • Dynamic execution can download outputs of previously remotely executed action in the local branch.
  2. Add a post-build step for downloads so that we can download files which are only known after the build complete. Use cases:
    • We can combine this with aspects and BEP to download files required by IDE after the build.
    • Tests require some of the outputs to run. There are some issues related to running tests with top-level mode which should be fixed by this change.
  3. Add a command line flag to only download arbitrary output files. Use cases:
    • Allow to download anything of the output tree without going through the build steps

We need a way to specify which files to download after the build (option 2) or with the download flag (option 3). For example:

  • Reuse the flags --remote_download_toplevel to only download output files of top level targets and --remote_download_minimal to only download necessary files.
  • Add a new flag which accept a list of targets whose output files should be downloaded.
  • I am not sure how to specify download files at file level. Is that useful (and can be implemented) to support regex search over the output tree? (like rg over a directory)

Options for downloading the content of a symlink file:

  • Provide a flag to control whether the download should follow the symlinks, this applies to all 3 download options above
  • When the code is reading the content of a symlink file (e.g. in the RemoteActionFS), we can follow the symlink using option 1
  • When other tools are reading the content of a symlink (e.g. IDE), the tool can use option 3 to download the file.
  • When users want to read the content of a symlink, they can use option 3 to download the file manually.

Related Issues

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-Remote-ExecIssues and PRs for the Execution (Remote) teamtype: feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions