Skip to content

Comments

Symlink actions cache#4260

Open
paveliak wants to merge 5 commits intoactions:mainfrom
paveliak:symlink-actions-cache
Open

Symlink actions cache#4260
paveliak wants to merge 5 commits intoactions:mainfrom
paveliak:symlink-actions-cache

Conversation

@paveliak
Copy link
Contributor

Presently we do bunch of IOPS to install 1st-party actions from archive that could be expensive for small VM SKU runners:

  • Tarball is copied into the staging directory
  • Tarball is unpacked there
  • Staging directory is copied into the workspace

With this change unpacked tarballs (if available) are symlinked into the workspace upon starting up the job.

NOTE: this change requires reactive work in the image

@paveliak paveliak requested a review from a team as a code owner February 23, 2026 22:06
Copilot AI review requested due to automatic review settings February 23, 2026 22:06
@paveliak paveliak force-pushed the symlink-actions-cache branch from 6080382 to 6be088d Compare February 23, 2026 22:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a feature-flagged optimization to reduce I/O when installing cached action repositories by symlinking an already-unpacked action directory from the runner’s action archive cache into the workspace, instead of copying/unpacking each time.

Changes:

  • Add a new feature flag (actions_symlink_cached_actions) to enable symlinking cached, unpacked actions.
  • Implement a symlink fast-path in ActionManager.DownloadRepositoryActionAsync when an unpacked cache directory is present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Runner.Worker/ActionManager.cs Adds the symlink-from-unpacked-cache fast-path before falling back to the existing archive-cache/copy/extract logic.
src/Runner.Common/Constants.cs Declares the new feature flag string constant used to gate the behavior.

if (!string.IsNullOrEmpty(actionArchiveCacheDir) &&
Directory.Exists(actionArchiveCacheDir))
{
var symlinkCachedActions = executionContext.Global.Variables.GetBoolean(Constants.Runner.Features.SymlinkCachedActions) ?? false;
Copy link
Member

Choose a reason for hiding this comment

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

do we want to also check an ENV that only set by hosted runner? I am to make sure the new code path won't get used by self-hosted runner.

Copy link
Contributor Author

@paveliak paveliak Feb 24, 2026

Choose a reason for hiding this comment

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

@TingluoHuang What are your concerns here? That something gets accidentally broken or it is security related (cache poisoning, etc)? Normally self-hosted runner would not see those directories and will execute the original code path

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.

2 participants