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

Path issue in github self-hosted runners Setup #424

Open
adi18fw opened this issue Jul 5, 2024 · 1 comment
Open

Path issue in github self-hosted runners Setup #424

adi18fw opened this issue Jul 5, 2024 · 1 comment

Comments

@adi18fw
Copy link

adi18fw commented Jul 5, 2024

I have created 8 GitHub runners on my local machine and set them up. However, when I try to run them using runsvc.sh, I encounter the following errors:

/github-runners/r1/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r2/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r3/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r4/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r5/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r6/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r7/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
/github-runners/r8/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory

However, if I navigate to ./externals/node16/bin/node in r1 and execute it directly, it works fine and opens the Node.js environment.

Here is my service file:

[Unit]
Description=Manage GitHub Actions Runners
After=network.target

[Service]
Type=simple
User=myuser
WorkingDirectory=/home/myuser/github-runners/

ExecStart=/bin/bash -c 'for i in {1..8}; do /home/myuser/github-runners/r$i/runsvc.sh start --instance r$i; done'

Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

@rsi-mrobinson
Copy link

rsi-mrobinson commented Jul 26, 2024

Seeing this issue as well with self-hosted runners. Disabling the wrapper by setting terraform_wrapper=false clears the error but seems to cause all stdout, stderr outputs to not populate.

update:

Worked out a workaround for this just throwing the plan into github_output

Setup Terraform (I'm using clowdhaus's action to grab the version based on my configuration):

- name: Terraform min/max versions
  id: minMax
  uses: clowdhaus/[email protected]

- name: Setup Terraform
  uses: hashicorp/setup-terraform@v3
  with:
    terraform_version: ${{ steps.minMax.outputs.maxVersion }}
    terraform_wrapper: false

Run the plan and set the output:

- name: Terraform Plan
  id: plan
  run: |
    terraform plan >/dev/null -no-color -out=tfplan
    plan=$(terraform show tfplan -no-color)
    {
      echo "PLAN<<EOF"
      echo "${plan}"
      echo "EOF"
    } >> $GITHUB_OUTPUT
  continue-on-error: true

Then in your script step set the plan variable

- uses: actions/github-script@v7
  env:
    PLAN: ${{ steps.plan.outputs.plan }}

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

No branches or pull requests

2 participants