|
|
|
@ -14,7 +14,7 @@ module JupyterService
|
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info "test_juypter: #{res}"
|
|
|
|
|
|
|
|
|
|
@shixun_jupyter_port = res['port']
|
|
|
|
@ -35,7 +35,8 @@ module JupyterService
|
|
|
|
|
@shixun_jupyter_port
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def jupyter_url_with_game(game)
|
|
|
|
|
|
|
|
|
|
def _open_game_jupyter(game)
|
|
|
|
|
## 打开tpi
|
|
|
|
|
shixun = game.myshixun.shixun
|
|
|
|
|
|
|
|
|
@ -53,6 +54,8 @@ module JupyterService
|
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@game_jupyter_port = res['port']
|
|
|
|
|
|
|
|
|
|
repo_save_path = game.myshixun.repo_save_path
|
|
|
|
|
|
|
|
|
|
"https://#{res['port']}.jupyter.educoder.net/notebooks/data/workspace/myshixun_#{tpiID}/#{repo_save_path}/01.ipynb"
|
|
|
|
@ -60,6 +63,17 @@ module JupyterService
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def jupyter_url_with_game(game)
|
|
|
|
|
_open_game_jupyter(game)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def jupyter_port_with_game(game)
|
|
|
|
|
if @game_jupyter_port.to_i <=0
|
|
|
|
|
_open_game_jupyter(shixun)
|
|
|
|
|
end
|
|
|
|
|
@game_jupyter_port
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def jupyter_save_with_shixun(shixun,jupyter_port)
|
|
|
|
|
author_name = current_user.real_name
|
|
|
|
|
author_email = current_user.git_mail
|
|
|
|
|