Skip to content

Add Docker Support for AmadeusGPT #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Base image with PyTorch and CUDA support
FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime

# User arguments for container setup - keeping for compatibility with Makefile
ARG user_name
ARG uid
ARG gid

# Install system dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y --no-install-recommends \
libgl1-mesa-glx libglib2.0-0 \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean

SHELL ["/bin/bash", "-c"]
RUN conda create -y --name amadeusGPT python=3.10
ENV PATH=/opt/conda/envs/amadeusGPT/bin:$PATH
RUN conda install -y -n amadeusGPT hdf5 pytables=3.8.0

# Install pip packages in the user environment
RUN pip install --no-cache-dir notebook amadeusgpt
RUN pip install -U --pre deeplabcut

# Initialize conda for bash
RUN conda init bash
RUN echo 'conda activate amadeusGPT' >> ~/.bashrc

USER root
# Default command when container starts (activating the conda env)
WORKDIR /app
CMD ["bash", "-l"]
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,36 @@ export streamlit_app=True
app:

streamlit run amadeusgpt/app.py --server.fileWatcherType none --server.maxUploadSize 1000

IMG_TAG := 0.1
IMG_NAME := amadeusgpt
DOCKERFILE := Dockerfile

BUILD_ARGS := \
--build-arg uid=$(shell id -u) \
--build-arg gid=$(shell id -g) \
--build-arg user_name=$(shell id -un)
build:
docker build $(BUILD_ARGS) \
-t $(IMG_NAME):$(IMG_TAG) -f $(DOCKERFILE) .

# [USER: ADJUST VOLUMES]
# path to the local project
HOST_SRC := /home/$(shell id -un)/AmadeusGPT
# path to the project in the container
DOCKER_SRC := /home/$(shell id -un)/AmadeusGPT
# DOCKER_DATA := /mnt
VOLUMES := \
--volume $(HOST_SRC):$(DOCKER_SRC)

CONTAINER_TAG :=v0.1
CONTAINER_NAME := amadeusgpt_$(CONTAINER_TAG)

run:
docker run --shm-size=60G --gpus all -it --name $(CONTAINER_NAME) \
$(VOLUMES) \
$(IMG_NAME):$(IMG_TAG)
# tail -f /dev/null

exec:
docker exec -it $(CONTAINER_NAME) /bin/bash
Loading