Closed oleks-popovych closed 2 years ago
Hello @oleks-popovych, we will take a look at this, thank you for your report!
Hello @oleks-popovych,
Have you tried using the version 20.04 for container? That way you will have recent glibc version installed. Docker hub has the 20.04 image https://hub.docker.com/_/ubuntu
Please confirm if you need to run your build within 18.04 container, so we could provide you with some additional info. For any additional questions or concerns please feel free to leave a comment here.
@dsame I've tried to, but I have some specific constrains that tight me to ubuntu 18.04.
Also I didn't expect it to be this hard since if I'm trying to run my code on ubuntu 18.04 provided by github (runners) everything works fine.
Isn't this just the container lacking this lib? May be try inspect if this lib is present (or try to install it) before running setup-python
? At least for me it seems to be the case
hello @oleks-popovych, In case you need to use python3.7 with the clean ubuntu 18.04 docker image the simplest way is to instal python 3.7 from some PPA repo:
- name: Set up Python 3.7
run: |
apt update
apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get install -y python3.7
ln -s `which python3.7` /usr/local/bin/python
python --version
Also pay attention the docker image provided does not have wget as well and you need to install it either in the separate step
- name: Set up wget
run: |
apt-get install -y wget
or in the same time as the python package apt-get install -y python3.7 wget
The full workflow: https://github.com/akv-platform/python-docker-1804/actions/runs/2100834524
Ideally, to save the time in the workflow i'd create the docker inherited from ubunut:18.04 with the python and wget pre-installed
Please confirm the suggested solution works for you.
hello @dhvcc, you are absolutely correct. The latest glibc supported by Ubuntu 18.04 is 2.27
@dsame it seems that this is a way.
@dsame @dhvcc
but still I don't understand why it's still working with python 3.7 installed via apt-get
, but not via setup/python
@dsame @dhvcc but still I don't understand why it's still working with python 3.7 installed via
apt-get
, but not viasetup/python
I think it's most likely not that setup-python is failing, but rather poetry choosing the wrong bundled version. I mena if you explicitly say poetry use 3.10
then it works, right?
@dhvcc
I don't even know that setup/python
uses poetry under the hood.
could you elaborate more on your advice, since I'm not to how to connect setup/python
and poetry
@dhvcc I don't even know that
setup/python
uses poetry under the hood. could you elaborate more on your advice, since I'm not to how to connectsetup/python
andpoetry
Oh, that's a different issue that's not poetry related, sorry haha
Basically what you need to do is to install right glibc version before running setup-python
Hi @oleks-popovych, it's difficult to say why it doesn't work properly on your self-hosted runner, I'm trying to reproduce this issue on hosted runner and it works: https://github.com/vsafonkin/test-repo/runs/5970187832?check_suite_focus=true
Could you try to execute apt-get update
command before setup-python
step?
@vsafonkin
Thank you for your reply.
I've already used a suggestion by @dsame to install python via apt-get
instead of using setup/python
Still I'm confused why underlying system matters when things are running in a container?
@vsafonkin Thank you for your reply. I've already used a suggestion by @dsame to install python via
apt-get
instead of usingsetup/python
Still I'm confused why underlying system matters when things are running in a container?
Not an underlying (host) system matters. It's the container itself. If libs are missing in a container (which is running Ubuntu 18), then python won't be set up properly
Still I'm confused why underlying system matters when things are running in a container?
As I see this issue: the setup-python
action uses the python build from source code, which was built on the hosted runner and downloaded from python-versions repository. As I know, Ubuntu container uses OS kernel from host OS. So using a python that has been built on a OS kernel with certain versions of the libraries can cause problems when running on another OS kernel.
Hi @oleks-popovych, I'm going to close this issue, feel free to contact us if you have any concerns, thank you.
Description: I’m trying to launch a workflow inside container on self-hosted runner.
Part of the workflow is python setup via action’s setup/python.
But I’m getting an error after trying to launch anything with installed python:
Action version: v2
Platform:
Runner type:
Tools version: python 3.7
Repro steps:
Expected behavior: it doesn't throw the error
Actual behavior: error