Skip to content

Commit 98df01f

Browse files
authored
Try Valkey for Workshops (#378)
### Description This PR accomplishes two things: 1. Generalized the try-valkey interface allowing for multiple, isolated instances of try-valkey to co-exist on valkey.io 2. Adds a new instance of try-valkey for the PyCon Africa conference workshop. Note: the actual distribution needs to be uploaded to the download.valkey.io CDN for the workshop to be functional. ### Issues Resolved n/a ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. --------- Signed-off-by: Kyle J. Davis <[email protected]>
1 parent 5db1223 commit 98df01f

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ _data/modules.json
1919
.vscode/*
2020
.idea/*
2121
tmp/*
22+
static/debug

content/try-valkey/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
+++
2+
title = "Try Valkey"
3+
template = "valkey-try-me.html"
4+
[extra]
5+
state_file = "https://download.valkey.io/try-me-valkey/8.1.0/states/state.bin.gz"
6+
filesystem_base_url = "https://download.valkey.io/try-me-valkey/8.1.0/fs/alpine-rootfs-flat"
7+
filesystem_base_fs = "https://download.valkey.io/try-me-valkey/8.1.0/fs/alpine-fs.json"
8+
+++
9+

content/try-valkey/index.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
+++
2+
title = "Try Valkey for PyCon Africa 2025"
3+
template = "valkey-try-me.html"
4+
[extra]
5+
state_file = "https://download.valkey.io/try-me-valkey/pyconafrica/states/state.bin.gz"
6+
filesystem_base_url = "https://download.valkey.io/try-me-valkey/pyconafrica/fs/alpine-rootfs-flat"
7+
filesystem_base_fs = "https://download.valkey.io/try-me-valkey/pyconafrica/fs/alpine-fs.json"
8+
+++
9+
10+
11+
This is an in-browser Valkey server, `valkey-cli`, and Python,that runs directly within your browser using a [V86](https://github.com/copy/v86) emulator, requiring no external installations. You will use this to complete the workshop.

templates/valkey-try-me.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
<link rel="stylesheet" href="https://download.valkey.io/try-me-valkey/vos/valkey-try-me.css" />
1212

1313
<!-- Body -->
14+
{% if page %}
15+
{{ page.content | markdown | safe }}
16+
{% else %}
1417
<title>Try Valkey</title>
1518
<p>This is an in-browser Valkey server and CLI that runs directly within your browser using a <a href="https://github.com/copy/v86">V86</a> emulator, requiring no external installations. </p>
1619
<p>Try it out below:</p>
20+
{% endif %}
1721
<div id="terminalWrapper" class="container" style="display: none;">
1822
<div id="terminal-container"></div>
1923
</div>
@@ -30,7 +34,11 @@
3034

3135
<script>
3236
"use strict";
33-
const FILE_URL = "https://download.valkey.io/try-me-valkey/8.1.0/states/state.bin.gz"; // Path to the .gz file
37+
{% if page %}
38+
const FILE_URL = "{{ page.extra.state_file | safe }}"; // Path to the .gz file
39+
{% else %}
40+
const FILE_URL = "{{ section.extra.state_file | safe }}"; // Path to the .gz file
41+
{% endif %}
3442
const CACHE_KEY = "valkey_binary_cache";
3543
const LAST_MODIFIED_KEY = "valkey_last_modified";
3644
let emulator;
@@ -138,8 +146,13 @@
138146
memory_size: 512 * 1024 * 1024,
139147
bios: { url: "https://download.valkey.io/try-me-valkey/vos/v86/bios/seabios.bin" },
140148
filesystem: {
141-
baseurl: "https://download.valkey.io/try-me-valkey/8.1.0/fs/alpine-rootfs-flat",
142-
basefs: "https://download.valkey.io/try-me-valkey/8.1.0/fs/alpine-fs.json",
149+
{% if page %}
150+
baseurl: "{{ page.extra.filesystem_base_url | safe }}",
151+
basefs: "{{ page.extra.filesystem_base_fs | safe }}",
152+
{% else %}
153+
baseurl: "{{ section.extra.filesystem_base_url | safe }}",
154+
basefs: "{{ section.extra.filesystem_base_fs | safe }}",
155+
{% endif %}
143156
},
144157
autostart: true,
145158
bzimage_initrd_from_filesystem: true,

0 commit comments

Comments
 (0)