-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
cache: yarn
doesn't work for a self hosted runner
#313
Comments
If you self-host the runner, why not simply install yarn on it? |
Problem is that yarn is an application that uses node. setup-node installs node. but setup-node cannot install node, because it uses the program that is written in node to do the caching. |
Maybe i got you wrong, but if you host your own runner, you can install whatever you want so the software is already there before your action starts. Make a vm with a custom image containing node. Only after that, install the github runner sw. |
So, basically the idea is to not use setup node to set up node on the self hosted runners? |
Okay, do we have a solution for this? Sure we can install it on the self-hosted runners, but the whole error is stupid... |
I totally agree.
And I still think that setup-node should install yarn, atleast when cache: yarn is set to be true
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Bjoern Jaenichen ***@***.***>
Sent: Thursday, September 2, 2021 5:32:11 PM
To: actions/setup-node ***@***.***>
Cc: Igor N. Dultsev ***@***.***>; Author ***@***.***>
Subject: Re: [actions/setup-node] `cache: yarn` doesn't work for a self hosted runner (#313)
Okay, do we have a solution for this?
Sure we can install it on the self-hosted runners, but the whole error is stupid...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#313 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKRLNOXKA5L5E2XOLQUXGDT76KHXANCNFSM5BVNWBFQ>.
|
@DirkLachowski how would you use multiple versions of node.js? |
Hello everyone! It's an expected behavior. If the runner does not have appropriate tool preinstalled it's expected that caching will fail. Please preinstall yarn to your self-hosted runners by your own. |
Yes, but the problem is that the tool depends on node, which you're taking care of installing! |
Basically, I have to install node, to be able to install node. That sounds counterintuitive, and wrong |
@dmitry-shibanov could you kindly make an doc section to explain how self-hosted runners should setup their config so they achieve caching? We're a bit blocked/lost about this. We followed the documention, yet on every new install yarn is re-installing deps. |
@n0mer By building one image per node version. Pinning your environment is what you want anyway to have reproducible builds. |
I came here stuck with this problem in 2023 and it seemed like few people didn't understand what @yhaskell was saying but I do. Still looking for a way out |
In the documentation, there is a section called
Caching packages dependencies
, which suggests to usecache: yarn
for caching yarn dependencies.On GitHub runners, it works, since GitHub runners have both node and yarn already installed, and therefore there is no problem.
On self-hosted runner, this is not a case.
Which leads us to a catch-22 situation: setup-node action actually expects node to be installed (together with yarn).
Therefore, the action itself fails (since it cannot run yarn during setup).
My proposal is maybe to actually install yarn during the action, at least if we need it for action to success.
Thanks!
The text was updated successfully, but these errors were encountered: