You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### General Description
This PR implements a browser-based environment that allows users to
interact with Valkey-CLI commands without needing local installation.
This feature was initially introduced in [Issue
#1412](valkey-io/valkey#1412), and it aims to
provide a lightweight, easy-to-access platform for users to explore
Valkey’s functionalities directly in the browser.
### Implementation
The solution uses a virtualized environment powered by
[v86](https://github.com/copy/v86), a tool that emulates an
x86-compatible CPU and hardware. The machine code for the environment is
translated into WebAssembly modules at runtime, allowing it to run
entirely within the browser.
* VM Configuration: When the page is loaded, the VM loads a
preconfigured Alpine Linux image that already has the Valkey server and
CLI installed. This configuration ensures users can immediately interact
with the Valkey CLI upon starting the web-based environment.
* Current Version: The current version of Valkey in the preconfigured
image is 8.1.0. However, binaries for earlier versions (7.2.8 and 8.0.1)
are also available in the S3 bucket. We can decide whether to set a
single version or implement a dropdown menu that allows users to choose
the version they want to interact with.
### Serving of Binary Files
The virtual machine used for this setup relies on two main binary file
components:
1. Binary files for the VM’s filesystem.
2. A binary file containing a preloaded state, which allows for seamless
page loading.
These binaries are served from an S3 bucket (currently set as a test
bucket) via CloudFront CDN.
* CORS Policy: To allow the browser to access these binary files, we
need to configure the appropriate CORS policy. Specifically, the
“Access-Control-Allow-Origin” header must be set correctly. This CORS
policy needs to be configured both for the S3 bucket and the CloudFront
distribution.
* We can set this policy only for the Try-Valkey files directory if we
prefer not to apply it to the entire bucket.
* Additionally, we can restrict access to these files by specifying that
only the Valkey website domain can use them. More details can be found
[here](https://repost.aws/knowledge-center/no-access-control-allow-origin-error).
### New Image Creation Process
Currently, the creation of new images for future Valkey versions will be
done manually. However, we plan to automate this process in the future
to simplify updates as new versions of Valkey are released.
I have also created a
[repository](https://github.com/valkey-io/valkey-try-me) for
documentation and for creating new images for Try Valkey.
### Screenshots
new "Try Valkey" tab
<img width="1510" alt="Screenshot 2025-06-03 at 11 48 36"
src="https://github.com/user-attachments/assets/d881c7b6-6156-4e85-aa45-673beb76528b"
/>
data warning
<img width="1510" alt="Screenshot 2025-06-03 at 11 48 47"
src="https://github.com/user-attachments/assets/d9c4c75c-90de-4c83-a3cd-a85bab2a648b"
/>
after pressing "load emulator"
<img width="1510" alt="Screenshot 2025-06-03 at 11 49 00"
src="https://github.com/user-attachments/assets/ea2f98c5-239d-462f-a2a7-3dd265ad66e5"
/>
---------
Signed-off-by: Shai Zarka <[email protected]>
Signed-off-by: Daniel Phillips <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
Co-authored-by: Daniel Phillips <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]>
<p>This is an in-browser Valkey server and CLI that runs directly within your browser using a <ahref="https://github.com/copy/v86">V86</a> emulator, requiring no external installations. </p>
0 commit comments