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

Prioritize RUNNER_TOOL_CACHE over AGENT_TOOLSDIRECTORY #824

Closed
2 of 5 tasks
brendanhaines opened this issue Feb 25, 2024 · 5 comments
Closed
2 of 5 tasks

Prioritize RUNNER_TOOL_CACHE over AGENT_TOOLSDIRECTORY #824

brendanhaines opened this issue Feb 25, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@brendanhaines
Copy link

Description:
When RUNNER_TOOL_CACHE and AGENT_TOOLSDIRECTORY are both specified, AGENT_TOOLSDIRECTORY is used instead of RUNNER_TOOL_CACHE (a default environment variable)

process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];

Action version:
v5

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
all

Repro steps:
Define AGENT_TOOLSDIRECTORY environment variable (where AGENT_TOOLSDIRECTORY != RUNNER_TOOL_CACHE)

Expected behavior:
AGENT_TOOLSDIRECTORY should be ignored and existing python binary in cache (path specified by RUNNER_TOOL_CACHE) should be used.

Actual behavior:
Binary cannot be found in cache since we look in the wrong location, resulting in it being re-downloaded.

@brendanhaines brendanhaines added bug Something isn't working needs triage labels Feb 25, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @brendanhaines
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@priya-kinthali
Copy link
Contributor

Hello @brendanhaines 👋,
The RUNNER_TOOL_CACHE is a predefined environment variable in GitHub Actions runners that directs to a directory for caching tools and dependencies, facilitating reuse across workflow runs. This is elaborated in the default environment variables documentation.

For self-hosted runners on Linux and Windows, the AGENT_TOOLSDIRECTORY environment variable allows the specification of a custom directory for tool installations and caching, as detailed in the advanced usage documentation.
When you designate a custom directory with AGENT_TOOLSDIRECTORY, the RUNNER_TOOL_CACHE no longer defaults to the runner's preset directory.
If a specific tool version doesn't exist in the AGENT_TOOLSDIRECTORY directory, it is downloaded and cached for subsequent runs. In case the same tool version already exists in the cache, the workflow optimizes by using the cached version, thereby eliminating the need for a new download.
Hope this clarifies!

@priya-kinthali
Copy link
Contributor

Hello @brendanhaines 👋,
Just a gentle ping, I hope the previous explanation was helpful. Please feel free to reply if you have any further concerns. Thank you!

@priya-kinthali
Copy link
Contributor

Hello @brendanhaines👋,
Just a gentle reminder!

@priya-kinthali
Copy link
Contributor

Hello,
Due to inactivity, I'm going to close this issue for now. Please feel free to reopen this issue or create a new one if necessary. Thank you😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants