Skip to content

Commit

Permalink
fix: revert to two files
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Nov 4, 2024
1 parent 0f6fdbd commit 601a416
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 124 deletions.
44 changes: 2 additions & 42 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,13 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Base
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.base
build-args: |
IMAGE=nvidia/cuda:12.6.1-devel-ubuntu24.04
tags: ghcr.io/ucsd-e4e/fishsense-lite:base-cuda
push: false
-
name: Build Middle
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.mid-cuda
tags: ghcr.io/ucsd-e4e/fishsense-lite:mid-cuda
push: false
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
file: docker/Dockerfile.cuda
tags: ghcr.io/ucsd-e4e/fishsense-lite:cuda
build-args: |
IMAGE=ghcr.io/ucsd-e4e/fishsense-lite:mid-cuda
push: true

build-cpu:
Expand All @@ -71,31 +51,11 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Base
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.base
build-args:
-IMAGE=ubuntu:24.04
tags: ghcr.io/ucsd-e4e/fishsense-lite:base-cpu
push: false
-
name: Build Middle
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.mid-cpu
tags: ghcr.io/ucsd-e4e/fishsense-lite:mid-cpu
push: false
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
file: docker/Dockerfile.cpu
tags: ghcr.io/ucsd-e4e/fishsense-lite:cpu
build-args:
-IMAGE=ghcr.io/ucsd-e4e/fishsense-lite:mid-cpu
push: true
26 changes: 0 additions & 26 deletions docker/Dockerfile

This file was deleted.

22 changes: 19 additions & 3 deletions docker/Dockerfile.base → docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG IMAGE=nvidia/cuda:12.6.1-devel-ubuntu24.04
FROM $IMAGE
FROM ubuntu:24.04

SHELL ["/bin/bash", "-c"]

Expand Down Expand Up @@ -30,4 +29,21 @@ RUN apt-get update && apt-get install -y sudo \
llvm \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

CMD ["/bin/bash"]
RUN echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER ubuntu
ENV HOME="/home/ubuntu"
RUN mkdir -p ${HOME}
WORKDIR ${HOME}

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"

RUN pyenv install 3.11
RUN pyenv global 3.11
RUN pip install --upgrade pip && pip cache purge

CMD ["/bin/bash"]
86 changes: 86 additions & 0 deletions docker/Dockerfile.cuda
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
FROM nvidia/cuda:12.6.1-devel-ubuntu24.04

SHELL ["/bin/bash", "-c"]

RUN apt-get update && apt-get upgrade -y && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y sudo \
build-essential \
git \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
python3-openssl \
libopencv-dev \
clang \
libclang-dev \
llvm \
python3-dev \
libpython3-dev \
ocl-icd-libopencl1 \
cmake \
pkg-config \
make \
ninja-build \
ocl-icd-libopencl1 \
ocl-icd-dev \
ocl-icd-opencl-dev \
libhwloc-dev \
clinfo \
dialog \
apt-utils \
libxml2-dev \
libclang-cpp-dev \
llvm-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# NVIDIA does not provide OpenCL passthru.
# POCL supports a CUDA-based OpenCL driver
RUN git clone https://github.com/pocl/pocl.git /pocl
WORKDIR /pocl
RUN git checkout v6.0
RUN mkdir build
WORKDIR /pocl/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DENABLE_CUDA=ON .. && \
make -j && \
make install && \
rm -rf /pocl

RUN echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

USER ubuntu
ENV HOME="/home/ubuntu"
RUN mkdir -p ${HOME}
WORKDIR ${HOME}

# We want access to all of the GPUs but do not want to expose any CPU devices
RUN echo "export POCL_DEVICES=cuda" >> ${HOME}/.bashrc

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN echo ". \"\$HOME/.cargo/env\"" >> ${HOME}/.bashrc

RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN echo "export PYENV_ROOT=\"\$HOME/.pyenv\"" >> ${HOME}/.bashrc && \
echo "[[ -d \$PYENV_ROOT/bin ]] && export PATH="\$PYENV_ROOT/bin:\$PATH"" >> ${HOME}/.bashrc && \
echo "eval \"\$(pyenv init -)\"" >> ${HOME}/.bashrc && \
echo "\"$(pyenv virtualenv-init -)\"" >> ${HOME}/.bashrc

RUN pyenv install 3.11
RUN pyenv global 3.11
RUN pip install --upgrade pip && pip cache purge

CMD ["/bin/bash"]
6 changes: 0 additions & 6 deletions docker/Dockerfile.mid-cpu

This file was deleted.

47 changes: 0 additions & 47 deletions docker/Dockerfile.mid-cuda

This file was deleted.

0 comments on commit 601a416

Please sign in to comment.