Skip to content

Commit

Permalink
Updating precourse, removed Flask preview of site
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlo committed Oct 28, 2024
1 parent 735bd1f commit e8bee38
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 71 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ to-do.md
/.quarto/
.DS_Store
[0-9]*/
venv/
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ RUN apt-get update -y \
libopenblas-base \
libgdal-dev \
curl \
python3-pip \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install -y ./google-chrome-stable_current_amd64.deb \
&& rm -rf ./google-chrome-stable_current_amd64.deb \
&& curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \
&& apt-get install -y ./quarto-linux-amd64.deb \
&& rm -rf ./quarto-linux-amd64.deb \
&& Rscript -e 'install.packages(c("remotes","fontawesome","here","htmlTable","leaflet","readxl","writexl"),repos = "http://cran.us.r-project.org");' \
&& pip3 install --no-cache-dir Flask==2.2.2 Werkzeug==2.2.2 PyYAML==6.0.2 watchdog==5.0.3 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /qmd /.cache \
&& chmod 777 /qmd /.cache
Expand Down
6 changes: 3 additions & 3 deletions home_precourse.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ upstore <- yaml::read_yaml(here("_quarto.yml"))$uppmax_storage
## PDC

Remote computing cluster Dardel at PDC in Stockholm will be use for data analyses. A PDC account is needed to use these resources.
If you do not already have a PDC account, please fill in the form at https://blackfish.pdc.kth.se/cgi-bin/accounts/request.py **at least 2 weeks before the course start** and use the same email that you applied to the course with. Fill in this information about which course it is:
If you do not already have a PDC account, please fill in the form at [https://blackfish.pdc.kth.se/cgi-bin/accounts/request.py](https://blackfish.pdc.kth.se/cgi-bin/accounts/request.py) **at least 2 weeks before the course start** and use the same email that you applied to the course with. Fill in this information about which course it is:

| | |
|---|---|
Expand Down Expand Up @@ -53,7 +53,7 @@ Finally you need to request a login account to UPPMAX. This will be the account
Checking your request and approving your account requires some manual work, so you might have to wait for some time (up to a working day) before the next step. When the account is ready to be created, you will receive an email to your registered email address (shown in your SUPR contact information) with information on how to proceed. You will get a one-time URL that you use to get the password (within seven days) to login to the cluster with. The link is only valid for 1 visit, so write down the password you get. When that has been done, the account ready for use within 15 minutes and you can then login using your password. Once you have logged into the cluster you can change your password by typing `passwd` in the terminal and follow the instuctions.

::: {.callout-note}
You will get one username & password for the account on UPPMAX, and one username and password for the account on NSC. Please keep track of both, we will tell you when to use which account during the workshop.
You will get one username & password for the account on UPPMAX, and one username and password for the account on PDC. Please keep track of both, we will tell you when to use which account during the workshop.
:::

## Install tools
Expand Down Expand Up @@ -84,7 +84,7 @@ When you need to transfer data between the remote cluster and your computer, you

## Connect to UPPMAX

See [Connecting to UPPMAX](topics/other/lab_connect.qmd) instructions listed on the **Contents** page.
See [Connecting to UPPMAX](topics/other/lab_connect_uppmax.qmd) instructions listed on the **Contents** page.

::: {.callout-tip}
If you want to get a primer on using the terminal, you can get started with the following **Tutorial One** at this link *[Unix tutorial for beginners](http://www.ee.surrey.ac.uk/Teaching/Unix/)*. You can use [https://scilifelab.github.io/courses/ngsintro/common/emu/](https://scilifelab.github.io/courses/ngsintro/common/emu/) [(or this mirror)](https://bellard.org/jslinux/vm.html?url=https://bellard.org/jslinux/buildroot-x86.cfg) to try the commands in the tutorial, so that you don't mess up any real world system. If you have any questions regarding this tutorial contact: *martin.dahlo [at] scilifelab.uu.se*.
Expand Down
65 changes: 0 additions & 65 deletions scripts/serve_quarto.py

This file was deleted.

112 changes: 112 additions & 0 deletions topics/other/lab_connect_pdc.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: "Connecting to PDC"
description: "Connecting to PDC through SSH and GUI (Browser and ThinLinc)"
date: ""
format: html
---

```{r,eval=TRUE,include=FALSE}
library(yaml)
library(here)
upid <- yaml::read_yaml(here("_quarto.yml"))$uppmax_project
```

We will teach you two different ways to connect to PDC. From PDC point of view it doesn't matter which one you use, and you can change whenever you want to or even use both ways simultaiously. The first one is a text-based SSH connection, and the other one is a graphical remote desktop. The latter one is useful if you need to view images or documents in GUI programs without having to first download the image/document to your own computer first. Since it is using graphics, it will require you to have an internet connection that is good and stable.

The reason we will teach you two ways is that some parts of this course will require you to view plots and images, and adding an additional download step would just unneccesarily complicate things.

## SSH connection

Let's look at the text-based SSH approach first. This type of connection work just fine even on slow internet connections since it only transmitts small amounts of text when you work with it. You will need an SSH program to do this, which fortunately is included in most major operating systems:

- {{< fa brands linux >}} Linux: Use Terminal (Included by default)
- {{< fa brands apple >}} OSX: Use Terminal (Included by default)
- {{< fa brands windows >}} Windows: Use Powershell or Command prompt, both should be installed by default

::: {.callout-note}
Where `username` is mentioned, change to your user name.
:::

Fire up the available SSH program and enter the following:

```bash
$ ssh [email protected]
```

Enter your password when prompted. As you type, nothing will show on the screen. No stars, no dots. It is supposed to be that way. Just type the password and press enter, it will be fine.

Now your screen should look something like this:

```
dahlo@dahlo-xps ~ $ ssh [email protected]
Last login: Fri May 18 15:03:59 2018 from mi04.icm.uu.se
_ _ ____ ____ __ __ _ __ __
| | | | _ \| _ \| \/ | / \ \ \/ / | System: rackham4
| | | | |_) | |_) | |\/| | / _ \ \ / | User: dahlo
| |_| | __/| __/| | | |/ ___ \ / \ |
\___/|_| |_| |_| |_/_/ \_\/_/\_\ |
###############################################################################
User Guides: http://www.uppmax.uu.se/support/user-guides
FAQ: http://www.uppmax.uu.se/support/faq
Write to [email protected], if you have questions or comments.
dahlo@rackham4 ~ $
```

Now you are connected to UPPMAX and can start working.

## Remote desktop

You can work on UPPMAX interactively through a graphical-user-interface (GUI) desktop environment using ThinLinc.

We have a ThinLinc server running at one of the login nodes which allows users to run a remote desktop. It can be reached from a web browser (Chrome and Firefox are the recommended web browsers) or from the ThinLink App. For more details please look here: <a href="https://uppmax.uu.se/support-sv/user-guides/thinlinc-graphical-connection-guide/" target="_blank" rel="noopener noreferrer">https://uppmax.uu.se/support-sv/user-guides/thinlinc-graphical-connection-guide/</a>

### Web browser

To be able to login via a web browser you will have to set up two-factor authentication first. Follow the <a href="https://www.uppmax.uu.se/support/user-guides/setting-up-two-factor-authentication/" target="_blank" rel="noopener noreferrer">instructions at the UPPMAX homepage</a>, and once you are done you can continue below.

1. Go to the login page, <a href="https://rackham-gui.uppmax.uu.se/" target="_blank" rel="noopener noreferrer">https://rackham-gui.uppmax.uu.se/</a>
2. Enter your UPPMAX username.
3. Enter your UPPMAX password, followed by your current two-factor authentication code.
Eg. if your password is `hunter2` and your current two-factor authentication code is `123456` you will enter `hunter2123456` as your password.

![](assets/thinlinc_00.png){width="200px"}

4. It will ask you which profile you want to use, so first press the `Forward` button. Then you can choose which desktop environment you want to use. `Xfce` is pretty straight-forward and easy to use, but feel free to try either of them. You get to choose every time you login so it's not a permanent choice.

![](assets/thinlinc_01.png){width="200px"}

5. Once your desktop has been loaded, start a terminal either by clicking the black terminal icon at the bottom of the screen, or by pressing the `Applications` button in the top left corner and select `Terminal Emulator`.

![](assets/thinlinc_02.png){width="200px"}

### ThinLink App

1. If you haven't already done so, download the ThinLinc client matching your local computer (i.e Windows, Linux, MacOS X or Solaris) from <a href="https://www.cendio.com/thinlinc/download" target="_blank" rel="noopener noreferrer">https://www.cendio.com/thinlinc/download</a> and install it.
2. Launch the ThinLinc client. You should see a form where you can enter your username and password, and possibly a server name. If you only see this simple form as shown below, you can click **Advanced** to be able to set the server name.

![](assets/thinlinc_03.png){width="200px"}

3. Change the **Server** setting to `rackham-gui.uppmax.uu.se`.
4. Change the **Name** setting to your UPPMAX username.
5. Set the **Password** setting to your UPPMAX password.
6. You do not need to change any other settings.
7. You will first come to the `ThinLinc profile chooser`. Press the `Forward` button to continue. Then you can choose which desktop environment you want to use. `Xfce` is pretty straight-forward and easy to use, but feel free to try either of them. You get to choose every time you login so it's not a permanent choice.
8. Press the **Connect** button.
9. If you connect for the first time you will see the "The server's host key is not cached ..." dialog.

![](assets/thinlinc_01.png){width="200px"}

10. Once your desktop has been loaded, start a terminal either by clicking the black terminal icon at the bottom of the screen, or by pressing the `Applications` button in the top left corner and select `Terminal Emulator`.

![](assets/thinlinc_02.png){width="200px"}

11. **Two factor authentication:** The ThinLinc client connects over SSH which means it **may** be required to present a two factor authentication code. If you need to use this when logging in with SSH you also need to use it when logging in with ThinLinc (it depends on where you connect from). The ThinLinc client does not know how to ask for the two factor code, so you will need to use the grace time feature. To do this, first you have to connect with regular SSH and present the required two factor code. Once you have logged in over SSH you can safely exit again. The login server will remember that you just logged in for a few minutes and will not ask for two factor authentication again, so make sure you do not wait too long to connect with the ThinLinc client.

## After connection to UPPMAX

From this point forward there is no difference between the two different ways of connection to UPPMAX. Both ways result in you having a terminal running on UPPMAX and from UPPMAX point of view they are the same.
File renamed without changes.

0 comments on commit e8bee38

Please sign in to comment.