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

uses: docker://... fails with "No such container" #200

Open
hasufell opened this issue Dec 30, 2024 · 10 comments
Open

uses: docker://... fails with "No such container" #200

hasufell opened this issue Dec 30, 2024 · 10 comments

Comments

@hasufell
Copy link

hasufell commented Dec 30, 2024

Pipeline: https://github.com/haskell/ghcup-hs/actions/runs/12536865845/job/34960342646#step:9:2

2024-12-29T16:07:48.6925873Z   �  docker pull image=hasufell/arm64v8-alpine-haskell:3.20 platform= username= forcePull=true
2024-12-29T16:07:49.7373772Z   �  docker create image=hasufell/arm64v8-alpine-haskell:3.20 platform= entrypoint=[] cmd=["sh" "-c" ".github/scripts/build.sh '--ghc-options=-split-sections' '--enable-executable-static'"] network="container:act-Build-and-release-3e41c296-c773-410e-ab2d-95ed980861c2-22900ec42b424889eaad00525fdc52f10dcc32a3aad9529730bac900ba7db6bf"
2024-12-29T16:07:49.7744554Z   �  docker run image=hasufell/arm64v8-alpine-haskell:3.20 platform= entrypoint=[] cmd=["sh" "-c" ".github/scripts/build.sh '--ghc-options=-split-sections' '--enable-executable-static'"] network="container:act-Build-and-release-3e41c296-c773-410e-ab2d-95ed980861c2-22900ec42b424889eaad00525fdc52f10dcc32a3aad9529730bac900ba7db6bf"
2024-12-29T16:07:49.7939532Z ##[error]  �  Failure - Main Run build (aarch64 linux)
2024-12-29T16:07:49.7957729Z ##[error]failed to start container: Error response from daemon: No such container: act-Build-and-release-3e41c296-c773-410e-ab2d-95ed980861c2-22900ec42b424889eaad00525fdc52f10dcc32a3aad9529730bac900ba7db6bf

Workflow: https://github.com/haskell/ghcup-hs/blob/54e171ff35fc7b467709ed6982bc5cfcae7d8c91/.github/workflows/release.yaml#L134

      - if: matrix.ARCH == 'ARM64'
        uses: docker://hasufell/arm64v8-alpine-haskell:3.20
        name: Run build (aarch64 linux)
        with:
          args: sh -c ".github/scripts/build.sh '--ghc-options=-split-sections' '--enable-executable-static'"
          network: host
        env:
          ARTIFACT: ${{ matrix.ARTIFACT }}
          ARCH: ${{ matrix.ARCH }}
          GHC_VER: ${{ matrix.GHC_VER }}
          DISTRO: ${{ matrix.DISTRO }}
          AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
          AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
          S3_HOST: ${{ env.S3_HOST }}

This works fine with github runners.

It is not the same as using the container:. .. feature. With the container feature, everything is run inside the container, including actions (like checkout). With the above syntax, only the step itself is run in the container. This is useful if the container does not support node20 (e.g. debian i386).

From what I see the issue might be how it sets up the network here:

network="container:act-Build-and-release-3e41c296-c773-410e-ab2d-95ed980861c2-22900ec42b424889eaad00525fdc52f10dcc32a3aad9529730bac900ba7db6bf"

In workflows with the container syntax, it appears to set network=host (see here). So why it's doing this here?

@hasufell
Copy link
Author

I'm using 0.9.0 binaries on Debian bookworm aarch64.

@ChristopherHX
Copy link
Owner

I'm aware of beeing unable to use docker actions like (docker://) when running on Host

See table https://github.com/christopherhx/github-act-runner#dependencies

I considered this a niche usecase in 2021, due to most platform that are 100% unsupported by GitHub itself lack docker support

Some unmentioned problems for docker actions

  • act uses docker volumes for cwd
  • act connects to the job container network (you noticed this)

This can be considered to be implemented.

I wonder what are your reasons to land here for the linux runner, since your example uses officially supported architectures?

@hasufell
Copy link
Author

hasufell commented Dec 30, 2024

I wonder what are your reasons to land here for the linux runner, since your example uses officially supported architectures?

ARM64 Alpine is not supported by GitHub (and so there is no node binary it can copy into the container).

@ChristopherHX
Copy link
Owner

ARM64 Alpine is not supported by GitHub

Yes this ist true.

For short term container: node:20-alpine (or any other tag / distro) in your Workflow Job should allow docker:// to run Images without node

@hasufell
Copy link
Author

Yes, but I also use armv7 and i386 containers, which don't have a valid node.

@ChristopherHX
Copy link
Owner

Yes, but I also use armv7 and i386 containers, which don't have a valid node.

I am not sure I understand your problem.

The error you are seeing with uses: docker:// in github-act-runner can be resolved like

on: push
jobs:
  test:
    runs-on: github-act-runner
    container: node:20-alpine # temporary unblocks docker://, needs `node` in path (this is unlike actions/runner)
    steps:
    - uses: docker://i386/debian:stable-backports # any image you want no node
      with:
        args: ""
        entrypoint: ""

If you want a custom i386 image for the job container, install node into your path of your custom image. As this runner is based on act, this is bring your own node instead of node provided by the runner application.
While the actions/runner has the i386 problems like you describe.

To use docker:// outside of any job container, can take a while for beeing implemented by me in github-act-runner. I could include this in release 1.0.0.

_Unrelated to github-act-runner, my fork of actions/runner aka https://github.com/ChristopherHX/runner.server, supports i386 images with node actions and running on alpine. While arm64 alpine docker images are still blocked, which I could consider to allow.

@hasufell
Copy link
Author

hasufell commented Dec 30, 2024

If you want a custom i386 image for the job container, install node into your path of your custom image.

This is not possible. Node does not support i386 or armv7 anymore. There is no node20 binary anywhere. And lots of actions have started failing if you don't have a recent node anymore.

@ChristopherHX
Copy link
Owner

ChristopherHX commented Jan 1, 2025

Ah ok, but latest armv7 (and v6) node20 is available in docker hub https://hub.docker.com/layers/library/node/20-alpine/images/sha256-6903d06620aa69644a02d9c84038cdf909deaa1cebb8724829dc05d66151f8e6.

A statically linked node20 (as node) for x86_64 in an otherwise i386 image would be a workaround at least I would think as almost all my x86 devices understand the 64bit execution set.

Node does not support i386 or armv7 anymore. There is no node20 binary anywhere.

I have a different outcome, it might be not be the latest node20 binary however it is node20

Here is a i386 node binary (yes the c# code hides the link), my actions/runner fork should be able to run node20 actions on i386 images that are not alpine.

You need to download a nightly of my runner fork from runner ci, I didn't have that entry in my last release

https://github.com/ChristopherHX/runner.server/blob/ba8f58eb859d5c8d741b6a1ac1596f8230a7e824/src/Runner.Worker/ExternalToolHelper.cs#L230

And lots of actions have started failing if you don't have a recent node anymore.

Do they fail with older node20 versions as well?

@ChristopherHX
Copy link
Owner

Update for node 22 you seem to be correct the x86 unofficial binaries are no longer available for that major version, while actions would skip this lts and wait for node 24 to be available for ca. 1 year or more to switch

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