Skip to content

Commit 39047a7

Browse files
VeckoTheGeckopre-commit-ci[bot]erikvansebille
authored
Update SURF setup instructions (#128)
* rename old surf setup * Update surf instructions * update pr template * Update suggested folder naming * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add course facilitator notes * Fixing suggestions by @ammedd --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Erik van Sebille <erikvansebille@gmail.com>
1 parent 1f40c3a commit 39047a7

3 files changed

Lines changed: 135 additions & 27 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Feel free to remove check-list items aren't relevant to your change -->
22

3-
- [ ] Closes #xxxx
3+
- Closes #xxxx
44
- [ ] Tests added
55
- [ ] Re-ran README.md help commands if the CLI has changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "plaintext"
8+
}
9+
},
10+
"source": [
11+
"# SURF Resarch Cloud: Virtualship environment setup\n",
12+
"\n",
13+
"> Note: \n",
14+
"> This guide is specific to students who are enrolled at UU in the Dynamical Oceanography course.\n",
15+
"\n",
16+
"In the class, we use virtualship in the cloud (in this case, SURF Research Cloud - called SURF RC from here-on). This has several advantages:\n",
17+
"\n",
18+
"- You aren't limited to the power of your laptop\n",
19+
"- Input datasets are downloaded faster, as they're downloaded to the cloud instance (and not to your laptop)\n",
20+
"\n",
21+
"\n",
22+
"## 1. Accepting SURF RC invite\n",
23+
"\n",
24+
"In your student email you'll have an invite from SURF Research Access Management (SRAM) to join a project on SURF RC. Accept this invite.\n",
25+
"\n",
26+
"## 2. Create the environment\n",
27+
"\n",
28+
"Navigate to the [SURF Research Cloud Dashboard](https://portal.live.surfresearchcloud.nl/), and create the storage and compute resources you need.\n",
29+
"\n",
30+
"Below we show create the storage.\n",
31+
"\n",
32+
"![Adding storage GIF](./assets/add-storage.gif)\n",
33+
"\n",
34+
"As shown: to create the storage go to the storage tab, click `+`, and add a SURF HPC Cloud Volume of 100Gb (naming it something unique and memorable). This will be your persistent storage for your workspace instance.\n",
35+
"\n",
36+
"Below we show create the workspace.\n",
37+
"\n",
38+
"![Adding workspace GIF](./assets/add-workspace.gif)\n",
39+
"\n",
40+
"\n",
41+
"As shown: to create the workspace instance go to the workspace tab, click `+`, search for and select \"virtualship\", then choose the storage you just created, adjust the expiration date to some time after 14 march 2025, and change the name/hostname to something memorable.\n",
42+
"\n",
43+
"Once the workspace is created, you can click \"Access\" to open it in a new tab. This might take a while (up to 10 minutes) - make sure to occasionally refresh the page.\n",
44+
"\n",
45+
"\n",
46+
"> IMPORTANT: Make sure to pause the instance when you’re not using it, and resume it next time you log in. Only the workspace creator can pause, resume, and delete the workspace - this is an unavoidable limitation of SURF RC.\n",
47+
"\n",
48+
"\n",
49+
"## 3. Jupyter workspace layout and additional config\n",
50+
"\n",
51+
"> Note: This only needs to be done once during setup.\n",
52+
"\n",
53+
"In the Jupyter workspace, you'll see the following in your file explorer:\n",
54+
"```\n",
55+
".\n",
56+
"├── KERNEL-README.ipynb\n",
57+
"├── data\n",
58+
"│ └── datasets\n",
59+
"| └── {your storage name} <--- Your persistent storage\n",
60+
"└── scratch\n",
61+
"```\n",
62+
"\n",
63+
"The `data/{your storage name}` folder is your persistent storage. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n",
64+
"\n",
65+
"---\n",
66+
"\n",
67+
"To be able to run virtualship from the terminal, we need to take some additional steps which are detailed in the `KERNEL-README.ipynb` contains important information for configuring your environment. Namely, for our uses, the \"Initialize conda\" section. Do the following.\n",
68+
"\n",
69+
"> #### Initialize conda\n",
70+
"> \n",
71+
"> To make the already installed conda-tool available for yourself, you have to initialize your terminal shell.\n",
72+
"> \n",
73+
"> Start a \"Terminal\" tab in the Jupyter Lab launcher and type:\n",
74+
"> ```\n",
75+
"> /etc/miniconda/bin/conda init\n",
76+
"> ```\n",
77+
"> Close the terminal tab and start a new one.\n",
78+
"> You will see that the terminal prompt has changed to something like\n",
79+
"> ```\n",
80+
"> (base) metheuser@mywsp:\n",
81+
"> ```\n",
82+
"> This is conda telling you that you are currently in the \"base\" environment.\n",
83+
"\n",
84+
"From here, you already have another environment set up for you. Running `conda env list` in the terminal, you should see:\n",
85+
"\n",
86+
"```bash\n",
87+
"(base) $ conda env list\n",
88+
"\n",
89+
"# conda environments:\n",
90+
"#\n",
91+
"base * /etc/miniconda\n",
92+
"virtualship /etc/miniconda/envs/virtualship`\n",
93+
"```\n",
94+
"\n",
95+
"Here you can do `conda activate virtualship` to activate the environment called \"virtualship\". Now you have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/{your storage name}` and run `virtualship` commands as you would on your local machine.\n",
96+
"\n",
97+
"---\n",
98+
"Finally, when you're working in Jupyter Notebooks, you are able to access the Conda environment with `virtualship` and related dependencies by switching the Kernel in the top right of the UI.\n",
99+
"\n"
100+
]
101+
},
102+
{
103+
"cell_type": "markdown",
104+
"metadata": {},
105+
"source": []
106+
}
107+
],
108+
"metadata": {
109+
"language_info": {
110+
"name": "python"
111+
}
112+
},
113+
"nbformat": 4,
114+
"nbformat_minor": 2
115+
}

