Daan
Daan
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
Finally works, thanks for all the help! The issue was the base image that was different.
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
Although I would exspect both images use python3.11 with the provided code
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
I can try to add "FROM python:3.11" to the dockerfile for teh sereverless endpoint,and delete "RUN python3.11 -m pip install --upgrade pip", then it certainly would be the same version, right?
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
Yes indeed, so I made manually a venv and app.sh file. My script works fine then if I execute it in the GPU. But in the serverless endpoint, with the other image it goes wrong. I really can't understand why
export TRANSFORMERS_CACHE=/workspace



rm -rf /workspace && ln -s /runpod-volume /workspace

source /workspace/.venv/bin/activate


cd workspace/.venv/bin

ls
export TRANSFORMERS_CACHE=/workspace



rm -rf /workspace && ln -s /runpod-volume /workspace

source /workspace/.venv/bin/activate


cd workspace/.venv/bin

ls
works, but then if i change ls by "pip list" it gives the error that pip is not found...
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
I use a network volume that is mounted in /workspace
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
oh, no it is because you do not use my network volume.
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
strange, I didn't had that error. I will retry it
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
Made the first one to manually make a .venv in worspace directory
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
Yes, indeed
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
daana2003/orca-gpu-runner:serverless_60
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
daana2003/orca-gpu-runner:no_vim_10
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
it is private, but I can make it public, one second
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
I live in Belgium 🙂
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
I think it is, this is the docker image used to create the venv (i made a pod with this templatte and manually created the venv):
# Gebruik een basisimage met Python 3.11
FROM python:3.11

# Stel de werkdirectory in op de root om te beginnen
WORKDIR /

# Kopieer de entrypoint in de container
COPY ./entrypoint.sh /entrypoint.sh

# Maak de scripts uitvoerbaar
RUN chmod +x /entrypoint.sh

# Installeer vim
#RUN apt-get update && apt-get install -y vim

# Stel het entrypoint script in als het entrypoint van de container
ENTRYPOINT ["/entrypoint.sh"]
# Gebruik een basisimage met Python 3.11
FROM python:3.11

# Stel de werkdirectory in op de root om te beginnen
WORKDIR /

# Kopieer de entrypoint in de container
COPY ./entrypoint.sh /entrypoint.sh

# Maak de scripts uitvoerbaar
RUN chmod +x /entrypoint.sh

# Installeer vim
#RUN apt-get update && apt-get install -y vim

# Stel het entrypoint script in als het entrypoint van de container
ENTRYPOINT ["/entrypoint.sh"]
and this is the one to make serverless endpoint:
# Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile
# DockerHub -> https://hub.docker.com/r/runpod/base/tags
FROM runpod/base:0.4.0-cuda11.8.0

# The base image comes with many system dependencies pre-installed to help you get started quickly.
# Please refer to the base image's Dockerfile for more information before adding additional dependencies.
# IMPORTANT: The base image overrides the default huggingface cache location.


# --- Optional: System dependencies ---
# COPY builder/setup.sh /setup.sh
# RUN /bin/bash /setup.sh && \
# rm /setup.sh


# Python dependencies
COPY builder/requirements.txt /requirements.txt
RUN python3.11 -m pip install --upgrade pip && \
python3.11 -m pip install --upgrade -r /requirements.txt --no-cache-dir && \
rm /requirements.txt

# NOTE: The base image comes with multiple Python versions pre-installed.
# It is reccommended to specify the version of Python when running your code.


# Add src files (Worker Template)
ADD src .

CMD python3.11 -u /handler.py
# Base image -> https://github.com/runpod/containers/blob/main/official-templates/base/Dockerfile
# DockerHub -> https://hub.docker.com/r/runpod/base/tags
FROM runpod/base:0.4.0-cuda11.8.0

# The base image comes with many system dependencies pre-installed to help you get started quickly.
# Please refer to the base image's Dockerfile for more information before adding additional dependencies.
# IMPORTANT: The base image overrides the default huggingface cache location.


# --- Optional: System dependencies ---
# COPY builder/setup.sh /setup.sh
# RUN /bin/bash /setup.sh && \
# rm /setup.sh


# Python dependencies
COPY builder/requirements.txt /requirements.txt
RUN python3.11 -m pip install --upgrade pip && \
python3.11 -m pip install --upgrade -r /requirements.txt --no-cache-dir && \
rm /requirements.txt

# NOTE: The base image comes with multiple Python versions pre-installed.
# It is reccommended to specify the version of Python when running your code.


# Add src files (Worker Template)
ADD src .

CMD python3.11 -u /handler.py
28 replies
RRunPod
Created by Daan on 1/2/2024 in #⚡|serverless
Problem with venv
If it has this code:
#!/bin/bash

export TRANSFORMERS_CACHE=/workspace



rm -rf /workspace && ln -s /runpod-volume /workspace

source /workspace/.venv/bin/activate


cd workspace/.venv/bin
pip list
#!/bin/bash

export TRANSFORMERS_CACHE=/workspace



rm -rf /workspace && ln -s /runpod-volume /workspace

source /workspace/.venv/bin/activate


cd workspace/.venv/bin
pip list
it gives
{
"delayTime": 6319,
"executionTime": 1100,
"id": "6f292b30-3562-463d-8f66-26a5355d9cf4-e1",
"output": "./entrypoint.sh: /workspace/.venv/bin/pip: /workspace/.venv/bin/python: bad interpreter: No such file or directory\n",
"status": "COMPLETED"
}
{
"delayTime": 6319,
"executionTime": 1100,
"id": "6f292b30-3562-463d-8f66-26a5355d9cf4-e1",
"output": "./entrypoint.sh: /workspace/.venv/bin/pip: /workspace/.venv/bin/python: bad interpreter: No such file or directory\n",
"status": "COMPLETED"
}
Any idea where it goes wrong? I understood that runpod already chose the mount path as "runpod-volume", that is why I did "rm -rf /workspace && ln -s /runpod-volume /workspace". Also, when executing pip list in a pod, ade with the same network volume, no errors.
28 replies
RRunPod
Created by Daan on 1/1/2024 in #⚡|serverless
Issue with Dependencies Not Being Found in Serverless Endpoint
But I think everything is installed correctly since I can execute a file that needs these dependencies, but I find it strange that if I execute the same command twice (after a new pod has been started with the same network volume) nothing comes up. as "Requirement already satisfied:.....". But running the program does work. However, when I start a serverless endpoint and want to do the same, I get the error that those dependencies are not installed.
24 replies
RRunPod
Created by Daan on 1/1/2024 in #⚡|serverless
Issue with Dependencies Not Being Found in Serverless Endpoint
this is the output now (message.txt)
24 replies
RRunPod
Created by Daan on 1/1/2024 in #⚡|serverless
Issue with Dependencies Not Being Found in Serverless Endpoint
yes, I use --no-cache-dir , but still I got the error. I thought it was solved because I didn't get the same error (I honestly didn'tt see tgis one-line error at first)
24 replies
RRunPod
Created by Daan on 1/1/2024 in #⚡|serverless
Issue with Dependencies Not Being Found in Serverless Endpoint
Also, I do not fully understand why this happens: If I have downloaded some dependencies in the venv, so they are saved in the network volume, I can reuse them because executing files (in the venv) that use the dependencies works fine. But, if I want to reinstall these dependencies I don't get something like "Requirement already satisfied:.....". Also "pip list" doesn't show these dependencies. This is really strange to me.
24 replies
RRunPod
Created by Daan on 1/1/2024 in #⚡|serverless
Issue with Dependencies Not Being Found in Serverless Endpoint
the size of the network volume is 250GB, so that won't be the problem here. when installing, I also only see the disk utilization of the container increasing, so maybe these dependencies are just installed on the container disk after all (but I think the commands I gave should be correct)?
24 replies