Skip to content

Commit cb3ceba

Browse files
committed
update with build own
1 parent c581c96 commit cb3ceba

File tree

5 files changed

+159
-16
lines changed

5 files changed

+159
-16
lines changed
64.7 KB
Loading
102 KB
Loading
345 KB
Loading

modules/01-working-in-jupyterhub/index.md

Lines changed: 159 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ authors:
1717
:class: dropdown
1818

1919
<iframe
20-
src="https://docs.google.com/presentation/d/e/2PACX-1vRe2ACdsZHjAfG_dpS_ZkDjLLG3qizsQCgWBgAXzetJlPz7DKVXWx3nrSfEK-LGEs_H8myf21tQzR9o/pubembed?start=false&loop=false&delayms=60000"
20+
src="https://docs.google.com/presentation/d/1BRWaZUEfBJlKA9WL7jIdL_4jlQ24wohS_GNjYJCFliw/edit?usp=sharing/pubembed?start=false&loop=false&delayms=60000"
2121
frameborder="0"
2222
width="960"
2323
height="569"
@@ -34,18 +34,13 @@ authors:
3434
:::
3535

3636

37-
## Access the [CryoCloud powerpoint](https://docs.google.com/presentation/d/1sj5oSAnHQ5Le0zMNqy55T-esZqro-WjVOPJdv_BR08M/edit?usp=sharing) whenever you need to reference it
37+
## Access the [CryoCloud powerpoint](https://docs.google.com/presentation/d/1BRWaZUEfBJlKA9WL7jIdL_4jlQ24wohS_GNjYJCFliw/edit?usp=sharing) whenever you need to reference it
3838

39-
Open the powerpoint by directly clicking on the hyperlink above or to open it in the CryoCloud Linux Desktop web browser as follows:
40-
41-
- Copy this hyperlink: `https://docs.google.com/presentation/d/1sj5oSAnHQ5Le0zMNqy55T-esZqro-WjVOPJdv_BR08M/edit?usp=sharing`
42-
- Click on the plus (`+`) sign in the `File Browser` to the left to open a `Launcher` window
43-
- Under Notebooks, click on `Desktop` to access the Linux Desktop. This will open a new tab.
44-
- Click on the `Web Browser` tool (globe) at the bottom of the screen
45-
- Paste the url into the search bar
39+
Open the powerpoint by directly clicking on the hyperlink above.
4640

4741
![](./slides.png)
4842

43+
---
4944

5045
## Open CryoCloud
5146

@@ -63,18 +58,157 @@ server and having to rerun your analysis.**
6358
:::
6459

6560
3) Sit back and learn about each of the tools!
61+
- How to bring your own environment
6662
- JupyterHub options and viewing setup
6763
- Github
6864
- Virtual Linux desktop
6965
- SyncThing
7066
- Viewing and editing of different files
7167

72-
Now after the demo...
68+
---
69+
70+
## Bring Your Own environment (custom Docker image)
71+
72+
CryoCloud allows you to launch your server using different software environments. Each environment corresponds to a Docker image, which defines the libraries, tools, and versions available to you. Switching Docker images is similar to switching between computers that have different applications installed.
73+
74+
Using a custom Docker image is useful when you want:
75+
- A different software stack than the defaults
76+
- An older or reproducible version of CryoCloud’s environment
77+
- A specialized environment from an external registry (e.g., Pangeo, Rocker)
78+
79+
This feature is called **Bring Your Own Image (BYOI)**.
80+
81+
82+
### 1. Selecting an environment when launching CryoCloud
83+
84+
When you open CryoCloud, the **Environment** dropdown provides:
85+
86+
- Python
87+
- R
88+
- Matlab
89+
- Other
90+
- Build Your Own
91+
92+
To use a custom Docker image, select **Other**.
93+
A field labeled **Custom image** will appear. This is where you will paste the Docker tag for the environment you want.
94+
95+
![](./bring_own.png)
96+
97+
98+
### 2. Finding a Docker tag
99+
100+
A Docker tag tells CryoCloud which exact environment to use. You can choose tags from CryoCloud’s maintained images or from Docker Hub.
101+
102+
103+
### Option A: Use an older or alternate CryoCloud environment
104+
105+
CryoCloud publishes its Python environment image to Quay.io.
106+
107+
1. Visit the repository tags page:
108+
https://quay.io/repository/cryointhecloud/cryo-hub-image?tab=tags
109+
110+
2. Browse the available tags. Each tag corresponds to a specific version.
111+
112+
3. Copy the full tag in the following form: `quay.io/cryointhecloud/cryo-hub-image:<tag>`
113+
114+
Example:
115+
116+
```
117+
quay.io/cryointhecloud/cryo-hub-image:e457bd429a1e
118+
```
119+
120+
Paste the tag into the **Custom image** field on CryoCloud. For reference, this image is built from the code in: https://github.com/CryoInTheCloud/hub-image.
121+
122+
```{image} ./image_tags.png
123+
:width: 60%
124+
:align: center
125+
```
126+
127+
### Option B: Use an image from Docker Hub
128+
129+
You may also use any public Docker image from Docker Hub.
130+
131+
1. Search for images at:
132+
https://hub.docker.com/
133+
134+
2. Tags typically follow this format: `account/image:tag`
135+
136+
Example:
137+
```
138+
pangeo/ml-notebook:latest
139+
rocker/geospatial:4.4
140+
```
141+
142+
Paste any valid tag into the **Custom image** field.
143+
73144

