当前位置:网站首页>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
边栏推荐
- 在Ubuntu上体验最新版本EROFS
- 一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
- VC6 compatibility and open file crash resolution
- Face recognition: attack types and anti spoofing techniques
- Static + code block + polymorphism + exception
- Summary of knowledge points of Jingtao project
- ROS learning: remote start ROS node
- Web安全(四)---XSS攻击
- PerconaXtraDBCluster8.0 最详尽用法指南
- use Xunit.DependencyInjection Transformation test project
猜你喜欢

你的主机中的软件中止了一个已建立的连接。解决方法
![A compilation bug brought by vs2015 Update1 update [existing solutions]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
A compilation bug brought by vs2015 Update1 update [existing solutions]

C expression tree (1)

2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?

VC6兼容性及打开文件崩溃问题解决

More than 50 object detection datasets from different industries

Download, installation and configuration of Sogou input method in Ubuntu

Goland 编写含有template的程序

The instanceof operator in ecmascript7 specification

1. In depth istio: how is sidecar auto injection realized?
随机推荐
Idea - the. IML file was not automatically generated by the project
Qt混合Python开发技术:Python介绍、混合过程和Demo
VC6 compatibility and open file crash resolution
Hand tearing algorithm - handwritten singleton mode
Assembly function MCALL systemstack asmcgocal system call
Privacy violation and null dereference of fortify vulnerability
Ladongo open source full platform penetration scanner framework
Qt混合Python开发技术:Python介绍、混合过程和Demo
关于晋升全栈工程师,从入门到放弃的神功秘籍,不点进来看一看?
C language I blog assignment 03
Web Security (4) -- XSS attack
Speed up your website with jsdelivr
leetcode之判断路径是否相交
The software in your host has terminated an established connection. resolvent
GoLand writes a program with template
Data transmission of asynchronous serial communication controlled by group bus communication
Sentry 安装
Cpp(四) Boost安装及基本使用 for Mac
Got timeout reading communication packets解决方法
数据库基本操作