当前位置:网站首页>Littlest JupyterHub| 02 使用nbgitpuller分发共享文件
Littlest JupyterHub| 02 使用nbgitpuller分发共享文件
2020-11-08 00:43:00 【酱肉包-】
在使用JupyterHub时,一个常见的需求就是给用户/学生分发数据和示例代码,一般而言我们想要使得学生/用户可以:
- 轻松获得最新版本的实验数据和代码
- 不必担心自己的作业丢失,即使老师修改了内容,也不会把学生的修改覆盖
- 不必手动处理合并冲突或其他复杂的操作
相应的,管理者/教师应当:
- 使用现代的协作版本控制工具来编写和存储教学材料,目前Git是最佳的工具
nbgitpuller 是一个Jupyter Notebook扩展,可以帮助实现上述功能
本教程将指导创建一个神奇的nbgitpuller链接,使得JupyterHub的用户可以点击该链接,直接从指定的git repository中获取最新版本的材料
-
00 预先配置要求
- 使用 Littlest JupyterHub安装的JupyterHub
-
需要分发的git仓库
-
01 生成一个nbgitpuller链接
使用一个基于Binder的应用进行链接的在线生成,操作步骤为:
1、打开链接mybinder.org based application,等待应用编译
2、在空白框内输入相关信息
branch:要拉取的git项目的分支
hub_url:自己服务器Jupyter Hub的url
repo_url:要拉取的git项目的url
urlpath:需要从git项目中拉取的文件路径
输入完成后,可以看到下方生成了一个链接,用户通过点击该链接就能把项目分发到各自的环境中
3、手工编辑分享链接,该链接的组织形式为:
http://<my-jhub-address>/hub/user-redirect/git-pull?repo=<your-repo-url>&branch=<your-branch-name>&subPath=<subPath>&app=<notebook | lab>
repo:git项目的链接
branch:项目的分支,默认为master
subPath:克隆后要启动的项目内的目录/笔记本的路径。默认为打开链接的 Git 仓库的根目录
app: 选择在哪个应用视图中打开(Jupyter Notebook/ Jupyter Lab)这个参数是可选的,默认为环境变量NBGITPULLER_APP的值,如果没有定义,则默认为Notebook
urlPath:如果指定了urlPath,app和subPath将会被覆盖,并重定向到指定的路径。
至此,分发链接就制作完成,可以将该链接通过各种方式分享给用户/学生了!
-
02 用户点击链接
1、当用户点击链接并登录Jupyter Hub后,可以看到如下图的进度条,此时正在自动进行远端的拉取和合并等操作
2、最终,用户进入到自己的环境中,可以看到该项目已经被置入文件目录!
下一节打算介绍有关nbgitpuller的具体特性:)
参考链接:
https://tljh.jupyter.org/en/latest/howto/content/nbgitpuller.html
https://github.com/jupyterhub/nbgitpuller#constructing-the-nbgitpuller-url
版权声明
本文为[酱肉包-]所创,转载请带上原文链接,感谢
https://my.oschina.net/jiangroubao/blog/4707788
边栏推荐
猜你喜欢
Basic operation of database
Brief history of computer
[solution] distributed timing task solution
微信昵称emoji表情,特殊表情导致列表不显示,导出EXCEL报错等问题解决!
鼠标变小手
use Xunit.DependencyInjection Transformation test project
微服务的出现和意义的探索
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
QT hybrid Python development technology: Python introduction, hybrid process and demo
手撕算法-手写单例模式
随机推荐
QT hybrid Python development technology: Python introduction, hybrid process and demo
Adobe media encoder / me 2021 software installation package (with installation tutorial)
Ubuntu下搜狗输入法的下载安装及配置
Insight -- the application of sanet in arbitrary style transfer
Hand tearing algorithm - handwritten singleton mode
A compilation bug brought by vs2015 Update1 update [existing solutions]
Windows下子系统Ubuntu安装
Animation techniques and details you may not know
Python image recognition OCR
Search and replace of sed
use Xunit.DependencyInjection Transformation test project
微信小程序request报400错误 @RequestBody接收不到
Qt混合Python开发技术:Python介绍、混合过程和Demo
Got timeout reading communication packets解决方法
团灭 LeetCode 股票买卖问题
Assembly function MCALL systemstack asmcgocal system call
Qt混合Python开发技术:Python介绍、混合过程和Demo
Face recognition: attack types and anti spoofing techniques
来自不同行业领域的50多个对象检测数据集
Getting started with go wire dependency injection