145+
### Example: Using a machine learning environment
146+
147+
If you want a Pangeo machine learning environment, enter:
148+
```
149+
pangeo/ml-notebook:latest
150+
```
151+
152+
CryoCloud will launch your session using that environment.
153+
154+
155+
### Tips
156+
157+
- If an image does not launch, ensure it includes a Jupyter-compatible single-user interface.
158+
- Private images requiring authentication are not currently supported through the UI.
159+
- Images must be Linux-based and appropriate for JupyterHub.
160+
- Use explicit tags (not `latest`) when reproducibility is important.
161+
162+
---
163+
164+
## Build Your Own image
165+
166+
CryoCloud also supports creating a fully customized environment using your own `environment.yml` file. This option is useful when you want complete control over the software stack and only want the packages you specify.
167+
168+
When launching CryoCloud, select **Build Your Own** from the **Environment** dropdown.
169+
A field labeled **Repository** will appear. This is where you will paste the URL of a GitHub repository that contains an `environment.yml` file.
170+
171+
![](./build_your_own.png)
172+
173+
174+
### Example: Using a minimal template repository
175+
176+
You can start with a simple example environment from the following template repository:
177+
178+
```
179+
https://github.com/tsnow03/BuildOwnImage_template_env.git
180+
```
181+
182+
To copy the correct link from your own repository:
183+
184+
1. Open your GitHub repository.
185+
2. Click the blue **Code** button.
186+
3. Copy the HTTPS URL (it should end in `.git`).
187+
188+
CryoCloud will use the `environment.yml` found in that repository to build your image.
189+
190+
191+
### Building the Image
192+
193+
1. Paste the repository URL into the **Repository** field.
194+
2. Click **Build image**.
195+
196+
CryoCloud will begin building a Docker image based on your `environment.yml`. Build times vary depending on the number of packages:
197+
198+
- Simple environments: ~30 seconds
199+
- Large or complex environments: up to ~1 hour
200+
201+
If the build process encounters an issue, an error message will appear in the log so you can revise your `environment.yml`.
202+
203+
After the image is built once, you can easily select it again in future sessions.
204+
205+
**Tip:** Test your `environment.yml` locally using Mamba before using Build Your Own to speed up the build process and avoid waiting through repeated failures.
206+
207+
---
74208

75209
## Task: Clone the CryoCloud jupyterbook
76210

77-
We will import the [CryoCloud Website Github repository](https://github.com/CryoInTheCloud/CryoCloudWebsite.git).
211+
We will import the [workshop repository](https://github.com/geojupyter/workshop-open-source-geospatial.git).
78212

79213
To do this:
80214
1. Select the plus (`+`) sign above the `File Browser` to the left, which will bring up a `Launcher` window.
@@ -94,17 +228,22 @@ To do this:
94228
3. Now clone the hackweek code into your current directory:
95229

96230
```
97-
https://github.com/CryoInTheCloud/CryoCloudWebsite.git
231+
https://github.com/geojupyter/workshop-open-source-geospatial.git
98232
```
99233

100234
4. You will see the folder pop into your `File Browser` on the left if you have the current directory open.
101235
Click on the folder to navigate through the files.
102236

103-
5. To open this tutorial, click on the `book` subdirectory > `tutorials` and double
104-
click on `CryoCloud`.
237+
5. To open this tutorial, click on the `materials` subdirectory > `01-working-in-jupyterhub` and double
238+
click on `index.md`.
105239
This should open up this tutorial in case you want to review it in the future.
106240

107241

242+
Now after the demo...
243+
244+
245+
---
246+
108247
## Shutting down your JupyterHub
109248

110249
```{tip}
@@ -121,12 +260,16 @@ We prefer you shut down the server when so we save that 90 minutes of computing
121260
To do so:
122261

123262
- In upper left, click on `File` > `Hub Control Panel`, which will open another tab
124-
- Click the `Stop Server` button. Once this button disappears after you clicked it, your server is off.
263+
- Click the red `Stop Server` button. Once this button disappears after you clicked it, your server is off.
125264
- Click `Log Out` in the top right of your screen and you will be logged out, or you can start a new server
126265
- You can now close this tab and the other tab where you were just working
127266

128-
![](./stop_server.png)
267+
```{image} ./stop_server.png
268+
:width: 70%
269+
:align: center
270+
```
129271

272+
---
130273

131274
## Summary
132275

-173 KB
Loading

0 commit comments

Comments
 (0)