Skip to content

Commit

Permalink
tidy/shorten setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jules32 committed Jun 25, 2024
1 parent 5c5297a commit e8dee33
Showing 1 changed file with 18 additions and 51 deletions.
69 changes: 18 additions & 51 deletions part0-setup.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,41 @@ title: "Setup"
editor: visual
---

## Setup Part 1: Log in to the Hub
## Login to 2i2c JupyterHub

Go to the Hub <https://openscapes.2i2c.cloud> \> log in with your GitHub Account \> select the Python server.
Go to the Openscapes 2i2c JupyterHub <https://openscapes.2i2c.cloud> \> log in with your GitHub Account \> select the Python server.

[![Login page for the NASA Openscapes 2i2c JupyterHub, "the Hub"](images/jupyterhub-2i2c-login.png)](https://openscapes.2i2c.cloud/)
[![Login page for the NASA Openscapes 2i2c JupyterHub, "the Hub"](images/jupyterhub-2i2c-login.png)](https://openscapes.2i2c.cloud/){width="40%"}

![Hub server options](images/jupyterhub-server-options.png)
Click the orange Start button with defaults for Python and resource allocation.

![](images/jupyterhub-loading.png)
![Hub server options - click Start with defaults](images/jupyterhub-server-options.png){width="50%"}

It takes a few minutes for the Hub to load. Please be patient!

While the server starts up, we’ll explore the Quarto Clinic website structure side by side with the repo.

### The website

This Quarto Clinic website has 4 things you can see on the left navbar:

- Welcome
- Setup & Explore
- Lessons
- Next Steps

Most of these are pages, but you'll see that "Lessons" has an arrow `>`; it is a folder with additional pages inside.

### The website's source repo - is this helpful for this clinic?

Let's go to this website's GitHub repository (or "repo"). You can get there from any page in this clinic website by clicking the GitHub Octocat icon underneath the Openscapes logo in the left navbar.
![](images/jupyterhub-loading.png){fig-align="center" width="50%"}

::: callout-tip
To open a link in a new browser tab, hold command on Mac, or control on a PC, then click.
:::

**Have a look at the filenames.** We can recognize the names of the webpages we see (and listed above), and they have red arrows marking them in the image below. Note that most files in this repo are `.qmd` files. These are plain text Quarto files that can combine Markdown text with code. `index.qmd` is the home page. When we click inside the `lessons` folder we see more `.qmd` files and an `images` folder that holds images used in the pages inside the Lessons section of the site.

*TODO: replace screenshots; red arrows for lessons*

![quarto-website-tutorial GitHub repository with files for webpages marked with red arrows](images/quarto-files-github.png){fig-alt="Screenshot of files on GitHub with red arrows identifying the files that we saw in the left sidebar" fig-align="center" width="80%"}

## Setup Part 2: Clone the Quarto Clinic repo

After our Hub server has loaded (Setup Part 1), we'll clone the Quarto Clinic repository into the Hub.
It takes a few minutes for the Hub to load. Please be patient!

**Option A:** In the Hub, use the Git tab to Clone the repo.
## Clone `quarto-clinic` repo

![Clone a GitHub repository in the Hub](images/jupyterhyb-clone-repo.png)
After our Hub server has loaded, we'll clone the Quarto Clinic repository into the Hub. We'll do this using a clickable plugin; you could also do this from the Terminal if you prefer.

**Option B:** In the Hub, do this by opening a terminal (File \> New \> Terminal). In the Terminal, `git clone` your repository and `cd` into it:
In the Hub, use the Git tab to Clone the repo.

``` bash
git clone https://github.com/openscapes/quarto-clinic
cd quarto-clinic
```
![Clone a GitHub repository in the Hub using a clickable plugin](images/jupyterhyb-clone-repo.png){fig-align="center" width="70%"}

### Aside: What is a branch?
## Create a branch

### Create a new branch
Next, we'll create a branch in git/GitHub. Working in a branch means you have your own version of the Quarto Clinic to edit and preview.

Working in a branch means you have your own version of the Quarto Clinic to edit and preview. Later, we'll learn how to contribute your edits to the Main branch of the Clinic by making a "Pull Request" on GitHub.
Branches are like parallel universes where you can safely make changes to source materials without disturbing the original. It is good practice to using branches for small, discrete additions that you will then contribute back to the main branch. In Clinic Part 2, we'll learn how to contribute your edits to the Main branch of the Clinic by making a "Pull Request" on GitHub.

Navigate into the `quarto-clinic` folder (In the Terminal: `cd quarto-clinic)` \> click the Git tab \> New Branch, with branch name = *your name*, to make it easy to identify your work in the exercises that follow.
First, set `quarto-clinic` as your working directory. In the Terminal type `cd quarto-clinic`. (You may need to click on the folder icon at the top-left of the side nav bar to return to the Terminal.)

![Create a branch](images/jupyterhub-git-branch.png)
Next, click the Git plugin tab. Click New Branch (blue rectangle) and enter a new branch name, let's write *your name*, to make it easy to identify your work in the exercises that follow.

In the terminal: `git checkout -b yourname`
![Create a branch](images/jupyterhub-git-branch.png){fig-align="center" width="70%"}

### Set up our Git credentials
## Set up our Git credentials

*TODO: do we need to do [Step 5.1. Configure Git (`git config`)](https://nasa-openscapes.github.io/2021-Cloud-Hackathon/tutorials/00_Setup.html#step-5.1.-configure-git-git-config)? (but ignore the push file part). Clarify the following text to say see the orange dot. click it to be prompted*

Expand All @@ -82,4 +50,3 @@ We'll follow the instructions in the 2021 Cloud Hackathon to [Setup your Persona
## Onward!

Since we have each set up our own GitHub clone with our unique branch of this Quarto Clinic website in the Hub, now we are ready to start editing! The next chapter describes how to do this in the JupyterHub.

0 comments on commit e8dee33

Please sign in to comment.