From c5d04305b3490d6c18d2d4fcd94a8456cf8f7d70 Mon Sep 17 00:00:00 2001 From: tison Date: Mon, 25 Sep 2023 10:45:48 +0800 Subject: [PATCH] refactor: first step to move all packages under src folder (#1226) ## Rationale The final result will be moved all packaged under the `src` folder so that we have a consistent and concise layout. Take materialize as an example: https://github.com/MaterializeInc/materialize/tree/main/src ## Detailed Changes First step: move `src` to `src/server` while keep all the effective code and config the same. So that we get rid of the special case first. ## Test Plan Everything should keep AS IS and existing tests should pass. --------- Signed-off-by: tison --- .github/workflows/ci.yml | 2 +- Cargo.toml | 41 +---------------- src/ceresdb/Cargo.toml | 59 +++++++++++++++++++++++++ src/{ => ceresdb}/bin/ceresdb-server.rs | 0 src/{ => ceresdb/src}/config.rs | 0 src/{ => ceresdb/src}/lib.rs | 0 src/{ => ceresdb/src}/setup.rs | 0 src/{ => ceresdb/src}/signal_handler.rs | 0 8 files changed, 61 insertions(+), 41 deletions(-) create mode 100644 src/ceresdb/Cargo.toml rename src/{ => ceresdb}/bin/ceresdb-server.rs (100%) rename src/{ => ceresdb/src}/config.rs (100%) rename src/{ => ceresdb/src}/lib.rs (100%) rename src/{ => ceresdb/src}/setup.rs (100%) rename src/{ => ceresdb/src}/signal_handler.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42cc3c2be6..c1c0f22ffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: run: | sudo apt update sudo apt install --yes protobuf-compiler - - name: Install clippy rustfmt + - name: Install check binaries run: | rustup component add clippy rustup component add rustfmt diff --git a/Cargo.toml b/Cargo.toml index 282448f70d..deca99a6b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,12 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -[package] -name = "ceresdb" -version = "1.2.6-alpha" -authors = ["CeresDB Authors "] -edition = "2021" - [workspace.package] version = "1.2.6-alpha" authors = ["CeresDB Authors "] @@ -75,16 +69,13 @@ members = [ "remote_engine_client", "router", "server", + "src/ceresdb", "system_catalog", "table_engine", "tools", "wal", ] -[[bin]] -name = "ceresdb-server" -path = "src/bin/ceresdb-server.rs" - [workspace.dependencies] alloc_tracker = { path = "components/alloc_tracker" } arrow = { version = "43.0.0", features = ["prettyprint"] } @@ -186,36 +177,6 @@ wal = { path = "wal" } xorfilter-rs = { git = "https://github.com/CeresDB/xorfilter", rev = "ac8ef01" } zstd = { version = "0.12", default-features = false } -[dependencies] -analytic_engine = { workspace = true } -catalog = { workspace = true } -catalog_impls = { workspace = true } -clap = { workspace = true } -cluster = { workspace = true } -datafusion = { workspace = true } -df_operator = { workspace = true } -etcd-client = { workspace = true } -interpreters = { workspace = true } -log = { workspace = true } -logger = { workspace = true } -meta_client = { workspace = true } -moka = { version = "0.10", features = ["future"] } -panic_ext = { workspace = true } -proxy = { workspace = true } -query_engine = { workspace = true } -router = { workspace = true } -runtime = { workspace = true } -serde = { workspace = true } -server = { workspace = true } -signal-hook = "0.3" -table_engine = { workspace = true } -toml = { workspace = true } -toml_ext = { workspace = true } -tracing_util = { workspace = true } - -[build-dependencies] -vergen = { version = "8", default-features = false, features = ["build", "cargo", "git", "gitcl", "rustc"] } - # This profile optimizes for good runtime performance. [profile.release] # reference: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units diff --git a/src/ceresdb/Cargo.toml b/src/ceresdb/Cargo.toml new file mode 100644 index 0000000000..06ac735f4e --- /dev/null +++ b/src/ceresdb/Cargo.toml @@ -0,0 +1,59 @@ +# Copyright 2023 The CeresDB Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[package] +name = "ceresdb" + +[package.version] +workspace = true + +[package.authors] +workspace = true + +[package.edition] +workspace = true + +[dependencies] +analytic_engine = { workspace = true } +catalog = { workspace = true } +catalog_impls = { workspace = true } +clap = { workspace = true } +cluster = { workspace = true } +datafusion = { workspace = true } +df_operator = { workspace = true } +etcd-client = { workspace = true } +interpreters = { workspace = true } +log = { workspace = true } +logger = { workspace = true } +meta_client = { workspace = true } +moka = { version = "0.10", features = ["future"] } +panic_ext = { workspace = true } +proxy = { workspace = true } +query_engine = { workspace = true } +router = { workspace = true } +runtime = { workspace = true } +serde = { workspace = true } +server = { workspace = true } +signal-hook = "0.3" +table_engine = { workspace = true } +toml = { workspace = true } +toml_ext = { workspace = true } +tracing_util = { workspace = true } + +[build-dependencies] +vergen = { version = "8", default-features = false, features = ["build", "cargo", "git", "gitcl", "rustc"] } + +[[bin]] +name = "ceresdb-server" +path = "bin/ceresdb-server.rs" diff --git a/src/bin/ceresdb-server.rs b/src/ceresdb/bin/ceresdb-server.rs similarity index 100% rename from src/bin/ceresdb-server.rs rename to src/ceresdb/bin/ceresdb-server.rs diff --git a/src/config.rs b/src/ceresdb/src/config.rs similarity index 100% rename from src/config.rs rename to src/ceresdb/src/config.rs diff --git a/src/lib.rs b/src/ceresdb/src/lib.rs similarity index 100% rename from src/lib.rs rename to src/ceresdb/src/lib.rs diff --git a/src/setup.rs b/src/ceresdb/src/setup.rs similarity index 100% rename from src/setup.rs rename to src/ceresdb/src/setup.rs diff --git a/src/signal_handler.rs b/src/ceresdb/src/signal_handler.rs similarity index 100% rename from src/signal_handler.rs rename to src/ceresdb/src/signal_handler.rs