tcardonne / docker-github-runner

Run GitHub Actions on self-hosted runner using Docker.
MIT License
297 stars 124 forks source link

setup-python #22

Closed coldfix closed 4 years ago

coldfix commented 4 years ago

Hi!,

I'm trying to deploy a self-hosted runner and came across this wonderful repo.

Everything worked perfectly -- until I tried using the setup-python action.. which fails with the following error:

2020-07-30T12:27:36.6953751Z Download action repository 'actions/setup-python@v2'
2020-07-30T12:27:37.6224109Z ##[group]Run actions/setup-python@v2
2020-07-30T12:27:37.6224365Z with:
2020-07-30T12:27:37.6224476Z   python-version: 3.x
2020-07-30T12:27:37.6224747Z   token: ***
2020-07-30T12:27:37.6224852Z env:
2020-07-30T12:27:37.6224951Z   ...
2020-07-30T12:27:37.6225470Z ##[endgroup]
2020-07-30T12:27:37.6554781Z Version 3.x was not found in the local cache
2020-07-30T12:27:38.2418804Z ##[error]Version 3.x with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
2020-07-30T12:27:38.2527363Z Cleaning up orphan processes

According to some notes found here, I hoped it would be enough to extend the docker image as follows:

FROM tcardonne/github-runner:latest
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir ${AGENT_TOOLSDIRECTORY}

However, still no luck: same error after rebuilding and restarting the docker image.

The above article also mentions that the linux runner can't be started as root. However, it seems that your image uses root, so I assume ownership/permissions shouldn't be the problem here(?).

Do you happen to have any experience with this or related issues?

Best, Thomas

coldfix commented 4 years ago

Might be related to not using one of the supported environments. I'll check if I can get it to work with one of those.

coldfix commented 4 years ago

Ok, update:

It now seems to work by changing the base image, and adding AGENT_TOOLSDIRECTORY as above:

- FROM debian:buster-slim
+ FROM ubuntu:20.04
+ ARG DEBIAN_FRONTEND=noninteractive

+ ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
+ RUN mkdir ${AGENT_TOOLSDIRECTORY}

The change in image size seems negligible (1.56GB -> 1.58GB).

What do you think about changing this or providing a second image with a different base?