Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
538f73b294 | ||
|
|
779ca9a2b2 | ||
| 3690813ae9 | |||
| c9f79c2af4 | |||
| 7ecc5f2671 | |||
| c8389c4855 | |||
| d31595f238 |
@@ -21,10 +21,11 @@ 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
|
||||
apt-get install -y python3 python3-pip gcc g++ build-essential gdebi-core curl wget openssh-server vim lrzsz net-tools sudo git
|
||||
curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | sudo -E bash -
|
||||
apt-get update
|
||||
apt-get install -y nodejs npm
|
||||
# 创建新用户
|
||||
useradd -m -s /bin/bash ${CREATE_USER}
|
||||
echo "${CREATE_USER}:${CREATE_USER_PASSWD}" | chpasswd
|
||||
@@ -34,7 +35,8 @@ EOT
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# 安装 Jupyter 和相关软件
|
||||
npm install -g configurable-http-proxy yarn --registry=https://registry.npmmirror.com
|
||||
npm install -g configurable-http-proxy yarn typescript-language-server vscode-css-languageserver-bin yaml-language-server \
|
||||
vscode-html-languageserver-bin vscode-json-languageserver-bin yaml-language-server --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 \
|
||||
@@ -61,6 +63,8 @@ EOT
|
||||
# jupyter nbextension enable --py --sys-prefix widgetsnbextension
|
||||
|
||||
# install Rstudio
|
||||
ARG RSERVER_VERSION="rstudio-server-2024.04.1-748-amd64.deb"
|
||||
ENV RSERVER_VERSION=${RSERVER_VERSION}
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
apt update -qq
|
||||
@@ -69,7 +73,7 @@ wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sud
|
||||
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
|
||||
apt-get update
|
||||
apt install --no-install-recommends r-base
|
||||
sudo wget "https://download2.rstudio.org/server/$(lsb_release -cs)/amd64/rstudio-server-2024.09.1-394-amd64.deb" -O /tmp/rstudio-server.deb
|
||||
sudo wget "https://download2.rstudio.org/server/$(lsb_release -cs)/amd64/${RSERVER_VERSION}" -O /tmp/rstudio-server.deb
|
||||
sudo chmod +x /tmp/rstudio-server.deb
|
||||
sudo gdebi -n /tmp/rstudio-server.deb
|
||||
sudo rm -rf /tmp/rstudio-server.deb
|
||||
|
||||
62
docker-compose-self.yml
Executable file
62
docker-compose-self.yml
Executable file
@@ -0,0 +1,62 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
# JupyterHub docker compose configuration file
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
hub:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.jupyterhub
|
||||
args:
|
||||
JUPYTERHUB_VERSION: latest
|
||||
restart: always
|
||||
image: quay.io/hotwa/jupyterhub:latest
|
||||
container_name: jupyterhub
|
||||
networks:
|
||||
- jupyterhub-network
|
||||
volumes:
|
||||
# The JupyterHub configuration file
|
||||
- "./jupyterhub_config_self.py:/srv/jupyterhub/jupyterhub_config.py:ro"
|
||||
# Bind Docker socket on the host so we can connect to the daemon from
|
||||
# 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"
|
||||
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
|
||||
# Notebook directory inside user image
|
||||
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
container_name: nginx-proxy
|
||||
depends_on:
|
||||
- hub
|
||||
volumes:
|
||||
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
|
||||
- "./nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt:ro"
|
||||
- "./nginx-selfsigned.key:/etc/ssl/private/nginx-selfsigned.key:ro"
|
||||
- "./dhparam.pem:/etc/ssl/certs/dhparam.pem:ro"
|
||||
ports:
|
||||
- "50000:443"
|
||||
networks:
|
||||
- jupyterhub-network
|
||||
|
||||
volumes:
|
||||
jupyterhub-data:
|
||||
|
||||
networks:
|
||||
jupyterhub-network:
|
||||
name: jupyterhub-network
|
||||
|
||||
# use 127.0.0.1:8000 access
|
||||
@@ -1,68 +1,108 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
# Configuration file for JupyterHub
|
||||
import os
|
||||
from pathlib import Path
|
||||
from dockerspawner import DockerSpawner
|
||||
|
||||
c = get_config()
|
||||
c.Application.log_level = 'DEBUG'
|
||||
c = get_config() # noqa: F821
|
||||
|
||||
# 基本的JupyterHub配置
|
||||
c.JupyterHub.cookie_secret_file = os.path.expanduser('~/.jupyterhub/jupyterhub_cookie_secret')
|
||||
db_file = os.path.expanduser('~/.jupyterhub/jupyterhub.sqlite')
|
||||
c.JupyterHub.db_url = f'sqlite:///{db_file}'
|
||||
c.ConfigurableHTTPProxy.pid_file = os.path.expanduser('~/.jupyterhub/jupyterhub-proxy.pid')
|
||||
# We rely on environment variables to configure JupyterHub so that we
|
||||
# avoid having to rebuild the JupyterHub container every time we change a
|
||||
# configuration parameter.
|
||||
|
||||
# Authenticator 设置
|
||||
c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator'
|
||||
c.PAMAuthenticator.encoding = 'utf8'
|
||||
c.Authenticator.admin_users = set()
|
||||
c.Authenticator.allowed_users = set()
|
||||
c.LocalAuthenticator.create_system_users = True
|
||||
# from dockerspawner import DockerSpawner
|
||||
|
||||
# Spawner 设置
|
||||
c.Spawner.ip = '127.0.0.1'
|
||||
c.Spawner.cmd = ['jupyter-labhub']
|
||||
c.Spawner.default_url = '/lab'
|
||||
c.LocalProcessSpawner.shell_cmd = ["bash", "-l", "-c"]
|
||||
c.Spawner.notebook_dir = '~'
|
||||
c.Spawner.args = ['--allow-root', "--KernelSpecManager.ensure_native_kernel=False", '--NotebookApp.allow_origin_pat=https://.*vscode-cdn\\.net', '--NotebookApp.iopub_data_rate_limit=10000000']
|
||||
# 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"
|
||||
|
||||
# 环境变量保持
|
||||
c.Spawner.env_keep = ['PATH', 'PYTHONPATH', 'LD_LIBRARY_PATH', 'ENV1', 'ENV2']
|
||||
# Spawn containers from this image
|
||||
c.DockerSpawner.image = os.environ["DOCKER_NOTEBOOK_IMAGE"]
|
||||
|
||||
# JupyterHub 服务配置
|
||||
c.JupyterHub.ip = '0.0.0.0'
|
||||
c.JupyterHub.port = 9000
|
||||
c.JupyterHub.shutdown_on_logout = True
|
||||
c.JupyterHub.statsd_prefix = 'jupyterhub'
|
||||
c.JupyterHub.page_title = 'JupyterHub Service'
|
||||
# Connect containers to this Docker network
|
||||
network_name = os.environ["DOCKER_NETWORK_NAME"]
|
||||
c.DockerSpawner.use_internal_ip = True
|
||||
c.DockerSpawner.network_name = network_name
|
||||
|
||||
# Dockerspawner 配置(如果需要启用)
|
||||
c.JupyterHub.spawner_class = DockerSpawner
|
||||
c.DockerSpawner.allowed_images='*'
|
||||
# Explicitly set notebook directory because we'll be mounting a volume to it.
|
||||
# Most `jupyter/docker-stacks` *-notebook images run the Notebook server as
|
||||
# user `jovyan`, and set the notebook directory to `/home/jovyan/work`.
|
||||
# We follow the same convention.
|
||||
notebook_dir = os.environ.get("DOCKER_NOTEBOOK_DIR", "/home/jovyan/work")
|
||||
c.DockerSpawner.notebook_dir = notebook_dir
|
||||
|
||||
# Docker 守护进程的地址
|
||||
c.DockerSpawner.docker_host = 'unix:///var/run/docker.sock'
|
||||
# Mount the real user's Docker volume on the host to the notebook user's
|
||||
# notebook directory in the container
|
||||
# c.DockerSpawner.volumes = {"jupyterhub-user-{username}": notebook_dir}
|
||||
# Mount the real user's Docker volume on the host to the notebook user's
|
||||
# notebook directory in the container
|
||||
c.DockerSpawner.volumes = {
|
||||
"jupyterhub-user-{username}": notebook_dir,
|
||||
"/mnt/mydrive": "/home/jovyan/work/mydrive",
|
||||
"/mnt/mydrive/project/docker-jupyterhub/id_rsa": "/home/jovyan/.ssh/id_rsa",
|
||||
}
|
||||
|
||||
# 使用的 Docker 镜像
|
||||
c.DockerSpawner.image = 'quay.io/jupyter/scipy-notebook'
|
||||
|
||||
# 删除容器当它停止时
|
||||
# Remove containers once they are stopped
|
||||
c.DockerSpawner.remove = True
|
||||
|
||||
# 设置网络(如果您有特定的 Docker 网络配置)
|
||||
# c.DockerSpawner.network_name = 'jupyterhub'
|
||||
# For debugging arguments passed to spawned containers
|
||||
c.DockerSpawner.debug = True
|
||||
# c.Application.log_level = 'DEBUG'
|
||||
|
||||
# JupyterHub 的连接地址,用于 DockerSpawner 内部通信
|
||||
# 如果 JupyterHub 运行在同一 Docker 网络中,可以使用 Docker 容器名称
|
||||
# c.JupyterHub.hub_connect_ip = 'jupyterhub'
|
||||
# User containers will access hub by container name on the Docker network
|
||||
c.JupyterHub.hub_ip = 'jupyterhub'
|
||||
c.JupyterHub.hub_port = 8080
|
||||
|
||||
# 其他配置...
|
||||
# Persist hub data on volume mounted inside container
|
||||
c.JupyterHub.cookie_secret_file = "/data/jupyterhub_cookie_secret"
|
||||
c.JupyterHub.db_url = "sqlite:////data/jupyterhub.sqlite"
|
||||
|
||||
# 注意:下面这行配置是不必要的,因为您已经使用 Unix 套接字
|
||||
# c.DockerSpawner.docker_host = 'tcp://docker-daemon-host:2375'
|
||||
# 如果使用TLS(根据需要取消注释)
|
||||
# os.environ['DOCKER_TLS_VERIFY'] = '1'
|
||||
# os.environ['DOCKER_CERT_PATH'] = '/path/to/certificates'
|
||||
# Authenticate users with Native Authenticator
|
||||
c.JupyterHub.authenticator_class = "nativeauthenticator.NativeAuthenticator"
|
||||
|
||||
# Allow anyone to sign-up without approval
|
||||
c.NativeAuthenticator.open_signup = True
|
||||
|
||||
# Allowed admins
|
||||
admin = os.environ.get("JUPYTERHUB_ADMIN")
|
||||
if admin:
|
||||
c.Authenticator.admin_users = [admin]
|
||||
|
||||
# c.DockerSpawner.extra_create_kwargs.update({
|
||||
# "environment": {"JUPYTER_ENABLE_LAB": "yes"}
|
||||
# })
|
||||
|
||||
# 启动jupyter时候增加跨域支持, 否则反向代理的时候出现问题
|
||||
# --NotebookApp.iopub_data_rate_limit=10000000 给nglview使用
|
||||
c.DockerSpawner.extra_create_kwargs.update({
|
||||
"environment": {"NOTEBOOK_ARGS": "--NotebookApp.allow_origin='*' --NotebookApp.iopub_data_rate_limit=10000000"}
|
||||
})
|
||||
|
||||
|
||||
# 要支持正则匹配的域名请求,可以通过设置 allow_origin_pat 参数来实现。这个参数允许你使用正则表达式来匹配允许跨域请求的域名。例如,如果你想允许所有以 .example.com 结尾的域名进行跨域请求,可以在 jupyterhub_config.py 文件中添加如下配置:
|
||||
|
||||
# c.Spawner.environment = {
|
||||
# 'JUPYTERHUB_CORS': '{"allow_origin_pat": "https?://.*\\.example\\.com"}'
|
||||
# }
|
||||
|
||||
# GPU 和网络配置
|
||||
c.DockerSpawner.extra_host_config = {
|
||||
'runtime': 'nvidia'
|
||||
}
|
||||
c.DockerSpawner.environment = {
|
||||
'NVIDIA_DRIVER_CAPABILITIES': 'compute,utility',
|
||||
'NVIDIA_VISIBLE_DEVICES': 'all'
|
||||
}
|
||||
|
||||
# 其他配置(根据需要添加)
|
||||
# ...
|
||||
|
||||
48
jupyterhub_config_self.py
Executable file
48
jupyterhub_config_self.py
Executable file
@@ -0,0 +1,48 @@
|
||||
import os
|
||||
|
||||
c = get_config() # noqa: F821
|
||||
|
||||
# 基本配置
|
||||
c.Authenticator.allow_all = True
|
||||
c.JupyterHub.spawner_class = "jupyterhub.spawner.LocalProcessSpawner"
|
||||
|
||||
# 单用户配置
|
||||
c.Spawner.cmd = ['jupyter-labhub']
|
||||
c.Spawner.default_url = '/lab'
|
||||
c.Spawner.notebook_dir = '/home/jovyan'
|
||||
c.Spawner.environment = {
|
||||
'JUPYTER_ENABLE_LAB': 'yes',
|
||||
'NOTEBOOK_ARGS': '--NotebookApp.allow_origin="*" --NotebookApp.iopub_data_rate_limit=10000000',
|
||||
}
|
||||
|
||||
# Hub IP 和端口配置
|
||||
c.JupyterHub.hub_ip = '0.0.0.0'
|
||||
c.JupyterHub.hub_port = 8080
|
||||
|
||||
# Cookie secret 和数据库 URL
|
||||
c.JupyterHub.cookie_secret_file = '/srv/jupyterhub/jupyterhub_cookie_secret'
|
||||
c.JupyterHub.db_url = 'sqlite:////srv/jupyterhub/jupyterhub.sqlite'
|
||||
|
||||
# Authenticator 配置
|
||||
c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
|
||||
c.NativeAuthenticator.open_signup = True
|
||||
|
||||
# 管理员配置
|
||||
admin = os.environ.get('JUPYTERHUB_ADMIN')
|
||||
if admin:
|
||||
c.Authenticator.admin_users = {admin}
|
||||
|
||||
# 调试模式
|
||||
c.JupyterHub.log_level = 'DEBUG'
|
||||
c.Spawner.debug = True
|
||||
|
||||
# GPU 和网络配置(仅在需要 GPU 时启用)
|
||||
c.Spawner.environment.update({
|
||||
'NVIDIA_DRIVER_CAPABILITIES': 'compute,utility',
|
||||
'NVIDIA_VISIBLE_DEVICES': 'all'
|
||||
})
|
||||
|
||||
# 可选:GPU runtime 配置
|
||||
c.Spawner.extra_host_config = {
|
||||
'runtime': 'nvidia'
|
||||
}
|
||||
@@ -92,9 +92,9 @@ 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
|
||||
apt-get install -y python3 python3-pip gcc g++ build-essential gdebi-core curl wget openssh-server vim lrzsz net-tools sudo git nodejs
|
||||
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
|
||||
apt-get install -y nodejs npm
|
||||
npm install -g configurable-http-proxy yarn --registry=https://registry.npmmirror.com
|
||||
# 创建新用户
|
||||
useradd -m -s /bin/bash ${CREATE_USER}
|
||||
@@ -110,7 +110,7 @@ python3 -m pip install aiohttp -i http://mirrors.aliyun.com/pypi/simple/ --trust
|
||||
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
|
||||
|
||||
ARG RSERVER_VERSION="rstudio-server-2024.09.1-394-amd64.deb"
|
||||
ARG RSERVER_VERSION="rstudio-server-2024.04.1-748-amd64.deb"
|
||||
ENV RSERVER_VERSION=${RSERVER_VERSION}
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
|
||||
@@ -17,19 +17,23 @@ SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/
|
||||
ENV MLNX_OFED_VERSION=23.10-3.2.2.0
|
||||
ENV STAGE_DIR=/tmp
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
# install Mellanox OFED prepare
|
||||
apt-get update
|
||||
apt install -y libnvidia-compute-535
|
||||
apt-get install -y pciutils tk kmod libusb-1.0-0 tcl chrpath libpci3 bison lsof graphviz ethtool swig udev libltdl-dev libelf1 libmnl0 debhelper flex libfuse2
|
||||
# SYSTEM_NAME=$(lsb_release -cs) # 查看发行版本
|
||||
# Pre-build **latest** DeepSpeed, so it would be ready for testing (otherwise, the 1st deepspeed test will timeout)
|
||||
python3 -m pip uninstall -y deepspeed
|
||||
# This has to be run (again) inside the GPU VMs running the tests.
|
||||
# The installation works here, but some tests fail, if we do not pre-build deepspeed again in the VMs running the tests.
|
||||
# TODO: Find out why test fail. install deepspeed
|
||||
# DS_BUILD_CPU_ADAM=${DS_BUILD_CPU_ADAM} DS_BUILD_FUSED_ADAM={DS_BUILD_FUSED_ADAM} python3 -m pip install "deepspeed<=0.14.0" --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check 2>&1
|
||||
# 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
|
||||
# install Mellanox OFED
|
||||
mkdir -p ${STAGE_DIR}
|
||||
wget http://www.mellanox.com/downloads/ofed/MLNX_OFED-${MLNX_OFED_VERSION}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64.tgz -O ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64.tgz
|
||||
tar xzf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64.tgz -C ${STAGE_DIR}
|
||||
cd ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64
|
||||
./mlnxofedinstall --user-space-only --without-fw-update --all -q > ${STAGE_DIR}/mlnxofedinstall.log 2>&1
|
||||
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}
|
||||
rm -rf ${STAGE_DIR}/MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ubuntu22.04-x86_64*
|
||||
EOT
|
||||
@@ -82,6 +86,7 @@ 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
|
||||
git clone https://github.com/microsoft/DeepSpeed-Kernels.git ${STAGE_DIR}/DeepSpeed-Kernels
|
||||
|
||||
@@ -104,7 +104,7 @@ npm install -g configurable-http-proxy
|
||||
python3 -m pip install jupyterhub jupyterlab notebook radian pycurl 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 nglview dockerspawner jupyterhub-nativeauthenticator lckr_jupyterlab_variableinspector -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
|
||||
EOT
|
||||
|
||||
ARG RSERVER_VERSION="rstudio-server-2024.09.1-394-amd64.deb"
|
||||
ARG RSERVER_VERSION="rstudio-server-2024.04.1-748-amd64.deb"
|
||||
ENV RSERVER_VERSION=${RSERVER_VERSION}
|
||||
RUN <<EOT
|
||||
#!/bin/bash
|
||||
|
||||
@@ -29,8 +29,7 @@ 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 --network=host --privileged --ipc=host --gpus all --ulimit memlock=-1 stack=67108864 hotwa/notebook:ngc /bin/bash
|
||||
docker run --rm -it --privileged --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 hotwa/notebook:ngc /bin/bash
|
||||
|
||||
```shell
|
||||
nvidia-smi
|
||||
@@ -121,23 +120,16 @@ pytorch-notebook
|
||||
|
||||
```shell
|
||||
git clone https://github.com/jupyter/docker-stacks.git
|
||||
cd spawnerdockerfile/docker-stacks/images/docker-stacks-foundation
|
||||
nerdctl --namespace buildkit build --no-cache --build-arg ROOT_IMAGE=nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 -t quay.io/hotwa/docker-stacks-foundation:latest .
|
||||
nerdctl --namespace buildkit build --build-arg ROOT_IMAGE=nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 -t quay.io/hotwa/docker-stacks-foundation:latest .
|
||||
nerdctl --namespace buildkit push quay.io/hotwa/docker-stacks-foundation:latest
|
||||
docker buildx build --build-arg ROOT_IMAGE=nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 -t quay.io/hotwa/docker-stacks-foundation:latest . --load # docker pull nvidia/cuda:12.4.1-devel-ubuntu22.04
|
||||
cd docker-stacks/images/docker-stacks-foundation
|
||||
docker buildx build --build-arg ROOT_CONTAINER=nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04 -t quay.io/hotwa/docker-stacks-foundation:latest . --load # docker pull nvidia/cuda:12.4.1-devel-ubuntu22.04
|
||||
cd ../base-notebook
|
||||
docker buildx build --build-arg OWNER=hotwa -t quay.io/hotwa/base-notebook:latest . --load
|
||||
nerdctl build --build-arg OWNER=hotwa -t quay.io/hotwa/base-notebook:latest .
|
||||
cd ../minimal-notebook/
|
||||
docker buildx build --build-arg OWNER=hotwa -t quay.io/hotwa/minimal-notebook:latest . --load
|
||||
nerdctl build --build-arg OWNER=hotwa -t quay.io/hotwa/minimal-notebook:latest .
|
||||
cd ../scipy-notebook
|
||||
docker buildx build --build-arg OWNER=hotwa -t quay.io/hotwa/scipy-notebook:latest . --load
|
||||
nerdctl build --build-arg OWNER=hotwa -t quay.io/hotwa/scipy-notebook:latest .
|
||||
cd ../pytorch-notebook
|
||||
docker buildx build --build-arg OWNER=hotwa -t quay.io/hotwa/pytorch-notebook:latest . --load
|
||||
nerdctl build --build-arg OWNER=hotwa -t quay.io/hotwa/pytorch-notebook:latest .
|
||||
```
|
||||
|
||||
# 然后构建自己的基础镜像
|
||||
|
||||
@@ -45,7 +45,7 @@ services:
|
||||
# tty: true
|
||||
# stdin_open: true
|
||||
restart: unless-stopped
|
||||
image: quay.io/hotwa/ngc:latest
|
||||
image: hotwa/notebook:ngc
|
||||
privileged: true
|
||||
ipc: host
|
||||
network_mode: host
|
||||
|
||||
Reference in New Issue
Block a user