Skip to content

Commit 4dd908e

Browse files
authored
update theme (#58)
* add storage to cost calculator * change theme
1 parent f964ded commit 4dd908e

File tree

2 files changed

+86
-22
lines changed

2 files changed

+86
-22
lines changed

_quarto.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ website:
3333

3434
format:
3535
html:
36-
theme: cosmo
36+
theme: flatly
3737
css: _styles/styles.css
3838
toc: true
3939
code-copy: true
4040
monobackgroundcolor: "#f8f9fa"
41+
linkcolor : "#007ba7"
4142
code-block-background: true

docs/responsible-use.qmd

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,22 @@ The UU provides a small starting budget of 10K credits for pilots or small proje
2929

3030
## Cost calculator
3131

32-
Use the calculator below to estimate the costs for the workspaces and storage volumes that you create. The costs of a workspace are determined by the number of CPU cores or GPU devices **plus** a small amount for workspace storage. Remember that a workspace will consume credits whenever it is in "State: Running". It will only stop consuming credits when you Pause or Delete a workspace in the [Research Cloud portal](https://portal.live.surfresearchcloud.nl/). Use the expiry date to schedule deletion of your workspace as an extra safeguard. [Storage volumes](https://utrechtuniversity.github.io/vre-docs/docs/first-steps.html#why-a-storage-volume) consume credits until you delete them in the [Research Cloud portal](https://portal.live.surfresearchcloud.nl/).
32+
Use the calculator below to estimate the costs for the workspaces and storage volumes that you create. The costs of a workspace are determined by the number of CPU cores or GPU devices **plus** a small amount for workspace storage (SSD). Remember that a workspace will consume credits whenever it is in "State: Running". It will only stop consuming credits when you Pause or Delete a workspace in the [Research Cloud portal](https://portal.live.surfresearchcloud.nl/). Use the expiry date to schedule deletion of your workspace as an extra safeguard. [Storage volumes](https://utrechtuniversity.github.io/vre-docs/docs/first-steps.html#why-a-storage-volume) consume credits until you delete them in the [Research Cloud portal](https://portal.live.surfresearchcloud.nl/).
3333

3434
Note: this describes costs for the standard use case, in which workspaces run on SURF's HPC Cloud environment. Although ResearchCloud also allows you to [run workspaces in different environment](manuals/creating.qmd#select-cloud-provider) (such as Microsoft's Azure cloud environment), the costs for this will be significantly higher.
3535

3636
```{shinylive-python}
3737
#| standalone: true
38-
#| viewerHeight: 1000
38+
#| viewerHeight: 600
3939
4040
from shiny import App, render, ui
4141
import numpy as np
4242
import matplotlib.pyplot as plt
4343
import faicons
44+
import shinyswatch
4445
4546
app_ui = ui.page_fluid(
47+
shinyswatch.theme.sandstone(),
4648
ui.layout_sidebar(
4749
ui.sidebar(
4850
ui.input_radio_buttons(
@@ -52,13 +54,12 @@ app_ui = ui.page_fluid(
5254
5355
),
5456
ui.value_box(
55-
title="Estimated total costs",
57+
title="Estimated costs workspace*",
5658
showcase=faicons.icon_svg("circle-dollar-to-slot",width="50px"),
5759
value=ui.output_ui("estimate"),
5860
theme="bg-gradient-blue-purple",
5961
),
6062
ui.output_plot("plot_compute"),
61-
ui.output_plot("plot_storage"),
6263
),
6364
)
6465
@@ -74,7 +75,6 @@ def server(input, output, session):
7475
ui.input_radio_buttons(
7576
"time_unit", "Time Unit", ["hours", "days"]
7677
),
77-
ui.input_slider("storage", "Storage volume size in GB", 5, 1500, 250, step=5),
7878
)
7979
else:
8080
return ui.TagList(
@@ -83,7 +83,6 @@ def server(input, output, session):
8383
ui.input_radio_buttons(
8484
"time_unit", "Time Unit", ["hours", "days"]
8585
),
86-
ui.input_slider("storage", "Storage volume size in GB", 5, 1500, 250, step=5),
8786
)
8887
8988
@render.plot(alt="Cost estimator")
@@ -124,21 +123,6 @@ def server(input, output, session):
124123
ax.set(xlabel='Time in # of ' + input.time_unit(), ylabel='Credits',
125124
title='Cost of running a workspace')
126125
127-
@render.plot(alt="Cost estimator")
128-
def plot_storage():
129-
x_max = 50.0
130-
t = np.arange(0.0, x_max, 1.0)
131-
cost = t * input.storage() * 0.681 / 30
132-
fig, ax = plt.subplots()
133-
ax.set_ylim([0, 1000])
134-
ax.set_xlim([0, int(x_max)])
135-
ax.plot(t, cost, label="Credits")
136-
ax.grid()
137-
ax.vlines(input.time(), 0, cost[input.time()], colors='r', linestyles='dashed', label='Estimated time')
138-
ax.hlines(y=cost[input.time()], xmin=0, xmax=input.time(), color='r', linestyle='dashed')
139-
ax.set(xlabel='Time in # of days', ylabel='Credits',
140-
title='Cost of persistent storage')
141-
142126
@render.text
143127
def estimate():
144128
ssd_hourly_cost = 1.525 * 100 / (30 * 24) # assumed on average 100GB SSD
@@ -159,6 +143,85 @@ app = App(app_ui, server)
159143
160144
```
161145

146+
> *Costs including workspaces storage (SSD)
147+
```{shinylive-python}
148+
#| standalone: true
149+
#| viewerHeight: 600
150+
151+
from shiny import App, render, ui
152+
import numpy as np
153+
import matplotlib.pyplot as plt
154+
import faicons
155+
import shinyswatch
156+
157+
app_ui = ui.page_fluid(
158+
shinyswatch.theme.sandstone(),
159+
ui.layout_sidebar(
160+
ui.sidebar(
161+
ui.output_ui("device_controls"),
162+
),
163+
ui.value_box(
164+
title="Costs persistent storage (HDD)",
165+
showcase=faicons.icon_svg("circle-dollar-to-slot",width="50px"),
166+
value=ui.output_ui("estimate"),
167+
theme="bg-gradient-blue-purple",
168+
),
169+
ui.output_plot("plot_storage"),
170+
),
171+
)
172+
173+
174+
def server(input, output, session):
175+
@output
176+
@render.ui
177+
def device_controls():
178+
return ui.TagList(
179+
ui.input_slider("time", "Estimated time", 1, 50, 12, step=1),
180+
ui.input_radio_buttons(
181+
"time_unit", "Time Unit", ["days", "months"]
182+
),
183+
ui.input_slider("storage", "Storage volume size in GB", 5, 1500, 250, step=5),
184+
)
185+
186+
@render.plot(alt="Cost estimator")
187+
def plot_storage():
188+
x_max = 50.0
189+
t = np.arange(0.0, x_max, 1.0)
190+
if input.time_unit() == "days":
191+
cost = t * input.storage() * 0.681 / 30
192+
else:
193+
cost = t * input.storage() * 0.681
194+
195+
fig, ax = plt.subplots()
196+
197+
if input.time_unit() == "days":
198+
ax.set_ylim([0, 1000])
199+
else:
200+
ax.set_ylim([0, 1000 * 30])
201+
202+
ax.set_xlim([0, int(x_max)])
203+
ax.plot(t, cost, label="Credits")
204+
ax.grid()
205+
ax.vlines(input.time(), 0, cost[input.time()], colors='r', linestyles='dashed', label='Estimated time')
206+
ax.hlines(y=cost[input.time()], xmin=0, xmax=input.time(), color='r', linestyle='dashed')
207+
if input.time_unit() == "days":
208+
ax.set(xlabel='Time in # of days', ylabel='Credits',
209+
title='Cost of persistent storage')
210+
else:
211+
ax.set(xlabel='Time in # of months', ylabel='Credits',
212+
title='Cost of persistent storage')
213+
@render.text
214+
def estimate():
215+
if input.time_unit() == "days":
216+
cost = input.time() * input.storage() * 0.681 / 30
217+
else:
218+
cost = input.time() * input.storage() * 0.681
219+
return f"{round(cost, 1)} credits"
220+
221+
app = App(app_ui, server)
222+
223+
```
224+
162225
## VRE lifetime and security updates
163226

164227
The recommended maximum lifetime of a VRE (or workspace) is no more than 4 weeks.

0 commit comments

Comments
 (0)