jupyterlab heroku扩展的服务器扩展
jupyterlab-heroku的Python项目详细描述
朱庇特实验室Heroku
jupyterlab扩展,用于管理应用程序并将其部署到heroku。
扩展支持voila仪表板的单击式部署
要求
创建Heroku帐户
如果您已经有一个heroku帐户,可以跳到下一节。
您可以按照以下说明创建新的Heroku帐户: https://signup.heroku.com/
安装Heroku客户端
您需要在计算机上安装heroku
客户端才能部署应用程序。要设置它:
https://devcenter.heroku.com/articles/getting-started-with-python#set-up
安装完成后,使用以下命令测试安装:
$ heroku --version
heroku/7.26.2 linux-x64 node-v11.14.0
登录Heroku
登录Heroku有不同的方式:
heroku login
将打开一个新的浏览器选项卡以使用电子邮件和密码登录- 使用api标记创建一个
~/.netrc
文件(有关详细信息,请参见the documentation) - 设置
HEROKU_API_KEY
环境变量
测试身份验证:heroku apps
其他依赖项
此扩展还需要:
- 朱庇特实验室1.0
git
安装
pip install jupyterlab-heroku
jupyter serverextension enable --sys-prefix --py jupyterlab_heroku
jupyter labextension install jupyterlab-heroku
由于heroku使用git
来部署应用程序,因此还建议为jupyterlab安装jupyterlab-git
扩展:
pip install jupyterlab-git
jupyter serverextension enable --sys-prefix --py jupyterlab_git
jupyter labextension install @jupyterlab/git
贡献
安装
# Clone the repo to your local environment# Move to jupyterlab-heroku directory# Create a new conda environment conda create -n jupyterlab-heroku -c conda-forge jupyterlab nodejs # Install the server extension python -m pip install -e . jupyter serverextension enable --sys-prefix --py jupyterlab_heroku # Install dependencies jlpm # Build Typescript source jlpm build # Link your development version of the extension with JupyterLab jupyter labextension link . # Rebuild Typescript source after making changes jlpm build # Rebuild JupyterLab after making any changes jupyter lab build
您可以监视源目录并在监视模式下运行JupyterLab,以监视扩展源中的更改并自动重新生成扩展和应用程序
# Watch the source directory in another terminal tab jlpm watch # Run jupyterlab in watch mode in one terminal tab jupyter lab --watch
卸载
jupyter labextension uninstall jupyterlab-heroku