From a4e79db348b4de57c55ff991f93e89831baec2c2 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 2 Sep 2022 15:46:46 +0300 Subject: [PATCH] Move `neon_local` to `control_plane`. Seems a bit silly to have a separate crate just for the executable. It relies on the control plane for everything it does, and it's the only user of the control plane. --- Cargo.lock | 20 +++---------------- Cargo.toml | 1 - control_plane/Cargo.toml | 3 +++ .../src/bin/neon_local.rs | 7 +++++++ neon_local/Cargo.toml | 19 ------------------ 5 files changed, 13 insertions(+), 37 deletions(-) rename neon_local/src/main.rs => control_plane/src/bin/neon_local.rs (99%) delete mode 100644 neon_local/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 2e300e46f5..563a998601 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -495,6 +495,9 @@ name = "control_plane" version = "0.1.0" dependencies = [ "anyhow", + "clap 3.2.16", + "comfy-table", + "git-version", "nix", "once_cell", "pageserver", @@ -1648,23 +1651,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "neon_local" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap 3.2.16", - "comfy-table", - "control_plane", - "git-version", - "pageserver", - "postgres", - "safekeeper", - "serde_json", - "utils", - "workspace_hack", -] - [[package]] name = "nix" version = "0.23.1" diff --git a/Cargo.toml b/Cargo.toml index a19f65a14f..1936b261f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ members = [ "proxy", "safekeeper", "workspace_hack", - "neon_local", "libs/*", ] diff --git a/control_plane/Cargo.toml b/control_plane/Cargo.toml index 425eb332c3..8a79a6e566 100644 --- a/control_plane/Cargo.toml +++ b/control_plane/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" edition = "2021" [dependencies] +clap = "3.0" +comfy-table = "5.0.1" +git-version = "0.3.5" tar = "0.4.38" postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="d052ee8b86fff9897c77b0fe89ea9daba0e1fa38" } serde = { version = "1.0", features = ["derive"] } diff --git a/neon_local/src/main.rs b/control_plane/src/bin/neon_local.rs similarity index 99% rename from neon_local/src/main.rs rename to control_plane/src/bin/neon_local.rs index 78a465539a..828d6a2e5a 100644 --- a/neon_local/src/main.rs +++ b/control_plane/src/bin/neon_local.rs @@ -1,3 +1,10 @@ +//! +//! `neon_local` is an executable that can be used to create a local +//! Neon environment, for testing purposes. The local environment is +//! quite different from the cloud environment with Kubernetes, but it +//! easier to work with locally. The python tests in `test_runner` +//! rely on `neon_local` to set up the environment for each test. +//! use anyhow::{anyhow, bail, Context, Result}; use clap::{App, AppSettings, Arg, ArgMatches}; use control_plane::compute::ComputeControlPlane; diff --git a/neon_local/Cargo.toml b/neon_local/Cargo.toml deleted file mode 100644 index 2fc38cfe02..0000000000 --- a/neon_local/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "neon_local" -version = "0.1.0" -edition = "2021" - -[dependencies] -clap = "3.0" -anyhow = "1.0" -serde_json = "1" -comfy-table = "5.0.1" -postgres = { git = "https://github.com/zenithdb/rust-postgres.git", rev="d052ee8b86fff9897c77b0fe89ea9daba0e1fa38" } -git-version = "0.3.5" - -# FIXME: 'pageserver' is needed for BranchInfo. Refactor -pageserver = { path = "../pageserver" } -control_plane = { path = "../control_plane" } -safekeeper = { path = "../safekeeper" } -utils = { path = "../libs/utils" } -workspace_hack = { version = "0.1", path = "../workspace_hack" }