-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
156 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# pull from devel image instead of base | ||
FROM nvidia/cuda:11.8.0-devel-ubuntu20.04 | ||
|
||
# Set bash as the default shell | ||
ENV SHELL=/bin/bash | ||
|
||
# Create a working directory | ||
WORKDIR /app/ | ||
|
||
# Build with some basic utilities | ||
RUN apt-get update && apt-get install -y \ | ||
python3-pip \ | ||
apt-utils \ | ||
vim \ | ||
git | ||
|
||
# alias python='python3' | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# build with some basic python packages | ||
RUN pip install \ | ||
numpy \ | ||
torch \ | ||
jupyterlab | ||
|
||
# start jupyter lab | ||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root", "--no-browser"] | ||
EXPOSE 8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM tverous/pytorch-notebook:base | ||
|
||
ARG MY_UID | ||
ARG MY_GID | ||
ARG USER | ||
ARG HOME | ||
|
||
# for prompts | ||
ENV RED='\033[0;31m' | ||
ENV GREEN='\033[0;32m' | ||
ENV NC='\033[0m' | ||
# run id -u | ||
ENV MY_UID=${MY_GID} | ||
# run id -g | ||
ENV MY_GID=${MY_UID} | ||
# your username | ||
ENV USER=${USER} | ||
# your home directory | ||
ENV HOME=${HOME} | ||
|
||
RUN test ! -z ${MY_UID} && echo ${GREEN}"MY_UID is set to ${MY_UID}"${NC} || (echo ${RED}"MY_UID is not set"${NC} && exit 1) | ||
RUN test ! -z ${MY_GID} && echo ${GREEN}"MY_GID is set to ${MY_GID}"${NC} || (echo ${RED}"MY_GID is not set"${NC} && exit 1) | ||
RUN test ! -z ${USER} && echo ${GREEN}"USER is set to ${USER}"${NC} || (echo ${RED}"USER is not set"${NC} && exit 1) | ||
RUN test ! -z ${HOME} && echo ${GREEN}"HOME is set to ${HOME}"${NC} || (echo ${RED}"HOME is not set"${NC} && exit 1) | ||
|
||
RUN unset RED && unset GREEN && unset NC | ||
|
||
# install sudo | ||
RUN apt-get update && apt-get install -y \ | ||
sudo | ||
|
||
# add a new user with the specific user id and group id | ||
RUN groupadd -g ${MY_GID} ${USER} \ | ||
&& useradd ${USER} -u ${MY_UID} -g ${MY_GID} -d ${HOME} -m -s /bin/bash | ||
|
||
# add user to the root group | ||
RUN usermod -aG root ${USER} | ||
|
||
# TODO: disable sudo password | ||
RUN echo "%${USER} ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers && exit | ||
|
||
USER ${USER} | ||
WORKDIR ${HOME} | ||
|
||
# start jupyter lab | ||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root", "--no-browser"] | ||
EXPOSE 8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM tverous/pytorch-notebook:user | ||
|
||
# install jupyter lab extensions | ||
RUN pip install \ | ||
# https://github.com/mohirio/jupyterlab-horizon-theme | ||
jupyterlab-horizon-theme \ | ||
# https://github.com/jupyterlab/jupyterlab-git | ||
jupyterlab-git \ | ||
# https://github.com/jupyter-lsp/jupyterlab-lsp | ||
jupyterlab-lsp \ | ||
# https://github.com/jtpio/jupyterlab-system-monitor | ||
jupyterlab-system-monitor | ||
|
||
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--allow-root", "--no-browser"] | ||
EXPOSE 8888 |