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

container Jobs Fail #2508

Open
afrazkhan opened this issue Oct 29, 2024 · 0 comments
Open

container Jobs Fail #2508

afrazkhan opened this issue Oct 29, 2024 · 0 comments
Labels
kind/bug Something isn't working

Comments

@afrazkhan
Copy link

afrazkhan commented Oct 29, 2024

Bug report info

act version:            0.2.68
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 8
Docker host:            unix:///Users/<me>/.docker/run/docker.sock
Sockets found:
        /var/run/docker.sock
        $HOME/.docker/run/docker.sock
Config files:
        /Users/<me>/Library/Application Support/act/actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
        /Users/<me>/.actrc:
                --container-daemon-socket -

Build info:
        Go version:            go1.23.1
        Module path:           command-line-arguments
        Main version:
        Main path:
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.68
                DefaultGODEBUG:       asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1
                CGO_ENABLED:          1
                CGO_CFLAGS:
                CGO_CPPFLAGS:
                CGO_CXXFLAGS:
                CGO_LDFLAGS:
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        27.2.0
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlayfs
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             6.10.4-linuxkit
        OS CPU:                8
        OS memory:             7839 MB
        Security options:
                name=seccomp,profile=unconfined
                name=cgroupns

Command used with act

act

Describe issue

Initially, I got the error:

Error: failed to start container: Error response from daemon: error while creating mount source path '/host_mnt/Users/<me>/.docker/run/docker.sock': mkdir /host_mnt/Users/<me>/.docker/run/docker.sock: operation not supported

After some searching around, I started running act with --container-daemon-socket -, which got past this problem. Unfortunately, it sees to have caused another problem which is that jobs using container have all of their steps run in the specified container image.

For example in this workflow:

jobs:
  artefacts:
    name: Upload artefacts
    runs-on: ubuntu-latest
    container: ghcr.io/guidionops/terraform-cloud-deployer:0.1.2
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Zip up the Lambdas
        run: |
          mkdir -p dist
          cp -r lambdas/* dist/
          pip install -r dist/requirements.txt -t dist/
          cd dist
          zip -r ../lambdas.zip *
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: build-and-terraform
          path: |
            lambdas.zip
            *.tf
          retention-days: 2

the steps "Checkout code" and "Zip up the Lambdas" run fine, but the "Archive artifacts" step fails because node is unavailable in the ghcr.io/guidionops/terraform-cloud-deployer:0.1.2 image. All of these steps work fine in Github Actions, since the actions/upload-artifact@v4 action does not try to run in the container above.

Link to GitHub repository

No response

Workflow content

jobs:
  artefacts:
    name: Upload artefacts
    runs-on: ubuntu-latest
    container: ghcr.io/guidionops/terraform-cloud-deployer:0.1.2
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Zip up the Lambdas
        run: |
          mkdir -p dist
          cp -r lambdas/* dist/
          pip install -r dist/requirements.txt -t dist/
          cd dist
          zip -r ../lambdas.zip *
      - name: Archive artifacts
        uses: actions/upload-artifact@v4
        with:
          name: build-and-terraform
          path: |
            lambdas.zip
            *.tf
          retention-days: 2

Relevant log output

# Without --container-daemon-socket -:

Error: failed to start container: Error response from daemon: error while creating mount source path '/host_mnt/Users/<me>/.docker/run/docker.sock': mkdir /host_mnt/Users/<me>/.docker/run/docker.sock: operation not supported

# With --container-daemon-socket -:

[Deploy Gatr Lambdas/Upload artefacts]   🐳  docker exec cmd=[node /var/run/act/actions/actions-upload-artifact@v4/dist/upload/index.js] user= workdir=
| OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown
[Deploy Gatr Lambdas/Upload artefacts]   ❌  Failure - Main Archive artifacts
[Deploy Gatr Lambdas/Upload artefacts] exitcode '126': failure

Additional information

No response

@afrazkhan afrazkhan added the kind/bug Something isn't working label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant