From c002c88024441782761bda9822333f4b153226de Mon Sep 17 00:00:00 2001 From: Jakub Novak Date: Thu, 9 Jan 2025 15:01:54 +0100 Subject: [PATCH] Use code interpreter with python 3.12 --- e2b.Dockerfile | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/e2b.Dockerfile b/e2b.Dockerfile index dbb7abe..26d447d 100644 --- a/e2b.Dockerfile +++ b/e2b.Dockerfile @@ -1,5 +1,5 @@ # Install dependencies and customize sandbox -FROM e2bdev/code-interpreter:latest +FROM e2bdev/code-interpreter:python-3.12.8 # Set working directory WORKDIR /home/user @@ -9,12 +9,6 @@ RUN apt-get update && apt-get install -y \ wget \ gpg \ libstdc++6 \ - && echo "deb http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy main" > /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 \ - && apt-get update \ - && apt-get install -y python3.12 python3.12-venv python3.12-dev \ - && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 \ - && update-alternatives --set python3 /usr/bin/python3.12 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -29,28 +23,22 @@ RUN git clone https://github.com/wandb/wandbot.git /home/user/wandbot && \ RUN pip install uv +# Set working directory +WORKDIR /home/user/wandbot + # Set LD_LIBRARY_PATH before running build.sh -RUN cd /home/user/wandbot && \ - export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH && \ +RUN export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH && \ (bash build.sh || true) -RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && uv pip install . -RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && uv pip install poetry -RUN cd /home/user/wandbot && . wandbot_venv/bin/activate && poetry install +RUN uv pip install --system . +RUN poetry install # Copy in the vector index COPY temp_index/* /home/user/temp_index/ -RUN cd /home/user/wandbot && \ - . wandbot_venv/bin/activate && \ - export INDEX_DIR=$(python -c 'from wandbot.configs.vectorstore_config import VectorStoreConfig; \ +RUN export INDEX_DIR=$(python -c 'from wandbot.configs.vectorstore_config import VectorStoreConfig; \ index_dir = VectorStoreConfig().index_dir; \ print(index_dir, end="")') && \ mkdir -p $INDEX_DIR && \ cp -r /home/user/temp_index/* $INDEX_DIR/ && \ rm -rf /home/user/temp_index - -# Ensure we're in the wandbot directory when container starts -WORKDIR /home/user - -