google-cloud-platform - 在 Google Cloud AI Notebook 中使用 Bokeh Server
问题描述
我正在尝试在 Google Cloud AI 笔记本环境中构建和测试一些散景组件。我已经使用这个云实例几个月了,几乎没有问题,但我似乎无法让教程https://docs.bokeh.org/en/latest/docs/user_guide/notebook.html正常工作。有没有人在这种环境中成功使用散景服务器?
该教程似乎不适用于我的用例。遵循和调整此方法时会返回几个 JavaScript 错误。
handler = FunctionHandler(modify_doc)
app = Application(handler)
show(modify_doc, notebook_url=remote_jupyter_proxy_url)
def remote_jupyter_proxy_url(port):
"""
Callable to configure Bokeh's show method when a proxy must be
configured.
If port is None we're asking about the URL
for the origin header.
"""
base_url = URL OF AI NOTEBOOK
host = urllib.parse.urlparse(base_url).netloc
# If port is None we're asking for the URL origin
# so return the public hostname.
if port is None:
return host
service_url_path = NOT A JUPYTER HUB SO UNCLEAR WHAT SHOULD BE HERE
proxy_url_path = 'proxy/%d' % port
user_url = urllib.parse.urljoin(base_url, service_url_path)
full_url = urllib.parse.urljoin(user_url, proxy_url_path)
print(full_url)
return full_url
将前面的代码拼凑在一起时,我在检查笔记本时收到以下消息:
panellayout.js:213 混合内容:“URL”处的页面是通过 HTTPS 加载的,但请求了不安全的脚本“URL”。此请求已被阻止;内容必须通过 HTTPS 提供。
解决方案
推荐阅读
- angular - 指令中带有 HostListener 的 FormArray
- php - 在 DriverException.php 第 33 行找不到 Laravel 5.3 接口 Throwable
- php - 为每个项目选择子集
- python - 如何基于“最新”相关模型优化排序
- jquery - 如何根据点击切换项目?
- reactjs - 如何在下一个js中生成构建文件
- android - 使用意图将图像共享到 applock 保险库
- javascript - Nodejs Try/Catch 块在定义对象后停止执行
- node.js - NodeJS 将 Dtos 映射到 TypeORM 实体
- php - .htaccess 解决相对路径问题