Commit 8885584b authored by chenpangpang's avatar chenpangpang
Browse files

feat: 初始提交

parent 7e6e7f2b
# gpu-base-image-build
## 构建命令
- 基于[pytorch官方镜像](https://hub.docker.com/r/pytorch/pytorch)构建镜像
```bash
./build_ubuntu.sh jupyterlab \
juypterlab-pytorch:2.3.1-py3.10-cuda12.1-ubuntu22.04 \
pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
```
- 参数1: framework,不需要改动
- 参数2: 输出镜像名称
- 参数3: 基础镜像
- 基于[nvidia官方镜像](https://hub.docker.com/r/nvidia/cuda)构建镜像
```bash
./build_ubuntu.sh jupyterlab \
juypterlab-pytorch:2.3.1-py3.8-cuda12.1-ubuntu22.04 \
nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04 \
TORCH_VERSION="2.3.1" \
TORCHVISION_VERSION="0.18.1" \
TORCHAUDIO_VERSION="2.3.1" \
CONDA_URL="https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh"
```
- 参数1: framework,不需要改动
- 参数2: 输出镜像名称
- 参数3: 基础镜像
## 验证镜像
-
\ No newline at end of file
#请确保网络畅通,插件可自行安装
#请将以下FROM后的镜像修改为需要添加codeserver的原始镜像
FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04
LABEL module="vscode"
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
ENV SHELL=/bin/bash \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
ARG SOURCES="-i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn"
SHELL ["/bin/bash","-c"]
USER root
WORKDIR /tmp
# 设置软链接python pip
RUN ln -sf /usr/bin/pip3 /usr/bin/pip \
&& ln -sf /usr/bin/python3 /usr/bin/python
COPY ./python-requirements.txt /tmp/
COPY ./code-server_4.7.0_amd64.deb ./
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak; \
version_codename=$(cat /etc/os-release | grep -i 'VERSION_CODENAME' | awk -F= '{print $2}') \
&& echo -e "deb http://mirrors.aliyun.com/ubuntu/ ${version_codename} main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-security main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-updates main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-proposed main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-backports main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename} main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-security main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-updates main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-proposed main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-backports main restricted universe multiverse" > /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install --no-install-recommends -y \
openssl \
libssl-dev \
net-tools \
locales \
wget \
git \
sudo \
openssh-client \
openssh-server \
python3.8 \
python3-pip \
&& locale-gen en_US.UTF-8 \
&& dpkg -i code-server_4.7.0_amd64.deb \
&& pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip install -r /tmp/python-requirements.txt ${SOURCES} \
&& cp /root/.config/pip/pip.conf /etc/pip.conf \
&& mkdir -p /var/run/sshd \
&& ssh-keygen -A \
&& sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
WORKDIR /
RUN pip3 install torch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 --index-url https://download.pytorch.org/whl/cu113 && \
([ ! -d /root/.cache/pip ] || rm -r /root/.cache/pip)
### 添加HF的镜像变量
#ENV HF_ENDPOINT=https://hf-mirror.com
#RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \
# echo 'export HF_ENDPOINT=https://hf-mirror.com' >> ~/.bashrc
EXPOSE 8080
\ No newline at end of file
ARG BASE_IMAGE="nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04"
FROM $BASE_IMAGE
ARG BASE_IMAGE
ARG DEBIAN_FRONTEND=noninteractive
LABEL module="jupyter"
# 是否基于torch镜像构建
ARG BASE_IMAGE_IS_TORCH=0
ARG TORCH_VERSION="2.0.1"
ARG TORCHVISION_VERSION="0.15.2"
ARG TORCHAUDIO_VERSION="2.0.2"
ARG CONDA_URL="https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_24.7.1-0-Linux-x86_64.sh"
ARG SOURCES="-i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn"
ENV TZ=Asia/Shanghai
ENV SHELL=/bin/bash \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
ENV HF_ENDPOINT=https://hf-mirror.com
SHELL ["/bin/bash","-c"]
USER root
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak \
&& mv /etc/apt/sources.list.d /etc/apt/sources.list.d.bak \
&& version_id=$(cat /etc/os-release | grep -i 'VERSION_CODENAME' | awk -F= '{print $2}') \
&& echo -e "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id} main restricted universe multiverse \n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-security main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-updates main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-proposed main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-backports main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id} main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-security main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-updates main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-proposed main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ ${version_id}-backports main restricted universe multiverse" > /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install --no-install-recommends -y vim openssl libssl-dev net-tools locales wget git git-lfs sudo openssh-client openssh-server \
&& locale-gen en_US.UTF-8
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
mkdir -p /tmp/conda-extension \
&& cd /tmp/conda-extension \
&& wget $CONDA_URL \
&& bash $(echo $CONDA_URL | awk -F "/" '{print $NF}') -b -p /opt/conda \
&& echo "export PATH=\$PATH:/opt/conda/bin" >> /etc/profile.d/sothisai.sh \
&& cd .. \
&& rm -rf /tmp/conda-extension; fi
ENV PATH=$PATH:/opt/conda/bin
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
pip3 install --upgrade pip ${SOURCES} || pip install --upgrade pip ${SOURCES} \
&& pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip3 install --no-cache-dir setuptools ipywidgets wheel \
&& mv /etc/apt/sources.list.bak /etc/apt/sources.list \
&& mv /etc/apt/sources.list.d.bak /etc/apt/sources.list.d \
&& pip3 install matplotlib; fi
# 安装pytorch 需要设置代理
#ENV http_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
#ENV https_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
pip3 install torch==$TORCH_VERSION torchvision==$TORCHVISION_VERSION torchaudio==$TORCHAUDIO_VERSION \
--index-url https://download.pytorch.org/whl/cu$(echo "$BASE_IMAGE" | awk -F'[:-]' '{n=split($2,a,"."); print a[1] a[2]}') \
&& rm -r /root/.cache/pip; fi
# 安装jupyterlab插件
RUN pip3 install jupyterlab==4.0.0
RUN mkdir -p /tmp/jupyter-extension
COPY ./jupyter_ext_dataset-0.1.0-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyter_ext_logo-0.1.0-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyterlab_language_pack_zh_cn-4.0.post6-py2.py3-none-any.whl /tmp/jupyter-extension/
COPY ./requirements.txt /tmp/jupyter-extension/
COPY ./static /tmp/jupyter-extension/static
COPY extension.sh /tmp/
RUN chmod +x /tmp/extension.sh && \
/tmp/extension.sh
COPY ./jupyter_lab_config.py /etc/
RUN jupytersite="$(python3 -m pip show jupyterlab | grep -i '^location' | awk '{print $2}')" \
&& JUPYTERLAB_DIR=$(echo ${jupytersite%%/lib/python*}) \
&& if [[ ${JUPYTERLAB_DIR}/bin/jupyter != "/opt/conda/bin/jupyter" ]]; \
then mkdir -p /opt/conda/bin; \
ln -sf ${JUPYTERLAB_DIR}/bin/jupyter /opt/conda/bin/jupyter;fi \
&& echo "export JUPYTER_CONFIG_PATH=/etc" >> /etc/bash.bashrc \
&& echo "export JUPYTER=${JUPYTERLAB_DIR}/bin/jupyter" >> /etc/bash.bashrc\
&& echo "export PATH=${JUPYTERLAB_DIR}/bin:${PATH}" >> /etc/bash.bashrc \
&& mkdir -p /var/run/sshd \
&& ssh-keygen -A \
&& sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
COPY ./python-requirements.txt /tmp/
RUN pip install -r /tmp/python-requirements.txt ${SOURCES}
EXPOSE 8888
#请确保网络畅通
#请将以下FROM后的镜像修改为需要添加rstudio的原始镜像
FROM original_images_name
#如有问题请通过以下邮箱联系
LABEL maintainer="chenwch1@sugon.com"
LABEL module="rstudio"
ARG R_VERSION=4.2.1
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
ENV SHELL=/bin/bash \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
ENV PATH=/usr/lib/rstudio-server/bin:${PATH}
SHELL ["/bin/bash","-c"]
USER root
WORKDIR /tmp
#设置代理
ENV http_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
ENV https_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
ENV HF_ENDPOINT=https://hf-mirror.com
COPY ./python-requirements.txt /tmp/
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak \
#&& mv /etc/apt/sources.list.d /etc/apt/sources.list.d.bak \
&& version_codename=$(cat /etc/os-release | grep -i 'VERSION_CODENAME' | awk -F= '{print $2}') \
&& version_id=$(cat /etc/os-release | grep -i 'VERSION_ID' | awk -F= '{print $2}' | sed 's/\"//g' | awk -F. '{print $1$2}') \
&& echo -e "deb http://mirrors.aliyun.com/ubuntu/ ${version_codename} main restricted universe multiverse \n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-security main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-updates main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-proposed main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ ${version_codename}-backports main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename} main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-security main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-updates main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-proposed main restricted universe multiverse\n\
deb-src http://mirrors.aliyun.com/ubuntu/ ${version_codename}-backports main restricted universe multiverse" > /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install --no-install-recommends -y \
gdebi-core \
curl \
openssl \
locales \
libssl-dev \
net-tools \
wget \
git \
sudo \
openssh-client \
openssh-server \
&& locale-gen en_US.UTF-8 \
&& curl -C - -kO --retry 10 https://cdn.rstudio.com/r/ubuntu-${version_id}/pkgs/r-${R_VERSION}_1_amd64.deb \
&& curl -C - -kO --retry 10 https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.2-576-amd64.deb \
&& gdebi -n r-${R_VERSION}_1_amd64.deb \
&& ln -s /opt/R/4.2.1/bin/R /usr/local/bin/R \
&& ln -s /opt/R/4.2.1/bin/Rscript /usr/local/bin/Rscript \
&& gdebi -n rstudio-server-2022.07.2-576-amd64.deb \
&& chmod 1777 /var/run/rstudio-server \
&& chmod 1777 /var/lib/rstudio-server \
&& rm -rf /var/lib/rstudio-server/rstudio-os.sqlite \
&& echo "export PATH=/usr/lib/rstudio-server/bin:${PATH}" >> /etc/bashrc \
#&& rm -rf /tmprm \
&& rm -rf /var/cache/yum/* \
&& pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip install -r /tmp/python-requirements.txt ${SOURCES} \
&& mkdir -p /var/run/sshd \
&& ssh-keygen -A \
&& sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
WORKDIR /
ENTRYPOINT bash --login;
#/bin/bash
# pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=12.1
# cuda=11.6(这个版本的空镜像,有些框架需要低版本)
# paddlepaddle-gpu==2.6.1.post120 cuda12
# tensroflow 安装最高版本 cuda12
rm -r ./tmp
framework=$1
newtag=$2
tmp_dockerfile="Dockerfile.${RANDOM}"
if [ ! -d "./tmp" ];then
mkdir tmp
fi
if [ "${framework}" == "jupyterlab" ];then
cp ./jupyter-extension-install-v2/*.whl ./tmp/
cp ./jupyter-extension-install-v2/requirements.txt ./tmp/
cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v2/static ./tmp/
fi
if [ "${framework}" == "codeserver" ];then
cp ./code-server_4.7.0_amd64.deb ./tmp/
fi
cp ./python-requirements.txt ./tmp/
cp -f ./Dockerfile.${framework}_ubuntu ./tmp/${tmp_dockerfile}
# temp_image="$(grep -n '^FROM' ./tmp/${tmp_dockerfile} | tac | head -1 | awk '{print $2}')"
# sed -i "s?${temp_image}?${base_tag}?g" ./tmp/${tmp_dockerfile}
docker build -f ./tmp/${tmp_dockerfile} -t ${newtag} ./tmp/
if [[ $? -eq 0 ]];then
echo -e "\033[32mBuild Image Successfully !\033[0m"
else
echo -e "\033[32mBuild Image unsuccessful !\033[0m"
exit 1
fi
\ No newline at end of file
echo "启动jupyter 检查文件中..."
WORKSPACE="/tmp/jupyter-extension"
content=$(nohup jupyter lab --allow-root --ip=0.0.0.0 --port=8888 > /tmp/start.log 2>&1 & sleep 20s; cat /tmp/start.log| grep "JupyterLab application directory")
echo $content
if [ -z "$content" ]; then
echo "content Not Found! please retry!"
else
jupyter_file_path=$(echo "$content" | grep -oP '(?<=is\s)(\/[^ ]+)')
fi
# ls "${jupyter_file_path}/static/index.html"
# echo "jupyter sourcecode path is :${jupyter_file_path}/static"
file_check=$(if [ -d "${jupyter_file_path}/static" ]; then echo "success"; else echo "file check failed"; fi)
echo $file_check
if [ "failed" == "$file_check" ]; then
echo "image jupyter sourcecode path check failed! please retry!"
fi
# 获取index的内容 那去js名 替换
js_content=$(cat ${jupyter_file_path}/static/index.html)
echo $js_content
js_path=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/main\.[^"]+\.js\?v=[^"]+' )
js_path2=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/vendors~main\.[^"]+\.js\?v=[^"]+' )
js_path3=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/vendors~main\.[^"]+\.js' )
echo "jupyter js source path is: $js_path"
if [ -z "$js_path" ];then
if [ -z "$js_path2" ];then
if [ -z "$js_path3" ];then
echo "image jupyter sourcecode main js path check failed!please retry!"
else
js_path=$js_path3
fi
else
js_path=$js_path2
fi
fi
cat $WORKSPACE/static/index-base.html > $WORKSPACE/static/index.html
sed -i "s#mainJsParam#${js_path}#g" $WORKSPACE/static/index.html
cp -a $WORKSPACE/static/index.html ${jupyter_file_path}/static/index.html
cp -a $WORKSPACE/static/scnet-loading.gif ${jupyter_file_path}/static/scnet-loading.gif
pip3 uninstall -r $WORKSPACE/requirements.txt
pip3 install --no-index --find-links=$WORKSPACE/ -r $WORKSPACE/requirements.txt
if pip list | grep -E 'jupyter_ext_dataset' && pip list | grep -E 'jupyter_ext_logo' && pip list | grep -E 'jupyterlab-language-pack-zh-CN' && [ "$(jupyter lab --version | cut -d. -f1)" -gt 2 ];then echo "安装成功";else echo \"安装失败!! \" | tee /jupyter-ext/errorImages.txt; fi
rm -r $WORKSPACE
\ No newline at end of file
# Jupyterlab插件部署手册
# Jupyterlab版本
期望后续新镜像Jupyterlab版本≥4.0.0 (python ≥ 3.8)
```bash
pip install jupyterlab=4.0.0
```
# 插件更新
## 单个镜像插件安装
```bash
# 提供whl插件包,每个功能一种插件,容器内执行
pip install jupyter_ext_dataset-0.1.0-py3-none-any.whl
# 批量安装
pip install --no-index --find-links=. -r requirements.txt
```
## 批量镜像插件安装
使用updateJupyterImage_script脚本
## 功能验证
Jupyterlab插件功能验证
```bash
# 确认三个插件及jupyterlab都有
pip list
```
在Sothisai中启动后
汉化、scnet图标、数据集插件左边菜单
\ No newline at end of file
#!/bin/bash
# 框架
framework=$1
# 输出镜像tag
image_tag=$2
# 基础镜像
base_image=$3
build_args=" --build-arg BASE_IMAGE=$base_image"
if [ ${base_image%%:*} = "pytorch/pytorch" ]; then
build_args="$build_args --build-arg BASE_IMAGE_IS_TORCH=1 "
fi
for arg in ${*:4}
do
build_args="$build_args --build-arg $arg "
done
tmp_dockerfile="Dockerfile.${RANDOM}"
if [ ! -d "./tmp" ];then
mkdir tmp
fi
if [ "${framework}" == "jupyterlab" ];then
cp ./jupyter-extension-install-v2/*.whl ./tmp/
cp ./jupyter-extension-install-v2/requirements.txt ./tmp/
cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v2/static ./tmp/
fi
if [ "${framework}" == "codeserver" ];then
cp ./code-server_4.7.0_amd64.deb ./tmp/
fi
cp ./python-requirements.txt ./tmp/
cp -f ./Dockerfile.${framework}_ubuntu ./tmp/${tmp_dockerfile}
echo "docker build -f ./tmp/${tmp_dockerfile} -t ${image_tag} $build_args ./tmp/"
docker build -f ./tmp/${tmp_dockerfile} -t ${image_tag} $build_args ./tmp/
rm -r ./tmp
if [[ $? -eq 0 ]];then
echo -e "\033[32mBuild Image Successfully !\033[0m"
else
echo -e "\033[32mBuild Image fail!\033[0m"
exit 1
fi
\ No newline at end of file
image.sourcefind.cn:5000/cpu/admin/base/jupyterlab:3.4.7-multi.python
\ No newline at end of file
jupyterlab-language-pack-zh-CN
jupyter_ext_logo
jupyter_ext_dataset
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}<script id="jupyter-config-data" type="application/json">{{ page_config_full | tojson }}</script>{% block favicon %}<link rel="icon" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon.ico" class="idle favicon"><link rel="" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon-busy-1.ico" class="busy favicon">{% endblock %}<script defer="defer" src="mainJsParam"></script></head>
<script>/* Remove token from URL. */
(function () {
var location = window.location;
var search = location.search;
// If there is no query string, bail.
if (search.length <= 1) {
return;
}
// Rebuild the query string without the `token`.
var query = '?' + search.slice(1).split('&')
.filter(function (param) { return param.split('=')[0] !== 'token'; })
.join('&');
// Rebuild the URL with the new query string.
var url = location.origin + location.pathname +
(query !== '?' ? query : '') + location.hash;
if (url === location.href) {
return;
}
window.history.replaceState({ }, '', url);
})();</script>
<body>
<div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" />
</div>
</body>
<style>
#sugon-logo-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 150px;
z-index: 100;
}
#sugon-logo-wrap img {
width: 100%;
}
</style>
<script>
var sugonLoadInterval = setInterval(() => {
var sugonMenu = document.getElementById('jp-menu-panel')
if (sugonMenu) {
clearInterval(sugonLoadInterval)
document.body.removeChild(document.getElementById('sugon-logo-wrap'))
}
}, 100)
</script>
</html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}<script id="jupyter-config-data" type="application/json">{{ page_config_full | tojson }}</script>{% block favicon %}<link rel="icon" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon.ico" class="idle favicon"><link rel="" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon-busy-1.ico" class="busy favicon">{% endblock %}<script defer="defer" src="{{page_config.fullStaticUrl}}/main.9907354c68bf45c5d68c.js?v=9907354c68bf45c5d68c"></script></head>
<script>/* Remove token from URL. */
(function () {
var location = window.location;
var search = location.search;
// If there is no query string, bail.
if (search.length <= 1) {
return;
}
// Rebuild the query string without the `token`.
var query = '?' + search.slice(1).split('&')
.filter(function (param) { return param.split('=')[0] !== 'token'; })
.join('&');
// Rebuild the URL with the new query string.
var url = location.origin + location.pathname +
(query !== '?' ? query : '') + location.hash;
if (url === location.href) {
return;
}
window.history.replaceState({ }, '', url);
})();</script>
<body>
<div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" />
</div>
</body>
<style>
#sugon-logo-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 150px;
z-index: 100;
}
#sugon-logo-wrap img {
width: 100%;
}
</style>
<script>
var sugonLoadInterval = setInterval(() => {
var sugonMenu = document.getElementById('jp-menu-panel')
if (sugonMenu) {
clearInterval(sugonLoadInterval)
document.body.removeChild(document.getElementById('sugon-logo-wrap'))
}
}, 100)
</script>
</html>
#!/bin/bash
WORKSPACE="/opt/jupyter-ext/install"
#循环读取images.txt,并存入list中
n=0
fail_image_array=()
for line in $(cat images.txt | grep ^[^#])
do
list[$n]=$line
((n+=1))
done
echo "需推送的镜像地址如下:"
for variable in ${list[@]}
do
echo ${variable}
done
for variable in ${list[@]}
do
#下载镜像
echo "准备拉取镜像: $variable"
docker pull $variable
# #获取拉取的镜像ID
imageId=`docker images -q $variable`
echo "[$variable]拉取完成后的镜像ID: $imageId"
#启动容器
CONTAINER_ID=$(docker run -v $WORKSPACE:/jupyter-ext -itd $variable)
echo "容器ID:${CONTAINER_ID},启动jupyter 检查文件中..."
content=$(docker exec ${CONTAINER_ID} bash -c 'nohup jupyter lab --allow-root --ip=0.0.0.0 --port=8888 > /tmp/start.log 2>&1 & sleep 20s; cat /tmp/start.log| grep "JupyterLab application directory"')
echo $content
if [ -z "$content" ]; then
echo "image jupyter sourcecode path check failed!please retry! imageId:$imageId,containerId:${CONTAINER_ID}"
docker stop ${CONTAINER_ID}
fail_image_array+=("${variable}")
continue
else
jupyter_file_path=$(echo "$content" | grep -oP '(?<=is\s)(\/[^ ]+)')
fi
echo "jupyter sourcecode path is :${jupyter_file_path}/static"
file_check=$(docker exec ${CONTAINER_ID} bash -c 'if [ -d "'${jupyter_file_path}'/static" ]; then echo "success"; else echo "failed"; fi')
echo $file_check
if [ "failed" == "$file_check" ]; then
echo "image jupyter sourcecode path check failed!please retry! image:$variable"
docker stop ${CONTAINER_ID}
fail_image_array+=("${variable}")
continue
fi
# 获取index的内容 那去js名 替换
js_content=$(docker exec ${CONTAINER_ID} bash -c "cat '${jupyter_file_path}'/static/index.html ")
echo $js_content
js_path=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/main\.[^"]+\.js\?v=[^"]+' )
js_path2=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/vendors~main\.[^"]+\.js\?v=[^"]+' )
js_path3=$(echo "$js_content" | grep -oP '{{page_config\.fullStaticUrl}}/vendors~main\.[^"]+\.js' )
echo "jupyter js source path is: $js_path"
if [ -z "$js_path" ];then
if [ -z "$js_path2" ];then
if [ -z "$js_path3" ];then
echo "image jupyter sourcecode main js path check failed!please retry! imageId:$imageId,containerId:${CONTAINER_ID}"
docker stop ${CONTAINER_ID}
fail_image_array+=("${variable}")
continue
else
js_path=$js_path3
fi
else
js_path=$js_path2
fi
fi
cat $WORKSPACE/static/index-base.html > $WORKSPACE/static/index.html
sed -i "s#mainJsParam#${js_path}#g" $WORKSPACE/static/index.html
docker cp -a $WORKSPACE/static/index.html ${CONTAINER_ID}:${jupyter_file_path}/static/index.html
docker cp -a $WORKSPACE/static/scnet-loading.gif ${CONTAINER_ID}:${jupyter_file_path}/static/scnet-loading.gif
jupyter_dir=$(docker exec ${CONTAINER_ID} bash -c "whereis jupyter | cat|awk -F':' '{print \$2}'")
echo "image env jupyter cmd path :${jupyter_dir}"
# docker exec ${CONTAINER_ID} bash -c "mkdir -p '/opt/conda/bin/';ln -s ${jupyter_dir} /opt/conda/bin/"
# 卸载之前jupyterlab插件
docker exec ${CONTAINER_ID} bash -c "pip uninstall -r /jupyter-ext/requirements.txt"
# 安装jupyterlab插件
docker exec ${CONTAINER_ID} bash -c "pip install --no-index --find-links=/jupyter-ext -r /jupyter-ext/requirements.txt;if pip list | grep -E 'jupyter_ext_dataset' && pip list | grep -E 'jupyter_ext_logo' && pip list | grep -E 'jupyterlab-language-pack-zh-CN' && [ "$(jupyter lab --version | cut -d. -f1)" -gt 2 ];then echo "安装成功";else echo \"安装失败!! $variable\" | tee /jupyter-ext/errorImages.txt; fi"
# 禁用splash插件
docker exec ${CONTAINER_ID} bash -c "jupyter labextension disable @jupyterlab/apputils-extension:splash"
# 打镜像
docker commit ${CONTAINER_ID} $variable
#重新打镜像标签
# docker tag $imageId $registryAddr$repository:$imageNewTag
# #推送镜像
# docker push $registryAddr$repository:$imageNewTag
# 删除容器及镜像
# docker stop ${CONTAINER_ID}
# docker rm ${CONTAINER_ID}
# docker rmi ${imageId}
# 验证命令
# docker run -it -p8080:8080 --env JUPYTERLAB_WORKSPACES_DIR=/tmp/111 --entrypoint='' f7fa3a053830 /bin/bash
# mkidr -p /opt/conda/bin/;ln -n /usr/bin/jupyter /opt/conda/bin/jupyter ;/opt/conda/bin/jupyter lab --allow-root --ip=0.0.0.0 --port=8080
done
echo "jupyter source code update failed:"
echo $fail_image_array
\ No newline at end of file
# Configuration file for lab.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
# Default: '%Y-%m-%d %H:%M:%S'
# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# Default: '[%(name)s]%(highlevel)s %(message)s'
# c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
# Default: 30
# c.Application.log_level = 30
## Configure additional log handlers.
#
# The default stderr logs handler is configured by the log_level, log_datefmt
# and log_format settings.
#
# This configuration can be used to configure additional handlers (e.g. to
# output the log to a file) or for finer control over the default handlers.
#
# If provided this should be a logging configuration dictionary, for more
# information see:
# https://docs.python.org/3/library/logging.config.html#logging-config-
# dictschema
#
# This dictionary is merged with the base logging configuration which defines
# the following:
#
# * A logging formatter intended for interactive use called
# ``console``.
# * A logging handler that writes to stderr called
# ``console`` which uses the formatter ``console``.
# * A logger with the name of this application set to ``DEBUG``
# level.
#
# This example adds a new handler that writes to a file:
#
# .. code-block:: python
#
# c.Application.logging_config = {
# 'handlers': {
# 'file': {
# 'class': 'logging.FileHandler',
# 'level': 'DEBUG',
# 'filename': '<path/to/file>',
# }
# },
# 'loggers': {
# '<application-name>': {
# 'level': 'DEBUG',
# # NOTE: if you don't list the default "console"
# # handler here then it will be disabled
# 'handlers': ['console', 'file'],
# },
# }
# }
# Default: {}
# c.Application.logging_config = {}
## Instead of starting the Application, dump configuration to stdout
# Default: False
# c.Application.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# Default: False
# c.Application.show_config_json = False
#------------------------------------------------------------------------------
# JupyterApp(Application) configuration
#------------------------------------------------------------------------------
## Base class for Jupyter applications
## Answer yes to any prompts.
# Default: False
# c.JupyterApp.answer_yes = False
## Full path of a config file.
# Default: ''
# c.JupyterApp.config_file = ''
## Specify a config file to load.
# Default: ''
# c.JupyterApp.config_file_name = ''
## Generate default config file.
# Default: False
# c.JupyterApp.generate_config = False
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.JupyterApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# See also: Application.log_format
# c.JupyterApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# See also: Application.log_level
# c.JupyterApp.log_level = 30
##
# See also: Application.logging_config
# c.JupyterApp.logging_config = {}
## Instead of starting the Application, dump configuration to stdout
# See also: Application.show_config
# c.JupyterApp.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# See also: Application.show_config_json
# c.JupyterApp.show_config_json = False
#------------------------------------------------------------------------------
# ExtensionApp(JupyterApp) configuration
#------------------------------------------------------------------------------
## Base class for configurable Jupyter Server Extension Applications.
#
# ExtensionApp subclasses can be initialized two ways:
# 1. Extension is listed as a jpserver_extension, and ServerApp calls
# its load_jupyter_server_extension classmethod. This is the
# classic way of loading a server extension.
# 2. Extension is launched directly by calling its `launch_instance`
# class method. This method can be set as a entry_point in
# the extensions setup.py
## Answer yes to any prompts.
# See also: JupyterApp.answer_yes
# c.ExtensionApp.answer_yes = False
## Full path of a config file.
# See also: JupyterApp.config_file
# c.ExtensionApp.config_file = ''
## Specify a config file to load.
# See also: JupyterApp.config_file_name
# c.ExtensionApp.config_file_name = ''
# Default: ''
# c.ExtensionApp.default_url = ''
## Generate default config file.
# See also: JupyterApp.generate_config
# c.ExtensionApp.generate_config = False
## Handlers appended to the server.
# Default: []
# c.ExtensionApp.handlers = []
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.ExtensionApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# See also: Application.log_format
# c.ExtensionApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# See also: Application.log_level
# c.ExtensionApp.log_level = 30
##
# See also: Application.logging_config
# c.ExtensionApp.logging_config = {}
## Whether to open in a browser after starting.
# The specific browser used is platform dependent and
# determined by the python standard library `webbrowser`
# module, unless it is overridden using the --browser
# (ServerApp.browser) configuration option.
# Default: False
# c.ExtensionApp.open_browser = False
## Settings that will passed to the server.
# Default: {}
# c.ExtensionApp.settings = {}
## Instead of starting the Application, dump configuration to stdout
# See also: Application.show_config
# c.ExtensionApp.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# See also: Application.show_config_json
# c.ExtensionApp.show_config_json = False
## paths to search for serving static files.
#
# This allows adding javascript/css to be available from the notebook server machine,
# or overriding individual files in the IPython
# Default: []
# c.ExtensionApp.static_paths = []
## Url where the static assets for the extension are served.
# Default: ''
# c.ExtensionApp.static_url_prefix = ''
## Paths to search for serving jinja templates.
#
# Can be used to override templates from notebook.templates.
# Default: []
# c.ExtensionApp.template_paths = []
#------------------------------------------------------------------------------
# LabServerApp(ExtensionApp) configuration
#------------------------------------------------------------------------------
## A Lab Server Application that runs out-of-the-box
## "A list of comma-separated URIs to get the allowed extensions list
#
# .. versionchanged:: 2.0.0
# `LabServerApp.whitetlist_uris` renamed to `allowed_extensions_uris`
# Default: ''
# c.LabServerApp.allowed_extensions_uris = ''
## Answer yes to any prompts.
# See also: JupyterApp.answer_yes
# c.LabServerApp.answer_yes = False
## The application settings directory.
# Default: ''
# c.LabServerApp.app_settings_dir = ''
## The url path for the application.
# Default: '/lab'
# c.LabServerApp.app_url = '/lab'
## Deprecated, use `LabServerApp.blocked_extensions_uris`
# Default: ''
# c.LabServerApp.blacklist_uris = ''
## A list of comma-separated URIs to get the blocked extensions list
#
# .. versionchanged:: 2.0.0
# `LabServerApp.blacklist_uris` renamed to `blocked_extensions_uris`
# Default: ''
# c.LabServerApp.blocked_extensions_uris = ''
## Whether to cache files on the server. This should be `True` except in dev
# mode.
# Default: True
# c.LabServerApp.cache_files = True
## Full path of a config file.
# See also: JupyterApp.config_file
# c.LabServerApp.config_file = ''
## Specify a config file to load.
# See also: JupyterApp.config_file_name
# c.LabServerApp.config_file_name = ''
## Extra paths to look for federated JupyterLab extensions
# Default: []
# c.LabServerApp.extra_labextensions_path = []
## Generate default config file.
# See also: JupyterApp.generate_config
# c.LabServerApp.generate_config = False
## Handlers appended to the server.
# See also: ExtensionApp.handlers
# c.LabServerApp.handlers = []
## Options to pass to the jinja2 environment for this
# Default: {}
# c.LabServerApp.jinja2_options = {}
## The standard paths to look in for federated JupyterLab extensions
# Default: []
# c.LabServerApp.labextensions_path = []
## The url for federated JupyterLab extensions
# Default: ''
# c.LabServerApp.labextensions_url = ''
## The interval delay in seconds to refresh the lists
# Default: 3600
# c.LabServerApp.listings_refresh_seconds = 3600
## The optional kwargs to use for the listings HTTP requests as
# described on https://2.python-requests.org/en/v2.7.0/api/#requests.request
# Default: {}
# c.LabServerApp.listings_request_options = {}
## The listings url.
# Default: ''
# c.LabServerApp.listings_url = ''
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.LabServerApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# See also: Application.log_format
# c.LabServerApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# See also: Application.log_level
# c.LabServerApp.log_level = 30
##
# See also: Application.logging_config
# c.LabServerApp.logging_config = {}
## Whether a notebook should start a kernel automatically.
# Default: True
# c.LabServerApp.notebook_starts_kernel = True
## Whether to open in a browser after starting.
# See also: ExtensionApp.open_browser
# c.LabServerApp.open_browser = False
## The optional location of the settings schemas directory. If given, a handler
# will be added for settings.
# Default: ''
# c.LabServerApp.schemas_dir = ''
## Settings that will passed to the server.
# See also: ExtensionApp.settings
# c.LabServerApp.settings = {}
## The url path of the settings handler.
# Default: ''
# c.LabServerApp.settings_url = ''
## Instead of starting the Application, dump configuration to stdout
# See also: Application.show_config
# c.LabServerApp.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# See also: Application.show_config_json
# c.LabServerApp.show_config_json = False
## The optional location of local static files. If given, a static file handler
# will be added.
# Default: ''
# c.LabServerApp.static_dir = ''
## paths to search for serving static files.
# See also: ExtensionApp.static_paths
# c.LabServerApp.static_paths = []
## Url where the static assets for the extension are served.
# See also: ExtensionApp.static_url_prefix
# c.LabServerApp.static_url_prefix = ''
## Paths to search for serving jinja templates.
# See also: ExtensionApp.template_paths
# c.LabServerApp.template_paths = []
## The application templates directory.
# Default: ''
# c.LabServerApp.templates_dir = ''
## The optional location of the themes directory. If given, a handler will be
# added for themes.
# Default: ''
# c.LabServerApp.themes_dir = ''
## The theme url.
# Default: ''
# c.LabServerApp.themes_url = ''
## The url path of the translations handler.
# Default: ''
# c.LabServerApp.translations_api_url = ''
## The url path of the tree handler.
# Default: ''
# c.LabServerApp.tree_url = ''
## The optional location of the user settings directory.
# Default: ''
# c.LabServerApp.user_settings_dir = ''
## Deprecated, use `LabServerApp.allowed_extensions_uris`
# Default: ''
# c.LabServerApp.whitelist_uris = ''
## The url path of the workspaces API.
# Default: ''
# c.LabServerApp.workspaces_api_url = ''
## The optional location of the saved workspaces directory. If given, a handler
# will be added for workspaces.
# Default: ''
# c.LabServerApp.workspaces_dir = ''
#------------------------------------------------------------------------------
# LabApp(LabServerApp) configuration
#------------------------------------------------------------------------------
##
# See also: LabServerApp.allowed_extensions_uris
# c.LabApp.allowed_extensions_uris = ''
## Answer yes to any prompts.
# See also: JupyterApp.answer_yes
# c.LabApp.answer_yes = False
## The app directory to launch JupyterLab from.
# Default: None
# c.LabApp.app_dir = None
## The application settings directory.
# Default: ''
# c.LabApp.app_settings_dir = ''
## The url path for the application.
# Default: '/lab'
# c.LabApp.app_url = '/lab'
## Deprecated, use `LabServerApp.blocked_extensions_uris`
# See also: LabServerApp.blacklist_uris
# c.LabApp.blacklist_uris = ''
##
# See also: LabServerApp.blocked_extensions_uris
# c.LabApp.blocked_extensions_uris = ''
## Whether to cache files on the server. This should be `True` except in dev
# mode.
# Default: True
# c.LabApp.cache_files = True
## Whether to enable collaborative mode.
# Default: False
# c.LabApp.collaborative = False
## Full path of a config file.
# See also: JupyterApp.config_file
# c.LabApp.config_file = ''
## Specify a config file to load.
# See also: JupyterApp.config_file_name
# c.LabApp.config_file_name = ''
## Whether to start the app in core mode. In this mode, JupyterLab
# will run using the JavaScript assets that are within the installed
# JupyterLab Python package. In core mode, third party extensions are disabled.
# The `--dev-mode` flag is an alias to this to be used when the Python package
# itself is installed in development mode (`pip install -e .`).
# Default: False
# c.LabApp.core_mode = False
## The default URL to redirect to from `/`
# Default: '/lab'
# c.LabApp.default_url = '/lab'
## Whether to start the app in dev mode. Uses the unpublished local
# JavaScript packages in the `dev_mode` folder. In this case JupyterLab will
# show a red stripe at the top of the page. It can only be used if JupyterLab
# is installed as `pip install -e .`.
# Default: False
# c.LabApp.dev_mode = False
## Whether to expose the global app instance to browser via window.jupyterlab
# Default: False
# c.LabApp.expose_app_in_browser = False
## Whether to load prebuilt extensions in dev mode. This may be
# useful to run and test prebuilt extensions in development installs of
# JupyterLab. APIs in a JupyterLab development install may be
# incompatible with published packages, so prebuilt extensions compiled
# against published packages may not work correctly.
# Default: False
# c.LabApp.extensions_in_dev_mode = False
## Extra paths to look for federated JupyterLab extensions
# Default: []
# c.LabApp.extra_labextensions_path = []
## Generate default config file.
# See also: JupyterApp.generate_config
# c.LabApp.generate_config = False
## Handlers appended to the server.
# See also: ExtensionApp.handlers
# c.LabApp.handlers = []
## Options to pass to the jinja2 environment for this
# Default: {}
# c.LabApp.jinja2_options = {}
## The standard paths to look in for federated JupyterLab extensions
# Default: []
# c.LabApp.labextensions_path = []
## The url for federated JupyterLab extensions
# Default: ''
# c.LabApp.labextensions_url = ''
## The interval delay in seconds to refresh the lists
# See also: LabServerApp.listings_refresh_seconds
# c.LabApp.listings_refresh_seconds = 3600
## The optional kwargs to use for the listings HTTP requests as
# described on https://2.python-requests.org/en/v2.7.0/api/#requests.request
# See also: LabServerApp.listings_request_options
# c.LabApp.listings_request_options = {}
## The listings url.
# Default: ''
# c.LabApp.listings_url = ''
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.LabApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# See also: Application.log_format
# c.LabApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# See also: Application.log_level
# c.LabApp.log_level = 30
##
# See also: Application.logging_config
# c.LabApp.logging_config = {}
## Whether a notebook should start a kernel automatically.
# Default: True
# c.LabApp.notebook_starts_kernel = True
## Whether to open in a browser after starting.
# See also: ExtensionApp.open_browser
# c.LabApp.open_browser = False
## The override url for static lab assets, typically a CDN.
# Default: ''
# c.LabApp.override_static_url = ''
## The override url for static lab theme assets, typically a CDN.
# Default: ''
# c.LabApp.override_theme_url = ''
## The optional location of the settings schemas directory. If given, a handler
# will be added for settings.
# Default: ''
# c.LabApp.schemas_dir = ''
## Settings that will passed to the server.
# See also: ExtensionApp.settings
# c.LabApp.settings = {}
## The url path of the settings handler.
# Default: ''
# c.LabApp.settings_url = ''
## Instead of starting the Application, dump configuration to stdout
# See also: Application.show_config
# c.LabApp.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# See also: Application.show_config_json
# c.LabApp.show_config_json = False
## Splice source packages into app directory.
# Default: False
# c.LabApp.splice_source = False
## The optional location of local static files. If given, a static file handler
# will be added.
# Default: ''
# c.LabApp.static_dir = ''
## paths to search for serving static files.
# See also: ExtensionApp.static_paths
# c.LabApp.static_paths = []
## Url where the static assets for the extension are served.
# See also: ExtensionApp.static_url_prefix
# c.LabApp.static_url_prefix = ''
## Paths to search for serving jinja templates.
# See also: ExtensionApp.template_paths
# c.LabApp.template_paths = []
## The application templates directory.
# Default: ''
# c.LabApp.templates_dir = ''
## The optional location of the themes directory. If given, a handler will be
# added for themes.
# Default: ''
# c.LabApp.themes_dir = ''
## The theme url.
# Default: ''
# c.LabApp.themes_url = ''
## The url path of the translations handler.
# Default: ''
# c.LabApp.translations_api_url = ''
## The url path of the tree handler.
# Default: ''
# c.LabApp.tree_url = ''
## The directory for user settings.
# Default: '/etc/lab/user-settings'
# c.LabApp.user_settings_dir = '/etc/lab/user-settings'
## Whether to serve the app in watch mode
# Default: False
# c.LabApp.watch = False
## Deprecated, use `LabServerApp.allowed_extensions_uris`
# See also: LabServerApp.whitelist_uris
# c.LabApp.whitelist_uris = ''
## The url path of the workspaces API.
# Default: ''
# c.LabApp.workspaces_api_url = ''
## The directory for workspaces
# Default: '/'
# c.LabApp.workspaces_dir = '/'
#------------------------------------------------------------------------------
# ServerApp(JupyterApp) configuration
#------------------------------------------------------------------------------
## Set the Access-Control-Allow-Credentials: true header
# Default: False
# c.ServerApp.allow_credentials = False
## Set the Access-Control-Allow-Origin header
#
# Use '*' to allow any origin to access your server.
#
# Takes precedence over allow_origin_pat.
# Default: ''
# c.ServerApp.allow_origin = ''
## Use a regular expression for the Access-Control-Allow-Origin header
#
# Requests from an origin matching the expression will get replies with:
#
# Access-Control-Allow-Origin: origin
#
# where `origin` is the origin of the request.
#
# Ignored if allow_origin is set.
# Default: ''
# c.ServerApp.allow_origin_pat = ''
## Allow password to be changed at login for the Jupyter server.
#
# While logging in with a token, the Jupyter server UI will give the opportunity to
# the user to enter a new password at the same time that will replace
# the token login mechanism.
#
# This can be set to false to prevent changing password from
# the UI/API.
# Default: True
# c.ServerApp.allow_password_change = True
## Allow requests where the Host header doesn't point to a local server
#
# By default, requests get a 403 forbidden response if the 'Host' header
# shows that the browser thinks it's on a non-local domain.
# Setting this option to True disables this check.
#
# This protects against 'DNS rebinding' attacks, where a remote web server
# serves you a page and then changes its DNS to send later requests to a
# local IP, bypassing same-origin checks.
#
# Local IP addresses (such as 127.0.0.1 and ::1) are allowed as local,
# along with hostnames configured in local_hostnames.
# Default: False
# c.ServerApp.allow_remote_access = False
## Whether to allow the user to run the server as root.
# Default: False
# c.ServerApp.allow_root = False
## Answer yes to any prompts.
# See also: JupyterApp.answer_yes
# c.ServerApp.answer_yes = False
## "
# Require authentication to access prometheus metrics.
# Default: True
# c.ServerApp.authenticate_prometheus = True
## The authorizer class to use.
# Default: 'jupyter_server.auth.authorizer.AllowAllAuthorizer'
# c.ServerApp.authorizer_class = 'jupyter_server.auth.authorizer.AllowAllAuthorizer'
## Reload the webapp when changes are made to any Python src files.
# Default: False
# c.ServerApp.autoreload = False
## The base URL for the Jupyter server.
#
# Leading and trailing slashes can be omitted,
# and will automatically be added.
# Default: '/'
# c.ServerApp.base_url = '/'
## Specify what command to use to invoke a web
# browser when starting the server. If not specified, the
# default browser will be determined by the `webbrowser`
# standard library module, which allows setting of the
# BROWSER environment variable to override it.
# Default: ''
# c.ServerApp.browser = ''
## The full path to an SSL/TLS certificate file.
# Default: ''
# c.ServerApp.certfile = ''
## The full path to a certificate authority certificate for SSL/TLS client
# authentication.
# Default: ''
# c.ServerApp.client_ca = ''
## Full path of a config file.
# See also: JupyterApp.config_file
# c.ServerApp.config_file = ''
## Specify a config file to load.
# See also: JupyterApp.config_file_name
# c.ServerApp.config_file_name = ''
## The config manager class to use
# Default: 'jupyter_server.services.config.manager.ConfigManager'
# c.ServerApp.config_manager_class = 'jupyter_server.services.config.manager.ConfigManager'
## The content manager class to use.
# Default: 'jupyter_server.services.contents.largefilemanager.LargeFileManager'
# c.ServerApp.contents_manager_class = 'jupyter_server.services.contents.largefilemanager.LargeFileManager'
## Extra keyword arguments to pass to `set_secure_cookie`. See tornado's
# set_secure_cookie docs for details.
# Default: {}
# c.ServerApp.cookie_options = {}
## The random bytes used to secure cookies.
# By default this is a new random number every time you start the server.
# Set it to a value in a config file to enable logins to persist across server sessions.
#
# Note: Cookie secrets should be kept private, do not share config files with
# cookie_secret stored in plaintext (you can read the value from a file).
# Default: b''
# c.ServerApp.cookie_secret = b''
## The file where the cookie secret is stored.
# Default: ''
# c.ServerApp.cookie_secret_file = ''
## Override URL shown to users.
#
# Replace actual URL, including protocol, address, port and base URL,
# with the given value when displaying URL to the users. Do not change
# the actual connection URL. If authentication token is enabled, the
# token is added to the custom URL automatically.
#
# This option is intended to be used when the URL to display to the user
# cannot be determined reliably by the Jupyter server (proxified
# or containerized setups for example).
# Default: ''
# c.ServerApp.custom_display_url = ''
## The default URL to redirect to from `/`
# Default: '/'
# c.ServerApp.default_url = '/'
## Disable cross-site-request-forgery protection
#
# Jupyter notebook 4.3.1 introduces protection from cross-site request forgeries,
# requiring API requests to either:
#
# - originate from pages served by this server (validated with XSRF cookie and token), or
# - authenticate with a token
#
# Some anonymous compute resources still desire the ability to run code,
# completely without authentication.
# These services can disable all authentication and security checks,
# with the full knowledge of what that implies.
# Default: False
# c.ServerApp.disable_check_xsrf = False
## handlers that should be loaded at higher priority than the default services
# Default: []
# c.ServerApp.extra_services = []
## Extra paths to search for serving static files.
#
# This allows adding javascript/css to be available from the Jupyter server machine,
# or overriding individual files in the IPython
# Default: []
# c.ServerApp.extra_static_paths = []
## Extra paths to search for serving jinja templates.
#
# Can be used to override templates from jupyter_server.templates.
# Default: []
# c.ServerApp.extra_template_paths = []
## Open the named file when the application is launched.
# Default: ''
# c.ServerApp.file_to_run = ''
## The URL prefix where files are opened directly.
# Default: 'notebooks'
# c.ServerApp.file_url_prefix = 'notebooks'
## Generate default config file.
# See also: JupyterApp.generate_config
# c.ServerApp.generate_config = False
## Extra keyword arguments to pass to `get_secure_cookie`. See tornado's
# get_secure_cookie docs for details.
# Default: {}
# c.ServerApp.get_secure_cookie_kwargs = {}
## (bytes/sec)
# Maximum rate at which stream output can be sent on iopub before they are
# limited.
# Default: 1000000
# c.ServerApp.iopub_data_rate_limit = 1000000
## (msgs/sec)
# Maximum rate at which messages can be sent on iopub before they are
# limited.
# Default: 1000
# c.ServerApp.iopub_msg_rate_limit = 1000
## The IP address the Jupyter server will listen on.
# Default: 'localhost'
c.ServerApp.ip = '0.0.0.0'
## Supply extra arguments that will be passed to Jinja environment.
# Default: {}
# c.ServerApp.jinja_environment_options = {}
## Extra variables to supply to jinja templates when rendering.
# Default: {}
# c.ServerApp.jinja_template_vars = {}
## Dict of Python modules to load as Jupyter server extensions.Entry values can
# be used to enable and disable the loading ofthe extensions. The extensions
# will be loaded in alphabetical order.
# Default: {}
# c.ServerApp.jpserver_extensions = {}
## The kernel manager class to use.
# Default: 'jupyter_server.services.kernels.kernelmanager.MappingKernelManager'
# c.ServerApp.kernel_manager_class = 'jupyter_server.services.kernels.kernelmanager.MappingKernelManager'
## The kernel spec manager class to use. Should be a subclass of
# `jupyter_client.kernelspec.KernelSpecManager`.
#
# The Api of KernelSpecManager is provisional and might change without warning
# between this version of Jupyter and the next stable one.
# Default: 'builtins.object'
# c.ServerApp.kernel_spec_manager_class = 'builtins.object'
## Preferred kernel message protocol over websocket to use (default: None). If an
# empty string is passed, select the legacy protocol. If None, the selected
# protocol will depend on what the front-end supports (usually the most recent
# protocol supported by the back-end and the front-end).
# Default: None
# c.ServerApp.kernel_ws_protocol = None
## The full path to a private key file for usage with SSL/TLS.
# Default: ''
# c.ServerApp.keyfile = ''
## Whether to limit the rate of IOPub messages (default: True). If True, use
# iopub_msg_rate_limit, iopub_data_rate_limit and/or rate_limit_window to tune
# the rate.
# Default: True
# c.ServerApp.limit_rate = True
## Hostnames to allow as local when allow_remote_access is False.
#
# Local IP addresses (such as 127.0.0.1 and ::1) are automatically accepted
# as local as well.
# Default: ['localhost']
# c.ServerApp.local_hostnames = ['localhost']
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.ServerApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The Logging format template
# See also: Application.log_format
# c.ServerApp.log_format = '[%(name)s]%(highlevel)s %(message)s'
## Set the log level by value or name.
# See also: Application.log_level
# c.ServerApp.log_level = 30
##
# See also: Application.logging_config
# c.ServerApp.logging_config = {}
## The login handler class to use.
# Default: 'jupyter_server.auth.login.LoginHandler'
# c.ServerApp.login_handler_class = 'jupyter_server.auth.login.LoginHandler'
## The logout handler class to use.
# Default: 'jupyter_server.auth.logout.LogoutHandler'
# c.ServerApp.logout_handler_class = 'jupyter_server.auth.logout.LogoutHandler'
## Sets the maximum allowed size of the client request body, specified in the
# Content-Length request header field. If the size in a request exceeds the
# configured value, a malformed HTTP message is returned to the client.
#
# Note: max_body_size is applied even in streaming mode.
# Default: 536870912
# c.ServerApp.max_body_size = 536870912
## Gets or sets the maximum amount of memory, in bytes, that is allocated for use
# by the buffer manager.
# Default: 536870912
# c.ServerApp.max_buffer_size = 536870912
## Gets or sets a lower bound on the open file handles process resource limit.
# This may need to be increased if you run into an OSError: [Errno 24] Too many
# open files. This is not applicable when running on Windows.
# Default: 0
# c.ServerApp.min_open_files_limit = 0
## DEPRECATED, use root_dir.
# Default: ''
c.ServerApp.notebook_dir = ''
## Whether to open in a browser after starting.
# The specific browser used is platform dependent and
# determined by the python standard library `webbrowser`
# module, unless it is overridden using the --browser
# (ServerApp.browser) configuration option.
# Default: False
c.ServerApp.open_browser = False
## Hashed password to use for web authentication.
#
# To generate, type in a python/IPython shell:
#
# from jupyter_server.auth import passwd; passwd()
#
# The string should be of the form type:salt:hashed-
# password.
# Default: ''
# c.ServerApp.password = ''
## Forces users to use a password for the Jupyter server.
# This is useful in a multi user environment, for instance when
# everybody in the LAN can access each other's machine through ssh.
#
# In such a case, serving on localhost is not secure since
# any user can connect to the Jupyter server via ssh.
# Default: False
# c.ServerApp.password_required = False
## The port the server will listen on (env: JUPYTER_PORT).
# Default: 0
c.ServerApp.port = 8888
## The number of additional ports to try if the specified port is not available
# (env: JUPYTER_PORT_RETRIES).
# Default: 50
# c.ServerApp.port_retries = 50
## Preferred starting directory to use for notebooks and kernels.
# Default: ''
# c.ServerApp.preferred_dir = ''
## DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
# Default: 'disabled'
# c.ServerApp.pylab = 'disabled'
## If True, display controls to shut down the Jupyter server, such as menu items
# or buttons.
# Default: True
# c.ServerApp.quit_button = True
## (sec) Time window used to
# check the message and data rate limits.
# Default: 3
# c.ServerApp.rate_limit_window = 3
## Reraise exceptions encountered loading server extensions?
# Default: False
# c.ServerApp.reraise_server_extension_failures = False
## The directory to use for notebooks and kernels.
# Default: ''
# c.ServerApp.root_dir = ''
## The session manager class to use.
# Default: 'builtins.object'
# c.ServerApp.session_manager_class = 'builtins.object'
## Instead of starting the Application, dump configuration to stdout
# See also: Application.show_config
# c.ServerApp.show_config = False
## Instead of starting the Application, dump configuration to stdout (as JSON)
# See also: Application.show_config_json
# c.ServerApp.show_config_json = False
## Shut down the server after N seconds with no kernels or terminals running and
# no activity. This can be used together with culling idle kernels
# (MappingKernelManager.cull_idle_timeout) to shutdown the Jupyter server when
# it's not in use. This is not precisely timed: it may shut down up to a minute
# later. 0 (the default) disables this automatic shutdown.
# Default: 0
# c.ServerApp.shutdown_no_activity_timeout = 0
## The UNIX socket the Jupyter server will listen on.
# Default: ''
# c.ServerApp.sock = ''
## The permissions mode for UNIX socket creation (default: 0600).
# Default: '0600'
# c.ServerApp.sock_mode = '0600'
## Supply SSL options for the tornado HTTPServer.
# See the tornado docs for details.
# Default: {}
# c.ServerApp.ssl_options = {}
## Supply overrides for terminado. Currently only supports "shell_command".
# Default: {}
# c.ServerApp.terminado_settings = {}
## Set to False to disable terminals.
#
# This does *not* make the server more secure by itself.
# Anything the user can in a terminal, they can also do in a notebook.
#
# Terminals may also be automatically disabled if the terminado package
# is not available.
# Default: True
# c.ServerApp.terminals_enabled = True
## Token used for authenticating first-time connections to the server.
#
# The token can be read from the file referenced by JUPYTER_TOKEN_FILE or set directly
# with the JUPYTER_TOKEN environment variable.
#
# When no password is enabled,
# the default is to generate a new, random token.
#
# Setting to an empty string disables authentication altogether, which
# is NOT RECOMMENDED.
# Default: '<generated>'
# c.ServerApp.token = '<generated>'
## Supply overrides for the tornado.web.Application that the Jupyter server uses.
# Default: {}
# c.ServerApp.tornado_settings = {}
## Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy. Necessary if the proxy handles
# SSL
# Default: False
# c.ServerApp.trust_xheaders = False
## Disable launching browser by redirect file
# For versions of notebook > 5.7.2, a security feature measure was added that
# prevented the authentication token used to launch the browser from being visible.
# This feature makes it difficult for other users on a multi-user system from
# running code in your Jupyter session as you.
# However, some environments (like Windows Subsystem for Linux (WSL) and Chromebooks),
# launching a browser using a redirect file can lead the browser failing to load.
# This is because of the difference in file structures/paths between the runtime and
# the browser.
#
# Disabling this setting to False will disable this behavior, allowing the browser
# to launch by using a URL and visible token (as before).
# Default: True
# c.ServerApp.use_redirect_file = True
## Specify where to open the server on startup. This is the
# `new` argument passed to the standard library method `webbrowser.open`.
# The behaviour is not guaranteed, but depends on browser support. Valid
# values are:
#
# - 2 opens a new tab,
# - 1 opens a new window,
# - 0 opens in an existing window.
#
# See the `webbrowser.open` documentation for details.
# Default: 2
# c.ServerApp.webbrowser_open_new = 2
## Set the tornado compression options for websocket connections.
#
# This value will be returned from
# :meth:`WebSocketHandler.get_compression_options`. None (default) will disable
# compression. A dict (even an empty one) will enable compression.
#
# See the tornado docs for WebSocketHandler.get_compression_options for details.
# Default: None
# c.ServerApp.websocket_compression_options = None
## The base URL for websockets,
# if it differs from the HTTP server (hint: it almost certainly doesn't).
#
# Should be in the form of an HTTP origin: ws[s]://hostname[:port]
# Default: ''
# c.ServerApp.websocket_url = ''
matplotlib
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment