openshift-actions-runners
openshift-actions-runners copied to clipboard
[FEATURE] Enable github action "setup-python" for those images.
Is your feature request related to a problem? Please describe.
The github action "setup-python" (https://github.com/actions/setup-python) is some kind of standard action when testing python related code with different python versions. It creates an virtual environment for every workflow and provides a fresh an clean python setup.
However it seems to not work correctly with the Fedora bases images, provided from RedHat. It always complains, that the right python version could not be found:
##[debug]Evaluating condition for step: 'Set up Python'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Set up Python
##[debug]Register post job cleanup for action: actions/setup-python@v2
##[debug]Loading inputs
##[debug]Evaluating: env.PYTHON_VERSION
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'PYTHON_VERSION'
##[debug]=> '3.9'
##[debug]Result: '3.9'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run actions/setup-python@v2
##[debug]Semantic version spec of 3.9 is 3.9
##[debug]isExplicit:
##[debug]explicit? false
##[debug]evaluating 0 versions
##[debug]match not found
Version 3.9 was not found in the local cache
##[debug]set auth
##[debug]check 3.11.0-alpha.6 satisfies 3.9
##[debug]check 3.11.0-alpha.5 satisfies 3.9
##[debug]check 3.11.0-alpha.4 satisfies 3.9
##[debug]check 3.11.0-alpha.3 satisfies 3.9
##[debug]check 3.11.0-alpha.2 satisfies 3.9
##[debug]check 3.11.0-alpha.1 satisfies 3.9
##[debug]check 3.10.4 satisfies 3.9
##[debug]check 3.10.3 satisfies 3.9
##[debug]check 3.10.2 satisfies 3.9
##[debug]check 3.10.1 satisfies 3.9
##[debug]check 3.10.0 satisfies 3.9
##[debug]check 3.10.0-rc.2 satisfies 3.9
##[debug]check 3.10.0-rc.1 satisfies 3.9
##[debug]check 3.10.0-beta.4 satisfies 3.9
##[debug]check 3.10.0-beta.3 satisfies 3.9
##[debug]check 3.10.0-beta.2 satisfies 3.9
##[debug]check 3.10.0-beta.1 satisfies 3.9
##[debug]check 3.10.0-alpha.7 satisfies 3.9
##[debug]check 3.10.0-alpha.6 satisfies 3.9
##[debug]check 3.10.0-alpha.5 satisfies 3.9
##[debug]check 3.10.0-alpha.4 satisfies 3.9
##[debug]check 3.10.0-alpha.3 satisfies 3.9
##[debug]check 3.10.0-alpha.2 satisfies 3.9
##[debug]check 3.10.0-alpha.1 satisfies 3.9
##[debug]check 3.9.12 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.11 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.10 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.9 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.8 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.7 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.6 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.5 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.4 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.3 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.2 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.2-rc.1 satisfies 3.9
##[debug]check 3.9.1 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.1-rc.1 satisfies 3.9
##[debug]check 3.9.0 satisfies 3.9
##[debug]x64===x64 && darwin===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && linux===linux
##[debug]x64===x64 && win32===linux
##[debug]x86===x64 && win32===linux
##[debug]check 3.9.0-rc.2 satisfies 3.9
##[debug]check 3.9.0-rc.1 satisfies 3.9
##[debug]check 3.9.0-beta.5 satisfies 3.9
##[debug]check 3.9.0-beta.4 satisfies 3.9
##[debug]check 3.8.12 satisfies 3.9
##[debug]check 3.8.11 satisfies 3.9
##[debug]check 3.8.10 satisfies 3.9
##[debug]check 3.8.9 satisfies 3.9
##[debug]check 3.8.8 satisfies 3.9
##[debug]check 3.8.7 satisfies 3.9
##[debug]check 3.8.6 satisfies 3.9
##[debug]check 3.8.5 satisfies 3.9
##[debug]check 3.8.4 satisfies 3.9
##[debug]check 3.8.3 satisfies 3.9
##[debug]check 3.8.2 satisfies 3.9
##[debug]check 3.8.1 satisfies 3.9
##[debug]check 3.8.0 satisfies 3.9
##[debug]check 3.7.12 satisfies 3.9
##[debug]check 3.7.11 satisfies 3.9
##[debug]check 3.7.10 satisfies 3.9
##[debug]check 3.7.9 satisfies 3.9
##[debug]check 3.7.8 satisfies 3.9
##[debug]check 3.7.7 satisfies 3.9
##[debug]check 3.7.6 satisfies 3.9
##[debug]check 3.7.5 satisfies 3.9
##[debug]check 3.7.1 satisfies 3.9
##[debug]check 3.6.15 satisfies 3.9
##[debug]check 3.6.14 satisfies 3.9
##[debug]check 3.6.13 satisfies 3.9
##[debug]check 3.6.12 satisfies 3.9
##[debug]check 3.6.11 satisfies 3.9
##[debug]check 3.6.10 satisfies 3.9
##[debug]check 3.6.9 satisfies 3.9
##[debug]check 3.6.8 satisfies 3.9
##[debug]check 3.6.7 satisfies 3.9
##[debug]check 3.5.10 satisfies 3.9
##[debug]check 3.5.9 satisfies 3.9
##[debug]check 3.5.4 satisfies 3.9
##[debug]check 3.4.10 satisfies 3.9
##[debug]check 3.4.4 satisfies 3.9
##[debug]check 3.3.7 satisfies 3.9
##[debug]check 3.3.5 satisfies 3.9
##[debug]check 3.2.5 satisfies 3.9
##[debug]check 3.1.4 satisfies 3.9
##[debug]check 3.0.1 satisfies 3.9
##[debug]check 2.7.18 satisfies 3.9
##[debug]check 2.7.17 satisfies 3.9
Error: Version 3.9 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
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Set up Python
There is also a description available how to get it running for self hosted runner: https://github.com/actions/setup-python#using-setup-python-with-a-self-hosted-runner I tried it out, but it did not help.
I think the issue is, that all precompiled python versions that are available are just there for Ubuntu but not for Fedora, that's why it says it cannot find a proper python package to install on the runner.
Describe the solution you'd like
I would like to have a OpenShift supported image, where the "setup-python" action can be run out of the box without ugly workarounds.
Describe alternatives you've considered
The alternative would be to change the "setup-python" action in a way, that it selects the right python version from pre-installed python versions, which are installed directly into the image (let's say for example python 3.8 to 3.10).
Additional context
I tried it with the image quay.io/redhat-github-actions/runner:v1
.
hi, you can build your own image which contains the python runtime(s) you need. There are analogous examples in this repository with a node runtime and a JDK.
A dotnet runner was also recently contributed by the community. A similar PR could be put up for python.
Hello, thanks for the answer.
Yes, I understand that this is also a solution: Setting up an own Python version in the image and just create and delete virtual environments of that version manually in the github workflow.
However, this would mean to make many things "setup-python" is taking care manually and it would mean, that we have to rework all our workflows, we are currently using on hosted github runners. That's why we would prefer a solution, that the more or less standard action "setup-python" works also with self-hosted runners.
It would be ok for us to provide a couple of python versions inside the image of the runner, which then can be used for "setup-python", to prevent the issue with the precompiled versions for Ubuntu. I'm currently trying to find out, if there is a way to do that with the action without rewriting it.