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

Issues using self-hosted runners #25

Closed
humphd opened this issue Oct 17, 2023 · 3 comments · Fixed by #26
Closed

Issues using self-hosted runners #25

humphd opened this issue Oct 17, 2023 · 3 comments · Fixed by #26

Comments

@humphd
Copy link

humphd commented Oct 17, 2023

I'm having a bunch of issues running this action with a self-hosted runner. Everything worked well until I made a change today to update some versions in pixi.toml.

My action basically looks like this:

env:
  PIXI_VERSION: 0.5.0

jobs:
  Lint:
    runs-on: [self-hosted, Linux, X64, ubuntu-22.04]
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Setup pixi
      uses: prefix-dev/[email protected]
      with:
        pixi-version: v${{ env.PIXI_VERSION }}

    ...
  
  Test:
    runs-on: [self-hosted, Linux, X64, ubuntu-22.04]
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3

    - name: Setup pixi
      uses: prefix-dev/[email protected]
      with:
        pixi-version: v${{ env.PIXI_VERSION }}

    ...

When I updated the pixi.toml and pixi.lock, I get errors:

TestENOENT: no such file or directory, lstat '.pixi'
--
TestDestination file path /home/github/.pixi/bin/pixi already exists

or

Run prefix-dev/[email protected]
Downloading Pixi
Error: Destination file path /home/github/.pixi/bin/pixi already exists

I've tried every combo of post-cleanup:true/post-cleanup:false based on the docs, and tried with and without cache:true.

I'm not sure how to fix this. Any tips?

@pavelzw
Copy link
Collaborator

pavelzw commented Oct 17, 2023

It looks like your runner persists its state between runs. Ideally, you would redeploy the runner image after each run to not persist old state.

For the case when this is not possible, post-cleanup: true should be the solution. This will delete all of the pixi stuff from the runner after it's finished. You probably executed the action once with post-cleanup: false which resulted in the action failing. To fix this issue, you can do

- run: rm -rf $HOME/.pixi

before the setup-pixi stuff once.

An alternative would be to use pixi-bin-path: ${{ runner.temp }}/bin/pixi. This should put pixi to a temporary location instead of in $HOME

@humphd
Copy link
Author

humphd commented Oct 17, 2023

I like the pixi-bin-path: ${{ runner.temp }}/bin/pixi approach along with post-cleanup: true, that seems to have been enough to fix our issue. I wonder if it's worth calling out in the README where you discuss self-hosted runners? I wouldn't have come to this solution without your guidance.

Thank you so much for your quick response! We have nothing but the highest of respect for the pixi devs and what you're building. It's really great software and very much appreciated.

@pavelzw
Copy link
Collaborator

pavelzw commented Oct 17, 2023

Good idea, see #26!

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 a pull request may close this issue.

2 participants