Skip to content

Commit

Permalink
chore: Consolidate and deduplicate cargo deps (#64)
Browse files Browse the repository at this point in the history
* chore: Consolidate and deduplicate cargo deps

This should slightly improve CI time since there will be less of a need to recompile multiple versions of the same crate

* Update canisters/node_status_canister/src/node_status_canister_backend/Cargo.toml
  • Loading branch information
sasa-tomic committed Jan 16, 2024
1 parent 97b98ef commit 31bb6df
Show file tree
Hide file tree
Showing 35 changed files with 971 additions and 3,734 deletions.
2,899 changes: 287 additions & 2,612 deletions Cargo.Bazel.lock

Large diffs are not rendered by default.

658 changes: 115 additions & 543 deletions Cargo.lock

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,150 @@ authors = ["IC Decentralized Reliability Engineering (DRE) Team"]
description = "Tooling for managing the Internet Computer"
documentation = "https://github.com/dfinity/dre/"

[workspace.dependencies]
actix = "0.13.1"
actix-web = { version = "4.2.1", default-features = false, features = [
"compress-gzip",
"macros",
] }
actix-rt = "2.2.0"
ahash = "0.8.3"
anyhow = "1.0.79"
assert_matches = "1.4.0"
async-recursion = "1.0.5"
async-timer = "0.7.4"
async-trait = "0.1.53"
backoff = { version = "0.4.0", features = ["tokio"] }
backon = "0.4.1"
candid = "0.9.11"
chrono = { version = "0.4.31", features = ["serde"] }
clap-num = "1.0.0"
clap = { version = "4.4.17", features = [
"derive",
"env",
"usage",
"color",
"help",
"error-context",
"suggestions",
"wrap_help",
"string",
"cargo",
] }
colored = "2.0.0"
counter = "0.5.2"
crossbeam = "0.8.0"
crossbeam-channel = "0.5.5"
cryptoki = "0.3.1"
csv = "1.1.6"
custom_error = "1.9.2"
decentralization = { path = "rs/decentralization" }
derive_builder = "0.12.0"
derive_more = "0.99.16"
dialoguer = "0.11.0"
dirs = "5.0.1"
dotenv = "0.15.0"
base64 = "0.21.7"
easy-parallel = "3.1.0"
edit = "0.1.4"
either = "1.6.1"
enum-map = "1.1.1"
env_logger = "0.10.0"
erased-serde = "0.4.2"
exitcode = "1.1.2"
flate2 = "1.0.22"
float-ord = "0.3.2"
fs2 = "0.4.3"
futures = "0.3.21"
futures-core = "0.3.16"
futures-util = "0.3.21"
gitlab = "0.1603.0"
hex = "0.4.3"
humantime = "2.1.0"
hyper = { version = "0.14.11", features = ["http2", "stream"] }
hyper-tls = "0.5.0"
ic-agent = "0.30.2"
ic-async-utils = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-base-types = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-canister-client = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-canister-client-sender = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-canisters = { path = "rs/ic-canisters" }
ic-config = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-crypto-utils-threshold-sig-der = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-http-endpoints-metrics = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-ic00-types = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-identity-hsm = "0.30.2"
ic-interfaces-registry = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-management-backend = { path = "rs/ic-management-backend" }
ic-management-types = { path = "rs/ic-management-types" }
ic-metrics = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-nns-common = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-nns-constants = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-nns-governance = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-protobuf = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-client = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-client-fake = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-client-helpers = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-common-proto = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-keys = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-local-registry = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-local-store = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-local-store-artifacts = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-nns-data-provider = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-subnet-type = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-transport = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-sys = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-types = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-utils = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
include_dir = "0.7.3"
itertools = "0.12.0"
keyring = "2.0.2"
lazy_static = "1.4.0"
log = "0.4.20"
lru = "0.12.1"
phantom_newtype = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
pkcs11 = "0.5.0"
pretty_env_logger = "0.5.0"
prometheus-http-query = "0.4.0"
prometheus = { version = "0.13.3", features = ["process"] }
prost = "0.12.1"
rand = { version = "0.8.5", features = ["std_rng"] }
rand_seeder = "0.2.3"
rayon = "1.8.0"
regex = "1.10.2"
registry-canister = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
reqwest = { version = "0.11", features = ["json"] }
retry = "2.0.0"
reverse_geocoder = "4.0.0"
ring = "0.17.7"
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0.195"
serde_json = "1.0.111"
serde_yaml = "0.9.30"
sha2 = "0.10.6"
simple_asn1 = "0.6.0"
slog-async = { version = "2.8.0", features = ["nested-values"] }
slog-term = "2.9.0"
slog = { version = "2.7.0", features = [
"max_level_trace",
"nested-values",
"release_max_level_debug",
"release_max_level_trace",
] }
socket2 = "0.5.5"
spinners = "4.1.1"
strum = { version = "0.25.0", features = ["derive"] }
strum_macros = "0.25.3"
tabled = "0.15.0"
tabular = "0.2"
tempfile = "3.8.0"
thiserror = "1.0.40"
tokio = { version = "1.2.0", features = ["full"] }
url = "2.5.0"
urlencoding = "2.1.0"
warp = "0.3"


[profile.release]
# Add debug information to the release build (does NOT reduce the level of optimization!)
# Makes flamegraphs and backtraces more readable.
Expand Down
1 change: 0 additions & 1 deletion canisters/Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ crate-type = ["cdylib"]
[dependencies]
candid = "0.8.4"
ic-cdk = "0.7.4"
ic-cdk-macros = "0.6.10"
serde = "1"
31 changes: 10 additions & 21 deletions rs/canister-log-fetcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.2.7", features = [
"derive",
"env",
"usage",
"color",
"help",
"error-context",
"suggestions",
"wrap_help",
"string",
"cargo",
] }
reqwest = { version = "0.11", features = ["json"] }
url = "2.3.1"
log = "0.4.14"
pretty_env_logger = "0.5.0"
tokio = { version = "1.14.0", features = ["full"] }
anyhow = "1.0.44"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.108"
humantime = "2.1.0"
clap = { workspace = true }
reqwest = { workspace = true }
url = { workspace = true }
log = { workspace = true }
pretty_env_logger = { workspace = true }
tokio = { workspace = true }
anyhow = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
humantime = { workspace = true }
1 change: 1 addition & 0 deletions rs/canister-log-fetcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::entry::Entry;

