Skip to content

Commit 2d3bf22

Browse files
authored
Merge pull request CycleCloud#4 from CycleCloud/bugfix/shiran-lab3-updates
Updates, mostly to Lab 3
2 parents aa780ef + 23ca943 commit 2d3bf22

File tree

4 files changed

+411
-375
lines changed

4 files changed

+411
-375
lines changed

Lab1/Tutorial.md

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ for orchestrating HPC clusters in Azure.
66
Please send questions or comments to [the Azure CycleCloud PM team](mailto:askcyclecloud@microsoft.com).
77

88
## Goals
9+
10+
In this lab you will learn how to:
11+
912
* Create a fully functional, configured Azure CycleCloud instance that can be
10-
used for further labs, pilot deployments, etc.
11-
* Learn how to configure and deploy a LAMMPS HPC cluster, one of the standard
13+
used for further labs, pilot deployments, etc.
14+
* Configure and deploy a LAMMPS HPC cluster, one of the standard
1215
cluster types included with Azure CycleCloud.
1316

1417
## Pre-requisites
15-
* Standard lab
16-
[prerequisites](https://github.com/CycleCloud/cyclecloud_tutorials/blob/master/README.md#prerequisites)
17-
18+
19+
* Standard lab [prerequisites](/README.md#prerequisites)
1820

1921
## 1. Starting An Azure CycleCloud Server
2022

@@ -31,7 +33,8 @@ As you follow the steps below, *please keep track of the following*:
3133

3234

3335
### 1.1 Log into (Azure Cloud Shell)[https://shell.azure.com]
34-
```
36+
37+
```sh
3538
Requesting a Cloud Shell.Succeeded.
3639
Connecting terminal...
3740

@@ -43,44 +46,52 @@ ellen@Azure:~$
4346
```
4447

4548
### 1.2 Figure out your username
46-
```
49+
50+
```sh
4751
ellen@Azure:~$ whoami
4852
ellen
4953
ellen@Azure:~$
5054
```
5155

5256
### 1.3 Generate an SSH keypair (if you do not already have one)
57+
5358
* In Cloud Shell, run:
54-
```
55-
ellen@Azure:~$ ssh-keygen -f ~/.ssh/id_rsa -N "" -b 4096
56-
Generating public/private rsa key pair.
57-
Your identification has been saved in /home/ellen/.ssh/id_rsa.
58-
Your public key has been saved in /home/ellen/.ssh/id_rsa.pub.
59-
The key fingerprint is:
60-
SHA256:L8DFLyfXbKQT5PZZFwTGFnAY4ODCtYFyhGhoHFTpbKM ellen@cc-c6733553-7b96c85fb8-hbmlw
61-
The key's randomart image is:
62-
+---[RSA 4096]----+
63-
|+o+.+..+ .oo==+o |
64-
|.= +.oo.=o .oo .|
65-
|o o oo oo.+ o . .|
66-
| = ... o B o . |
67-
| o . o S * * |
68-
| E . * o |
69-
| . . |
70-
| . |
71-
| |
72-
+----[SHA256]-----+
73-
ellen@Azure:~$
74-
```
59+
60+
```sh
61+
ellen@Azure:~$ ssh-keygen -f ~/.ssh/id_rsa -N "" -b 4096
62+
Generating public/private rsa key pair.
63+
Your identification has been saved in /home/ellen/.ssh/id_rsa.
64+
Your public key has been saved in /home/ellen/.ssh/id_rsa.pub.
65+
The key fingerprint is:
66+
SHA256:L8DFLyfXbKQT5PZZFwTGFnAY4ODCtYFyhGhoHFTpbKM ellen@cc-c6733553-7b96c85fb8-hbmlw
67+
The key's randomart image is:
68+
+---[RSA 4096]----+
69+
|+o+.+..+ .oo==+o |
70+
|.= +.oo.=o .oo .|
71+
|o o oo oo.+ o . .|
72+
| = ... o B o . |
73+
| o . o S * * |
74+
| E . * o |
75+
| . . |
76+
| . |
77+
| |
78+
+----[SHA256]-----+
79+
ellen@Azure:~$
80+
```
81+
7582
### 1.4 Retrieve the SSH-pubkey
76-
```
77-
ellen@Azure:~$ cat ~/.ssh/id_rsa.pub
78-
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwIvmC4K/0BUwOBqCsPxw5Ht8qWyDkorrU+gc6cJbohREoMFZkMlGEe2XqIyYTpHAu0ISicZEJ4MoWExPFrrZRqoYAHPrHyNnie9tVR5UMkqzNhs31qEWLtfEBOrcJIsPNdFuvnAqiQnhMQut3Jtamjc3XnMU8kJ3yL/+xIU4vKkQ8XIey+GGowR69oJI37mYKr9jT9dejB4gP2l6JyrVehnOG6QXRtg/gzFgyX08u8wKhuohNIPLlf2VzIXQml69P9PcD3muePIxi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4QeH6d5iQ2p2Z2cVWYbz/DjJNoCF0Cbzp9w1KprpErlrtd1epIGQTUDgx4YhChyrdXQiYCJBJ1jvhJcWfKj6rHz94eTEr6S5W4etP/IuACqKTpmAxQqSdU7NdHZVPH8c6w89JX3DAYRjg0PKVm56Ib6C+kct8M6/NQQeyhi5DM0SGW+T7tBjDxsUQ== ellen@cc-c6733553-7b96c85fb8-hbmlw
87+
ellen@Azure:~$
88+
```
89+
90+
### <a name="1.5"></a>1.5 Create a service principal
91+
8292
Substitute a custom value for `cyclecloudlabs` as the name of your service principal. The name must be unique across all of Azure.
83-
```
93+
94+
```sh
8495
ellen@Azure:~$ az ad sp create-for-rbac --name cyclecloudlabs
8596
{
8697
"appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
@@ -90,7 +101,8 @@ ellen@Azure:~$ az ad sp create-for-rbac --name cyclecloudlabs
90101
"tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
91102
}
92103
```
93-
_Save this output somewhere. You will need it in the section below as well as in future tutorials in this lab._
104+
105+
_Save this output somewhere. You will need it in the section below as well as later in this lab and in other labs._
94106
95107
### 1.6 Deploy Azure CycleCloud
96108
[![Deploy to
@@ -133,10 +145,10 @@ ellen@Azure:~$
133145
like and then click "Next".![First Login](images/cc-first-login.png)
134146
* Accept the End-User License Agreement and click "Next".
135147
* Create an admin user:
136-
- For the User ID, use the same `username` used above in step 1.5. Remember
137-
that this is also the username of your Cloud Shell session.
138-
- Enter a name for the user.
139-
- Enter and confirm a new password that meets the minimum requirements.
148+
* For the User ID, use the same `username` used above in step 1.5. Remember
149+
that this is also the username of your Cloud Shell session.
150+
* Enter a name for the user.
151+
* Enter and confirm a new password that meets the minimum requirements.
140152
141153
![Create Account](images/cc-create-account.png)
142154
@@ -165,7 +177,7 @@ LAMMPS as a solver.
165177
* Click the "Save" button on the bottom to create this cluster.
166178
* Click the "Start" button to provision the cluster resources in Azure.
167179
![CC Cluster Prepared](images/cc-cluster-prepared.png)
168-
- Starting up the cluster for the first time takes about 10 minutess. By
180+
* Starting up the cluster for the first time takes about 10 minutess. By
169181
default, only the master (or "head") node of the cluster is started. Azure
170182
CycleCloud provisions all the necessary network and storage resources needed
171183
by the master node, and also sets up the scheduling environment in the
@@ -174,7 +186,7 @@ LAMMPS as a solver.
174186
for the green status bar before proceeding to the next step.
175187
![CC Cluster Ready](images/cc-cluster-ready.png)
176188
177-
### 2.2 Connecting to the master node and submitting a LAMMPS job
189+
### <a name="2.2"></a> 2.2 Connecting to the master node and submitting a LAMMPS job
178190
179191
The SSH public key you specified as part of the deployment is stored in the Azure CycleCloud application server and pushed into each cluster that you create. As a result, you can use your SSH private key to log into the
180192
master node.

Lab2/Tutorial.md

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,26 @@ concepts such as projects and cluster template management.
99
Please send questions or comments to [the Azure CycleCloud PM team](mailto:askcyclecloud@microsoft.com).
1010

1111
## Goals
12-
By the end of this lab, we will cover:
13-
* Installing and configuring the Azure CycleCloud `cyclecloud` CLI tool
14-
* Creating a new CycleCloud project, a way of configuring and customizing a
12+
13+
In this lab you will learn how to:
14+
15+
* Install and configure the Azure CycleCloud `cyclecloud` CLI tool
16+
* Create a new CycleCloud project, a way of configuring and customizing a
1517
CycleCloud cluster
16-
* Modifying a cluster template to add storage to the cluster's NFS server
17-
* Importing the modified cluster template into CycleCloud in order to add a new
18-
cluster type
19-
* Starting the new cluster type, and verifying that the persistent storage has been
20-
added to the file system
18+
* Modify a cluster template to add storage to the cluster's NFS server
19+
* Import cluster templates into CycleCloud in order to add new cluster type
20+
* Create a new cluster from a custom cluster type, start it, and verify that the persistent storage has been added to the file system
2121

2222
## Pre-requisites
23+
2324
* Standard lab
2425
[prerequisites](https://github.com/CycleCloud/cyclecloud_tutorials/blob/master/README.md#prerequisites)
2526

2627
## 3. Modifying a cluster template
28+
2729
Azure CycleCloud's cluster types are great for standard use cases. But
2830
occassionally users find themselves needing to customize the clusters for more
29-
advanced or differently configured deployments.
31+
advanced or differently configured deployments.
3032

3133
A common customization is adding managed disks to a VM in a
3234
compute cluster. By default, in most Azure CycleCloud clusters the master nodes
@@ -45,10 +47,11 @@ environment. Once again, we will use the [Azure Cloud Shell](https://shell.azure
4547
as our shell environment.
4648

4749
### 3.1 Installing and setting up the Azure CycleCloud CLI
50+
4851
* If you are still logged onto the LAMMPS master node from the [previous lab](/Lab1/Tutorial.md),
4952
return to Cloud Shell by running the `exit` command.
5053

51-
```
54+
```sh
5255
[ellen@ip-0A000404 ~]$ exit
5356
logout
5457
Connection to 40.114.123.148 closed.
@@ -57,7 +60,8 @@ as our shell environment.
5760

5861
* Download the CycleCloud command line installer into the Cloud Shell
5962
environment by running the following command from the prompt:
60-
```
63+
64+
```sh
6165
ellen@Azure:~$ wget https://cyclecloudarm.blob.core.windows.net/cyclecloudrelease/7.5.0/cyclecloud-cli.zip
6266
--2018-08-02 21:48:30-- https://cyclecloudarm.blob.core.windows.net/cyclecloudrelease/7.5.0/cyclecloud-cli.zip
6367
Resolving cyclecloudarm.blob.core.windows.net (cyclecloudarm.blob.core.windows.net)... 52.239.154.132
@@ -71,8 +75,10 @@ as our shell environment.
7175
2018-08-02 21:48:31 (112 MB/s) - ‘cyclecloud-cli.zip’ saved [4546572/4546572]
7276
ellen@Azure:~$
7377
```
78+
7479
* Unzip the file:
75-
```
80+
81+
```sh
7682
ellen@Azure:~$ unzip cyclecloud-cli.zip
7783
Archive: cyclecloud-cli.zip
7884
creating: cyclecloud-cli-installer/
@@ -93,18 +99,20 @@ as our shell environment.
9399
inflating: cyclecloud-cli-installer/packages/pogo-sdist.tar.gz
94100
ellen@Azure:~$
95101
```
96-
* Change into the unzipped install directory, and run the install script
97-
```
102+
103+
* Change into the unzipped install directory, and run the install script
104+
105+
```sh
98106
ellen@Azure:~$ cd cyclecloud-cli-installer
99107
ellen@Azure:~/cyclecloud-cli-installer$ ./install.sh
100108
cyclecloud and pogo commands have been installed to /home/ellen/bin
101109
ellen@Azure:~/cyclecloud-cli-installer$
102110
```
103111

104-
- If you receive the error `'/home/ellen/bin' not found in your PATH
112+
* If you receive the error `'/home/ellen/bin' not found in your PATH
105113
environment variable. Make sure to update it`, you can fix it as follows:
106114

107-
```
115+
```sh
108116
ellen@Azure:~$ echo $PATH
109117
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/opt/mssql-tools/bin
110118
ellen@Azure:~$ export PATH=~/bin:$PATH
@@ -116,15 +124,15 @@ as our shell environment.
116124

117125
The Azure CycleCloud CLI communicates with the server over a REST API. To use
118126
it you first have to initialize it using the `initialize` command.
119-
- The CycleServer URL is the FQDN of your application
127+
* The CycleServer URL is the FQDN of your application
120128
server set up in [Lab 1 Section 1.7](/Lab1/Tutorial.md#1.7).
121-
- The installed Azure CycleCloud server uses either a Let's Encrypt SSL
129+
* The installed Azure CycleCloud server uses either a Let's Encrypt SSL
122130
certificate or a self-signed certificate. Type `yes` when asked if you allow an
123131
untrusted certificate.
124-
- The CycleServer username is the one use to log into the CycleCloud web portal.
125-
- The CycleServer password is the password for the user above.
132+
* The CycleServer username is the one use to log into the CycleCloud web portal.
133+
* The CycleServer password is the password for the user above.
126134
127-
```
135+
```sh
128136
ellen@Azure:~$ cyclecloud initialize
129137
CycleServer URL: [http://localhost:8080] https://{FQDN}
130138
Detected untrusted certificate. Allow?: [no] yes
@@ -145,7 +153,8 @@ as our shell environment.
145153
146154
* Verify that the CycleCloud CLI works using the `show_cluster` command. The command
147155
should display the LAMMPS cluster you created in [Lab 1](/Lab1/Tutorial.md#2.1).
148-
```
156+
157+
```sh
149158
ellen@Azure:~$ cyclecloud show_cluster
150159
--------------------
151160
LammpsLabs : started
@@ -155,9 +164,10 @@ as our shell environment.
155164
master: Started e6e008a1259743f8406967a023633a6a 40.114.123.148 (10.0.4.4)
156165
Total nodes: 1
157166
ellen@Azure:~$
158-
```
167+
```
168+
169+
### <a name="3.2"></a> 3.2 Creating a new CycleCloud Project
159170
160-
### 3.2 Creating a new CycleCloud Project
161171
Azure CycleCloud clusters are defined using text files. To take a look at one of
162172
these, use the CycleCloud CLI to create a new project, and generate a template
163173
from it.
@@ -166,13 +176,13 @@ from it.
166176
167177
Create a parent directory for cyclecloud
168178
projects, then create a new project with the `cyclecloud project init`
169-
command.
179+
command.
170180
171-
- In the example below, the project is named `azurecyclecloud_labs`.
172-
- When asked for the `Default Locker`, specify `azure-storage`. This was
181+
* In the example below, the project is named `azurecyclecloud_labs`.
182+
* When asked for the `Default Locker`, specify `azure-storage`. This was
173183
created for you during deployment.
174184
175-
```
185+
```sh
176186
ellen@Azure:~$ mkdir ~/cyclecloud_projects/
177187
ellen@Azure:~$ cd ~/cyclecloud_projects/
178188
ellen@Azure:~/cyclecloud_projects$ cyclecloud project init azurecyclecloud_labs
@@ -192,29 +202,36 @@ from it.
192202
to modify the file but you can use another editor (such as `vi` or `emacs`).
193203
194204
Add the line `type = application` into `project.ini` and save the changes.
195-
```
205+
206+
```sh
196207
ellen@Azure:~/cyclecloud_projects$ cd ./azurecyclecloud_labs
197208
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$ code .
198209
```
210+
199211
![Edit Project File](images/cloudshell-editor-project-ini.png)
200212
201213
### 3.3 Generate a new cluster template file
214+
202215
* Run the following command to create a new cluster template. The last argument
203216
is the output file that will contain our new template.
204217
205-
```
218+
```sh
206219
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$ cyclecloud project generate_template templates/pbs_extended_nfs.template.txt
207220
Cluster template written to templates/pbs_extended_nfs.template.txt
208221
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$
209222
```
210223
211224
### 3.4 Add volumes to the NFS server in the template
225+
212226
* Open the generated template file in an editor:
213-
```
227+
228+
```sh
214229
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$ code templates/pbs_extended_nfs.template.txt
215230
```
231+
216232
* After line 44, add the following blocks:
217-
```INI
233+
234+
```ini
218235
# Add 2 premium disks in a RAID 0 configuration to the NFS export
219236
[[[volume nfs-1]]]
220237
Size = 512
@@ -233,6 +250,7 @@ from it.
233250
fs_type = ext4
234251
raid_level = 0
235252
```
253+
236254
* Save the changes. The template file should now look like this: ![Edit Cluster Template](images/edit-cluster-template.png)
237255
238256
These 15 lines express that two premium disks (`SSD = True`) of 512GB each
@@ -247,8 +265,10 @@ from it.
247265
[More information about customizing volumes and mounts in a CycleCloud cluster.](https://docs.microsoft.com/en-us/azure/cyclecloud/attach-storage)
248266
249267
### 3.5 Import the new cluster template
268+
250269
* Using the CycleCloud CLI, import the template into the application server:
251-
```
270+
271+
```sh
252272
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$ cyclecloud import_template -f templates/pbs_extended_nfs.template.txt
253273
Importing default template in templates/pbs_extended_nfs.template.txt....
254274
---------------------------------
@@ -260,10 +280,12 @@ from it.
260280
Total nodes: 1
261281
ellen@Azure:~/cyclecloud_projects/azurecyclecloud_labs$
262282
```
283+
263284
* You should now see a new cluster type in the Azure CycleCloud UI:
264285
![New Cluster Type](images/new-application-cluster.png)
265286
266287
### 3.6 Start the cluster
288+
267289
* Follow the procedure in [Section 2 from Lab 1](/Lab1/Tutorial.md#2.1) to start
268290
a new cluster based on this new cluster type. Note that you must select a
269291
"Master VM Type" that supports attached premium storage, such as
@@ -272,7 +294,7 @@ from it.
272294
* After the cluster is started, log into the master node and verify that
273295
`/mnt/exports` is a 1TB volume:
274296
275-
```
297+
```sh
276298
[ellen@ip-0A000405 ~]$ df -H /mnt/exports
277299
Filesystem Size Used Avail Use% Mounted on
278300
/dev/mapper/vg_cyclecloud_nfs-lv0 1.1T 80M 1.1T 1% /mnt/exports

0 commit comments

Comments
 (0)