我来告诉你我的申请 .
我想做的事 :
-
我的前端通过一些url params(如http://x.x.x.x/?notebook-name=normalisation_script.ipynb&open-type=open_extisting_notebook&project-id=1111&user=user_one&token=345678654567890989765435hbgt654567yt)向某个URL发出get请求
-
我的pod获取上述请求并告诉kubernetes启动用户pod应该将URL params设置为docker容器中的环境变量 .
-
Docker入口点脚本使用这些env变量来选择要运行的任务 .
我必须在iframe中打开我的笔记本,所以它应该绕过登录等所有步骤并启动服务器 .
我在更新其入口点后使用docker-stack / datascience-notebook图像 .
我现在做了什么:
-
通过遵循零到jupyterhub-with-kubernetes文档,我能够在谷歌 Cloud 平台上托管jupyterhub服务器(零到jupyterhub-with-kubernetes文档使用jupyterhub / jupyterhub头盔图来在kubernetes上部署应用程序) .
-
我使用TmpAuthentication绕过登录和启动服务器 . 现在,我在extraEnv中为helm-chart config.yaml文件定义了我的env变量 .
我的头盔图配置文件看起来像这样 .
hub:
cookieSecret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
extraConfig: |
import tmpauthenticator
c.JupyterHub.authenticator_class = tmpauthenticator.TmpAuthenticator
c.Authenticator.auto_login = True
proxy:
secretToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
cull:
timeout: 60
every: 30
singleuser:
storage:
type: none
image:
name: kushalgupta/datascience-notebook
tag: '0.35'
extraEnv:
POLLY_FUNC: "open_new_notebook"
POLLY_NOTEBOOK_NAME: "my-notebook-custom-on-gcloud"
POLLY_PROJECT_ID: 1172
POLLY_TYPE: "http://testpolly.elucidata.io"
需要帮助:
-
只需点击这样的网址即可在浏览器中打开笔记本http://x.x.x.x/?notebook-name=normalisation_script.ipynb&open-type=open_extisting_notebook&project-id=1111&user=user_one&token=345678654567890989765435hbgt654567yt
-
将这些URL参数设置为docker容器中的env变量 .
我是后端技术的新手,不知道如何做到这一点 . 任何人都可以知道或有一些想法如何实现这一目标 . 谢谢 .