Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43e1004b15 | ||
|
|
e57401677f | ||
|
|
f0d71a9441 | ||
|
|
edfdd28619 | ||
|
|
7f7d490de6 | ||
|
|
e7e28fd76d | ||
|
|
730dc832b0 | ||
|
|
7cecd16dc9 | ||
|
|
2d056396a8 | ||
|
|
86efe1122c | ||
|
|
c7bff5448a | ||
| cea7bc59f3 | |||
| db5b989aad |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
/docker-stacks
|
||||
jupyterhub-data
|
||||
*.tar
|
||||
@@ -1,4 +1,3 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM debian:bullseye
|
||||
ARG CREATE_USER="jovyan"
|
||||
ARG CREATE_USER_PASSWD="password"
|
||||
|
||||
@@ -8,8 +8,6 @@ ARG ROOT_PASSWD="password"
|
||||
ARG HOME="/home/${CREATE_USER}"
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND}
|
||||
ARG NODEJS_VERSION='18'
|
||||
ENV NODEJS_VERSION=${NODEJS_VERSION}
|
||||
|
||||
USER root
|
||||
RUN <<EOT
|
||||
@@ -21,8 +19,6 @@ apt-get install -y tzdata
|
||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
echo 'Asia/Shanghai' > /etc/timezone
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
sudo apt-get remove --purge libnode72:amd64 -y
|
||||
curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | sudo -E bash -
|
||||
# 安装所需的软件包
|
||||
apt-get install -y python3 python3-pip gcc g++ build-essential nodejs npm gdebi-core curl wget openssh-server vim lrzsz net-tools sudo git
|
||||
# 创建新用户
|
||||
@@ -33,26 +29,17 @@ EOT
|
||||
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
mkdir -p ~/.pip
|
||||
echo "
|
||||
[global]
|
||||
index-url = https://mirrors.aliyun.com/pypi/simple/
|
||||
|
||||
[install]
|
||||
trusted-host=mirrors.aliyun.com
|
||||
" >> ~/.pip/pip.conf
|
||||
# 安装 Jupyter 和相关软件
|
||||
npm install -g configurable-http-proxy yarn --registry=https://registry.npmmirror.com
|
||||
python3 -m pip install ipython jupyter_packaging jupyterhub jupyterlab notebook radian pycurl jupyter-rsession-proxy \
|
||||
ipykernel jupyterlab-language-pack-zh-CN jupyterlab-git jupyterlab-system-monitor jupyter_nbextensions_configurator \
|
||||
jupyter_contrib_nbextensions jupyterlab-unfold jupyterlab_widgets jupyterlab-drawio jupyterlab-spreadsheet-editor \
|
||||
jupyterlab-cell-flash jedi-language-server jupyterlab_code_formatter jupyterlab-spellchecker jupyterlab_vim nbresuse \
|
||||
ipydrawio jedi ipympl black isort theme-darcula ipywidgets tensorboard jupyterlab_latex jupyter_bokeh autopep8 \
|
||||
xeus-python jupyterlab-lsp python-lsp-server dockerspawner jupyterhub-nativeauthenticator lckr_jupyterlab_variableinspector -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
git clone https://ghproxy.dockless.eu.org/https://github.com/arose/nglview
|
||||
cd nglview
|
||||
python3 setup.py install
|
||||
cd js
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install typescript@latest --registry=https://registry.npmmirror.com
|
||||
npm install --registry=https://registry.npmmirror.com
|
||||
cd ../..
|
||||
python -m ipykernel install --sys-prefix
|
||||
jupyter nbextension enable --py --sys-prefix widgetsnbextension
|
||||
jupyter nbextension enable --py --sys-prefix nglview
|
||||
jupyter-nbextension enable nglview --py --sys-prefix
|
||||
npm install -g configurable-http-proxy
|
||||
python3 -m pip install jupyterhub jupyterlab notebook radian pycurl jupyter-rsession-proxy ipykernel jupyterlab-language-pack-zh-CN jupyterlab-git jupyterlab-system-monitor jupyter_nbextensions_configurator jupyter_contrib_nbextensions jupyterlab-unfold jupyterlab_widgets jupyterlab-drawio jupyterlab-spreadsheet-editor jupyterlab-cell-flash jedi-language-server jupyterlab_code_formatter jupyterlab-spellchecker jupyterlab_vim nbresuse ipydrawio jedi ipympl black isort theme-darcula ipywidgets tensorboard jupyterlab_latex jupyter_bokeh autopep8 xeus-python jupyterlab-lsp python-lsp-server nglview dockerspawner jupyterhub-nativeauthenticator lckr_jupyterlab_variableinspector
|
||||
# 创建 JupyterHub 配置目录
|
||||
mkdir -p /root/.jupyterhub
|
||||
EOT
|
||||
@@ -73,9 +60,22 @@ sudo wget "https://download2.rstudio.org/server/$(lsb_release -cs)/amd64/rstudio
|
||||
sudo chmod +x /tmp/rstudio-server.deb
|
||||
sudo gdebi -n /tmp/rstudio-server.deb
|
||||
sudo rm -rf /tmp/rstudio-server.deb
|
||||
EOT
|
||||
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# 安装micromamba
|
||||
echo "1" | bash <(curl -s https://raw.githubusercontent.com/hotwa/MicroMamba_Installer/main/install.sh)
|
||||
mkdir -p /root/workspace/personal /root/workspace/project
|
||||
EOT
|
||||
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# 清理和减小镜像大小
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man/?? /usr/share/man/??_*
|
||||
EOT
|
||||
|
||||
|
||||
|
||||
CMD ["jupyterhub", "-f", "/srv/jupyterhub/jupyterhub_config.py"]
|
||||
@@ -12,7 +12,7 @@ services:
|
||||
args:
|
||||
JUPYTERHUB_VERSION: latest
|
||||
restart: always
|
||||
image: quay.io/hotwa/jupyterhub:latest
|
||||
image: hotwa/jupyterhub # registry.cn-hangzhou.aliyuncs.com/hotwa/jupyterhub
|
||||
container_name: jupyterhub
|
||||
networks:
|
||||
- jupyterhub-network
|
||||
@@ -23,17 +23,16 @@ services:
|
||||
# within the container
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:rw"
|
||||
# Bind Docker volume on host for JupyterHub database and cookie secrets
|
||||
- "./jupyterhub-data:/data"
|
||||
- "jupyterhub-data:/data"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "8080:8080"
|
||||
environment:
|
||||
# This username will be a JupyterHub admin
|
||||
JUPYTERHUB_ADMIN: admin
|
||||
# All containers will join this network
|
||||
DOCKER_NETWORK_NAME: jupyterhub-network
|
||||
# JupyterHub will spawn this Notebook image for users
|
||||
DOCKER_NOTEBOOK_IMAGE: quay.io/hotwa/notebook:latest
|
||||
DOCKER_NOTEBOOK_IMAGE: hotwa/notebook:latest
|
||||
# Notebook directory inside user image
|
||||
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
|
||||
|
||||
|
||||
49
id_rsa
Executable file
49
id_rsa
Executable file
@@ -0,0 +1,49 @@
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
|
||||
NhAAAAAwEAAQAAAgEArjozHdq/VMgEmQZn5i/3UiRxmU2EZ0J7h0bMV/dIl7dALHDQeGuh
|
||||
Y8rwcCXsCwNBYGvRhBYkaMIgM+Gi/BTDufgHyJ7UKsYWACdxrj8Ycy1nS/qB2ppuLcRrzi
|
||||
us/XDuU8eBdqrvjL7KXn6FcBXE3wPSas3rPnBp1o0Fc4ipu91U/LDpZ8RvAesvMFfZc4cm
|
||||
QO/6zNm7zQ7vEemhXmFKnafe+EGJl9YIJuHud8EkRKwb7YMCjSdUxk/LRN4hlFel5+Hgf5
|
||||
tMmJpXdIyusCtGVG1IhvQv/R6ojLX+5qZE+3P7FFJWY/KeLqymiC9VCZ7nOmYzhhU7ROIv
|
||||
I4Eszdpp+vVn93lpfa1jjYIl1WbU9rhCbmjdbthDrK/8R/9NRIgLJbCIdXUOKv+JS2aX+a
|
||||
0dmPKDTuUAZwU7K5c4ftlfi7eb5D7gHKR4XE9NuOZncG8Idb0OQg79txOhYn/nheV3yv34
|
||||
VcSQytR/9EoEgjEfdTUhaqovSGEkM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cQUAdqjCcfgNt/PR8kfqUGs
|
||||
9FA33icsulTiOXyzPr5Ua96v6mAtscbkWLPPXVYm9DifarC787EfaeX2SZrmNpELV4I4oj
|
||||
U/mbKKDoMwtZTuzkClswBPa5o5yoo8TzFISTAdbK26xquS4THaOUsXv0zI26HUMoCf4Idr
|
||||
06xtUwljLdVdEjBkpXTRMLUbSfMoOOYTPmsMN2yCyz2AI5XCs5ChXF0q7rFdY68VG6n7Go
|
||||
6Un4HKfpUxdouHexTX4PJsU225oeLtCSMfsil1jf25Z7Kj3/VuEEQ4h/DW+iE7ZBz3Czgd
|
||||
iiUTZHgTrWm18wkQAAAQEA0sBQdC2Af3psNbk0vQ7MVwMQED7q0OHSpDfKxQdLgo0xASJ0
|
||||
nTX5HamlA57Owrln0HgW332Xp3vHwL9170pk260xx0R2gndX6JxZTbI6RBhggEfSDj7YOt
|
||||
aAWEk1zzcqi0IBv51x8gd7xqwOezkxpM2k3Ej93/+/qzEJDwcn/QxCjqwRRQgY3KGr+H+q
|
||||
R/cFkD8b+lFaLumQu1v7dMJltOD5Ls+rPglIUqWBeMILuyPbmBXxFF00yOuhkcpIwPN266
|
||||
nTtSishRCLkDL83lWVGw3PmOtifEmlvU8cb+t7d+T/kvwgTUSd6m8oVHphxvx3NBUmpzhO
|
||||
H0lsz1qPDuEJTQAAABJweWx5emVuZ0BnbWFpbC5jb20BAgMEBQYH
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
@@ -10,21 +10,7 @@ c = get_config() # noqa: F821
|
||||
# avoid having to rebuild the JupyterHub container every time we change a
|
||||
# configuration parameter.
|
||||
|
||||
# from dockerspawner import DockerSpawner
|
||||
|
||||
# class MyDockerSpawner(DockerSpawner):
|
||||
# def start(self):
|
||||
# # 启动父类的start方法
|
||||
# self.user_options['environment']['JUPYTER_ENABLE_NBEXTENSIONS'] = 'true'
|
||||
# self.user_options['cmd'] = [
|
||||
# 'bash',
|
||||
# '-c',
|
||||
# 'pip install nglview jupyter_packaging -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com && jupyter nbextension enable nglview --py --sys-prefix && jupyter labextension install nglview-js-widgets && jupyter labextension install @jupyter-widgets/jupyterlab-manager && start-singleuser.sh'
|
||||
# ]
|
||||
# return super().start()
|
||||
|
||||
# Spawn single-user servers as Docker containers
|
||||
c.Authenticator.allow_all = True
|
||||
c.JupyterHub.spawner_class = "dockerspawner.DockerSpawner"
|
||||
|
||||
# Spawn containers from this image
|
||||
|
||||
@@ -6,7 +6,7 @@ http {
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
@@ -33,7 +33,6 @@ http {
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port; # 添加这一行,保持原有的端口号
|
||||
|
||||
# WebSocket support
|
||||
proxy_http_version 1.1;
|
||||
|
||||
@@ -78,8 +78,6 @@ ARG ROOT_PASSWD="password"
|
||||
ARG HOME="/home/${CREATE_USER}"
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND}
|
||||
ARG NODEJS_VERSION='18'
|
||||
ENV NODEJS_VERSION=${NODEJS_VERSION}
|
||||
|
||||
COPY install.sh /tmp
|
||||
RUN <<EOT
|
||||
@@ -92,10 +90,7 @@ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
echo 'Asia/Shanghai' > /etc/timezone
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
# 安装所需的软件包
|
||||
sudo apt-get remove --purge libnode72:amd64 -y
|
||||
curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | sudo -E bash -
|
||||
apt-get install -y python3 python3-pip gcc g++ build-essential nodejs npm gdebi-core curl wget openssh-server vim lrzsz net-tools sudo git nodejs
|
||||
npm install -g configurable-http-proxy yarn --registry=https://registry.npmmirror.com
|
||||
# 创建新用户
|
||||
useradd -m -s /bin/bash ${CREATE_USER}
|
||||
echo "${CREATE_USER}:${CREATE_USER_PASSWD}" | chpasswd
|
||||
@@ -105,7 +100,11 @@ EOT
|
||||
# 安装 Jupyter 和相关软件
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
python3 -m pip install ipython jupyterhub jupyterlab notebook jupyter_packaging -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
npm install -g configurable-http-proxy
|
||||
git clone https://github.com/arose/nglview
|
||||
cd nglview
|
||||
python setup.py install
|
||||
cd ..
|
||||
python3 -m pip install aiohttp -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
python3 -m pip install jupyterhub jupyterlab notebook radian pycurl aiohttp jupyter-rsession-proxy ipykernel>=6.25.0 jupyterlab-language-pack-zh-CN jupyterlab-git jupyterlab-system-monitor jupyter_nbextensions_configurator jupyter_contrib_nbextensions jupyterlab_widgets jupyterlab-drawio jupyterlab-spreadsheet-editor jupyterlab-cell-flash jedi-language-server jupyterlab_code_formatter jupyterlab-spellchecker jupyterlab_vim nbresuse ipydrawio jedi ipympl black isort theme-darcula ipywidgets tensorboard jupyterlab_latex jupyter_bokeh autopep8 xeus-python jupyterlab-lsp python-lsp-server dockerspawner jupyterhub-nativeauthenticator lckr_jupyterlab_variableinspector -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
EOT
|
||||
@@ -139,58 +138,23 @@ USER ${NB_UID}
|
||||
ARG MODULAR_HOME="/home/${CREATE_USER}/.modular"
|
||||
ENV MODULAR_HOME=$MODULAR_HOME
|
||||
ENV PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:/home/${CREATE_USER}/.local/bin:$PATH"
|
||||
ARG HTTP_PROXY=""
|
||||
ARG HTTPS_PROXY=""
|
||||
ARG NO_PROXY="localhost,127.0.0.1"
|
||||
ENV HTTP_PROXY=$HTTP_PROXY
|
||||
ENV HTTPS_PROXY=$HTTPS_PROXY
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
curl --retry 5 https://get.modular.com | sh -
|
||||
mamba create -n mojo python=3.10 ipykernel ipython nglview -c conda-forge -y
|
||||
mamba activate mojo && modular install mojo
|
||||
mamba run -n mojo python -m ipykernel install --user --name="mojo" --display-name="mojo_env"
|
||||
curl https://get.modular.com | sh -
|
||||
mamba create -n mojo python=3.10 -c conda-forge -y
|
||||
mamba activate mojo
|
||||
modular install mojo
|
||||
EOT
|
||||
|
||||
# Install Rust https://rsproxy.cn/#getStarted
|
||||
ENV RUSTUP_DIST_SERVER="https://rsproxy.cn"
|
||||
ENV RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"
|
||||
# Install Rust
|
||||
ENV PATH="/home/${CREATE_USER}/.cargo/bin:$PATH"
|
||||
ENV CARGO_UNSTABLE_SPARSE_REGISTRY="true"
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y
|
||||
echo '[source.crates-io]
|
||||
replace-with = "rsproxy-sparse"
|
||||
[source.rsproxy]
|
||||
registry = "https://rsproxy.cn/crates.io-index"
|
||||
[source.rsproxy-sparse]
|
||||
registry = "sparse+https://rsproxy.cn/index/"
|
||||
[registries.rsproxy]
|
||||
index = "https://rsproxy.cn/crates.io-index"
|
||||
[net]
|
||||
git-fetch-with-cli = true' >> ~/.cargo/config.toml
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source $HOME/.cargo/env
|
||||
cargo install evcxr_jupyter
|
||||
evcxr_jupyter --install
|
||||
EOT
|
||||
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
sudo apt update
|
||||
sudo apt install -y texlive-full
|
||||
mamba create -n torch tensorboard jupyter_packaging pytorch biopython biopandas pymol-open-source mdtraj torchvision torchaudio python=3 ipython requests scienceplots autopep8 ipykernel\
|
||||
pandas numpy matplotlib scipy seaborn orange3 -c pytorch -c nvidia -c conda-forge -y
|
||||
git clone https://ghproxy.dockless.eu.org/https://github.com/arose/nglview
|
||||
cd nglview
|
||||
mamba run -n torch python3 setup.py install
|
||||
cd js
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install typescript@latest --registry=https://registry.npmmirror.com
|
||||
npm install --registry=https://registry.npmmirror.com
|
||||
cd ../..
|
||||
mamba run -n torch python -m ipykernel install --user --name="torch" --display-name="torch_env"
|
||||
EOT
|
||||
|
||||
WORKDIR "${HOME}"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ ENV ROOT_PASSWD=${ROOT_PASSWD}
|
||||
WORKDIR /root
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
ENV STAGE_DIR=/tmp
|
||||
# https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/
|
||||
ENV MLNX_OFED_VERSION=23.10-3.2.2.0
|
||||
RUN <<EOT
|
||||
@@ -29,34 +30,53 @@ python3 -m pip uninstall -y deepspeed
|
||||
# from https://github.com/huggingface/transformers/blob/main/docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile install deepspeed fail
|
||||
# reference deepspeed install from https://github.com/microsoft/DeepSpeed/blob/master/docker/Dockerfile
|
||||
# install deepspeed prepare
|
||||
apt-get update
|
||||
apt-get install -y libnvidia-compute-535
|
||||
apt-get install -y flex tk ethtool libpci3 libltdl-dev bison lsof tcl libelf1 pciutils kmod libmnl0 debhelper libusb-1.0-0 graphviz chrpath swig libfuse2 udev
|
||||
# install Mellanox OFED
|
||||
mkdir -p ${STAGE_DIR}
|
||||
cd ${STAGE_DIR}
|
||||
wget -q -O - http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64.tgz | tar xzf -
|
||||
cd MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64
|
||||
./mlnxofedinstall --user-space-only --without-fw-update --all -q
|
||||
cd ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64
|
||||
./mlnxofedinstall --user-space-only --without-fw-update --all -q > /tmp/mlnxofedinstall.log 2>&1
|
||||
cd ${STAGE_DIR}
|
||||
rm -rf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64*
|
||||
# rm -rf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64*
|
||||
EOT
|
||||
|
||||
ARG NV_PEER_MEM_VERSION="1.2"
|
||||
ENV NV_PEER_MEM_VERSION=${NV_PEER_MEM_VERSION}
|
||||
ENV NV_PEER_MEM_TAG=${NV_PEER_MEM_VERSION}-0
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# install nv_peer_mem
|
||||
mkdir -p ${STAGE_DIR}
|
||||
git clone https://github.com/Mellanox/nv_peer_memory.git --branch ${NV_PEER_MEM_TAG} ${STAGE_DIR}/nv_peer_memory
|
||||
cd ${STAGE_DIR}/nv_peer_memory
|
||||
./build_module.sh
|
||||
cd ${STAGE_DIR}
|
||||
tar xzf ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_VERSION}.orig.tar.gz
|
||||
cd ${STAGE_DIR}/nvidia-peer-memory-${NV_PEER_MEM_VERSION}
|
||||
apt-get update
|
||||
apt --fix-broken install -y
|
||||
apt-get install -y dkms
|
||||
dpkg-buildpackage -us -uc
|
||||
dpkg -i ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_TAG}_all.deb
|
||||
EOT
|
||||
RUN mkdir -p ${STAGE_DIR} && \
|
||||
git clone https://github.com/Mellanox/nv_peer_memory.git --branch ${NV_PEER_MEM_TAG} ${STAGE_DIR}/nv_peer_memory && \
|
||||
cd ${STAGE_DIR}/nv_peer_memory && \
|
||||
./build_module.sh && \
|
||||
cd ${STAGE_DIR} && \
|
||||
tar xzf ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_VERSION}.orig.tar.gz && \
|
||||
cd ${STAGE_DIR}/nvidia-peer-memory-${NV_PEER_MEM_VERSION} && \
|
||||
apt-get update && \
|
||||
apt-get --fix-broken install -y && \
|
||||
apt-get install -y dkms && \
|
||||
dpkg-buildpackage -us -uc && \
|
||||
dpkg -i ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_TAG}_all.deb
|
||||
|
||||
# ENV NV_PEER_MEM_VERSION=${NV_PEER_MEM_VERSION}
|
||||
# ENV NV_PEER_MEM_TAG=${NV_PEER_MEM_VERSION}-0
|
||||
# RUN <<EOT
|
||||
# #!/bin/bash
|
||||
# # install nv_peer_mem
|
||||
# mkdir -p ${STAGE_DIR}
|
||||
# git clone https://github.com/Mellanox/nv_peer_memory.git --branch ${NV_PEER_MEM_TAG} ${STAGE_DIR}/nv_peer_memory
|
||||
# cd ${STAGE_DIR}/nv_peer_memory
|
||||
# ./build_module.sh
|
||||
# cd ${STAGE_DIR}
|
||||
# tar xzf ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_VERSION}.orig.tar.gz
|
||||
# cd ${STAGE_DIR}/nvidia-peer-memory-${NV_PEER_MEM_VERSION}
|
||||
# apt-get update
|
||||
# apt-get --fix-broken install -y
|
||||
# apt-get install -y dkms
|
||||
# dpkg-buildpackage -us -uc
|
||||
# dpkg -i ${STAGE_DIR}/nvidia-peer-memory_${NV_PEER_MEM_TAG}_all.deb
|
||||
# EOT
|
||||
|
||||
# base tools
|
||||
RUN <<EOT
|
||||
@@ -86,9 +106,9 @@ pip install -v -U git+https://github.com/facebookresearch/xformers.git@main#egg=
|
||||
pip install git+https://github.com/huggingface/transformers
|
||||
EOT
|
||||
|
||||
ENV STAGE_DIR=/tmp
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
apt install -y cmake gcc g++ libssl-dev
|
||||
git clone https://github.com/microsoft/DeepSpeed-Kernels.git ${STAGE_DIR}/DeepSpeed-Kernels
|
||||
cd ${STAGE_DIR}/DeepSpeed-Kernels
|
||||
python -m pip install -v .
|
||||
@@ -142,6 +162,9 @@ python -m pip install black~=23.1 ruff==0.1.5 diffusers>=0.17.0
|
||||
python -m pip install --no-deps git+https://github.com/huggingface/optimum.git#egg=optimum[diffusers,quality]
|
||||
EOT
|
||||
|
||||
|
||||
# SSH daemon port inside container cannot conflict with host OS port
|
||||
ENV SSH_PORT=2222
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# 项目目录中的定义通常会覆盖用户家目录中的定义
|
||||
@@ -156,6 +179,8 @@ CUDA_HOME=${CUDA_HOME}
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
||||
EOF
|
||||
unset https_proxy http_proxy
|
||||
cat /etc/ssh/sshd_config > ${STAGE_DIR}/sshd_config && \
|
||||
sed "0,/^Port 22/s//Port ${SSH_PORT}/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config
|
||||
EOT
|
||||
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
@@ -29,7 +29,8 @@ NCCL_IB_DISABLE=0
|
||||
## test command
|
||||
|
||||
docker run -it --rm --network=host --privileged --ipc=host --ulimit memlock=-1 --gpus all hotwa/notebook:ngc
|
||||
docker run --rm -it --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 hotwa/notebook:ngc /bin/bash
|
||||
docker run --rm -it --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/pytorch:24.06-py3 /bin/bash
|
||||
docker run -it --rm --network=host --privileged --ipc=host --ulimit memlock=-1 --gpus all quay.io/hotwa/ngc:latest /bin/bash
|
||||
|
||||
```shell
|
||||
nvidia-smi
|
||||
|
||||
@@ -45,7 +45,7 @@ services:
|
||||
# tty: true
|
||||
# stdin_open: true
|
||||
restart: unless-stopped
|
||||
image: hotwa/notebook:ngc
|
||||
image: quay.io/hotwa/ngc:latest
|
||||
privileged: true
|
||||
ipc: host
|
||||
network_mode: host
|
||||
|
||||
Reference in New Issue
Block a user