mod entry;

#[allow(clippy::iter_skip_zero)]
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let args = Cli::parse();
Expand Down
99 changes: 38 additions & 61 deletions rs/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,44 @@ documentation.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0.130", features = ["derive"] }
chrono = "0.4.31"
clap = { version = "4.2.7", features = [
"derive",
"env",
"usage",
"color",
"help",
"error-context",
"suggestions",
"wrap_help",
"string",
"cargo",
] }
reqwest = { version = "0.11", features = ["json"] }
serde_json = "1.0.68"
anyhow = "1.0.44"
futures = "0.3.21"
colored = "2.0.0"
log = "0.4.14"
pretty_env_logger = "0.5.0"
regex = "1.5.4"
ic-base-types = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-nns-constants = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-nns-governance = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-canister-client = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-sys = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-nns-data-provider = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-keys = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-registry-transport = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-protobuf = { git = "https://github.com/dfinity/ic.git", rev = "4b3b2ce76c4bde0c1c60fb80b0915931003b7eca" }
ic-canisters = { path = "../ic-canisters" }
prost = "0.12.1"
tokio = { version = "1.14.0", features = ["full"] }
strum = { version = "0.25.0", features = ["derive"] }
strum_macros = "0.25.1"
flate2 = "1.0.22"
dirs = "5.0.1"
decentralization = { path = "../decentralization" }
ic-management-types = { path = "../ic-management-types" }
ic-management-backend = { path = "../ic-management-backend" }
dialoguer = "0.10.0"
itertools = "0.11.0"
async-trait = "0.1.53"
keyring = "2.0.2"
cryptoki = "0.3.1"
candid = "0.9.5"
url = "2.3.1"
clap-num = "1.0.0"
sha2 = "0.10.6"
edit = "0.1.4"
tabular = "0.2"
ic-agent = "0.27.0"
actix-web = { version = "4.2.1", default-features = false, features = [
"compress-gzip",
"macros",
] }
dotenv = "0.15.0"
socket2 = "0.5.4"
spinners = "4.1.0"
tabled = "0.14.0"
anyhow = { workspace = true }
async-trait = { workspace = true }
candid = { workspace = true }
clap = { workspace = true }
clap-num = { workspace = true }
colored = { workspace = true }
cryptoki = { workspace = true }
decentralization = { workspace = true }
dialoguer = { workspace = true }
dirs = { workspace = true }
dotenv = { workspace = true }
edit = { workspace = true }
flate2 = { workspace = true }
futures = { workspace = true }
ic-base-types = { workspace = true }
ic-canister-client = { workspace = true }
ic-canisters = { workspace = true }
ic-management-backend = { workspace = true }
ic-management-types = { workspace = true }
ic-nns-constants = { workspace = true }
ic-nns-governance = { workspace = true }
ic-sys = { workspace = true }
itertools = { workspace = true }
keyring = { workspace = true }
log = { workspace = true }
pretty_env_logger = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
socket2 = { workspace = true }
spinners = { workspace = true }
strum = { workspace = true }
tabled = { workspace = true }
tabular = { workspace = true }
tokio = { workspace = true }
url = { workspace = true }

