Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use nbgitpuller to distribute shared files

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to use nbgitpuller to distribute shared files, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

When using JupyterHub, a common requirement is to distribute data and sample code to users / students. In general, we want to enable students / users to:

Easy access to the latest version of experimental data and code

You don't have to worry about losing your homework. Even if the teacher modifies the content, he won't overwrite the students' changes.

There is no need to manually handle merge conflicts or other complex operations

Accordingly, managers / teachers should:

Git is currently the best tool to use modern collaborative version control tools to write and store teaching materials.

Nbgitpuller is a Jupyter Notebook extension that can help achieve the above functions

This tutorial will guide you through creating a magical nbgitpuller link so that JupyterHub users can click on the link to get the latest version of the material directly from the specified git repository.

00 pre-configuration requirements

Use JupyterHub installed with Littlest JupyterHub

Git repository that needs to be distributed

01 generate a nbgitpuller link

Use an Binder-based application to generate links online, as follows:

1. Open the link mybinder.org based application and wait for the application to compile

2. Enter the relevant information in the blank box

Branch: branch of the git project to be pulled

Hub_url: the url of your own server Jupyter Hub

Repo_url: the url of the git project to be pulled

Urlpath: the file path that needs to be pulled from the git project

When the input is complete, you can see that a link is generated below, and users can click on the link to distribute the project to their respective environment.

3. Manually edit the sharing link, which is organized in the following form:

Http:///hub/user-redirect/git-pull?repo=&branch=&subPath=&app=

Links to repo:git projects

Branch: branch of the project. Default is master.

SubPath: the path to the directory / notebook within the project to be started after cloning. Default is to open the root directory of the linked Git repository

App: choose which application view to open (Jupyter Notebook/ Jupyter Lab). This parameter is optional. It defaults to the value of the environment variable NBGITPULLER_APP. If it is not defined, it defaults to Notebook.

UrlPath: if urlPath,app and subPath are specified, they will be overwritten and redirected to the specified path.

At this point, the distribution link is completed, and the link can be shared with users / students in various ways!

02 user clicks the link

1. When the user clicks the link and logs in to Jupyter Hub, you can see the progress bar in the following figure. At this time, remote pull and merge operations are being carried out automatically.

2. Finally, when users enter their own environment, they can see that the project has been placed in the file directory!

On how to use nbgitpuller to distribute shared files to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report