Skip to content

Commit 237a20a

Browse files
committed
dockerfile with sam2
1 parent ddb8e8d commit 237a20a

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

Dockerfile.sam2

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
2+
ARG user_name
3+
ARG uid
4+
ARG gid
5+
ENV HOME=/root
6+
WORKDIR ${HOME}
7+
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
RUN apt-get update -y && apt-get install -y --no-install-recommends \
10+
vim zsh tmux wget htop jupyter python3 python3-pip libgl1-mesa-glx git sudo ssh libglib2.0-0 \
11+
tree \
12+
&& apt-get -y autoclean \
13+
&& apt-get -y autoremove \
14+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
15+
&& apt-get clean \
16+
&& apt-get update
17+
18+
# Install conda packages as root
19+
SHELL ["/bin/bash", "-lc"]
20+
RUN conda install -y python=3.10 pytables=3.8.0 hdf5 jupyter
21+
22+
# Install DeepLabCut and other pip packages as root
23+
RUN pip install --no-cache-dir --upgrade pip setuptools && \
24+
pip install --no-cache-dir gpustat nvitop pytest PySide6==6.3.1 streamlit networkx isort black && \
25+
pip install --no-cache-dir amadeusgpt && \
26+
pip install --no-cache-dir git+https://github.com/DeepLabCut/DeepLabCut.git
27+
28+
# Initialize conda for zsh shell
29+
RUN /opt/conda/bin/conda init zsh
30+
31+
# Create a non-root user
32+
RUN mkdir /app /logs /data
33+
RUN groupadd -g ${gid} ${user_name} \
34+
&& useradd -m -u ${uid} -g ${gid} ${user_name} \
35+
&& chown -R ${uid}:${gid} /home
36+
37+
# Switch to the new user and set home directory as working directory
38+
USER ${user_name}
39+
ENV HOME=/home/${user_name}
40+
WORKDIR ${HOME}
41+
42+
RUN git clone https://github.com/facebookresearch/sam2.git && cd sam2 && pip install -e .
43+
44+
# Install Oh My Zsh and plugins
45+
# RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended \
46+
# && git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
47+
# && git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
48+
# && sed -i 's/^plugins=(.*)$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc
49+
# RUN echo "export PATH=$PATH:/home/${user_name}/.local/bin" >> /home/${user_name}/.zshrc
50+
51+
USER root
52+
WORKDIR /app
53+
54+
# CMD ["zsh"]
55+
# SHELL ["/bin/zsh", "-c"]
56+
CMD ["/bin/bash"]
57+
SHELL ["/bin/bash", "-c"]

Makefile

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ app:
33

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

6-
IMG_TAG := 0.1
6+
IMG_TAG := 0.2
77
IMG_NAME := amadeusgpt
8-
DOCKERFILE := Dockerfile
8+
DOCKERFILE := Dockerfile.sam2
99

1010
BUILD_ARGS := \
1111
--build-arg uid=$(shell id -u) \
@@ -24,7 +24,7 @@ DOCKER_SRC := /home/$(shell id -un)/AmadeusGPT
2424
VOLUMES := \
2525
--volume $(HOST_SRC):$(DOCKER_SRC)
2626

27-
CONTAINER_TAG :=v0.1
27+
CONTAINER_TAG :=v0.14
2828
CONTAINER_NAME := amadeusgpt_$(CONTAINER_TAG)
2929

3030
run:

0 commit comments

Comments
 (0)