Commit e5afa281 authored by chenpangpang's avatar chenpangpang
Browse files

feat: 更新插件

parent 0f9cb486
......@@ -14,8 +14,17 @@ ARG TORCHAUDIO_VERSION
# ----- tensorflow args -----
ARG TENSORFLOW_VERSION
ARG CONDA_URL="https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_24.7.1-0-Linux-x86_64.sh"
ARG IMAGE_TAG
#ARG CONDA_URL="https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py310_24.7.1-0-Linux-x86_64.sh"
# ----- paddlepaddle args -----
ARG PADDLEPADDLE_VERSION
ARG PADDLENLP_VERSION
ARG CUDA_VERSION
ARG PADDLE_URL
# ----- conda and python args ----
ARG CONDA_URL
#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 \
......@@ -43,8 +52,9 @@ RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak \
&& 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
# ----- conda and python install -----
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
RUN if [ -n "$CONDA_URL" ];then \
mkdir -p /tmp/conda-extension \
&& cd /tmp/conda-extension \
&& wget $CONDA_URL \
......@@ -60,21 +70,53 @@ RUN pip3 install --upgrade pip ${SOURCES} || pip install --upgrade pip ${SOURCES
&& mv /etc/apt/sources.list.bak /etc/apt/sources.list \
&& mv /etc/apt/sources.list.d.bak /etc/apt/sources.list.d
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 && -n "$TORCH_VERSION" ];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]}') \
RUN if [ -n "$TORCH_VERSION" ] && [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
cuda_version=$(echo "$BASE_IMAGE" | awk -F'[:-]' '{n=split($2,a,"."); print a[1] a[2]}') \
&& if [ "${TORCH_VERSION%%.*}" -eq 1 ]; then \
pip3 install --no-cache-dir "numpy<2" \
&& pip3 install --no-cache-dir torch==$TORCH_VERSION+cu$cuda_version torchvision==$TORCHVISION_VERSION+cu$cuda_version torchaudio==$TORCHAUDIO_VERSION \
--extra-index-url https://download.pytorch.org/whl/cu$cuda_version;else \
pip3 install --no-cache-dir torch==$TORCH_VERSION torchvision==$TORCHVISION_VERSION torchaudio==$TORCHAUDIO_VERSION \
--index-url https://download.pytorch.org/whl/cu$cuda_version; fi \
&& rm -r /root/.cache/pip; fi
RUN if [ -n "$TORCH_VERSION" ];then \
pip install --no-cache-dir transformers accelerate diffusers; fi
RUN if [ -n "$TENSORFLOW_VERSION" ]; then \
tf_version_minor=$(echo $TENSORFLOW_VERSION | cut -d'.' -f1-2 ) && \
pip install --no-cache-dir tensorflow[and-cuda]==$TENSORFLOW_VERSION \
tensorflow-text==$tf_version_minor.* tf-models-official==$tf_version_minor.* && \
apt-get update -y && \
apt-get install --no-install-recommends -y libnvinfer8 libnvjitlink-12-3 libnvjpeg-12-3 libnvinfer-plugin8; fi
tf_version_minor=$(echo $TENSORFLOW_VERSION | cut -d'.' -f1-2 ); \
[ "$tf_version_minor" == "2.13" ] || [ "$tf_version_minor" == "2.18" ] && tensorflow_text_version=$tf_version_minor.0rc0 || tensorflow_text_version=$tf_version_minor.*; \
pip install --no-cache-dir tensorflow==$TENSORFLOW_VERSION -i https://pypi.org/simple/ && \
pip install --no-cache-dir tensorflow-text==$tensorflow_text_version tensorflow-hub; fi
# 2.16.1必须手动添加环境变量
RUN if [ $TENSORFLOW_VERSION == "2.16.1" ]; then \
python_version=$(echo $IMAGE_TAG | awk -F'[-:]' '{for(i=3;i<=NF;i++) if($i ~ /^py[0-9]+\.[0-9]+$/) {gsub(/^py/,"",$i); print $i; exit}}') && \
CUDNN_PATH=/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn && \
echo "export CUDNN_PATH=$CUDNN_PATH" >> /etc/bash.bashrc && \
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDNN_PATH/lib:/usr/local/cuda/lib64" >> /etc/bash.bashrc;fi && \
if [ $TENSORFLOW_VERSION == "2.8.0" ] || [ $TENSORFLOW_VERSION == "2.7.0" ] || [ $TENSORFLOW_VERSION == "2.6.0" ]; then \
pip install --no-cache-dir protobuf==3.20.*;fi && \
if [ $TENSORFLOW_VERSION == "2.4.0" ] || [ $TENSORFLOW_VERSION == "2.5.0" ] || [ $TENSORFLOW_VERSION == "2.6.0" ]; then \
pip install --no-cache-dir numpy==1.19.2 matplotlib==3.6.*;fi && \
if [ $TENSORFLOW_VERSION == "2.8.0" ] || [ $TENSORFLOW_VERSION == "2.10.0" ] || [ $TENSORFLOW_VERSION == "2.11.0" ] || [ $TENSORFLOW_VERSION == "2.9.0" ] || [ $TENSORFLOW_VERSION == "2.9.3" ] || [ $TENSORFLOW_VERSION == "2.14.0" ]; then \
pip install --no-cache-dir "numpy<2"; fi
# ----- paddlepaddle install -----
RUN if [ -n "$PADDLEPADDLE_VERSION" ] && [ -n "$PADDLE_URL" ]; then \
pip install paddlepaddle-gpu==$PADDLEPADDLE_VERSION -f $PADDLE_URL -i $PADDLE_URL \
&& rm -r /root/.cache/pip; \
fi
RUN if [ -n "$PADDLEPADDLE_VERSION" ] && [ -z "$PADDLE_URL" ]; then \
pip install paddlepaddle-gpu==$PADDLEPADDLE_VERSION -i https://pypi.tuna.tsinghua.edu.cn/simple \
&& rm -r /root/.cache/pip; \
fi
RUN if [ -n "$PADDLENLP_VERSION" ] ; then \
pip install paddlenlp==$PADDLENLP_VERSION ppdiffusers huggingface_hub --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install --upgrade ppdiffusers --no-deps && rm -r /root/.cache/pip; \
fi
COPY ./python-requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/python-requirements.txt
......@@ -88,8 +130,8 @@ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \
# 安装jupyterlab插件, 生成sshd配置
RUN pip3 install jupyterlab==4.0.0
RUN mkdir -p /tmp/jupyter-extension
COPY ./jupyter_ext_model-1.0.7-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyter_ext_platform-1.0.11-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyter_ext_model-1.0.10-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyter_ext_platform-1.0.13-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 ./git_lfs-1.6-py2.py3-none-any.whl /tmp/jupyter-extension/
COPY ./requirements.txt /tmp/jupyter-extension/
......@@ -111,7 +153,6 @@ RUN jupytersite="$(python3 -m pip show jupyterlab | grep -i '^location' | awk '{
&& ssh-keygen -A \
&& sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
EXPOSE 8888
......
#!/bin/bash
# 框架
framework=$1
# 输出镜像tag
......@@ -10,9 +9,10 @@ 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
build_args="$build_args --build-arg IMAGE_TAG=$image_tag"
for arg in ${*:4}
do
build_args="$build_args --build-arg $arg "
build_args="$build_args --build-arg $arg"
done
tmp_dockerfile="Dockerfile.${RANDOM}"
......@@ -21,11 +21,11 @@ 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 ./jupyter-extension-install-v3/*.whl ./tmp/
cp ./jupyter-extension-install-v3/requirements.txt ./tmp/
cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v2/static ./tmp/
cp -r ./jupyter-extension-install-v3/static ./tmp/
fi
if [ "${framework}" == "codeserver" ];then
cp ./code-server_4.7.0_amd64.deb ./tmp/
......@@ -38,10 +38,11 @@ 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/
#echo "docker build -f ./tmp/${tmp_dockerfile} -t ${image_tag} $build_args ./tmp/"
build_status=$?
rm -r ./tmp
if [[ $? -eq 0 ]];then
if [[ build_status -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
fi
# 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-v4/*.whl ./tmp/
cp ./jupyter-extension-install-v4/requirements.txt ./tmp/
cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v4/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_platform==1.0.13
jupyter_ext_model==1.0.10
git_lfs==1.6
<!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>
<div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" />
<div class="waiting-text">加载服务中,请稍候</div>
<span class="time-limit time-limited">
当前实例任务单次运行最大时长
<span class="time" id="sugon-time-limit"></span>
,请注意及时保存重要文件
</span>
<span class="time-limit time-unlimited">当前实例任务不会自动关停并将持续产生费用,请注意按需手动关停。</span>
</div>
</body>
<style>
#sugon-logo-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
text-align: center;
}
#sugon-logo-wrap img {
width: 50px;
}
#sugon-logo-wrap .waiting-text {
font-size: 20px;
font-weight: 500;
color: #3b4048;
line-height: 30px;
margin: 18px 0 26px;
text-align: center;
}
#sugon-logo-wrap .time-limit {
font-size: 14px;
font-weight: 400;
color: #3B4048;
line-height: 14px;
display: none;
}
#sugon-logo-wrap .time-limit .time {
font-weight: 700;
font-size: 18px;
color: #FFB333;
}
</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)
const query = new URLSearchParams(window.location.search);
if (query.get('limit')) {
const limit = query.get('limit')
if (limit === 'unlimited') {
document.querySelector('.time-limit.time-unlimited').style.display = 'block'
} else {
const timeText = Number(limit.split(':')[0]) + '小时'
document.querySelector('.time-limit.time-limited').style.display = 'block'
document.getElementById('sugon-time-limit').innerText = timeText
}
}
</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.dd06365fd804e00186dc.js?v=dd06365fd804e00186dc"></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>
<div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" />
<div class="waiting-text">加载服务中,请稍候</div>
<span class="time-limit time-limited">
当前实例任务单次运行最大时长
<span class="time" id="sugon-time-limit"></span>
,请注意及时保存重要文件
</span>
<span class="time-limit time-unlimited">当前实例任务不会自动关停并将持续产生费用,请注意按需手动关停。</span>
</div>
</body>
<style>
#sugon-logo-wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
text-align: center;
}
#sugon-logo-wrap img {
width: 50px;
}
#sugon-logo-wrap .waiting-text {
font-size: 20px;
font-weight: 500;
color: #3b4048;
line-height: 30px;
margin: 18px 0 26px;
text-align: center;
}
#sugon-logo-wrap .time-limit {
font-size: 14px;
font-weight: 400;
color: #3B4048;
line-height: 14px;
display: none;
}
#sugon-logo-wrap .time-limit .time {
font-weight: 700;
font-size: 18px;
color: #FFB333;
}
</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)
const query = new URLSearchParams(window.location.search);
if (query.get('limit')) {
const limit = query.get('limit')
if (limit === 'unlimited') {
document.querySelector('.time-limit.time-unlimited').style.display = 'block'
} else {
const timeText = Number(limit.split(':')[0]) + '小时'
document.querySelector('.time-limit.time-limited').style.display = 'block'
document.getElementById('sugon-time-limit').innerText = timeText
}
}
</script>
</html>
#!/bin/bash
# WORKSPACE="/opt/jupyter-ext/install"
WORKSPACE=$(pwd)
#循环读取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/uninstall.txt -y"
# 安装jupyterlab插件
# 安装 jupyterlab 插件
docker exec ${CONTAINER_ID} bash -c "
pip install --no-index --find-links=/jupyter-ext -r /jupyter-ext/requirements.txt
jupyter_version=$(jupyter lab --version | cut -d. -f1)
if pip list | grep -E 'jupyter_ext_model' && \
pip list | grep -E 'jupyter_ext_platform' && \
pip list | grep -E 'jupyterlab-language-pack-zh-CN'; 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
......@@ -2,4 +2,4 @@ setuptools
ipywidgets
wheel
matplotlib
git-lfs
\ No newline at end of file
git-lfs
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