[dev-dependencies]
tempfile = "3.3.0"
Expand Down
4 changes: 2 additions & 2 deletions rs/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl Cli {
}

pub fn get_update_cmd_args(update_version: &UpdateVersion) -> Vec<String> {
vec![
[
[
vec![
format!("--{}-version-to-elect", update_version.release_artifact),
Expand All @@ -402,7 +402,7 @@ impl Cli {
]
.concat(),
match update_version.versions_to_retire.clone() {
Some(versions) => vec![
Some(versions) => [
vec![format!("--{}-versions-to-unelect", update_version.release_artifact)],
versions,
]
Expand Down
4 changes: 2 additions & 2 deletions rs/cli/src/ic_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl ProposeCommand {
subnet_id,
node_ids_add: nodes_ids_add,
node_ids_remove: nodes_ids_remove,
} => vec![
} => [
vec!["--subnet-id".to_string(), subnet_id.to_string()],
if !nodes_ids_add.is_empty() {
[
Expand All @@ -614,7 +614,7 @@ impl ProposeCommand {
vec![subnet.to_string(), version.clone()]
}
Self::Raw { command: _, args } => args.clone(),
Self::UpdateNodesHostosVersion { nodes, version } => vec![
Self::UpdateNodesHostosVersion { nodes, version } => [
nodes.iter().map(|n| n.to_string()).collect::<Vec<_>>(),
vec!["--hostos-version-id".to_string(), version.to_string()],
]
Expand Down
10 changes: 5 additions & 5 deletions rs/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl Runner {
})
.fold(BTreeMap::new(), |mut acc, (node_id, subnet, dc)| {
acc.entry(dc.unwrap_or_default().name)
.or_insert_with(Vec::new)
.or_default()
.push((node_id, subnet));
acc
})
Expand Down Expand Up @@ -285,9 +285,9 @@ impl Runner {
let mut summary = "## List of nodes\n".to_string();
let mut builder_dc = Builder::default();
let nodes_by_dc = self.nodes_by_dc(nodes_to_update.clone()).await;
builder_dc.set_header(["dc", "node_id", "subnet"]);
builder_dc.push_record(["dc", "node_id", "subnet"]);
nodes_by_dc.into_iter().for_each(|(dc, nodes_with_sub)| {
let _builder = builder_dc.push_record([
builder_dc.push_record([
dc,
nodes_with_sub.iter().map(|(p, _)| p.to_string()).join("\n"),
nodes_with_sub
Expand All @@ -305,7 +305,7 @@ impl Runner {
if let Some(subnets_affected) = maybe_subnets_affected {
summary.push_str("## Updated nodes per subnet\n");
let mut builder_subnets = Builder::default();
builder_subnets.set_header([
builder_subnets.push_record([
"subnet_id",
"updated_nodes",
"count",
Expand Down Expand Up @@ -349,7 +349,7 @@ impl Runner {
})
.sorted_by(|a, b| a[3].cmp(&b[3]))
.for_each(|row| {
let _builder = builder_subnets.push_record(row);
builder_subnets.push_record(row);
});

let mut table_subnets = builder_subnets.build();
Expand Down
Loading

0 comments on commit 31bb6df

Please sign in to comment.