Skip to content

Commit

Permalink
updated pytorch and some other packages on top of image with cuda <= …
Browse files Browse the repository at this point in the history
…2.12
  • Loading branch information
andersla committed Oct 15, 2024
1 parent bb6d6ef commit 29ed706
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
8 changes: 4 additions & 4 deletions build-local-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ echo "tensorflow_version=$tensorflow_version"
echo "tag=$tag"
echo "image=$image"

## CPU version
### 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 \
DOCKER_BUILDKIT=1 docker buildx build -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 "Push with this command"
echo docker push "ghcr.io/pharmbio/$image:${tag}-gpu"

#docker push "ghcr.io/pharmbio/$image:$tag-devel"
26 changes: 26 additions & 0 deletions build-push-local-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#set -xv

git_branch="$(git branch --show-current)"
tag=$git_branch
tensorflow_version="${git_branch#tf-}" # remove prefix
tensorflow_version="${tensorflow_version%-*}" # remove suffix
image="pharmbio-notebook"
echo "tensorflow_version=$tensorflow_version"
echo "tag=$tag"
echo "image=$image"

## 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

docker push "ghcr.io/pharmbio/$image:${tag}"

# GPU version
DOCKER_BUILDKIT=1 docker buildx build -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 docker push "ghcr.io/pharmbio/$image:${tag}-gpu"

9 changes: 1 addition & 8 deletions docker/env.cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +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

RUN echo "Installing for CUDA framework"
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


# RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
# torch==2.2.1 \
# torchvision \
# torchaudio;
# RUN python3 -m pip install \
# --extra-index-url=https://pypi.nvidia.com \
# cudf-cu12==24.6.* dask-cudf-cu12==24.6.* cuml-cu12==24.6.* \
Expand All @@ -74,8 +69,6 @@ RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.o
# raft-dask-cu12==24.6.* cuvs-cu12==24.6.*;




# Add pharmbio templates, examples and misc
#WORKDIR /pharmbio/
#COPY README.md .
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ fastparquet
#umap-learn
#torchsummary
scanpy
jupyterlab

0 comments on commit 29ed706

Please sign in to comment.