Skip to content

Commit

Permalink
Test caching improvements, test bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Liana64 committed Dec 5, 2024
1 parent 090b1b9 commit 8e3b438
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions apps/chai/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ ARG DEBIAN_FRONTEND=noninteractive

ENV \
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility,graphics" \
VIRTUAL_ENV=/opt/venv \
PATH="${VIRTUAL_ENV}:$PATH" \
PATH="/opt/venv/bin:$PATH" \
UMASK="0002" \
LANG=C.UTF-8 \
TZ="Etc/UTC" \
Expand All @@ -29,26 +28,33 @@ ENV \
UV_HTTP_TIMEOUT=1000

USER root
WORKDIR /app

RUN \
groupadd --gid ${GID} ${USERNAME} \
&& useradd --uid ${UID} --gid ${GID} --create-home --shell /bin/bash ${USERNAME} \
&& apt-get update && apt-get install -y --no-install-recommends \
curl unzip build-essential catatonit jq \
gnupg ca-certificates lsb-release \
nano vim tree \
# -----------------------------------
# TODO: Build images with extras
# -----------------------------------
# htop tmux psmisc \
# socat rsync aria2 openssh-server \
# -----------------------------------
# TODO: Build images with RDMA & InfiniBand
# -----------------------------------
# libibverbs1 librdmacm1 \
# -----------------------------------
&& curl -fsSL -o /tmp/app.zip "https://github.com/chaidiscovery/chai-lab/archive/refs/tags/v${VERSION}.zip" \
nano vim tree
# -----------------------------------
# TODO: Build images with extras
# -----------------------------------
# htop tmux psmisc \
# socat rsync aria2 openssh-server \
# -----------------------------------
# TODO: Build images with RDMA & InfiniBand
# -----------------------------------
# libibverbs1 librdmacm1 \
# -----------------------------------

COPY --chown=${UID}:${GID} ./apps/chai/entrypoint.sh /entrypoint.sh
RUN chmod -R 755 /entrypoint.sh

USER ${USERNAME}
WORKDIR /app

RUN \
curl -fsSL -o /tmp/app.zip "https://github.com/chaidiscovery/chai-lab/archive/refs/tags/v${VERSION}.zip" \
&& unzip -q /tmp/app.zip -d /tmp/app \
&& cp -R /tmp/app/chai-lab-${VERSION}/LICENSE /app \
&& cp -R /tmp/app/chai-lab-${VERSION}/assets /app \
Expand All @@ -57,20 +63,20 @@ RUN \
&& printf "UpdateMethod=docker\nBranch=master\nPackageVersion=%s\nPackageAuthor=[RareCompute](https://github.com/RareCompute)\n" "${VERSION}" > /app/package_info \
&& chown -R ${UID}:${GID} /app && chmod -R 755 /app \
&& curl -LsSf https://astral.sh/uv/0.5.6/install.sh | sh \
&& . $HOME/.local/bin/env \
&& uv venv --no-python-downloads ${VIRTUAL_ENV} \
&& . ${VIRTUAL_ENV}/bin/activate \
&& uv pip install -r /tmp/app/chai-lab-${VERSION}/requirements.in \
&& chown -R ${UID}:${GID} ${VIRTUAL_ENV} && chmod -R 755 ${VIRTUAL_ENV} \
&& source $HOME/.local/bin/env \
&& uv venv --no-python-downloads /opt/venv \
&& source /opt/venv/bin/activate \
&& uv pip install -r /tmp/app/chai-lab-${VERSION}/requirements.in

USER root
RUN \
chown -R ${UID}:${GID} /opt/venv && chmod -R 755 /opt/venv \
&& apt-get purge -y build-essential \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /root/.cache /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& chsh -s /bin/bash

COPY --chown=${UID}:${GID} ./apps/chai/entrypoint.sh /entrypoint.sh
RUN chmod -R 755 /entrypoint.sh

USER ${USERNAME}
WORKDIR /app

Expand Down

0 comments on commit 8e3b438

Please sign in to comment.