-
Notifications
You must be signed in to change notification settings - Fork 17
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
How to use Volta in CI #43
Comments
@dustinsoftware Out of curiosity, what is the use case for calling Alternatively, you can use the |
I just noticed rustup has a precedence algorithm that involves env vars in a way that would work well for CI matrices, which gives me some confidence that that approach could work for Volta. Unlike rustup, though, I think there would need to be more than one variable: one for each dimension that should be independently controlled. Probably we’d want variables like |
FYI I just spent some time getting volta to work on CircleCI. After some experimentation, I arrived at the following setup which seems to work as expected now: commands:
setup-node-version:
description: Install volta & ensure consistent node & yarn versions are installed
steps:
- run:
name: Install volta
command: |
curl https://get.volta.sh | bash
echo 'export VOLTA_HOME=$HOME/.volta' >> $BASH_ENV
echo 'export PATH=$VOLTA_HOME:$PATH' >> $BASH_ENV
- run:
name: Pin node@10
command: volta install node@10
- run:
name: Pin yarn@1.19
command: volta install yarn@1.19 Note that I had to add both Somewhat related, on Github Actions I didn't need to do anything but |
For folks wanting to use volta with GitHub actions, I created https://github.com/rwjblue/setup-volta (see usage details in README). I hope to be able to move that repo into the |
Nice! I played around with this myself (turns out, it didn't "just work" on Github, it just so happened by accident that the default installed yarn/node versions matched the ones I had setup, so it seemed like Volta was working 🤕 ), with a much more "basic" implementation - although it does some other things as well (setting up problem matchers, ..): https://github.com/mydea/actions-ember-testing - Might just remove the volta part from it and use yours, as it seems more thorough :) |
FYI - The GitHub action has been moved into this org: |
fyi, @mydea 's comment above isn't quite right: the PATH-setting line should say |
Any updates? Did anyone set up volta in the bitbucket pipelines? |
I was also struggling with this in and Azure DevOps pipeline. So this worked for me in Azure DevOps:
|
@spiderhands This worked for me in bitbucket pipelines: - step:
caches:
- node
name: "Install frontend dependencies and start dev server"
script:
- curl https://get.volta.sh | bash
- export VOLTA_HOME=$HOME/.volta
- export PATH=$VOLTA_HOME/bin:$PATH
- volta install node
- npm install
- node --version
- node server.js & |
Oh, just realised it might be useful for people here to know that GitHub's own |
@shreejan-regmi01 what image are you using as a base for this? the only two things i need in my pipeline are volta and aws cli
|
I used the image |
I use the first 3 lines of that script in my bitbucket pipelines. But the download fails sometimes, with a 404. And then the entire pipeline fails of course. Is that because of rate limiting? Or does the pipeline run at the same time 'volta latest' gets changed and it's just an unlucky timing issue? Is there some other way the volta people would like to do this? Because this can hammer their download URL quite a bit if all the runs of everyone start with downloading the script. |
I planned to use Volta in my CI, to ease experimentation across dev teams, but as I understand it, it will lead to every single CI job downloading Node/Npm at each start. Is there a way to make Volta efficient in CI ? |
Most ci/cd systems i know of have caching methods you can define.
For instance , i can mark any folder as a cache , which means that folder
is placed as is in Amy ci/cd job, unless it isn't used for over a week, in
that case nothing gets restored so you start fresh.
Mark your ~/.volta directory (i think , typing this from memory ) as
cacheable , or save and restore it another way with every ci/cd job and it
should be fine ?
…On Thu, Feb 23, 2023, 20:43 Pazns ***@***.***> wrote:
I planned to use Volta in my CI, to ease experimentation across dev teams,
but as I understand it, it will lead to every single CI job downloading
Node/Npm at each start.
As it is running over Kubernetes pods, I would have mounted a volume from
the local node into the pod into a Volta download cache folder, to at least
mitigate the issue, and share the raw archives.
I don't know where this folder is, or if this is even possible as Volta
does low-level stuff with hard-links.
Is there a way to make Volta efficient in CI ?
—
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALMD2DSHSIYL4J6NINWJ4H3WY64UZANCNFSM4IOX4TGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I had a great conversation with @chancancode about using Volta in CI. The main takeaway was we should have instructions in the docs for how to use Volta in CI. But it turned out to be nontrivial and we should spend some time polishing the user experience and testing it out in popular CI systems (Travis, Circle, Azure Pipelines, and GitHub Actions). We should also have doc pages or sections for each of these popular CI systems.
Some of the challenges Godfrey ran into:
curl | bash
silently fails sometimes because of something about how Travis does download caching.eval
orsource
in the CI yaml?VOLTA_HOME/bin
?For reference, here's a fairly minimal travis config Godfrey is using for his project, where he got Volta working.
The text was updated successfully, but these errors were encountered: