Skip to content

Commit e34941e

Browse files
authored
Merge pull request #56 from MonashDeepNeuron/dev
HPC Training Book v1.2.1 - Fix to M3 Chapters
2 parents cf14336 + ddb8b45 commit e34941e

File tree

9 files changed

+98
-8
lines changed

9 files changed

+98
-8
lines changed

src/chapter3/challenges.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
1-
# Challenges
1+
# M3 Challenges
22

33
## Challenge 1
44

5-
Something simple to start off. Create a bash script called `hello.sh` that prints "Hello World" to the screen. Submit this job to the queue using `sbatch`. Check the status of the job using `squeue`. Once the job has finished, check the output using `cat`. You can find the output file in the directory you submitted the job from.
5+
Navigate to your scratch directory and, using vim (or your chosen in-terminal editor) create a file called `hello.txt` that contains the text "Hello World". Once you have created the file, use the `cat` command to print the contents of the file to the screen.
66

77
## Challenge 2
88

9-
Something a bit more involved. Clone your [challenges repository](https://github.com/MonashDeepNeuron/HPC-Training-Challenges.git) into your personal folder in the scratch directory. Then, in this same directory, create a submission script that will install python 3.10 using miniconda, create a virtual environment, install the necessary dependencies, and clone and run the `alexnet_stl10.py` script in the M3 section. Remember, don't directly load python using module, follow the instructions in the [software tooling](./software-tooling.md#python) chapter.
10-
Once completed, commit and push your changes as well as the output.
9+
Write a bash script that prints the contents of the above hello.txt file to the screen and run it locally (on your login node).
1110

1211
## Challenge 3
1312

14-
A continuation of challenge 2. Edit your submission script so that you get a gpu node, and run the script using the gpu.
15-
Commit and push your changes as well as the output.
13+
Submit the above script to the queue by writing another SLURM bash script. Check the status of the job using `squeue`. Once the job has finished, check the output using `cat`. You can find the output file in the directory you submitted the job from.
14+
15+
## Challenge 4
16+
17+
Request an interactive node and attach to it. Once you have done this, install python 3.7 using conda.
18+
19+
## Challenge 5
20+
21+
Clone and run [this](./dl_on_m3/alexnet_stl10.py) script. You will need to first install the dependencies for it. You don't need to wait for it to finish, just make sure it is working. You will know its working if it starts listing out the loss and accuracy for each epoch. You can stop it by pressing `ctrl + c`.
22+
23+
Once you have confirmed that it is working, deactivate and delete the conda environment, and then end the interactive session.
24+
25+
> Hint: I have included the dependencies and their versions (make sure you install the right version) in the `requirements.txt` file. You will need python 3.7 to run this script.
26+
27+
## Challenge 6
28+
29+
Go back to the login node. Now you are going to put it all together. Write a bash script that does the following:
30+
31+
- (1) requests a compute node
32+
- (2) installs python using conda
33+
- (3) clones and runs the above script
34+
35+
Let this run fully. Check the output of the script to make sure it ran correctly. Does it match the output of the script you ran in challenge 5?
36+
> Hint: You can check the output of the script at any time by `cat`ing the output file. The script does not need to have finished running for you to do this.
37+
38+
## Challenge 7
39+
40+
Edit your submission script so that you get a gpu node, and run the script using the gpu.
41+
> Hint: Use the m3h partition
42+
43+
## Challenge 8
44+
45+
Now you want to clean up your working directory. First, push your solutions to your challenges repo. Then, delete the challenges directory, as well as the conda environment you created in challenge 6.

src/chapter3/imgs/aaf_strudel.png

243 KB
Loading

src/chapter3/imgs/auth_strudel.png

906 KB
Loading

src/chapter3/imgs/strudel1.png

215 KB
Loading

src/chapter3/imgs/strudel2.png

192 KB
Loading

src/chapter3/imgs/strudel_home.png

362 KB
Loading

src/chapter3/software-tooling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ To create and activate Python environments within Miniconda, follow these steps:
6363
```bash
6464
# Create a new environment
6565
# Change env-name to whatever you want to call your environment
66-
conda create --name env-name python=3.10
66+
conda create --name env-name python=<version>
6767

6868
# Activate the environment
6969
conda activate env-name

src/chapter3/start.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Request an account
44

5-
In order to access M3, you will need to request an account. To do this, follow this link: [HPC ID](https://hpc.erc.monash.edu.au/karaage/aafbootstrap). This should take you to a page this this: ![HPC ID](./imgs/aaf.png)
5+
In order to access M3, you will need to request an account. To do this, follow this link: [HPC ID](https://hpc.erc.monash.edu.au/karaage/aafbootstrap). This should take you to a page this this:
6+
7+
![HPC ID](./imgs/aaf.png)
68

79
Type in Monash, as you can see here. Select Monash University, and tick the Remember my organisation box down the bottom. Once you continue to your organisation, it will take you to the Monash Uni SSO login page. You will need to login with your Monash credentials.
810

@@ -19,3 +21,30 @@ To request to join the MDN project, again from the Home page click on Join Exiti
1921
In the text box type `vf38` and click search. This is the project code for MDN. Then select the project and click submit. You will now have to wait for the project admins to approve your request. Once they have done this, you will be able to access the project. This should not take longer than a few days, and you will get an email telling you when you have access.
2022

2123
Once you have access to everything, you are ready to get started with M3. Good job!!
24+
25+
## Git SSH setup
26+
27+
In order to reliably clone git repos in M3, in particular private ones, it is best practice to use SSH cloning. This is a bit more complicated to set up, but once it is done, it is much more streamlined. There are few steps involved. First, you will need to generate an SSH key on M3. Login to M3, and run the following command:
28+
29+
```bash
30+
ssh-keygen -t ed25519 -C "[email protected]"
31+
```
32+
33+
This will then prompt you to enter a file location. Just press enter to use the default location. It will then ask you to enter a passphrase. This is optional, but recommended.
34+
35+
Once you have generated your key, you need to add it to the ssh agent. Do this by running:
36+
37+
```bash
38+
eval "$(ssh-agent -s)"
39+
ssh-add ~/.ssh/id_ed25519
40+
```
41+
42+
You will then need to copy the public key to your clipboard. You can do this by running:
43+
44+
```bash
45+
cat ~/.ssh/id_ed25519.pub
46+
```
47+
48+
Then, go to your github account, go to settings, and click on the SSH and GPG keys tab. Click on New SSH key, and paste the key into the box. Give it a name, and click Add SSH key.
49+
50+
You should now be able to clone repos using SSH. To do this, go to the repo you want to clone, but instead of copying the HTTP link, copy the SSH link, and then its regular git cloning.

src/chapter3/strudel.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Strudel
2+
3+
STRUDEL is a web application used to connect to M3. There are two main benefits to this over regular ssh. Firstly, you are able to access a desktop session, so you can interact easier with M3, look at graphs, etc.. STRUDEL also enables the use of Jupyter notebooks, which are especially useful for data science and machine learning.
4+
5+
## Accessing STRUDEL
6+
7+
First, go to the [STRUDEL](https://beta.desktop.cvl.org.au/) website. You should see something like this:
8+
9+
![strudel select cvl](imgs/strudel1.png)
10+
11+
Select the CVL option, and you should be taken to another page, where you choose how to log in.
12+
13+
![strudel login](imgs/strudel2.png)
14+
15+
Select AAF. On the next page, search for and select Monash University.
16+
17+
![AAF Login](imgs/aaf_strudel.png)
18+
19+
You will now be taken to the Monash login page. Once you have logged in, it will show one last page, asking permission to use your details. Click allow, and you will be taken to the STRUDEL home page.
20+
21+
![strudel home page](imgs/strudel_home.png)
22+
23+
## Desktop Session
24+
25+
To start a desktop session using STRUDEL, click on the **Desktop** tab on the side, select your desired options, and click launch. Once the session has started, you will be able to attach to it by clicking on the connect button in the *Pending / Running Desktops* section.
26+
27+
## Jupyter Notebooks
28+
29+
Similar to Desktops, if you want a basic Jupyter notebook, click on the **Jupyter Lab** tab, choose how much compute you want, and click launch.
30+
31+
If you want to have a more customised Jupyter notebook, you can do this by first sshing into M3, and activate conda. Then activate the conda environment `jupyterlab`. Install you desired packages in this environment. Once you have done this, go back to STRUDEL, and launch a **Jupyter Lab - BYO** session.

0 commit comments

Comments
 (0)