Skip to content
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

Post soft-launch fixes #526

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 5 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,9 @@ Read more about [Plane’s architecture](https://plane.dev/concepts/architecture

[![Architecture diagram of Plane](./docs/public/arch-diagram.svg)](https://plane.dev/concepts/architecture)

## Example
## Learn more

Imagine a multiplayer document editor. When Sam opens a document with ID `abc123`, the application requests a process from Plane with that key. In this case no process is running, so Plane starts a new one.

When Jane opens the *same* document, the application requests a process from Plane with the same key (`abc123`). This time Plane already has a process running for that key, so it returns a URL which maps to that process.

As long as either Jane or Sam has document `abc123` open, Plane will keep the process associated with that document running. After **both** Jane and Sam have closed the document, Plane will shut down the process.

If Carl later opens the same document, Plane will start a _new_ process for him, possibly on a different machine.

## Quick Start

This repo includes a Docker Compose file that is suitable for running a local development instance of Plane.

This works on Linux and Mac systems with Docker installed.

In the root of this repo, run:

```bash
docker compose -f docker/docker-compose.yml up
```

This tells Docker to run a Postgres database, as well as a minimal Plane stack: one controller, one drone, and one proxy (see below for an explanation).

The Plane Controller will be available at http://localhost:8080, and the Plane Proxy will be available at http://localhost:9090.

### Connecting to a process

The `docker/cli.sh` script runs the Plane CLI, configured to connect to the local Plane Controller.

```bash
docker/cli.sh connect \
--wait \
--cluster 'localhost:9090' \
--image ghcr.io/drifting-in-space/demo-image-drop-four
```

## Running tests

Tests can be run with `cargo test`, but it can be slow because it does not run tests in parallel and some of the tests are slow.

You can use `nextest` to run tests in parallel:

```bash
cargo install nextest
cargo nextest run -j 5
```

The `-j 5` flag tells `nextest` to run 5 tests in parallel. If you set it too high, you may encounter Docker issues.
- Read the [quickstart guide](https://plane.dev/quickstart-guide)
- Learn about [Plane concepts](https://plane.dev/concepts/session-backends)
- See instructions for [building and developing Plane locally](https://plane.dev/developing)
- Read about [production deployment](https://plane.dev/deploy-to-prod)
2 changes: 1 addition & 1 deletion docs/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Use cases include:

<Callout type="warning">
This documentation refers to the 0.4.0 release of Plane, which is a complete rewrite. These docs are
brand new as of January 2024, and still a work in progres. Please mind the wet paint!
brand new as of January 2024, and still a work in progress. Please mind the wet paint!

If anything is unclear in the meantime, please [open a discussion](https://github.com/drifting-in-space/plane/discussions)
on Plane’s GitHub.
Expand Down
5 changes: 3 additions & 2 deletions plane/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "plane"
version = "0.2.0"
version = "0.4.0"
edition = "2021"
default-run = "plane"
description = "Session backend orchestrator for ambitious browser-based apps."
repository = "https://github.com/drifting-in-space/plane"
license = "MIT"
readme = "../README.md"
homepage = "https://plane.dev"
readme = "README.md"

[dependencies]
acme2-eab = "0.5.4"
Expand Down
27 changes: 27 additions & 0 deletions plane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<a href="https://plane.dev">
<img src="../resources/plane-logo-light.svg" alt="Plane logo" />
</a>

[![GitHub Repo stars](https://img.shields.io/github/stars/drifting-in-space/plane?style=social)](https://github.com/drifting-in-space/plane)
[![Docker image](https://img.shields.io/docker/v/plane/plane)](https://hub.docker.com/r/plane/plane/tags)
[![Build Docker Image](https://github.com/drifting-in-space/plane/actions/workflows/build-image.yml/badge.svg)](https://github.com/drifting-in-space/plane/actions/workflows/build-image.yml)
[![Tests](https://github.com/drifting-in-space/plane/actions/workflows/tests.yml/badge.svg)](https://github.com/drifting-in-space/plane/actions/workflows/tests.yml)
[![Chat on Discord](https://img.shields.io/static/v1?label=chat&message=discord&color=404eed)](https://discord.gg/N5sEpsuhh9)

[Plane](https://plane.dev) is a distributed system for **running stateful WebSocket backends at scale**. Plane is heavily inspired by [Figma’s mulitplayer infrastructure](https://www.figma.com/blog/rust-in-production-at-figma/), which dynamically spawns a process for each active document.

Use cases include:
- Scaling up [authoritative multiplayer backends](https://driftingin.space/posts/you-might-not-need-a-crdt).
- Running isolated code environments (like REPLs, code notebooks, and LLM agent sandboxes).
- Data-intensive applications that need a dedicated high-RAM process for each active user session.

Read more about [Plane’s architecture](https://plane.dev/concepts/architecture).

[![Architecture diagram of Plane](../docs/public/arch-diagram.svg)](https://plane.dev/concepts/architecture)

## Learn more

- Read the [quickstart guide](https://plane.dev/quickstart-guide)
- Learn about [Plane concepts](https://plane.dev/concepts/session-backends)
- See instructions for [building and developing Plane locally](https://plane.dev/developing)
- Read about [production deployment](https://plane.dev/deploy-to-prod)
1 change: 1 addition & 0 deletions plane/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![warn(clippy::unwrap_used)]
#![cfg_attr(test, allow(clippy::unwrap_used))]
#![doc = include_str!("../README.md")]

use serde::{Deserialize, Serialize};

Expand Down
Loading