-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* uv2 * bump dependencies * optimize dockerfile * add nltk * push
- Loading branch information
Showing
10 changed files
with
3,862 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Run the following command to build `ghcr.io/allenai/oi-cuda-no-conda:12.1-cudnn8-dev-ubuntu20.04` | ||
# docker build --build-arg CUDA=12.1.0 --build-arg TARGET=cudnn8-devel --build-arg DIST=ubuntu20.04 -f Dockerfile.base . -t cuda-no-conda:12.1-cudnn8-dev-ubuntu20.04 | ||
|
||
ARG CUDA | ||
ARG DIST | ||
ARG TARGET | ||
FROM --platform=linux/amd64 nvidia/cuda:${CUDA}-${TARGET}-${DIST} | ||
|
||
ARG DEBIAN_FRONTEND="noninteractive" | ||
ENV TZ="America/Los_Angeles" | ||
|
||
# Install base tools. | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
jq \ | ||
language-pack-en \ | ||
make \ | ||
man-db \ | ||
manpages \ | ||
manpages-dev \ | ||
manpages-posix \ | ||
manpages-posix-dev \ | ||
sudo \ | ||
unzip \ | ||
vim \ | ||
wget \ | ||
fish \ | ||
parallel \ | ||
iputils-ping \ | ||
htop \ | ||
emacs \ | ||
zsh \ | ||
rsync \ | ||
tmux | ||
|
||
# This ensures the dynamic linker (or NVIDIA's container runtime, I'm not sure) | ||
# puts the right NVIDIA things in the right place (that THOR requires). | ||
ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute | ||
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH | ||
|
||
# Ensure users can modify their container environment. | ||
RUN echo '%users ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
# Make the base image friendlier for interactive workloads. This makes things like the man command | ||
# work. | ||
RUN yes | unminimize | ||
|
||
# Install MLNX OFED user-space drivers | ||
# See https://docs.nvidia.com/networking/pages/releaseview.action?pageId=15049785#Howto:DeployRDMAacceleratedDockercontaineroverInfiniBandfabric.-Dockerfile | ||
ENV MOFED_VER 24.01-0.3.3.1 | ||
ENV OS_VER ubuntu20.04 | ||
ENV PLATFORM x86_64 | ||
RUN wget --quiet https://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VER}/MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz && \ | ||
tar -xvf MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz && \ | ||
MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}/mlnxofedinstall --basic --user-space-only --without-fw-update -q && \ | ||
rm -rf MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM} && \ | ||
rm MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz | ||
|
||
# Install Docker CLI. Version matches Beaker on-premise servers. | ||
RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.21.tgz -o docker.tgz \ | ||
&& sudo tar xzvf docker.tgz --strip 1 -C /usr/local/bin docker/docker \ | ||
&& rm docker.tgz | ||
|
||
# Install Beaker | ||
ARG BEAKER_VERSION | ||
RUN curl --silent \ | ||
--connect-timeout 5 \ | ||
--max-time 10 \ | ||
--retry 5 \ | ||
--retry-delay 0 \ | ||
--retry-max-time 40 \ | ||
--output beaker.tar.gz \ | ||
"https://beaker.org/api/v3/release/cli?os=linux&arch=amd64&version=${BEAKER_VERSION}" \ | ||
&& tar -zxf beaker.tar.gz -C /usr/local/bin/ ./beaker \ | ||
&& rm beaker.tar.gz | ||
|
||
# The -l flag makes bash act as a login shell and load /etc/profile, etc. | ||
ENTRYPOINT ["bash", "-l"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM ghcr.io/allenai/oi-cuda-no-conda:12.1-cudnn8-dev-ubuntu20.04 | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
ENV HF_HUB_ENABLE_HF_TRANSFER=1 | ||
ENV UV_COMPILE_BYTECODE=1 | ||
|
||
# setup files | ||
WORKDIR /stage/ | ||
|
||
# Install the project's dependencies using the lockfile and settings | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-install-project | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-install-project --extra compile | ||
|
||
COPY open_instruct open_instruct | ||
COPY eval eval | ||
COPY configs configs | ||
COPY scripts scripts | ||
# hack: only copy oe-eval-internal if it exists | ||
COPY mason.py oe-eval-internal* /stage/ | ||
COPY .git/ ./.git/ | ||
COPY pyproject.toml uv.lock . | ||
RUN chmod +x scripts/* | ||
|
||
# install dependencies | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv sync --frozen --extra compile | ||
|
||
# for interactive session | ||
RUN chmod -R 777 /stage/ | ||
|
||
# uv dockerfile magic: place executables in the environment at the front of the path | ||
ENV PATH=/stage/.venv/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.