Rename zenith crate to neon_local (#1625)

This commit is contained in:
bojanserafimov
2022-05-05 19:06:53 -04:00
committed by GitHub
parent 11a44eda0e
commit ef40e404cf
6 changed files with 36 additions and 37 deletions

34
Cargo.lock generated
View File

@@ -1487,6 +1487,23 @@ dependencies = [
"tempfile",
]
[[package]]
name = "neon_local"
version = "0.1.0"
dependencies = [
"anyhow",
"clap 3.0.14",
"comfy-table",
"control_plane",
"pageserver",
"postgres",
"postgres_ffi",
"safekeeper",
"serde_json",
"utils",
"workspace_hack",
]
[[package]]
name = "nix"
version = "0.23.1"
@@ -3703,23 +3720,6 @@ dependencies = [
"chrono",
]
[[package]]
name = "zenith"
version = "0.1.0"
dependencies = [
"anyhow",
"clap 3.0.14",
"comfy-table",
"control_plane",
"pageserver",
"postgres",
"postgres_ffi",
"safekeeper",
"serde_json",
"utils",
"workspace_hack",
]
[[package]]
name = "zeroize"
version = "1.5.2"

View File

@@ -6,7 +6,7 @@ members = [
"proxy",
"safekeeper",
"workspace_hack",
"zenith",
"neon_local",
"libs/*",
]

View File

@@ -49,14 +49,14 @@ make -j5
```sh
# Create repository in .zenith with proper paths to binaries and data
# Later that would be responsibility of a package install script
> ./target/debug/zenith init
> ./target/debug/neon_local init
initializing tenantid c03ba6b7ad4c5e9cf556f059ade44229
created initial timeline 5b014a9e41b4b63ce1a1febc04503636 timeline.lsn 0/169C3C8
created main branch
pageserver init succeeded
# start pageserver and safekeeper
> ./target/debug/zenith start
> ./target/debug/neon_local start
Starting pageserver at 'localhost:64000' in '.zenith'
Pageserver started
initializing for single for 7676
@@ -64,7 +64,7 @@ Starting safekeeper at '127.0.0.1:5454' in '.zenith/safekeepers/single'
Safekeeper started
# start postgres compute node
> ./target/debug/zenith pg start main
> ./target/debug/neon_local pg start main
Starting new postgres main on timeline 5b014a9e41b4b63ce1a1febc04503636 ...
Extracting base backup to create postgres instance: path=.zenith/pgdatadirs/tenants/c03ba6b7ad4c5e9cf556f059ade44229/main port=55432
Starting postgres node at 'host=127.0.0.1 port=55432 user=zenith_admin dbname=postgres'
@@ -72,7 +72,7 @@ waiting for server to start.... done
server started
# check list of running postgres instances
> ./target/debug/zenith pg list
> ./target/debug/neon_local pg list
NODE ADDRESS TIMELINES BRANCH NAME LSN STATUS
main 127.0.0.1:55432 5b014a9e41b4b63ce1a1febc04503636 main 0/1609610 running
```
@@ -94,16 +94,16 @@ postgres=# select * from t;
5. And create branches and run postgres on them:
```sh
# create branch named migration_check
> ./target/debug/zenith timeline branch --branch-name migration_check
> ./target/debug/neon_local timeline branch --branch-name migration_check
Created timeline '0e9331cad6efbafe6a88dd73ae21a5c9' at Lsn 0/16F5830 for tenant: c03ba6b7ad4c5e9cf556f059ade44229. Ancestor timeline: 'main'
# check branches tree
> ./target/debug/zenith timeline list
> ./target/debug/neon_local timeline list
main [5b014a9e41b4b63ce1a1febc04503636]
┗━ @0/1609610: migration_check [0e9331cad6efbafe6a88dd73ae21a5c9]
# start postgres on that branch
> ./target/debug/zenith pg start migration_check
> ./target/debug/neon_local pg start migration_check
Starting postgres node at 'host=127.0.0.1 port=55433 user=stas'
waiting for server to start.... done
@@ -123,7 +123,7 @@ INSERT 0 1
6. If you want to run tests afterwards (see below), you have to stop all the running the pageserver, safekeeper and postgres instances
you have just started. You can stop them all with one command:
```sh
> ./target/debug/zenith stop
> ./target/debug/neon_local stop
```
## Running tests

View File

@@ -1,5 +1,5 @@
[package]
name = "zenith"
name = "neon_local"
version = "0.1.0"
edition = "2021"

View File

@@ -62,15 +62,15 @@ http_port = {safekeeper_http_port}
struct TimelineTreeEl {
/// `TimelineInfo` received from the `pageserver` via the `timeline_list` http API call.
pub info: TimelineInfo,
/// Name, recovered from zenith config mappings
/// Name, recovered from neon config mappings
pub name: Option<String>,
/// Holds all direct children of this timeline referenced using `timeline_id`.
pub children: BTreeSet<ZTimelineId>,
}
// Main entry point for the 'zenith' CLI utility
// Main entry point for the 'neon_local' CLI utility
//
// This utility helps to manage zenith installation. That includes following:
// This utility helps to manage neon installation. That includes following:
// * Management of local postgres installations running on top of the
// pageserver.
// * Providing CLI api to the pageserver
@@ -125,12 +125,12 @@ fn main() -> Result<()> {
.takes_value(true)
.required(false);
let matches = App::new("Zenith CLI")
let matches = App::new("Neon CLI")
.setting(AppSettings::ArgRequiredElseHelp)
.version(GIT_VERSION)
.subcommand(
App::new("init")
.about("Initialize a new Zenith repository")
.about("Initialize a new Neon repository")
.arg(pageserver_config_args.clone())
.arg(timeline_id_arg.clone().help("Use a specific timeline id when creating a tenant and its initial timeline"))
.arg(
@@ -258,7 +258,7 @@ fn main() -> Result<()> {
None => bail!("no subcommand provided"),
};
// Check for 'zenith init' command first.
// Check for 'neon init' command first.
let subcommand_result = if sub_name == "init" {
handle_init(sub_args).map(Some)
} else {
@@ -481,9 +481,8 @@ fn handle_init(init_match: &ArgMatches) -> Result<LocalEnv> {
};
let mut env =
LocalEnv::create_config(&toml_file).context("Failed to create zenith configuration")?;
env.init()
.context("Failed to initialize zenith repository")?;
LocalEnv::create_config(&toml_file).context("Failed to create neon configuration")?;
env.init().context("Failed to initialize neon repository")?;
// default_tenantid was generated by the `env.init()` call above
let initial_tenant_id = env.default_tenant_id.unwrap();

View File

@@ -1108,7 +1108,7 @@ class ZenithCli:
assert type(arguments) == list
bin_zenith = os.path.join(str(zenith_binpath), 'zenith')
bin_zenith = os.path.join(str(zenith_binpath), 'neon_local')
args = [bin_zenith] + arguments
log.info('Running command "{}"'.format(' '.join(args)))