|
1 | 1 | # Getting started on tutorials |
2 | 2 |
|
3 | | -:::{admonition} Updates in progress |
4 | | -:class: warning |
5 | | - |
6 | | -The resources are actively being updated! Some parts are still out of date, and is the content from last year. In the meantime, please watch out for references to 2020, 2021 ("OHW21") or links that don't work. |
7 | | - |
8 | | -::: |
9 | | - |
10 | 3 | ## Introduction |
11 | 4 |
|
12 | | -Most tutorials will be run live as Jupyter notebooks on the [OceanHackWeek JupyterHub ("The Hub")](https://ocean.hackweek.io/) in your browser. The instructor and and all participants can be running their own copies of the notebooks in their Hub account, with files cloned from the OHW source in GitHub. |
13 | | - |
14 | | -Below are instructions for getting the tutorials started on the the Hub in your browser, and updating the tutorials files with the latest version from GitHub. The schedule of tutorials is available [here](../schedule.md), and links to tutorial materials and some background resources are availabe elsewhere in the Tutorials section. |
15 | | - |
16 | | - |
17 | | -## Pre-Hackweek tutorials |
18 | | - |
19 | | -- **Git and GitHub, including the Git fork - clone "workflow".** [Presentation slides (pdf)](https://github.com/oceanhackweek/ohw-preweek/tree/master/git-github-survival-guide") — [video](https://youtu.be/7nYFRixSV2c) |
20 | | -- **Jupyter and Scientific Python basics: numpy, pandas, matplotlib.** [Jupyter notebooks](https://github.com/oceanhackweek/ohw-preweek/tree/master/data-analysis-modules) — [video](https://youtu.be/CTUAgpvfze0) |
21 | | - |
22 | | - |
23 | | -## Start the Hub in your browser |
24 | | - |
25 | | -### Step 1 |
26 | | -Navigate to the [OceanHackWeek Hub, https://ocean.hackweek.io/](https://ocean.hackweek.io/). |
27 | | - |
28 | | -### Step 2 |
29 | | -Sign in using your GitHub account, if you are not already signed in. (First time only: Grant the OceanHackWeek Organization permissions - this grants you access to the cloud computing environment for the Hackweek.) |
30 | | - |
31 | | -### Step 3 |
32 | | -Start the "Oceanhackweek" computing environement (the Oceanhackweek "image"). It may take up to a minute or so to start up. |
33 | | - |
34 | | - |
35 | | -## Upload (`git clone`) a copy of the `oh20-tutorials` GitHub repository and follow along |
36 | | -This basic workflow allows you to follow along with tutorials with your own live copy of the tutorials notebooks while staying up-to-date with any changes made to the master tutorials repository, [ohw20-tutorials](https://github.com/oceanhackweek/ohw20-tutorials). |
37 | | - |
38 | | -### Shortcut |
39 | | -The first time you try to upload (`git clone`) the `ohw20-tutorials` repository, launch a new terminal, then enter: |
40 | | - |
41 | | -```bash |
42 | | -git clone https://github.com/oceanhackweek/ohw20-tutorials.git |
43 | | -``` |
44 | | - |
45 | | -Now you have a new `ohw20-tutorials` directory under your "home" directory, `/home/jovyan`. You're good to go! |
46 | | - |
47 | | -### Longer description - Step 1 |
48 | | -Navigate to the [tutorial repository on GitHub](https://github.com/oceanhackweek/ohw20-tutorials). |
49 | | - |
50 | | -Clone the tutorial to the Hub environment. You can easily copy the link to a repository by selecting the green "clone or download" dropdown (making sure the pop up says "Clone with HTTPS") and hitting the clipboard icon, which will automatically copy the link for you. |
51 | | - |
52 | | -Launch a terminal using the "plus" sign in the upper left corner of your JupyterHub: |
53 | | - |
54 | | - |
55 | | - |
56 | | -then execute the `git clone` statement: |
57 | | - |
58 | | -```bash |
59 | | -git clone https://github.com/oceanhackweek/ohw20-tutorials.git |
60 | | -``` |
61 | | - |
62 | | -A new `ohw20-tutorials` directory will be created, holding the repository clone. |
63 | | - |
64 | | -<!-- _Note: a more detailed version of step 1, including images, is available as part of the [Preliminary Steps - JupyterHub Connection](https://icesat-2hackweek.github.io/learning-resources/preliminary/jupyterhub/#how-do-i-get-my-code-in-and-out-of-pangeo) --> |
65 | | - |
66 | | -### Step 2 |
67 | | -Follow along by opening and running the tutorial notebooks. You can save changes within your clone (such as edits to a notebook) or add other files, then download a copy to your local machine if you'd like. |
| 5 | +Tutorials will be run live on the [OceanHackWeek JupyterHub ("The Hub"), https://oceanhackweek.2i2c.cloud](https://oceanhackweek.2i2c.cloud) in your browser either as Jupyter notebooks or as scripts and notebooks in RStudio. The instructor and all participants can be running their own copies of the tutorial in their Hub account, with files cloned from the OHW source in GitHub. |
68 | 6 |
|
69 | | -### Step 3 |
70 | | -Update your Hub copy with any changes to the `origin` repository. If you have saved changes within your local copy of the notebook or added other files, this may cause conflicts (*ask us questions if you run into problems!*). Fetch and merge (using `git pull`) the latest changes from the `origin` remote. |
| 7 | +Below are instructions for getting the tutorials started on the the Hub in your browser, and updating the tutorials files with the latest version from the GitHub tutorials repository, [https://github.com/oceanhackweek/ohw-tutorials](https://github.com/oceanhackweek/ohw-tutorials). |
71 | 8 |
|
72 | | -```bash |
73 | | -git pull origin |
74 | | -``` |
| 9 | +The schedule of tutorials is available [here](../../ohw22/schedule.md), and links to tutorial materials and some background resources will be available there as well. |
75 | 10 |
|
76 | | -These instructions assume you're working on the default `master` branch. |
| 11 | +## How do I get the tutorial repository into the Hub? |
77 | 12 |
|
78 | | -**Please note: the OceanHackWeek JupyterHub (the Hub) should not be relied upon to save your files beyond the duration of the hackweek, and will be removed a couple of weeks after the hackweek. Thus, for any non-repository changes or repository changes that have not been pushed to GitHub, you MUST complete Step 3 to save the files to your local machine if you would like continued access to them.** |
| 13 | +For the tutorials, we recommend the use of [nbgitpuller](https://jupyterhub.github.io/nbgitpuller/) to clone and pull the tutorials repository, or update the clone you already have. Use [this magical nbgitpuller link](https://oceanhackweek.2i2c.cloud/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Foceanhackweek%2Fohw-tutorials&urlpath=lab%2Ftree%2Fohw-tutorials%2F&branch=OHW22) to accomplish this clone or update. |
79 | 14 |
|
80 | | ----- |
81 | | -Adapted from [https://icesat-2hackweek.github.io/learning-resources/tutorials/getting_started/](https://icesat-2hackweek.github.io/learning-resources/tutorials/getting_started/). Originally from [https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97](https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97) |
| 15 | +See this [extended discussion](../prep/jupyterhub.md#how-do-i-get-the-tutorial-repository) for more details about `nbgitpuller` and the alternative approach relying on `git` commands and `GitHub` workflows. |
0 commit comments