Skip to content

added Try Valkey support #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zarkash-aws
Copy link

@zarkash-aws zarkash-aws commented May 4, 2025

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, 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, 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.

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 for documentation and for creating new images for Try Valkey.

Signed-off-by: Shai Zarka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant