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

Externals not mounted in DIND from Runner #321

Open
bioshazard opened this issue Sep 1, 2021 · 5 comments
Open

Externals not mounted in DIND from Runner #321

bioshazard opened this issue Sep 1, 2021 · 5 comments

Comments

@bioshazard
Copy link

bioshazard commented Sep 1, 2021

I am running into a complication where the mount of /home/runner/externals yields an empty folder in my jobs.

runner@runner-pool2-pod-4cj8m:~$ ls -la externals/total 16
drwxr-xr-x 4 runner 121 4096 Aug 30 17:28 .
drwxr-xr-x 1 runner 121 4096 Sep  1 12:01 ..
drwxr-xr-x 6 runner 121 4096 Aug 30 17:28 node12
drwxr-xr-x 3 runner 121 4096 Aug 30 17:28 node12_alpine
runner@runner-pool2-pod-4cj8m:~$ docker run --rm -it -v /home/runner/externals:/_externals --entrypoint bash centos:7
[root@b2aec0c0ed67 /]# ls -la /_externals/
total 8
drwxr-xr-x 2 root root 4096 Sep  1 12:25 .
drwxr-xr-x 1 root root 4096 Sep  1 12:25 ..

I have traced the issue down to DIND taking in that mount from its own container rather than mounting remotely from the runner as is apparently the expected function. I believe one could share a mount between runner and docker container to make it available on the DIND side of things, but out of the box, I do not see how any users are able to perform actions/checkout@v2 due to the missing /__e/node12/bin/node as the mount is empty.

Is anyone else's experience that the runner container can remotely mount its externals folder to DIND? Or is there some of other sync activity I am missing? Currently searching around for a clever way to expose the existing runner folder onto DIND, but I am starting to think I will rather need to copy the node12 folder to DIND to make it available when the mount is performed.

@bioshazard
Copy link
Author

hmmmm gonna try an init container to copy the externals to an emptydir mount...

@bioshazard
Copy link
Author

So using an init container totally worked. I created an emptyDir, mounted to an init container as /_externals, rsync'd /home/runner/externals, then mounted that volume in the runner and DIND and its now available. I am still not sure how anyone else is using this successfully given the above limitation. Am I missing something?

@developerdino
Copy link

I believe I am hitting this same issue on checkout.

OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/__e/node12/bin/node\": stat /__e/node12/bin/node: no such file or directory": unknown

@bioshazard
Copy link
Author

@developerdino yep that is the exact error. You can see if you hop into the container that the externals folder has the node bin on the runner, but that DIND attempts the mount on its side instead mounting an empty folder.

@developerdino
Copy link

Thanks @bioshazard for all the hints as to how to fix this. I've managed to get everything working again based on your info by just creating the mounts for the externals, I'll create a PR for the example file so anyone else coming across this will be able to solve it easily.

I'm also wondering if this is a recent addition to the actions-runner deployment by Github and that is why we haven't seen this until only recently!

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