a year ago
I am trying to run an app dependent on python version 3.10. How do I specify the use of python 3.10?
My DockerFile is as follows:
FROM docker.io/nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04 AS base
# Use the provided 'release' stage as the starting point
FROM base AS release
# Set up the environment
ENV DEBIAN_FRONTEND="noninteractive"
# Install dependencies for Python, build tools, and system updates
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
build-essential \
ffmpeg \
curl \
ca-certificates \
wget \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /
# Add deadsnakes PPA for Python 3.10
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y python3.10 python3.10-distutils python3-pip
# Ensure alternatives system links to python3.10
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
update-alternatives --set python3 /usr/bin/python3.10
# Install pip and ensure it's up to date
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
# Copy the application code
COPY ..
# Install project dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Run the web service on container startup.
CMD ["python", "run", "main.py", "--host 0.0.0.0", "--port=${PORT:-5000}"]3 Replies
a year ago
Hello,
If you need Python 3.10, you will need to install Python 3.10 via the Dockerfile.
I also see that you have Nvidia Cuda there, you should know that Railway does not support GPUs.
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
Thanks for the response, more specifically I am not able to install python packages during build time. I created a requirements.txt file from my poetry project and so the requirments.txt file looks similar to the following:
ctranslate2==4.4.0 ; python_version == "3.10" ..So during build time my logs are as follows:
Ignoring pytz: markers 'python_version == "3.10"' don't match your environment
Ignoring pyyaml: markers 'python_version == "3.10"' don't match your environment
Ignoring requests: markers 'python_version == "3.10"' don't match your environmentI tried removing the DockerFile all together and instead add just the file `.python-version` with:
```
# .python-version
3.10
```
This also did not work and I still get at build time:
```
Ignoring uvicorn: markers 'python_version == "3.10"' don't match your environment
```
At deploy it does not recognize "numpy" and crashes. Am I missing something with just using python 3.10? Is there a better way working with a poetry project and uploading repo to Railway?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
I think you would have better mileage there- looking at the logs, it looks like your requirements.txt isn't set to be working with the python version that you set. Assuming that poetry is all set up in the way we expect. So, I would try just linking the repo. With that said, it's also likely that the CudaDNN ubuntu will fail any attempt at compilation because we don't support those bindings at host. A lot of things can be wrong, which makes it hard for us to debug on it on your behalf.
- Angelo
Status changed to Awaiting User Response Railway • about 1 year ago
7 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 7 months ago