Commit 3c821ab7 authored by chenpangpang's avatar chenpangpang
Browse files

update jupyter plugin

parent 90f95878
...@@ -54,9 +54,6 @@ RUN pip3 install --upgrade pip ${SOURCES} || pip install --upgrade pip ${SOURCES ...@@ -54,9 +54,6 @@ 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
COPY ./python-requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/python-requirements.txt
# 安装pytorch 需要设置代理 # 安装pytorch 需要设置代理
#ENV http_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/ #ENV http_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
#ENV https_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/ #ENV https_proxy=http://ac19pn3az3:M36tPjtQ@10.21.131.1:3128/
...@@ -66,6 +63,9 @@ RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \ ...@@ -66,6 +63,9 @@ RUN if [ $BASE_IMAGE_IS_TORCH -eq 0 ];then \
--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]}') \
&& rm -r /root/.cache/pip; fi && rm -r /root/.cache/pip; fi
COPY ./python-requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/python-requirements.txt
### 添加HF的镜像变量 ### 添加HF的镜像变量
ENV HF_ENDPOINT=https://hf-mirror.com ENV HF_ENDPOINT=https://hf-mirror.com
RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \
...@@ -75,8 +75,8 @@ RUN echo 'export HF_ENDPOINT=https://hf-mirror.com' >> /etc/bash.bashrc && \ ...@@ -75,8 +75,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_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.10-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 ./requirements.txt /tmp/jupyter-extension/ COPY ./requirements.txt /tmp/jupyter-extension/
COPY ./static /tmp/jupyter-extension/static COPY ./static /tmp/jupyter-extension/static
......
...@@ -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
rm -r $WORKSPACE # 禁用splash插件
\ No newline at end of file jupyter labextension disable @jupyterlab/apputils-extension:splash
rm -r $WORKSPACE
jupyterlab-language-pack-zh-CN jupyterlab-language-pack-zh-CN
jupyter_ext_logo jupyter_ext_platform==1.0.10
jupyter_ext_dataset jupyter_ext_model==1.0.7
\ 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> <!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. */ <script>/* Remove token from URL. */
(function () { (function () {
var location = window.location; var location = window.location;
var search = location.search; var search = location.search;
// If there is no query string, bail. // If there is no query string, bail.
if (search.length <= 1) { if (search.length <= 1) {
return; return;
} }
// Rebuild the query string without the `token`. // Rebuild the query string without the `token`.
var query = '?' + search.slice(1).split('&') var query = '?' + search.slice(1).split('&')
.filter(function (param) { return param.split('=')[0] !== 'token'; }) .filter(function (param) { return param.split('=')[0] !== 'token'; })
.join('&'); .join('&');
// Rebuild the URL with the new query string. // Rebuild the URL with the new query string.
var url = location.origin + location.pathname + var url = location.origin + location.pathname +
(query !== '?' ? query : '') + location.hash; (query !== '?' ? query : '') + location.hash;
if (url === location.href) { if (url === location.href) {
return; return;
} }
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>
</div> <span class="time-limit time-limited">
</body> 当前实例任务单次运行最大时长
<style> <span class="time" id="sugon-time-limit"></span>
#sugon-logo-wrap { ,请注意及时保存重要文件
position: absolute; </span>
top: 50%; <span class="time-limit time-unlimited">当前实例任务不会自动关停并将持续产生费用,请注意按需手动关停。</span>
left: 50%; </div>
transform: translate(-50%, -50%); </body>
width: 300px; <style>
height: 150px; #sugon-logo-wrap {
z-index: 100; position: absolute;
} top: 50%;
left: 50%;
#sugon-logo-wrap img { transform: translate(-50%, -50%);
width: 100%; z-index: 100;
} text-align: center;
</style> }
<script> #sugon-logo-wrap img {
var sugonLoadInterval = setInterval(() => { width: 50px;
var sugonMenu = document.getElementById('jp-menu-panel') }
if (sugonMenu) { #sugon-logo-wrap .waiting-text {
clearInterval(sugonLoadInterval) font-size: 20px;
document.body.removeChild(document.getElementById('sugon-logo-wrap')) font-weight: 500;
} color: #3b4048;
}, 100) line-height: 30px;
</script> margin: 18px 0 26px;
</html> 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.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.cad2364f9e7610a9f01d.js?v=cad2364f9e7610a9f01d"></script></head>
<script>/* Remove token from URL. */ <script>/* Remove token from URL. */
(function () { (function () {
var location = window.location; var location = window.location;
var search = location.search; var search = location.search;
// If there is no query string, bail. // If there is no query string, bail.
if (search.length <= 1) { if (search.length <= 1) {
return; return;
} }
// Rebuild the query string without the `token`. // Rebuild the query string without the `token`.
var query = '?' + search.slice(1).split('&') var query = '?' + search.slice(1).split('&')
.filter(function (param) { return param.split('=')[0] !== 'token'; }) .filter(function (param) { return param.split('=')[0] !== 'token'; })
.join('&'); .join('&');
// Rebuild the URL with the new query string. // Rebuild the URL with the new query string.
var url = location.origin + location.pathname + var url = location.origin + location.pathname +
(query !== '?' ? query : '') + location.hash; (query !== '?' ? query : '') + location.hash;
if (url === location.href) { if (url === location.href) {
return; return;
} }
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>
</div> <span class="time-limit time-limited">
</body> 当前实例任务单次运行最大时长
<style> <span class="time" id="sugon-time-limit"></span>
#sugon-logo-wrap { ,请注意及时保存重要文件
position: absolute; </span>
top: 50%; <span class="time-limit time-unlimited">当前实例任务不会自动关停并将持续产生费用,请注意按需手动关停。</span>
left: 50%; </div>
transform: translate(-50%, -50%); </body>
width: 300px; <style>
height: 150px; #sugon-logo-wrap {
z-index: 100; position: absolute;
} top: 50%;
left: 50%;
#sugon-logo-wrap img { transform: translate(-50%, -50%);
width: 100%; z-index: 100;
} text-align: center;
</style> }
<script> #sugon-logo-wrap img {
var sugonLoadInterval = setInterval(() => { width: 50px;
var sugonMenu = document.getElementById('jp-menu-panel') }
if (sugonMenu) { #sugon-logo-wrap .waiting-text {
clearInterval(sugonLoadInterval) font-size: 20px;
document.body.removeChild(document.getElementById('sugon-logo-wrap')) font-weight: 500;
} color: #3b4048;
}, 100) line-height: 30px;
</script> margin: 18px 0 26px;
</html> 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>
...@@ -5,4 +5,6 @@ matplotlib ...@@ -5,4 +5,6 @@ matplotlib
transformers transformers
git-lfs git-lfs
accelerate accelerate
diffusers diffusers
\ No newline at end of file datasets
hf_transfer
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