Skip to content

Commit

Permalink
Update episode 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteyn committed Oct 18, 2024
1 parent 94645e7 commit 2962b01
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 28 deletions.
16 changes: 9 additions & 7 deletions episodes/01-intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Building an HPC for Training"
title: "Introduction"
teaching: 10
exercises: 2
exercises:
---

:::::::::::::::::::::::::::::::::::::: questions
Expand Down Expand Up @@ -44,16 +44,18 @@ learners might not be able to log in or there are significant delays in getting
jobs into queues which again affects the timing of the workshop.

All these mentioned issues (and probably more) can be addressed by having a
dedicated HPC for training. But usually "real" HPCs are very expensive.
dedicated HPC for training. But usually "real" HPCs are very expensive and it
wouldn't be feasible to purchase typical high-end HPC hardware just for a
training setup. However, it is completely possible to use low-end hardware to
create a cluster that will run almost all the required software to learn how
to use an HPC.



::::::::::::::::::::::::::::::::::::: keypoints

- Use `.md` files for episodes when you want static content
- Use `.Rmd` files for episodes when you need to generate output
- Run `sandpaper::check_lesson()` to identify any issues with your lesson
- Run `sandpaper::build_lesson()` to preview your lesson locally
- What is an HPC?
- What would be the advantages of having an HPC dedicated to training?

::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down
119 changes: 102 additions & 17 deletions episodes/02-prepareSDCard.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,114 @@
---
title: Introducing the Shell
teaching: 5
exercises: 0
title: "Preparing an SD Card" teaching: 30 exercises: 20
---
:::::::::::::::::::::::::::::::::::::: questions
- Where do you download the Raspberry Pi Imager from?
- Where do you download the CarpentriesOffline image from?
- How do you install the Raspberry Pi imager on your computer?
- What is the CarpentriesOffline image?
- What is the Raspberry Pi Imager used for?
::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::: objectives
- download and install the Raspberry Pi imager
- download and install the CarpentriesOffline image
- write the CarpentriesOffline image to the SD Card
::::::::::::::::::::::::::::::::::::::::::::::::
## Introduction
Every computer needs to load an operating system when you switch it on.
Therefore it will usually have a default place where it will look for an
operating system in the first place. The process of loading the operating system
is called **booting**. In general, if someone tells you to reboot your computer
it means to switch is off and switch it back on again so that the operating
system can be loaded from scratch. In the case of your desktop or laptop
computers you will have a hard drive built into the computer or alternatively
you might be able to boot from a USB device.

::::::::::::::::::::::::::::::::::::::: objectives
In the case of the Raspberry Pi its default booting device is an SD card.
Pre-RPi3 used a mini-SD card but RPi3 and RPi4 use micro-SD cards. SD cards are
available in various capacities, ie. the amount of information that can be
stored on it. A basic operating system for the Pi will probably take about 2GB
but then you will also need space for all the Carpentries lesson files and other
software that you want to make available to the learners.

- Explain how the shell relates to the keyboard, the screen, the operating system, and users' programs.
- Explain when and why command-line interfaces should be used instead of graphical interfaces.
Usually when you buy a RPi you can also buy an SD card with the operating system
pre-loaded. Alternatively you can buy an empty SD card and prepare it yourself.
Preparing the SD card involves downloading an **image** of the operating system
(and there are various versions available), downloading the software, Raspberry
Pi Imager, required for writing the image to the SD card and then using the
software to write the image to the SD card.

