Commit e670fa96 authored by chenpangpang's avatar chenpangpang
Browse files

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

Update jupyter plugin

See merge request !2
parents 235feb09 1d6fa5fb
...@@ -60,6 +60,7 @@ RUN pip3 install --upgrade pip ${SOURCES} || pip install --upgrade pip ${SOURCES ...@@ -60,6 +60,7 @@ 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.bak /etc/apt/sources.list \
&& mv /etc/apt/sources.list.d.bak /etc/apt/sources.list.d && mv /etc/apt/sources.list.d.bak /etc/apt/sources.list.d
RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 && -n "$TORCH_VERSION" ];then \ RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 && -n "$TORCH_VERSION" ];then \
pip3 install torch==$TORCH_VERSION torchvision==$TORCHVISION_VERSION torchaudio==$TORCHAUDIO_VERSION \ 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]}') \ --index-url https://download.pytorch.org/whl/cu$(echo "$BASE_IMAGE" | awk -F'[:-]' '{n=split($2,a,"."); print a[1] a[2]}') \
...@@ -87,9 +88,10 @@ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \ ...@@ -87,9 +88,10 @@ 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_dataset-0.1.0-py3-none-any.whl /tmp/jupyter-extension/ COPY ./jupyter_ext_model-1.0.7-py3-none-any.whl /tmp/jupyter-extension/
COPY ./jupyter_ext_logo-0.1.0-py3-none-any.whl /tmp/jupyter-extension/ COPY ./jupyter_ext_platform-1.0.11-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 ./requirements.txt /tmp/jupyter-extension/ COPY ./requirements.txt /tmp/jupyter-extension/
COPY ./static /tmp/jupyter-extension/static COPY ./static /tmp/jupyter-extension/static
COPY extension.sh /tmp/ COPY extension.sh /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-v2/*.whl ./tmp/ cp ./jupyter-extension-install-v3/*.whl ./tmp/
cp ./jupyter-extension-install-v2/requirements.txt ./tmp/ cp ./jupyter-extension-install-v3/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-v2/static ./tmp/ cp -r ./jupyter-extension-install-v3/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/
......
...@@ -60,6 +60,9 @@ pip3 uninstall -r $WORKSPACE/requirements.txt ...@@ -60,6 +60,9 @@ pip3 uninstall -r $WORKSPACE/requirements.txt
pip3 install --no-index --find-links=$WORKSPACE/ -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 if pip list | grep -E 'jupyter_ext_platform' && pip list | grep -E 'jupyter_ext_model' && 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
# 禁用splash插件
jupyter labextension disable @jupyterlab/apputils-extension:splash
rm -r $WORKSPACE rm -r $WORKSPACE
...@@ -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-v2/*.whl ./tmp/ cp ./jupyter-extension-install-v3/*.whl ./tmp/
cp ./jupyter-extension-install-v2/requirements.txt ./tmp/ cp ./jupyter-extension-install-v3/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-v2/static ./tmp/ cp -r ./jupyter-extension-install-v3/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_logo jupyter_ext_platform==1.0.11
jupyter_ext_dataset jupyter_ext_model==1.0.7
\ No newline at end of file git_lfs==1.6
...@@ -24,9 +24,15 @@ ...@@ -24,9 +24,15 @@
window.history.replaceState({ }, '', url); window.history.replaceState({ }, '', url);
})();</script> })();</script>
<body>
<div id="sugon-logo-wrap"> <div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" /> <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> </div>
</body> </body>
<style> <style>
...@@ -35,14 +41,32 @@ ...@@ -35,14 +41,32 @@
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 300px;
height: 150px;
z-index: 100; z-index: 100;
text-align: center;
} }
#sugon-logo-wrap img { #sugon-logo-wrap img {
width: 100%; 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> </style>
<script> <script>
var sugonLoadInterval = setInterval(() => { var sugonLoadInterval = setInterval(() => {
...@@ -52,5 +76,18 @@ ...@@ -52,5 +76,18 @@
document.body.removeChild(document.getElementById('sugon-logo-wrap')) document.body.removeChild(document.getElementById('sugon-logo-wrap'))
} }
}, 100) }, 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> </script>
</html> </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> <!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. */ <script>/* Remove token from URL. */
(function () { (function () {
var location = window.location; var location = window.location;
...@@ -24,9 +24,15 @@ ...@@ -24,9 +24,15 @@
window.history.replaceState({ }, '', url); window.history.replaceState({ }, '', url);
})();</script> })();</script>
<body>
<div id="sugon-logo-wrap"> <div id="sugon-logo-wrap">
<img src="{{page_config.fullStaticUrl}}/scnet-loading.gif" /> <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> </div>
</body> </body>
<style> <style>
...@@ -35,14 +41,32 @@ ...@@ -35,14 +41,32 @@
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 300px;
height: 150px;
z-index: 100; z-index: 100;
text-align: center;
} }
#sugon-logo-wrap img { #sugon-logo-wrap img {
width: 100%; 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> </style>
<script> <script>
var sugonLoadInterval = setInterval(() => { var sugonLoadInterval = setInterval(() => {
...@@ -52,5 +76,18 @@ ...@@ -52,5 +76,18 @@
document.body.removeChild(document.getElementById('sugon-logo-wrap')) document.body.removeChild(document.getElementById('sugon-logo-wrap'))
} }
}, 100) }, 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> </script>
</html> </html>
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