Problem mounting volumes within self-hosted runner

Hi all,

I’m testing out using a self-hosted runner for my project https://github.com/PhpGt/Dom

I use Github actions to run my unit tests. Running the actions using Github-hosted runners executes fine, but it’s really slow, which is why I’m experimenting with running my own.

When the self-hosted runner executes, a step fails when trying to install dependencies. The error message states that Composer could not find a composer.json file in /github/workspace. My assumption here is that the mounted directory at /github/workspace is empty.

Here is a FAILING run on my self-hosted runner using runs-on: self-hosted https://github.com/PhpGt/Dom/runs/499257107

Here is a SUCCESSFUL run on Github-hosted runner using runs-on: ubuntu https://github.com/PhpGt/Dom/runs/499269016

I can’t figure out what the difference is, apart from where the runner is hosted, which shouldn’t make any difference due to it all being dockerised.

Any advice on how I can track this issue down is appreciated!

Thanks,

Greg.

Hi @g105b ,

What self-hosted runner did you use? Docker actions is only supported on linux OS, please make sure you didn’t use macOS or windows.

Checked on side with ubuntu self-hosted runner, ‘composer.json’ is successfully checked out after ‘actions/checkout’. And action ‘php-actions/composer’ succeeds.

Thanks.

Hi @weide-zhou ,

I’m using Ubuntu to host the runner, not Windows or Mac.

I’m really interested in knowing exactly how you managed to run that yourself on a self-hosted Ubuntu runner, so I can compare to how I’m doing it. You can see clearly from my failed attempts that I’m not seeing hte same outcome as you.

EDIT: I’ve just noticed your fork of the repo, and I’ve had a look in there. I can see here https://github.com/weide-zhou/Dom/actions/runs/53495156/workflow#L7 that you are using ubuntu-latest to run the Actions, and I can’t see where you have used a self-hosted action.

See here for my latest run: https://github.com/PhpGt/Dom/runs/501338508

Just to confirm, my workflows succeed as expected when using ubuntu-latest (Github-hosted), and I’m only having the issue when I self-host.

Greg.

Thanks for your reply! The forked repo doens’t have a self-hosted runner. Please check my workflow yaml and checkrun from the link.

I also notice your latest workflow has been passed on self-hosted runner, could you please confirm whether the issue is gone?

Thanks.

Hi @weide-zhou ,

I have somehow managed to get some of the issues resolved, but I only did this by flattening my VPS and starting again. I did not knowingly change anything. Now I’m having issues with the self hosted runner creating files under the wrong permissions, but I will get there on my own I’m sure… maybe just very, very slowly.

Thanks for your advice,

Greg.

Thanks for your confirmation! @g105b

It’s recommended to raise a new ticket about the ‘creating files’ on self-hosted runner if you still encounter it.

Nah, I think I’ll leave it now and wait for Actions to become more stable. I don’t currently consider it fit for production. I’ve worked with CI for years and have never had to wrestle so much with a product as I have with Actions, so I’m cutting my losses and scrapping them off until they get better.

Hi @g105b ,

Sorry for the inconvenience taken. Github will keep improving and appreciate any ideas from all users.

You’re always welcome to share feed back here and raise any query in Github Community Forum! Thanks!

Hi guys, same issue here, I am using gitlab ci with my own gitlab runner running on Kubernetes and they offer docker in docker functionality, that way I can use my own runner on kubernetes so I just started doing a POC using github actions by using self-hosted runner in order to replicate the same functionality but when a new kubernetes pod gets created the current workspace is not mounted

Using ubuntu-lastest works but I would like to use kubernetes instead of a virtual machine

Thanks!