From 23099757963a67e65b6b6af18ef6dc082331119a Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Wed, 16 Oct 2024 12:46:33 +0530 Subject: [PATCH] fix: use the correct client cli name and paths --- .github/workflows/benchmark-prs.yml | 2 +- .github/workflows/generate-benchmark-charts.yml | 8 ++++---- .github/workflows/memcheck.yml | 2 +- .github/workflows/merge.yml | 12 ++++++------ .github/workflows/nightly_wan.yml | 8 ++++---- .github/workflows/nightly_wan_churn.yml | 2 +- README.md | 4 ++-- autonomi-cli/README.md | 2 +- autonomi-cli/benches/files.rs | 2 +- autonomi-cli/src/access/data_dir.rs | 2 +- autonomi-cli/src/opt.rs | 6 +++--- sn_logging/src/layers.rs | 6 +----- 12 files changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/workflows/benchmark-prs.yml b/.github/workflows/benchmark-prs.yml index af1b3ce0fe..8c6dab409e 100644 --- a/.github/workflows/benchmark-prs.yml +++ b/.github/workflows/benchmark-prs.yml @@ -5,7 +5,7 @@ on: pull_request env: CARGO_INCREMENTAL: "0" RUST_BACKTRACE: 1 - CLIENT_DATA_PATH: /home/runner/.local/share/safe/client + CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi NODE_DATA_PATH: /home/runner/.local/share/safe/node jobs: diff --git a/.github/workflows/generate-benchmark-charts.yml b/.github/workflows/generate-benchmark-charts.yml index 27a737a7a7..b8c6a10ffe 100644 --- a/.github/workflows/generate-benchmark-charts.yml +++ b/.github/workflows/generate-benchmark-charts.yml @@ -67,7 +67,7 @@ jobs: # Criterion outputs the actual bench results to stderr "2>&1 tee output.txt" takes stderr, # passes to tee which displays it in the terminal and writes to output.txt run: | - cargo criterion --features=local --message-format=json 2>&1 -p autonomi | tee -a output.txt + cargo criterion --features=local --message-format=json 2>&1 -p autonomi-cli | tee -a output.txt cat output.txt | rg benchmark-complete | jq -s 'map({ name: (.id | split("/"))[-1], unit: "MiB/s", @@ -158,17 +158,17 @@ jobs: shell: bash run: | peak_mem_usage=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob safe.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs/*/*.log -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/{print $2}' | sort -n | tail -n 1 ) total_mem=$( - rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs --glob safe.* -o --no-line-number --no-filename | + rg '"memory_used_mb":[^,]*' $CLIENT_DATA_PATH/logs/*/*.log -o --no-line-number --no-filename | awk -F':' '/"memory_used_mb":/ {sum += $2} END {printf "%.0f\n", sum}' ) num_of_times=$( - rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs --glob safe.* -c --stats | + rg "\"memory_used_mb\"" $CLIENT_DATA_PATH/logs/*/*.log -c --stats | rg "(\d+) matches" | rg "\d+" -o ) diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index 55d3790bb5..20116e6149 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -11,7 +11,7 @@ on: env: SAFE_DATA_PATH: /home/runner/.local/share/safe - CLIENT_DATA_PATH: /home/runner/.local/share/safe/client + CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi NODE_DATA_PATH: /home/runner/.local/share/safe/node BOOTSTRAP_NODE_DATA_PATH: /home/runner/.local/share/safe/bootstrap_node RESTART_TEST_NODE_DATA_PATH: /home/runner/.local/share/safe/restart_node diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 1b5395b028..3c50891759 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -313,7 +313,7 @@ jobs: - name: Delete current register signing key shell: bash - run: rm -rf ${{ matrix.safe_path }}/client + run: rm -rf ${{ matrix.safe_path }}/autonomi - name: Generate new register signing key run: ./target/release/autonomi --log-output-dest=data-dir register generate-key @@ -932,7 +932,7 @@ jobs: # ls -l /home/runner/.local/share/safe # rm -rf /home/runner/.local/share/safe/test_faucet # rm -rf /home/runner/.local/share/safe/test_genesis - # rm -rf /home/runner/.local/share/safe/client + # rm -rf /home/runner/.local/share/safe/autonomi # env: # SN_LOG: "all" # timeout-minutes: 5 @@ -973,7 +973,7 @@ jobs: # ls -l /home/runner/.local/share/safe # rm -rf /home/runner/.local/share/safe/test_faucet # rm -rf /home/runner/.local/share/safe/test_genesis - # rm -rf /home/runner/.local/share/safe/client + # rm -rf /home/runner/.local/share/safe/autonomi # ~/safe --log-output-dest=data-dir wallet create --no-password # if GENESIS_PK=a9925296499299fdbf4412509d342a92e015f5b996e9acd1d2ab7f2326e3ad05934326efdc345345a95e973ac1bb6637 GENESIS_SK=40f6bbc870355c68138ac70b450b6425af02b49874df3f141b7018378ceaac66 nohup ~/faucet --log-output-dest=data-dir send 100000000 $(~/safe --log-output-dest=data-dir wallet address | tail -n 1); then # echo "Faucet with different genesis key not rejected!" @@ -995,7 +995,7 @@ jobs: # ls -l /home/runner/.local/share/safe # rm -rf /home/runner/.local/share/safe/test_faucet # rm -rf /home/runner/.local/share/safe/test_genesis - # rm -rf /home/runner/.local/share/safe/client + # rm -rf /home/runner/.local/share/safe/autonomi # target/release/faucet server & # sleep 60 # env: @@ -1161,7 +1161,7 @@ jobs: # ls $CLIENT_DATA_PATH/wallet/confirmed_spends -l # ls $CLIENT_DATA_PATH/logs -l # env: - # CLIENT_DATA_PATH: /home/runner/.local/share/safe/client + # CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi # timeout-minutes: 1 # replication_bench_with_heavy_upload: @@ -1169,7 +1169,7 @@ jobs: # name: Replication bench with heavy upload # runs-on: ubuntu-latest # env: - # CLIENT_DATA_PATH: /home/runner/.local/share/safe/client + # CLIENT_DATA_PATH: /home/runner/.local/share/safe/autonomi # steps: # - uses: actions/checkout@v4 diff --git a/.github/workflows/nightly_wan.yml b/.github/workflows/nightly_wan.yml index 9c84f58488..e5f4a42511 100644 --- a/.github/workflows/nightly_wan.yml +++ b/.github/workflows/nightly_wan.yml @@ -129,7 +129,7 @@ jobs: path: | ~/.local/share/safe/node/*/logs/*.log* ~/.local/share/safe/*/*/*.log* - ~/.local/share/safe/client/logs/*/*.log* + ~/.local/share/safe/autonomi/logs/*/*.log* - name: destroy network if: always() @@ -235,7 +235,7 @@ jobs: # path: | # ~/.local/share/safe/node/*/logs/*.log* # ~/.local/share/safe/*/*/*.log* - # ~/.local/share/safe/client/logs/*/*.log* + # ~/.local/share/safe/autonomi/logs/*/*.log* # - name: destroy network # uses: maidsafe/sn-testnet-control-action/destroy-network@main @@ -349,7 +349,7 @@ jobs: # path: | # ~/.local/share/safe/node/*/logs/*.log* # ~/.local/share/safe/*/*/*.log* - # ~/.local/share/safe/client/logs/*/*.log* + # ~/.local/share/safe/autonomi/logs/*/*.log* # # - name: Stop the WAN network # if: always() @@ -555,7 +555,7 @@ jobs: # path: | # ~/.local/share/safe/node/*/logs/*.log* # ~/.local/share/safe/*/*/*.log* - # ~/.local/share/safe/client/logs/*/*.log* + # ~/.local/share/safe/autonomi/logs/*/*.log* # # - name: Stop the WAN network # if: always() diff --git a/.github/workflows/nightly_wan_churn.yml b/.github/workflows/nightly_wan_churn.yml index 5101f8fdd6..2cbf72fd8c 100644 --- a/.github/workflows/nightly_wan_churn.yml +++ b/.github/workflows/nightly_wan_churn.yml @@ -127,7 +127,7 @@ jobs: path: | ~/.local/share/safe/node/*/logs/*.log* ~/.local/share/safe/*/*/*.log* - ~/.local/share/safe/client/logs/*/*.log* + ~/.local/share/safe/autonomi/logs/*/*.log* - name: Stop the WAN network if: always() diff --git a/README.md b/README.md index 31d6c73e43..e591b0ca1b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Libp2p.
### For Users -- [CLI](https://github.com/maidsafe/safe_network/blob/main/autonomi_cli/README.md) The Command Line +- [CLI](https://github.com/maidsafe/safe_network/blob/main/autonomi-cli/README.md) The Command Line Interface, allowing users to interact with the network from their terminal. - [Node](https://github.com/maidsafe//safe_network/blob/main/sn_node/README.md) The backbone of the safe network. Nodes can be run on commodity hardware and provide storage space and validation of @@ -65,7 +65,7 @@ cargo build --release --features=network-contacts --bin safenode - [Autonomi API](https://github.com/maidsafe/safe_network/blob/main/autonomi/README.md) The client APIs allowing use of the Autonomi Network to users and developers. -- [Autonomi CLI](https://github.com/maidsafe/safe_network/blob/main/autonomi_cli/README.md) The Command Line +- [Autonomi CLI](https://github.com/maidsafe/safe_network/blob/main/autonomi-cli/README.md) The Command Line Interface, allowing users to interact with the network from their terminal. - [Node](https://github.com/maidsafe/safe_network/blob/main/sn_node/README.md) The backbone of the autonomi network. Nodes can be run on commodity hardware and run the Network. diff --git a/autonomi-cli/README.md b/autonomi-cli/README.md index b10d2128fb..42a487bd38 100644 --- a/autonomi-cli/README.md +++ b/autonomi-cli/README.md @@ -1,7 +1,7 @@ # A CLI for the Autonomi Network ``` -Usage: autonomi_cli [OPTIONS] +Usage: autonomi [OPTIONS] Commands: file Operations related to file handling diff --git a/autonomi-cli/benches/files.rs b/autonomi-cli/benches/files.rs index f545936334..4b4794c16e 100644 --- a/autonomi-cli/benches/files.rs +++ b/autonomi-cli/benches/files.rs @@ -99,7 +99,7 @@ fn get_cli_path() -> PathBuf { path.push("target"); } path.push("release"); - path.push("autonomi_cli"); + path.push("autonomi"); path } diff --git a/autonomi-cli/src/access/data_dir.rs b/autonomi-cli/src/access/data_dir.rs index af0db16c2c..b694d3f6fb 100644 --- a/autonomi-cli/src/access/data_dir.rs +++ b/autonomi-cli/src/access/data_dir.rs @@ -13,7 +13,7 @@ pub fn get_client_data_dir_path() -> Result { let mut home_dirs = dirs_next::data_dir() .ok_or_else(|| eyre!("Failed to obtain data dir, your OS might not be supported."))?; home_dirs.push("safe"); - home_dirs.push("client"); + home_dirs.push("autonomi"); std::fs::create_dir_all(home_dirs.as_path()).wrap_err("Failed to create data dir")?; Ok(home_dirs) } diff --git a/autonomi-cli/src/opt.rs b/autonomi-cli/src/opt.rs index 8f3fb20967..a49f6029b1 100644 --- a/autonomi-cli/src/opt.rs +++ b/autonomi-cli/src/opt.rs @@ -27,9 +27,9 @@ pub(crate) struct Opt { /// `data-dir` is the default value. /// /// The data directory location is platform specific: - /// - Linux: $HOME/.local/share/safe/client/logs - /// - macOS: $HOME/Library/Application Support/safe/client/logs - /// - Windows: C:\Users\\AppData\Roaming\safe\client\logs + /// - Linux: $HOME/.local/share/safe/autonomi/logs + /// - macOS: $HOME/Library/Application Support/safe/autonomi/logs + /// - Windows: C:\Users\\AppData\Roaming\safe\autonomi\logs #[allow(rustdoc::invalid_html_tags)] #[clap(long, value_parser = LogOutputDest::parse_from_str, verbatim_doc_comment, default_value = "data-dir")] pub log_output_dest: LogOutputDest, diff --git a/sn_logging/src/layers.rs b/sn_logging/src/layers.rs index 91f771e6b9..4bc1f46996 100644 --- a/sn_logging/src/layers.rs +++ b/sn_logging/src/layers.rs @@ -266,12 +266,10 @@ fn get_logging_targets(logging_env_value: &str) -> Result> if contains_keyword_all_sn_logs || contains_keyword_verbose_sn_logs { let mut t = BTreeMap::from_iter(vec![ // bins - ("autonomi_cli".to_string(), Level::TRACE), + ("autonomi-cli".to_string(), Level::TRACE), ("evm_testnet".to_string(), Level::TRACE), - ("faucet".to_string(), Level::TRACE), ("safenode".to_string(), Level::TRACE), ("safenode_rpc_client".to_string(), Level::TRACE), - ("safe".to_string(), Level::TRACE), ("safenode_manager".to_string(), Level::TRACE), ("safenodemand".to_string(), Level::TRACE), // libs @@ -279,8 +277,6 @@ fn get_logging_targets(logging_env_value: &str) -> Result> ("evmlib".to_string(), Level::TRACE), ("sn_evm".to_string(), Level::TRACE), ("sn_build_info".to_string(), Level::TRACE), - ("sn_client".to_string(), Level::TRACE), - ("sn_faucet".to_string(), Level::TRACE), ("sn_logging".to_string(), Level::TRACE), ("sn_node_manager".to_string(), Level::TRACE), ("sn_node_rpc_client".to_string(), Level::TRACE),