Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Does not work with self-hosted #41

Open
alexandru-calinoiu opened this issue Dec 13, 2019 · 8 comments
Open

Does not work with self-hosted #41

alexandru-calinoiu opened this issue Dec 13, 2019 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@alexandru-calinoiu
Copy link

When I run on a self-hosted runner I always get an error that ruby was not found,

Preatty sure it has something to do with your note

. Note that this action only uses versions of Ruby already installed in the cache. 

How do I prime that cache?

@alexandru-calinoiu
Copy link
Author

alexandru-calinoiu commented Dec 23, 2019

Can anyoane please make me understand how this works, our build server spends a lot of time now building ruby every time, the energy consumption escalates to the climate problems we are having.

@masa-iwasaki
Copy link

This action uses only versions in the tool cache as explaind in README.

optionally installing a version of ruby and adding to PATH. Note that this action only uses versions of Ruby already installed in the cache. The action will fail if no matching versions are found.

If self-hosted runner doesn't provide a way to build tool caches, which has been installed in default virtual-environments, I guess you need to setup Ruby by yourself without this action.

@bryanmacfarlane
Copy link
Member

You can populate a tool cache directory with various versions and it will work. I will try and write something up. (hint: run env to see the tool cache root and dump it's directory structure on a hosted run).

@bryanmacfarlane bryanmacfarlane added the documentation Improvements or additions to documentation label Jan 7, 2020
@bryanmacfarlane
Copy link
Member

#44

@aashish108
Copy link

Heya, just started needing Ruby env on a self hosted runner. Not sure what to do here? Self hosted is my only option. Not sure if there is a long way round as sudo access is not usable. Thanks!

@everops-alex
Copy link

This is something we've dealt with as well, and as a work around we cache several rubies, pythons, sbt's in our runner image. It would be awesome if we could use the setup-* in self-hosted. 🙏

@eregon
Copy link
Contributor

eregon commented May 7, 2020

If self-hosted is there any guarantee it's running one of the well-known virtual environments (ubuntu-latest/macos-latest/windows-latest)?
If not, then it seems necessary to build Ruby yourself on that runner.

Then you would like to use setup-* with that pre-installed Ruby?
That might already work if the pre-installed Ruby is recognized as part of the tool cache.
This action doesn't do much beyond adding ruby/bin to PATH though.

@bryanmacfarlane
Copy link
Member

If the goal is to do matrix testing (test my code against all these versions of ruby) then I think as long as you build and populate the tool cache in the prescribed directory layout it should work. Which is what find does: https://github.com/actions/setup-ruby/blob/master/src/cache.ts#L6

Should be something laid out in the cache dir by tool name, version and optionally arch.

$(RUNNER_TOOL_CACHE)
 |_ ruby
     |_ (version)
         |_ [arch]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants