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

Can't run Jobs with JS & Docker Actions if they are interdependent #39

Closed
zackijack opened this issue Jun 24, 2020 · 8 comments
Closed
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@zackijack
Copy link

If in my workflow, there are 2 types of Actions:

  • Javascript (which run directly on the runner pod, e.g. actions/checkout@v2)
  • Docker (which run using DinD on the docker pod, e.g. docker/build-push-action@v1.1.0)

And if these 2 Actions are interdependent, then I will get an error.

For example, the workflow that I have is more or less like this:

name: Build and push Docker image

on:
  push:
    branches:
      - master

jobs:
  build-push:
    name: build-push
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2

      - name: Build and push Docker images
        uses: docker/build-push-action@v1.1.0
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
          repository: your-repo/your-image
          tags: latest

the docker/build-push-action@v1.1.0 will fail because it cannot find the Dockerfiles that have been cloned by actions/checkout@v2. This error does not occur if using the hosted runner.

does this happen because of the runner and docker run in different containers? I use the manifest from the example here.

Is there a solution to this problem?

@zackijack
Copy link
Author

btw, thanks for this amazing operator 🍻

@davidkarlsen
Copy link
Collaborator

davidkarlsen commented Jun 24, 2020

There are some known problems in this area:
actions/runner#406 and actions/runner#486 and I guess that is why: actions/runner#367 is not resolved either.
Also see actions/runner#560

What version of the runner are you using (not the operator, but the runner pods it spawns) - I
am for instance able to build docker images inside of the operator pod, and these Dockerfiles add files from the filesystem inside of the pod.

@davidkarlsen davidkarlsen added the question Further information is requested label Jun 24, 2020
@zackijack
Copy link
Author

What version of the runner are you using (not the operator, but the runner pods it spawns)

the container uses this image, so I think the runner version is 2.263.0

@davidkarlsen
Copy link
Collaborator

Try tag 2.263.0-1 or higher (there was a new version yesterday). We changed the home-dir to match when running non-containerised, that could influence it. It is a bit strange that I can build docker-images but not you, but that might be because a context is sent to the docker daemon, while in your case it might be relying on bind-mounting something which is done from the host where docker runs.

@zackijack
Copy link
Author

updated to version2.267.0, but still getting the same error path or Dockerfile not found
actions-1
Screen Shot 2020-06-24 at 18 41 25

@davidkarlsen
Copy link
Collaborator

What happens if you build the image outside of the action and just use it to push?

@davidkarlsen
Copy link
Collaborator

davidkarlsen commented Aug 19, 2020

@zackijack: BTW - what CNI are you using? calico? I wonder if this is the problem: projectcalico/calico#2334

@davidkarlsen
Copy link
Collaborator

linking docker-library/docker#62

@davidkarlsen davidkarlsen added documentation Improvements or additions to documentation and removed stale labels Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants