Repository navigation
feat(install): run Lens in a microsandbox microVM as an alternative to Docker - #255
Merged
Merged
Conversation
…o Docker install.sh asks on a first install (where KVM or Apple silicon is there) whether to run Lens in Docker, the default, or in one microsandbox microVM; LENS_BACKEND chooses without asking and is kept in .env. microsandbox/run.sh sets up and runs SurrealDB, the API, the worker and the web app inside the sandbox from the stock Python image. A CI job runs the one-line install in a microsandbox on a KVM runner. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvAGWoQxiwkGkk374pvkSh
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvAGWoQxiwkGkk374pvkSh
Owner
Author
|
Generated by Claude Code |
…picked With port 0, UDP chose a free port and TCP then had to bind the same number; when something already held it on TCP the listener failed to start, which made test_hub_takes_devices_in_and_organises_them fail now and then. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvAGWoQxiwkGkk374pvkSh
…cached in its volume A sandbox started again with msb restart or msb start boots without running Lens, so the second install never answered. install.sh now writes .lens-sandbox, the command that replaces the sandbox, runs it, and starts it at boot; run.sh keeps the downloaded packages in the volume, so a fresh sandbox is up in about half a minute. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvAGWoQxiwkGkk374pvkSh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: the one-line install always ran Lens in Docker.
After: on a first install where microsandbox can run (Linux with KVM, or a Mac with Apple silicon), the installer asks whether to use Docker (still the default) or a microsandbox microVM, which needs no Docker.
LENS_BACKEND=microsandboxpicks it without the question. The choice is saved in.env, so running the line again keeps it. Existing Docker installs stay on Docker.How: microsandbox can't build images or connect sandboxes by name, so Lens runs as one sandbox started from
python:3.12-slim-bookworm. Inside it,microsandbox/run.shinstalls the same system packages as the backend image and fetches SurrealDB 3.2.4, rclone, Node 22 and uv. It builds the backend and web app from the code (mounted read-only), rebuilding only when the code changes. Then it runs SurrealDB, the API, the worker and the web app, and restarts any of them that stops. Data and builds go in the named volumelens-data. The sandbox's network allows the internet, the LAN and the host (host.docker.internalstill points at the host's model servers). It publishes the same ports Docker does. A systemd unit (Linux) or a LaunchAgent (Mac) brings the sandbox back after a reboot.Not yet: Matterbridge, Fedora and OpenSearch in the sandbox; prebuilt images; moving an existing Docker install. These are listed in
docs/microsandbox.md.Motivation and Context
Adeel asked for microsandbox as an install-time alternative to Docker.
Steps to reproduce (if appropriate):
curl -fsSL .../install.sh | LENS_BACKEND=microsandbox shon a KVM host. CI adds a job, "One-line install in a microsandbox", on a GitHub-hosted runner with KVM. I ranrun.shin a stand-in container (same image, same mounts). It installed and built, the setup page answered, and stop and start were clean, with the database stopped last.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01VvAGWoQxiwkGkk374pvkSh
Generated by Claude Code