File tree Expand file tree Collapse file tree 2 files changed +57
-0
lines changed
Expand file tree Collapse file tree 2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM mambaorg/micromamba:jammy-cuda-12.1.0
2+
3+ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
4+ ENV ENV_NAME=diffusors SHELL=/bin/bash
5+ ARG NEW_MAMBA_USER=$ENV_NAME
6+ ARG NEW_MAMBA_USER_ID=5005
7+ ARG NEW_MAMBA_USER_GID=5005
8+ EXPOSE 8888
9+
10+ RUN micromamba install -y -n base -c conda-forge python=3.11 \
11+ && micromamba clean --all --yes
12+
13+ USER root
14+ RUN apt update && apt install -y git tmux nvtop htop \
15+ && apt clean autoremove -y
16+ RUN usermod "--login=${NEW_MAMBA_USER}" "--home=/home/${NEW_MAMBA_USER}" \
17+ --move-home "-u ${NEW_MAMBA_USER_ID}" "${MAMBA_USER}" && \
18+ groupmod "--new-name=${NEW_MAMBA_USER}" \
19+ "-g ${NEW_MAMBA_USER_GID}" "${MAMBA_USER}" && \
20+ # Update the expected value of MAMBA_USER for the
21+ # _entrypoint.sh consistency check.
22+ echo "${NEW_MAMBA_USER}" > "/etc/arg_mamba_user" && :
23+ ENV MAMBA_USER=$NEW_MAMBA_USER
24+
25+ USER $MAMBA_USER
26+ WORKDIR /workspace
27+ # Install any needed packages specified in environment.yml
28+ COPY environment.yml environment.yml
29+ RUN micromamba create -n $ENV_NAME -f environment.yml -y \
30+ && micromamba clean --all --yes
31+
32+ CMD ["jupyter" , "lab" , "--ip=0.0.0.0" , "--no-browser" ]
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ branch=$( git rev-parse --abbrev-ref HEAD)
4+
5+ docker rm -f diffusors-${branch}
6+ docker build --build-arg NEW_MAMBA_USER_ID=$( id -u) --build-arg NEW_MAMBA_USER_GID=$( id -g) -t diffusors:${branch} .
7+ docker run --gpus all \
8+ --env-file .env \
9+ -it -d -v $PWD :/workspace \
10+ -v /data:/data \
11+ -p 8888:8888 \
12+ --shm-size=200g --ulimit memlock=-1 --ulimit stack=64000000 \
13+ --name diffusors-${branch} \
14+ diffusors:${branch} bash
15+
16+ # Wait for the Docker container to start
17+ sleep 5
18+
19+ # Get the logs from the running Docker container
20+ logs=$( docker logs diffusors-${branch} )
21+
22+ # Extract the token from the logs
23+ token=$( echo " ${logs} " | grep -oP ' (?<=token=)[a-z0-9]*' | head -n 1)
24+
25+ echo " Jupyter Notebook Token: ${token} "
You can’t perform that action at this time.
0 commit comments