diff --git a/README.md b/README.md index e604c1a4..ac0bf48c 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,12 @@ listed under [In progress](#in-progress), and what comes next under [Planned](#p machines that join over the mesh to transcribe and tell voices apart, not yet tried on a real cloud), and Linux and model hosts are planned. ([Auto scaling](docs/scaling.md); [checks](docs/requirements.md#scale-out)) +- **Run on more machines.** Add a Mac with a GPU, a box for the assistant's code or a server with more disk, and + Lens joins it over a private network of its own, a Nebula mesh it issues the certificates for: one install line + with a one-time token, and the machine needs nothing else. Worker nodes run jobs as their own user of the + database, never with Lens's keys; compute nodes run the assistant's code on a sandbox gateway of their own. + Settings › Nodes and Network show each machine and the mesh, and agents do the same over the API. Not yet tried + between two real machines. ([Nodes and the mesh](docs/mesh.md); [checks](docs/requirements.md#run-on-more-machines)) - **Keep it up to date and backed up.** Lens checks for a new release once a day and tells admins by email or a notification. One click in Settings › Updates (or one API call) upgrades it through a small agent on the machine, showing each step, and rolls back when the new version doesn't start; nothing installs unless an admin says so. The @@ -280,8 +286,6 @@ These are open pull requests, not yet part of Lens: - **Web clipper:** signing in, or using your API token, not only an import webhook's ([#406](https://github.com/adeelahmad/lense/pull/406)). - **Automations:** more operators for conditions ([#434](https://github.com/adeelahmad/lense/pull/434)). -- **Nodes:** Lens's own private network between the machines it runs on, a Nebula mesh it issues the certificates - for ([#607](https://github.com/adeelahmad/lense/pull/607)). ## Planned diff --git a/docs/requirements.md b/docs/requirements.md index d9de2539..ba1ea51e 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -277,6 +277,18 @@ request, to another check that proves the same thing; loosening a requirement or | When AWS takes a spot instance back, the scaler says why and launches another | [test_scaling_aws.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/domain/test_scaling_aws.py) `test_describe_says_when_aws_took_a_spot_instance_back`, `test_the_scaler_replaces_a_spot_unit_aws_took_back`, `test_terminate_check_and_listing` | | Agents manage scaling in the assistant and over MCP: proposals wait for the person, actions within the terms happen at once | [test_scaling_agents.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_scaling_agents.py) `test_the_assistant_proposes_and_the_person_approves_in_the_web_app`, `test_a_setup_conversation_makes_a_group_that_still_waits_for_the_person`, `test_only_admins_get_the_scaling_tools`, `test_mcp_clients_manage_scaling_but_never_approve` | +## Run on more machines + +| Requirement | Checks | +|---|---| +| Off until an admin adds a node, which makes the mesh's certificate authority and turns it on; nothing goes in `.env` | [test_mesh.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh.py) `test_adding_a_node_makes_the_ca_a_token_and_turns_the_mesh_on`; [settings-mesh.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/settings-mesh.test.tsx) `is off until a node is added` | +| A machine joins with the install line and a one-time token that never crosses the wire, and its answer is sealed for that token; wrong or spent tokens are refused and repeated wrong joins turned away | [test_mesh.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh.py) `test_a_machine_joins_without_sending_the_token`, `test_a_join_answer_is_only_for_the_token_it_was_sealed_with`, `test_too_many_wrong_joins_from_one_address_are_turned_away`; [test_mesh_node.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh_node.py) `test_a_machine_joins_and_follows_the_primary`, `test_a_spent_or_wrong_token_is_not_tried_again`, `test_the_install_line_names_this_install_and_the_token` | +| After joining, a node talks to this install over the mesh only: it follows its config, renews its certificate and reports every minute, and a removed node is blocked everywhere until an undo | [test_mesh.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh.py) `test_a_node_reports_renews_and_follows_its_config`; [test_mesh_node.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh_node.py) `test_a_machine_joins_and_follows_the_primary`, `test_a_primary_out_of_reach_is_tried_again_later`, `test_the_primarys_mesh_address_is_a_host_only_for_nodes_calls` | +| Nebula runs in its own container, fetched once with its checksum checked against the one kept in Lens, and is started again when it stops | [test_mesh_service.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh_service.py) `test_the_sidecar_pins_the_nebula_lens_does`, `test_the_sidecar_downloads_nebula_only_with_its_checksum`, `test_the_keeper_and_the_sidecar_bring_up_the_primary`, `test_a_stopped_nebula_is_started_again_after_a_while`; [test_mesh.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh.py) `test_nebula_is_fetched_once_with_its_checksum_checked` | +| A worker node runs jobs as its own user of Lens's database, never root and never with the archive's secret, reading only its namespaces' files over the mesh, never a vault's | [test_mesh_workers.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh_workers.py) `test_a_worker_node_runs_lens_worker_as_its_own_user_of_the_database`, `test_its_jobs_read_files_from_here_over_the_mesh`, `test_a_node_serving_some_namespaces_takes_only_their_jobs`, `test_only_a_worker_node_gets_the_database`, `test_a_node_runs_only_the_steps_a_node_can` | +| A compute node runs the assistant's code on a gateway of its own, which Lens reaches over the mesh with mutual TLS, holding its certificate sealed | [test_mesh_compute.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mesh_compute.py) `test_a_compute_nodes_install_line_starts_its_gateway`, `test_a_compute_node_hands_over_its_gateway_and_the_assistant_may_run_code_there`, `test_only_a_compute_node_gives_a_gateway_and_only_a_certificate`, `test_lens_reaches_the_nodes_gateway_with_its_certificate_checked_by_name` | +| Settings › Nodes adds a machine with Enter, shows its install line once, lists each machine with how it's doing, renames in place and removes with Undo; Settings › Network shows the mesh and its settings | [settings-mesh.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/settings-mesh.test.tsx) `adds a node with Enter and shows the install line once, with its terms`, `lists each machine with how it's doing`, `removes a node without asking, and undoes it`, `renames a node with Enter`, `says whether a compute node's sandbox gateway runs`, `shows that it runs, and what Nebula said`, `checks the network and the hosts as the server does` | + ## Keep it up to date and backed up | Requirement | Checks |