Skip to content

Commit

Permalink
cleanup a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
andersla committed Oct 14, 2024
1 parent 3d72bee commit bb6d6ef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
15 changes: 10 additions & 5 deletions build-local-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ image="pharmbio-notebook"
echo "tensorflow_version=$tensorflow_version"
echo "tag=$tag"
echo "image=$image"
#switched to buildx build
# Build docker image for this container.
# docker buildx build --no-cache -t ghcr.io/pharmbio/$image:$tag \
# --build-arg BASE_IMAGE=tensorflow/tensorflow:${tensorflow_version}-jupyter \
# -f ./docker/env.cpu.Dockerfile . || exit 1

## CPU version
#DOCKER_BUILDKIT=1 docker buildx build --no-cache -t ghcr.io/pharmbio/$image:${tag} \
# --build-arg BASE_IMAGE=tensorflow/tensorflow:${tensorflow_version}-jupyter \
# -f docker/env.cuda.Dockerfile . || exit 1

# GPU version
DOCKER_BUILDKIT=1 docker buildx build --no-cache -t ghcr.io/pharmbio/$image:${tag}-gpu \
--build-arg BASE_IMAGE=tensorflow/tensorflow:${tensorflow_version}-gpu-jupyter \
-f docker/env.cuda.Dockerfile . || exit 1

echo Push image with command:
echo docker push "ghcr.io/pharmbio/$image:${tag}-gpu"

#docker push "ghcr.io/pharmbio/$image:$tag-devel"
27 changes: 7 additions & 20 deletions docker/env.cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install base dependencies
ENV DEBIAN_FRONTEND=noninteractive
# >apt_installs.txt to save instead of executing
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends \
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
software-properties-common \
Expand Down Expand Up @@ -46,8 +43,7 @@ RUN <<EOF
sqlite3 \
libgl1-mesa-glx \
python3-venv \
openjdk-17-jdk-headless \
EOF
openjdk-17-jdk-headless

# Install Rust (comment out if not needed)
#RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand All @@ -59,21 +55,12 @@ COPY requirements.txt .
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
python3 -m pip install --no-cache-dir -r requirements.txt


# Breakpoint - temporary shell for debugging
RUN --mount=type=cache,target=/tmp \
echo "Entering breakpoint shell"; \
sleep infinity

RUN echo "Step 2: Continuing after breakpoint"

RUN <<EOF
echo "Installing for CUDA framework"
python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
RUN echo "Installing for CUDA framework"
RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
torch==2.4.1 \
torchvision \
torchaudio;
EOF
torchaudio


# RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
# torch==2.2.1 \
Expand Down Expand Up @@ -116,4 +103,4 @@ WORKDIR /home/jovyan
# Then the entrypoint will start jupyter notebook server
#
COPY entrypoint.sh /
CMD /entrypoint.sh
CMD /entrypoint.sh
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ matplotlib
pandas
polars
pillow
jupyterlab
tifffile
#chembl-webresource-client
albumentations
Expand Down

0 comments on commit bb6d6ef

Please sign in to comment.