Skip to content

Commit 38d9018

Browse files
authored
Merge pull request #1 from Yolo1105/gh-pages
add new features in 1,2,3,5, and edit some attributes to nyu
2 parents 6ed5fb9 + 8bdff10 commit 38d9018

File tree

4 files changed

+200
-31
lines changed

4 files changed

+200
-31
lines changed

_episodes/01-connecting.md

+117-12
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,57 @@ objectives:
1010
- Connect to a remote HPC system.
1111
keypoints:
1212
- To connect to a remote HPC system using SSH and a password,
13-
run `ssh [email protected]`.
13+
run `ssh <NetID>@greene.hpc.nyu.edu`.
1414
- To connect to a remote HPC system using SSH and an SSH key,
15-
run `ssh -i ~/.ssh/key_for_remote_computer [email protected]`.
15+
run `ssh -i ~/.ssh/key_for_remote_computer <NetID>@greene.hpc.nyu.edu`.
1616
---
1717

18+
## Prerequisites
19+
To access the Greene HPC cluster, you must be connected to the NYU network. If you are physically on campus and connected via a wired connection in your office or through NYU's WiFi, you can directly SSH into the clusters without any additional steps. However, if you are off-campus or working remotely, connecting through the NYU VPN or using the gateway servers is required to establish a secure connection to the HPC systems.
20+
21+
### Remote Connections with the NYU VPN & HPC Gateway Server
22+
If you are connecting from a remote location that is not on the NYU network (your home for example), you have two options:
23+
24+
1. VPN Option: set up your computer to use the NYU VPN. Once you've created a VPN connection, you can proceed as if you were connected to the NYU net.
25+
26+
2. Gateway Option: go through our gateway servers (example below). Gateways are designed to support only a very minimal set of commands and their only purpose is to let users connect HPC systems without needing to first connect to the VPN.
27+
28+
### Log into the Greene Cluster
29+
NYU Campus: From within the NYU network, that is, from an on-campus location, or after you VPN inside NYU's network, you can login to the HPC clusters directly.
30+
31+
Off-campus: The host name of Greene is 'greene.hpc.nyu.edu'. Logging in to Greene is the two-stage process. The HPC clusters (Greene) are not directly visible to the internet (outside the NYU Network). If you are outside NYU's Network (off-campus) you must first login to a bastion host named gw.hpc.nyu.edu.
32+
33+
From within the NYU network, that is, from an on-campus location, or after you VPN inside NYU's network, you can log in to the HPC clusters directly. You do not need to log in to the bastion host.
34+
35+
To log in to the HPC cluster (Greene), simply use:
36+
37+
```bash
38+
ssh <NYUNetID>@greene.hpc.nyu.edu
39+
```
40+
41+
For access from Windows stations using PuTTY, please [click here](#).
42+
43+
To connect to VPN from Linux/MAC, please [click here](#).
44+
45+
From an off-campus location (outside NYU-NET), logging in to the HPC clusters is a two-step process:
46+
47+
1. First, log in to the bastion host, `gw.hpc.nyu.edu`. From a Mac or Linux workstation, this is a simple terminal command (replace `<NYUNetID>` with your NetID). Your password is the same password you use for NYU Home:
48+
49+
```bash
50+
ssh <NYUNetID>@gw.hpc.nyu.edu
51+
```
52+
53+
Windows users will need to use PuTTY, see [here](#) for instructions.
54+
55+
2. Next, log in to the cluster. For Greene, this is done with:
56+
57+
```bash
58+
ssh <NYUNetID>@greene.hpc.nyu.edu
59+
```
60+
61+
1862
## Opening a Terminal
63+
Accessing the Greene HPC cluster is primarily done through the Command Line Interface (CLI). A CLI provides a text-based environment that allows users to manage files, run programs, and navigate directories via command input. On macOS, the built-in CLI tool is Terminal, while Windows 10 users can leverage the Windows Subsystem for Linux (WSL) for similar functionality. Additionally, a popular tool for connecting to Linux servers from Windows is PuTTY, a free SSH client.
1964

2065
Connecting to an HPC system is most often done through a tool known as "SSH"
2166
(Secure SHell) and usually SSH is run through a terminal. So, to begin using an
@@ -37,6 +82,17 @@ then a quick search on the Internet for "how to open a terminal window in" with
3782
your particular Linux flavour appended to the end should quickly give you the
3883
directions you need.
3984

85+
To connect to the gateway servers, simply open a terminal application and enter the following command:
86+
```bash
87+
ssh <NetID>@gw.hpc.nyu.edu
88+
```
89+
90+
After typing in your password you will be logged in to the cluster. Once this connection is established, you can make one more hop and connect to one of the HPC clusters:
91+
```bash
92+
# this will connect you to Greene HPC cluster
93+
ssh <NetID>@greene.hpc.nyu.edu
94+
```
95+
4096
### Mac
4197

4298
Macs have had a terminal built in since the first version of OS X since it is
@@ -48,6 +104,19 @@ of results (it will look like a tiny, black computer screen) and you will be
48104
presented with a terminal window. Alternatively, you can find Terminal under
49105
"Utilities" in the Applications menu.
50106

107+
To connect to the gateway servers, simply open a terminal application and enter the following command:
108+
109+
```bash
110+
ssh <NetID>@gw.hpc.nyu.edu
111+
```
112+
113+
After typing in your password you will be logged in to the cluster. Once this connection is established, you can make one more hop and connect to one of the HPC clusters:
114+
115+
```bash
116+
# this will connect you to Greene HPC cluster
117+
ssh <NetID>@greene.hpc.nyu.edu
118+
```
119+
51120
### Windows
52121

53122
While Windows does have a command-line interface known as the "Command Prompt"
@@ -80,6 +149,8 @@ it is easy to add plug-ins or remove the software. The installer edition adds
80149
MobaXterm to your Windows installation and menu as any other program you might
81150
install. If you are not sure that you will continue to use MobaXterm in the
82151
future, the portable edition is likely the best choice for you.
152+
MobaKeyGen, see the MoabXterm
153+
[documentation](https://mobaxterm.mobatek.net/documentation.html)
83154

84155
Download the version that you would like to use and install it as you would any
85156
other software on your Windows installation. Once the software is installed you
@@ -107,6 +178,8 @@ PuTTY is available for free download from
107178
Download the version that is correct for your operating system and install it
108179
as you would other software on your Windows system. Once installed it will be
109180
available through the start menu or similar.
181+
puttygen, see the Putty
182+
[documentation](https://www.chiark.greenend.org.uk/~sgtatham/putty/docs.html)
110183

111184
Running PuTTY will not initially produce a terminal but instead a window full
112185
of connection options. Putting the address of the remote system in the "Host
@@ -128,6 +201,47 @@ For those logging in with PuTTY it would likely be best to cover the terminal
128201
basics already mentioned above before moving on to navigating the remote
129202
system.
130203

204+
### Open OnDemand (Web-based Graphical User Interface)
205+
Open OnDemand is an open source project funded by the National Science Foundation (NSF). Open OnDemand is designed to create easier access to users to interface with HPC systems. Originally developed by Ohio Supercomputer Center (OSC), used by many universities around the world, and now servicing the NYU Greene HPC cluster.
206+
207+
Open OnDemand has a variety of convenient tools to manage files, access the command line, manage and monitor jobs, and launch interactive applications, such as Jupyter Notebooks, RStudio sessions, and even full Linux Desktops.
208+
209+
Features Include:
210+
211+
Easy file management - upload and download files, view HTML and pictures without downloading
212+
213+
Command-line shell access without any SSH client locally installed
214+
215+
Job management and monitoring
216+
217+
Full Linux desktop experience without X11
218+
219+
Interactive Apps such as JupyterHub and RStudio without the need for port forwarding
220+
221+
Open OnDemand (OOD) is accessible to all users with a valid NYU HPC account while on-campus network or through a VPN.
222+
223+
To access OOD visit: https://ood.hpc.nyu.edu (VPN Required)
224+
225+
#### Access the Shell
226+
227+
Under the clusters menu you can select the Greene Shell Access option to access the Linux shell. No local SSH client is required.
228+
229+
#### Interactive Applications
230+
231+
GUI based applications are accessible without the need for port or X11 forwarding. Select the Interactive Apps menu, select the desired application, and submit the job based on required resources and options.
232+
233+
#### Troubleshooting Connections to Open OnDemand
234+
235+
A common issue that can occur is receiving an error that the Open OnDemand page cannot be reached. Sometimes this can indicate that the service is down, but often this is an issue with the the local browser cache. You can test this by opening a private browser window and seeing if https://ood.hpc.nyu.edu will load. If it does, try deleting the cache for https://ood.hpc.nyu.edu in your browser history to resolve this issue.
236+
237+
In Chrome, this can be done by navigating to this page in your settings:
238+
239+
chrome://settings/content/all?searchSubpage=ood.hpc.nyu.edu&search=site+data
240+
241+
The link above will automatically search for the Open OnDemand site data and cookies. You can then simply click on the trashcan icon to delete the site cache.
242+
243+
Once done, try navigating again to https://ood.hpc.nyu.edu and the site should load. For other issues please email [email protected].
244+
131245
## Creating an SSH key
132246

133247
SSH keys are an alternative method for authentication to obtain access to
@@ -207,15 +321,6 @@ to provide.
207321
> [Secure Secure Shell](https://stribika.github.io/2015/01/04/secure-secure-shell.html).
208322
{: .callout}
209323

210-
211-
### Windows
212-
213-
On Windows you can use
214-
- puttygen, see the Putty
215-
[documentation](https://www.chiark.greenend.org.uk/~sgtatham/putty/docs.html)
216-
- MobaKeyGen, see the MoabXterm
217-
[documentation](https://mobaxterm.mobatek.net/documentation.html)
218-
219324
## Logging onto the system
220325

221326
With all of this in mind, let's connect to a remote HPC system. In this
@@ -227,7 +332,7 @@ example computer, we will use SSH (if you are using PuTTY, see above).
227332

228333
SSH allows us to connect to UNIX computers remotely, and use them as if they
229334
were our own. The general syntax of the connection command follows the format
230-
`ssh -i ~/.ssh/key_for_remote_computer [email protected]`
335+
`ssh -i ~/.ssh/key_for_remote_computer <NetID>@greene.hpc.nyu.edu`
231336
when using SSH keys and `ssh [email protected]` if only
232337
password access is available. Let's attempt to connect to the HPC system
233338
now:

_episodes/02-navigation.md

+32-18
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ happened yet, and we're not going to be able to do anything until we learn a
2323
few basic commands. By the end of this lesson, you will know how to "move
2424
around" the system and look at what's there.
2525

26+
27+
## System Architecture
28+
Files Systems for usage:
29+
30+
The NYU HPC clusters have multiple file systems for user's files. Each file system is configured differently to serve a different purpose.
31+
32+
| Space | Environment Variable | Space Purpose | Flushed | Allocation (per user) |
33+
|-----------|----------------------|-------------------------------------------------------------------------------|-------------------------------------------------|-----------------------|
34+
| /home | $HOME | Program development space; storing small files you want to keep long term, e.g. source code, scripts. | NO | 20 GB |
35+
| /scratch | $SCRATCH | Computational workspace. Best suited to large, infrequent reads and writes. | YES. Files not accessed for 60 days are deleted. | 5 TB |
36+
| /archive | $ARCHIVE | Long-term storage | NO | 2 TB |
37+
| /beegfs | $BEEGFS | Computational workspace, workflows with many small files. | YES. Files not accessed for 60 days are deleted. | 2 TB |
38+
39+
2640
Right now, all we see is something that looks like this:
2741

2842
~~~
@@ -45,7 +59,7 @@ $ whoami
4559
~~~
4660
{: .language-bash}
4761
~~~
48-
yourUsername
62+
<NetID>
4963
~~~
5064
{: .output}
5165

@@ -61,7 +75,7 @@ stands for "print working directory"). ("Directory" is another word for
6175
"folder"). At any moment, our **current working directory** (where we are) is
6276
the directory that the computer assumes we want to run commands in unless we
6377
explicitly specify something else. Here, the computer's response is `{{
64-
site.workshop_host_homedir }}/yourUsername`, which is ``yourUsername`` **home
78+
site.workshop_host_homedir }}/<NetID>`, which is ``<NetID>`` **home
6579
directory**. Note that the location of your home directory may differ from
6680
system to system.
6781

@@ -70,7 +84,7 @@ $ pwd
7084
~~~
7185
{: .language-bash}
7286
~~~
73-
{{ site.workshop_host_homedir }}/yourUsername
87+
{{ site.workshop_host_homedir }}/<NetID>
7488
~~~
7589
{: .output}
7690

@@ -135,7 +149,7 @@ $ pwd
135149
{: .output}
136150
137151
What is the `~` character? When using the shell, `~` is a shortcut that
138-
represents `{{ site.workshop_host_homedir }}/yourUserName`.
152+
represents `{{ site.workshop_host_homedir }}/<NetID>`.
139153
140154
Now that we know how to use `cd`, we can go anywhere. That's a lot of
141155
responsibility. What happens if we get "lost" and want to get back to where we
@@ -144,7 +158,7 @@ started?
144158
To go back to your home directory, the following three commands will work:
145159
146160
```
147-
$ cd {{ site.workshop_host_homedir }}/yourUserName
161+
$ cd {{ site.workshop_host_homedir }}/<NetID>
148162
$ cd ~
149163
$ cd
150164
```
@@ -224,8 +238,8 @@ $ pwd
224238
{: .language-bash}
225239
226240
```
227-
{{ site.workshop_host_homedir }}/yourUserName/documents
228-
{{ site.workshop_host_homedir }}/yourUserName
241+
{{ site.workshop_host_homedir }}/<NetID>/documents
242+
{{ site.workshop_host_homedir }}/<NetID>
229243
```
230244
{: .output}
231245
@@ -259,7 +273,7 @@ $ ls -l
259273
```
260274
{: .language-bash}
261275
```
262-
drwxr-xr-x 2 yourUsername tc001 4096 Jan 14 17:31 documents
276+
drwxr-xr-x 2 <NetID> tc001 4096 Jan 14 17:31 documents
263277
```
264278
{: .output}
265279
@@ -277,15 +291,15 @@ $ ls -l -a
277291
```
278292
{{ site.workshop_host_prompt }} ls -la
279293
total 36
280-
drwx--S--- 5 yourUsername tc001 4096 Nov 28 09:58 .
294+
drwx--S--- 5 <NetID> tc001 4096 Nov 28 09:58 .
281295
drwxr-x--- 3 root tc001 4096 Nov 28 09:40 ..
282-
-rw-r--r-- 1 yourUsername tc001 18 Dec 6 2016 .bash_logout
283-
-rw-r--r-- 1 yourUsername tc001 193 Dec 6 2016 .bash_profile
284-
-rw-r--r-- 1 yourUsername tc001 231 Dec 6 2016 .bashrc
285-
drwxr-sr-x 2 yourUsername tc001 4096 Nov 28 09:58 documents
286-
-rw-r--r-- 1 yourUsername tc001 334 Mar 3 2017 .emacs
287-
drwxr-xr-x 4 yourUsername tc001 4096 Aug 2 2016 .mozilla
288-
drwx--S--- 2 yourUsername tc001 4096 Nov 28 09:58 .ssh
296+
-rw-r--r-- 1 <NetID> tc001 18 Dec 6 2016 .bash_logout
297+
-rw-r--r-- 1 <NetID> tc001 193 Dec 6 2016 .bash_profile
298+
-rw-r--r-- 1 <NetID> tc001 231 Dec 6 2016 .bashrc
299+
drwxr-sr-x 2 <NetID> tc001 4096 Nov 28 09:58 documents
300+
-rw-r--r-- 1 <NetID> tc001 334 Mar 3 2017 .emacs
301+
drwxr-xr-x 4 <NetID> tc001 4096 Aug 2 2016 .mozilla
302+
drwx--S--- 2 <NetID> tc001 4096 Nov 28 09:58 .ssh
289303
```
290304
{: .output}
291305
@@ -308,8 +322,8 @@ $ ls -l -a ~/documents
308322
{: .language-bash}
309323
310324
```
311-
drwxr-sr-x 2 yourUsername tc001 4096 Nov 28 09:58 .
312-
drwx--S--- 5 yourUsername tc001 4096 Nov 28 09:58 ..
325+
drwxr-sr-x 2 <NetID> tc001 4096 Nov 28 09:58 .
326+
drwx--S--- 5 <NetID> tc001 4096 Nov 28 09:58 ..
313327
```
314328
{: .output}
315329

_episodes/03-files.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ $ cd hpc-test
3131
```
3232
{: .language-bash}
3333

34-
3534
## Creating and Editing Text Files
3635

3736
When working on an HPC system, we will frequently need to create or edit text
@@ -72,6 +71,13 @@ editor. Here are the shortcut keys for a few common actions:
7271
* <kbd>Ctrl</kbd>+<kbd>U</kbd> &mdash; paste the cut text line (or lines). This
7372
command can be repeated to paste the same text elsewhere.
7473

74+
| Option | Explanation |
75+
|--------------|-------------------------|
76+
| Ctrl + O | Save the changes |
77+
| Ctrl + X | Exit nano |
78+
| Ctrl + K | Cut single line |
79+
| Ctrl + U | Paste the text |
80+
7581

7682
> ## Using `vim` as a text editor
7783
>
@@ -180,6 +186,12 @@ draft.txt
180186
```
181187
{: .output}
182188

189+
| Command | Explanation |
190+
|----------------------------------|------------------------------------------------------------------------------------------------------------------|
191+
| mv dummy_file.txt test_file.txt | Renames `dummy_file.txt` as `test_file.txt`. |
192+
| mv subdir new_subdir | Renames the directory "subdir" to a new directory "new_subdir". |
193+
194+
183195
**Renaming** &mdash; `draft.txt` isn't a very descriptive name. How do we go
184196
about changing it? It turns out that `mv` is also used to rename files and
185197
directories. Although this may not seem intuitive at first, think of it as
@@ -215,6 +227,12 @@ has two different uses that work in the same way as `mv`:
215227
- Copy to other directory (copied file retains original name): `cp file
216228
directory`
217229

230+
| Command | Explanation |
231+
|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
232+
| cp test_file1.txt test_file2.txt | Copies a duplicate copy of `test_file1.txt` with the new name `test_file2.txt`. |
233+
| cp -r subdir subdir2 | Recursively copies the directory "subdir" to a new directory "subdir2". That is, a new directory "subdir2" is created, and each file and directory under "subdir" is replicated in "subdir2". |
234+
235+
218236
Let's try this out.
219237

220238
```
@@ -274,6 +292,15 @@ files
274292
```
275293
{: .output}
276294

295+
| Command | Explanation |
296+
|----------------------------------|------------------------------------------------------------------------------------------------------------------|
297+
| rm dummy_file.txt | Remove a file. |
298+
| rm -i dummy_file.txt | If you use `-i` you will be prompted for confirmation before each file is deleted. |
299+
| rm -f serious_file.txt | Forcibly removes a file without asking, regardless of its permissions (provided you own the file). |
300+
| rmdir subdir/ | Removes "subdir" if it is already empty. Otherwise, the command fails. |
301+
| rm -r subdir/ | Recursively deletes the directory "subdir" and everything in it. Use it with care! |
302+
303+
277304
What happened? As it turns out, `rmdir` is unable to remove directories that
278305
have stuff in them. To delete a directory and everything inside it, we will use
279306
a special variant of `rm`, `rm -rf directory`. This is probably the scariest
@@ -440,3 +467,4 @@ out and see which ones you like best!
440467
441468
Out of `cat`, `head`, `tail`, and `less`, which method of reading files is your
442469
favourite? Why?
470+

0 commit comments

Comments
 (0)