GithubHelp home page GithubHelp logo

Comments (6)

myoung34 avatar myoung34 commented on May 22, 2024 1

having a shebang line #!/bin/bash doesnt make it executable. You need to probably need to chmod +x that script to be safe or check permissions.

There's not much I can do here, I'm not sure how to troubleshoot a third party repo but this one seems to work with all the other workflows thrown at it.

from docker-github-actions-runner.

RainbowMango avatar RainbowMango commented on May 22, 2024

Hi @myoung34 ,
I have a script and it's executable:

-rwxr-xr-x  1 root root  697 Nov 11 10:03 verify-codegen.sh

The job is

  codegen:
    name: codegen
    runs-on: self-hosted
    steps:
      - name: checkout code
        uses: actions/checkout@v2
      - name: install Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.14.x
      - name: verify codegen
        run: hack/verify-codegen.sh

The same job runs all well before, but after I switched to selfhost-runner, it always has Permission issue:

/tmp/github-runner-your-repo/_temp/596a7601-8880-4e26-a527-96d9ba0f3a8c.sh: line 1: hack/verify-codegen.sh: Permission denied

PS: I'm running with deployment.

from docker-github-actions-runner.

myoung34 avatar myoung34 commented on May 22, 2024

@RainbowMango @Jollerprutt The reason I can't help you is because as a base: there's nothing preventing this from workign as far as this project is concerned.

To prove that this works as expected:

$ docker run \
  -e REPO_URL="https://github.com/OctoKode/test1" \
  -e RUNNER_NAME="foo-runner" \
  -e RUNNER_TOKEN="redact" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  myoung34/github-runner:latest

And committed this test push: OctoKode/test1@ce44c44

Its essentially the same as your verify codegen as far as executing is concerned:

name: Test

on: [push]

jobs:
  test:
    runs-on: self-hosted
    steps:
    - uses: actions/checkout@v1
    - name: ls
      run: ls -alh; pwd
    - name: verify codegen
      run: ./test.sh

where test.sh is +x and

#!/bin/bash
echo something

which gives me:

√ Connected to GitHub
2021-03-21 20:54:32Z: Running job: test
2021-03-21 20:54:37Z: Job test completed with result: Succeeded

From the runner

The output is here: https://github.com/OctoKode/test1/runs/2161381995?check_suite_focus=true

There's absolutely nothing keeping .sh files from executing. Youll need to dig into what permissions, location, etc is syncing and possibly preventing the execution, but again: nothing here is preventing these scripts from working.

from docker-github-actions-runner.

RainbowMango avatar RainbowMango commented on May 22, 2024

@myoung34 Thanks. I added bash before each script and that works.

      - name: verify codegen
        run: bash hack/verify-codegen.sh

I don't know why.

from docker-github-actions-runner.

myoung34 avatar myoung34 commented on May 22, 2024

my guess is that whatever FS driver youre using is losing the +x

if you do a ls -alh i bet it will coincide

from docker-github-actions-runner.

makarov-roman avatar makarov-roman commented on May 22, 2024

This is because docker mounts tmpfs with noexec flag. More info here
Edit: That I said above is relevant for --mount type=tmpfs. Apparently you can use --tmpfs with exec flag as workaround
e.g.

docker run -d --name github-runner9 \
  -e REPO_URL="https://github.com/Jollerprutt/ci_test" \
  -e RUNNER_NAME_PREFIX="arm-runner" \
  -e ACCESS_TOKEN="<redacted>" \
  -e RUNNER_WORKDIR="/tmp/github-runner-your-repo2" \
  -e RUNNER_GROUP="my-group" \
  -e LABELS="linux,arm64,cluster1,safe" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --tmpfs /tmp/github-runner-your-repo2:exec \
  --security-opt=label=disable \
  myoung34/github-runner:latest

from docker-github-actions-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.