docs/user-guide/tutorials/surf_research_cloud_setup.ipynb

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,9 @@
2323
"\n",
2424
"In your student email you'll have an invite from SURF Research Access Management (SRAM) to join a project on SURF RC. Accept this invite.\n",
2525
"\n",
26-
"## 2. Create the environment\n",
27-
"\n",
28-
"Navigate to the [SURF Research Cloud Dashboard](https://portal.live.surfresearchcloud.nl/), and create the storage and compute resources you need.\n",
29-
"\n",
30-
"Below we show create the storage.\n",
31-
"\n",
32-
"![Adding storage GIF](./assets/add-storage.gif)\n",
33-
"\n",
34-
"As shown: to create the storage go to the storage tab, click `+`, and add a SURF HPC Cloud Volume of 100Gb (naming it something unique and memorable). This will be your persistent storage for your workspace instance.\n",
35-
"\n",
36-
"Below we show create the workspace.\n",
37-
"\n",
38-
"![Adding workspace GIF](./assets/add-workspace.gif)\n",
39-
"\n",
40-
"\n",
41-
"As shown: to create the workspace instance go to the workspace tab, click `+`, search for and select \"virtualship\", then choose the storage you just created, adjust the expiration date to some time after 14 march 2025, and change the name/hostname to something memorable.\n",
42-
"\n",
43-
"Once the workspace is created, you can click \"Access\" to open it in a new tab. This might take a while (up to 10 minutes) - make sure to occasionally refresh the page.\n",
44-
"\n",
45-
"\n",
46-
"> IMPORTANT: Make sure to pause the instance when you’re not using it, and resume it next time you log in. Only the workspace creator can pause, resume, and delete the workspace - this is an unavoidable limitation of SURF RC.\n",
26+
"## 2. Open the environment\n",
4727
"\n",
28+
"Navigate to the [SURF Research Cloud Dashboard](https://portal.live.surfresearchcloud.nl/), and click \"access\" on the shared workspace.\n",
4829
"\n",
4930
"## 3. Jupyter workspace layout and additional config\n",
5031
"\n",
@@ -56,11 +37,11 @@
5637
"├── KERNEL-README.ipynb\n",
5738
"├── data\n",
5839
"│ └── datasets\n",
59-
"| └── {your storage name} <--- Your persistent storage\n",
40+
"| └── shared-storage <--- The shared persistent storage\n",
6041
"└── scratch\n",
6142
"```\n",
6243
"\n",
63-
"The `data/{your storage name}` folder is your persistent storage. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n",
44+
"The `data/shared-storage` folder is your persistent storage. Here you can make a folder (e.g., `mkdir data/shared-storage/{your-group-name}` replacing `{your-group-name}` with your group name) to house your work for the unit. This folder will be visible to anyone using the workspace, but only you will be able to make edits to it. This is the primary place you should store your `virtualship` configs and content relevant to this unit.\n",
6445
"\n",
6546
"---\n",
6647
"\n",
@@ -84,19 +65,31 @@
8465
"From here, you already have another environment set up for you. Running `conda env list` in the terminal, you should see:\n",
8566
"\n",
8667
"```bash\n",
87-
"(base) $ conda env list\n",
68+
"conda env list\n",
8869
"\n",
8970
"# conda environments:\n",
9071
"#\n",
9172
"base * /etc/miniconda\n",
9273
"virtualship /etc/miniconda/envs/virtualship`\n",
9374
"```\n",
9475
"\n",
95-
"Here you can do `conda activate virtualship` to activate the environment called \"virtualship\". Now you have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/{your storage name}` and run `virtualship` commands as you would on your local machine.\n",
76+
"Here you can do `conda activate virtualship` to activate the environment called \"virtualship\". This environment is a shared environment among all workspace users that can be centrally updated. If you want you can create and manage your own environments by running the relevant conda commands.\n",
77+
"\n",
78+
"With the `virtualship` environment, you now have access to the `virtualship` command in your terminal, which can be confirmed by running `virtualship --help`. From here you can `cd` into `data/shared-storage/{your-name}` and run `virtualship` commands as you would on your local machine.\n",
9679
"\n",
9780
"---\n",
9881
"Finally, when you're working in Jupyter Notebooks, you are able to access the Conda environment with `virtualship` and related dependencies by switching the Kernel in the top right of the UI.\n",
99-
"\n"
82+
"\n",
83+
"\n",
84+
"\n",
85+
"## Course facilitator notes\n",
86+
"\n",
87+
"If `virtualship` is updated on GitHub, and you want to update the shared environment, you can do so by running the following commands in the terminal:\n",
88+
"\n",
89+
"```bash\n",
90+
"conda activate virtualship\n",
91+
"sudo /etc/miniconda/envs/virtualship/bin/pip install --upgrade git+https://github.com/OceanParcels/virtualship@main\n",
92+
"```"
10093
]
10194
},
10295
{

0 commit comments

Comments
 (0)