Skip to content

Commit

Permalink
further fixes on deepnote
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwen committed Sep 21, 2024
1 parent 9c762a7 commit eef51b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
7 changes: 3 additions & 4 deletions deepnote/data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ RUN SYNCTHING_VERSION=$(curl -s https://api.github.com/repos/syncthing/syncthing
mv syncthing-linux-amd64-${SYNCTHING_VERSION}/syncthing /root/work/bin/ && \
rm -rf syncthing-linux-amd64-${SYNCTHING_VERSION} syncthing.tar.gz

# Set up PATH
ENV PATH="/root/work/bin:${PATH}"

# Set working directory
WORKDIR /root/work

# RUN python -m venv --system-site-packages ~/venv

ENV VIRTUAL_ENV=/root/work/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PATH="/root/work/bin:$VIRTUAL_ENV/bin:$PATH"

ENV SHELL=/bin/bash
ENV LC_ALL=en_US.UTF-8
Expand All @@ -58,3 +55,5 @@ RUN . venv/bin/activate && pip install -r requirements.txt

# Activate virtual environment in bash
RUN echo "source /root/work/venv/bin/activate" >> ~/.bashrc

CMD ["/bin/bash"]
29 changes: 23 additions & 6 deletions deepnote/llm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM bitnami/python:3.12-debian-12
ARG FROM_PYTHON_VERSION=3.11
ARG DEBIAN_VERSION=bookworm
FROM python:${FROM_PYTHON_VERSION}-slim-${DEBIAN_VERSION}
ENV DEBIAN_FRONTEND noninteractive

# Switch to root user
USER root

# Install system dependencies
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get -yq dist-upgrade \
&& apt-get install -yq --no-install-recommends \
vim \
screen \
cmake curl git \
locales sudo unzip \
ssh gnupg2 \
lsof \
netcat-openbsd \
mtr-tiny \
Expand Down Expand Up @@ -45,17 +52,27 @@ RUN apt-get update && \
apt-get install -y haproxy && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set up Python virtual environment
RUN python -m venv venv \
&& . venv/bin/activate \
&& rm -rf ~/.cache/pip

# Copy requirements.txt and install Python dependencies
COPY requirements.txt .
RUN . venv/bin/activate && pip install -r requirements.txt
# RUN . venv/bin/activate && pip install -r requirements.txt

ENV SHELL=/bin/bash
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen

ENV VIRTUAL_ENV=/root/work/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="/root/work/bin:$VIRTUAL_ENV/bin:$PATH"

# Set default shell to zsh
SHELL ["/bin/bash", "-c"]

# Activate virtual environment in bash
Expand Down

0 comments on commit eef51b8

Please sign in to comment.