Commit 1440eb08 authored by chenpangpang's avatar chenpangpang
Browse files

Merge branch 'update-jupyter-plugin' into 'dev'

Update jupyter plugin

See merge request !4
parents 8a9a5632 91a85f26
...@@ -130,8 +130,8 @@ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \ ...@@ -130,8 +130,8 @@ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \
# 安装jupyterlab插件, 生成sshd配置 # 安装jupyterlab插件, 生成sshd配置
RUN pip3 install jupyterlab==4.0.0 RUN pip3 install jupyterlab==4.0.0
RUN mkdir -p /tmp/jupyter-extension RUN mkdir -p /tmp/jupyter-extension
COPY ./jupyter_ext_model-1.0.7-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.11-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 ./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 ./git_lfs-1.6-py2.py3-none-any.whl /tmp/jupyter-extension/
COPY ./requirements.txt /tmp/jupyter-extension/ COPY ./requirements.txt /tmp/jupyter-extension/
......
...@@ -21,11 +21,11 @@ if [ ! -d "./tmp" ];then ...@@ -21,11 +21,11 @@ if [ ! -d "./tmp" ];then
mkdir tmp mkdir tmp
fi fi
if [ "${framework}" == "jupyterlab" ];then if [ "${framework}" == "jupyterlab" ];then
cp ./jupyter-extension-install-v3/*.whl ./tmp/ cp ./jupyter-extension-install-v4/*.whl ./tmp/
cp ./jupyter-extension-install-v3/requirements.txt ./tmp/ cp ./jupyter-extension-install-v4/requirements.txt ./tmp/
cp ./extension.sh ./tmp/ cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/ cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v3/static ./tmp/ cp -r ./jupyter-extension-install-v4/static ./tmp/
fi fi
if [ "${framework}" == "codeserver" ];then if [ "${framework}" == "codeserver" ];then
cp ./code-server_4.7.0_amd64.deb ./tmp/ cp ./code-server_4.7.0_amd64.deb ./tmp/
......
...@@ -21,11 +21,11 @@ if [ ! -d "./tmp" ];then ...@@ -21,11 +21,11 @@ if [ ! -d "./tmp" ];then
mkdir tmp mkdir tmp
fi fi
if [ "${framework}" == "jupyterlab" ];then if [ "${framework}" == "jupyterlab" ];then
cp ./jupyter-extension-install-v3/*.whl ./tmp/ cp ./jupyter-extension-install-v4/*.whl ./tmp/
cp ./jupyter-extension-install-v3/requirements.txt ./tmp/ cp ./jupyter-extension-install-v4/requirements.txt ./tmp/
cp ./extension.sh ./tmp/ cp ./extension.sh ./tmp/
cp ./jupyter_lab_config.py ./tmp/ cp ./jupyter_lab_config.py ./tmp/
cp -r ./jupyter-extension-install-v3/static ./tmp/ cp -r ./jupyter-extension-install-v4/static ./tmp/
fi fi
if [ "${framework}" == "codeserver" ];then if [ "${framework}" == "codeserver" ];then
cp ./code-server_4.7.0_amd64.deb ./tmp/ cp ./code-server_4.7.0_amd64.deb ./tmp/
......
jupyterlab-language-pack-zh-CN jupyterlab-language-pack-zh-CN
jupyter_ext_platform==1.0.11 jupyter_ext_platform==1.0.13
jupyter_ext_model==1.0.7 jupyter_ext_model==1.0.10
git_lfs==1.6 git_lfs==1.6
#!/bin/bash #!/bin/bash
WORKSPACE="/opt/jupyter-ext/install" # WORKSPACE="/opt/jupyter-ext/install"
WORKSPACE=$(pwd)
#循环读取images.txt,并存入list中 #循环读取images.txt,并存入list中
n=0 n=0
...@@ -95,11 +95,21 @@ do ...@@ -95,11 +95,21 @@ do
echo "image env jupyter cmd path :${jupyter_dir}" 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/" # docker exec ${CONTAINER_ID} bash -c "mkdir -p '/opt/conda/bin/';ln -s ${jupyter_dir} /opt/conda/bin/"
# 卸载之前jupyterlab插件 # 卸载之前jupyterlab插件
docker exec ${CONTAINER_ID} bash -c "pip uninstall -r /jupyter-ext/requirements.txt" 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;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" # 安装 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插件 # 禁用splash插件
docker exec ${CONTAINER_ID} bash -c "jupyter labextension disable @jupyterlab/apputils-extension:splash" docker exec ${CONTAINER_ID} bash -c "jupyter labextension disable @jupyterlab/apputils-extension:splash"
...@@ -109,11 +119,11 @@ do ...@@ -109,11 +119,11 @@ do
# docker tag $imageId $registryAddr$repository:$imageNewTag # docker tag $imageId $registryAddr$repository:$imageNewTag
# #推送镜像 # #推送镜像
# docker push $registryAddr$repository:$imageNewTag # docker push $registryAddr$repository:$imageNewTag
# 删除容器及镜像 # 删除容器及镜像
# docker stop ${CONTAINER_ID} docker stop ${CONTAINER_ID}
# docker rm ${CONTAINER_ID} docker rm ${CONTAINER_ID}
# docker rmi ${imageId} # docker rmi ${imageId}
# 验证命令 # 验证命令
...@@ -121,4 +131,4 @@ do ...@@ -121,4 +131,4 @@ do
# 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 # 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 done
echo "jupyter source code update failed:" echo "jupyter source code update failed:"
echo $fail_image_array echo $fail_image_array
\ 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