Skip to content

Commit 332aefa

Browse files
DOC: Add SURF setup instructions (#110)
* DOC: Add SURF setup instructions * DOC: Update surf instructions with environment creation
1 parent edccedb commit 332aefa

File tree

5 files changed

+117
-0
lines changed

5 files changed

+117
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ __pycache__/
66
# Figures
77
*.jpg
88
*.gif
9+
!docs/**/*.gif
910

1011
# Data files created
1112
/results
466 KB
Loading
774 KB
Loading

docs/user-guide/tutorials/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
maxdepth: 1
66
caption: Tutorials
77
---
8+
surf_research_cloud_setup.ipynb
89
ADCP_data_tutorial.ipynb
910
CTD_data_tutorial.ipynb
1011
Drifter_data_tutorial.ipynb
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+
}

0 commit comments

Comments
 (0)