Skip to content

Commit

Permalink
fix(ai): 修复jupyter启动时参数错误问题 (#1190)
Browse files Browse the repository at this point in the history
jupyter应用启动时,PasswordIdentityProvider.hashed_password不生效,改为ServerApp.password
  • Loading branch information
ZihanChen821 committed Apr 8, 2024
1 parent 6de3338 commit a737493
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/little-snakes-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@scow/ai": patch
"@scow/docs": patch
---

jupyter 启动命令参数 PasswordIdentityProvider.hashed_password 改为 ServerApp.password
2 changes: 1 addition & 1 deletion apps/ai/config/ai/apps/jupter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ web:
jupyter-lab
# 运行任务的脚本。可以使用准备脚本定义的
script: |
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --PasswordIdentityProvider.hashed_password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --ServerApp.password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
proxyType: absolute
# 如何连接应用
connect:
Expand Down
7 changes: 5 additions & 2 deletions apps/ai/src/server/trpc/route/jobs/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,11 @@ export const listAppSessions =
// 如果是训练,不需要连接信息
if (sessionMetadata.jobType === JobType.APP && sessionMetadata.appId) {

const app = checkAppExist(apps, sessionMetadata.appId);

const app = apps[sessionMetadata.appId];
// 未找到该应用 不报错。
if (!app) {
return;
}
// judge whether the app is ready
if (runningJobInfo && runningJobInfo.state === "RUNNING") {
// 对于k8s这种通过容器运行作业的集群,当把容器中的作业工作目录挂载到宿主机中时,目录中新生成的文件不会马上反映到宿主机中,
Expand Down
2 changes: 1 addition & 1 deletion dev/vagrant/config/ai/apps/jupyter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ web:
jupyter-lab
# 运行任务的脚本。可以使用准备脚本定义的
script: |
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --PasswordIdentityProvider.hashed_password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --ServerApp.password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
proxyType: absolute
# 如何连接应用
connect:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/deploy/config/ai/apps/apps/jupyterlab/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ web:

# 运行任务的脚本。可以使用准备脚本定义的变量
script: |
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --PasswordIdentityProvider.hashed_password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --ServerApp.port_retries=0 --ServerApp.password="sha1:${SALT}:${PASSWORD_SHA1}" --ServerApp.open_browser=False --ServerApp.base_url="${PROXY_BASE_PATH}/${HOST}/${SVCPORT}/" --ServerApp.allow_origin='*' --ServerApp.disable_check_xsrf=True --ServerApp.root_dir="${workingDir}" --allow-root
# 如何连接应用
connect:
Expand Down

0 comments on commit a737493

Please sign in to comment.