::::::::::::::::::::::::::::::::::::::::::::::::::
Internet connectivity might prove to be a problem during this workshop so your
instructor might bring an image along that can be copied or perhaps they will
provide pre-prepared microSD cards.
::: challenge
## Challenge 1: What software do you need to prepare an SD card?
1. Word 2. Excel 3. Raspberry Pi Imager 4. LibreOffice 5. SonicPi
:::::: solution
1. Word cannot be used to prepare an SD card, it is a word processor 3. Excel
cannot be used to prepare an SD card, it is a spreadsheet 4. The correct answer
is *3* 5. LibreOffice is an office suite and connot be used to prepare an SD
card 6. SonicPi is a live coding environment to support computing and music
lessons in schools.
::::::
:::
::: challenge
## Challenge 2: Where would you find the CarpentriesOffline image?
1. On the Raspberry Pi website 2. On The Carpentries website 3. On the
CarpentriesOffline website 4. On the Microsoft website?
:::::: solution
::::::
:::
If you have not already done so you have to download and install the Raspberry
Pi Imager. Using your browser, navigate to the Raspberry Pi [download
page](https://www.raspberrypi.com/software/). You should now be able to select
the download for your operating system. Click on the appropriate link and save
the installation file to your computer. The web page will provide further
information for installing the software on your computer.
Once the installation is complete you should be able to run the Imager which
will open with the following screen:

:::::::::::::::::::::::::::::::::::::::: questions
![The Raspberry Pi Imager](fig/RaspberryPiImager.png){alt='An image of the
Raspberry Pi Imager software intro screen'}

- What is a command shell and why would I use one?
You can now click on the **Choose OS** button which will open a window for
selecting the image you want to write to the SD card. Scroll down to the bottom
where you should find an option **Use custom**. Click on that option:

::::::::::::::::::::::::::::::::::::::::::::::::::
![Selecting an image to write to the SD card](fig/ChooseImage.png){alt='An image
of the RPi Imager software screen for selecting an image to be written to the SD
card'}

Navigate to where you saved the CarpentriesOffline image and select it. Make
sure you have inserted the SD card into your computer. Now click on the **Choose
Storage** button and select the device you want to write the image to:

:::::::::::::::::::::::::::::::::::::::: keypoints
![Select a device to write the image to](fig/SelectDevice.png){alt='An image of the
RPi Imager software screen for selecting the device to be written to'}

- A shell is a program whose primary purpose is to read commands and run other programs.
- This lesson uses Bash, the default shell in many implementations of Unix.
- Programs can be run in Bash by entering commands at the command-line prompt.
- The shell's main advantages are its high action-to-keystroke ratio, its support for automating repetitive tasks, and its capacity to access networked machines.
- A significant challenge when using the shell can be knowing what commands need to be run and how to run them.
Once you have selected the Storage device, click the **WRITE** button. You will
be prompted to overwrite the information on the SD card, click on **YES** to
accept.

::::::::::::::::::::::::::::::::::::::::::::::::::
![Prompt to overwrite the SD card](fig/PromptToOverwrite.png){alt='An image of
the RPi Imager software screen for confirming to overwrite the SD card'}

The image will now be written to the SD card.
![Overwriting the SD card](fig/Writing.png){alt='An image of the RPi Imager
software screen while writing the image to the SD card'}

Once the image has been written to the SD card a **Write Successful** message
will be displayed.

![Write Successful](fig/ImageWritten.png){alt='An image of the RPi Imager
software screen after the image has been written succesfully.'}

You can now remove the SD card from your computer and insert it into the
Raspberry Pi.

::::::::::::::::::::::::::::::::::::: keypoints
- Know where to download the Raspberry Pi Imager from
- Know how to install the Raspberry Pi Imager
- Know where to download the CarpentriesOffline RPi image
- Know how to write the CarpentriesOffline image to an SD card
::::::::::::::::::::::::::::::::::::::::::::::::
[r-markdown]: https://rmarkdown.rstudio.com/
Binary file added episodes/fig/ChooseImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/ImageWritten.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/PromptToOverwrite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/RaspberryPiImager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/SDCards.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/SelectDevice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added episodes/fig/Writing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
site: sandpaper::sandpaper_site
---

This is a new lesson built with [The Carpentries Workbench][workbench].


[workbench]: https://carpentries.github.io/sandpaper-docs

2 changes: 1 addition & 1 deletion learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Setup
---

For this lesson you will need:
The minimum equipment you will need for this lesson would be:

- 2 computers (eg. two Raspberry Pis or laptops), one which will serve as the
login node and one which will be a compute node. These do not need keyboards
Expand Down

0 comments on commit 2962b01

Please sign in to comment.