Merge branch 'main' into devgpu

This commit is contained in:
Your Name
2024-07-17 04:55:47 +00:00
12 changed files with 393 additions and 79 deletions

View File

@@ -8,6 +8,8 @@ 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
@@ -19,6 +21,8 @@ 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
# 创建新用户
@@ -38,8 +42,25 @@ index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host=mirrors.aliyun.com
" >> ~/.pip/pip.conf
# 安装 Jupyter 和相关软件
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
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
# 创建 JupyterHub 配置目录
mkdir -p /root/.jupyterhub
EOT
@@ -60,22 +81,9 @@ 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"]