Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] move out localnet logic + add command for Aptos Workspace #15508

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

vgao1996
Copy link
Contributor

@vgao1996 vgao1996 commented Dec 5, 2024

This PR adds a new hidden command (aptos workspace) to the CLI. Based on our previous discussion, this is the easiest way to distribute aptos-workspace-binary.

To make this happen, I created a new crate aptos-localnet and moved some of the shared logic there. This is to deal with circular dependencies. This also aligns with the long-term vision @banool and I landed on -- we'll unify the two localnet implementations and eventually move everything into the aptos-localnet crate.

Copy link

trunk-io bot commented Dec 5, 2024

⏱️ 3h 40m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
execution-performance / single-node-performance 1h 35m 🟥🟩🟥🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 12m 🟩
rust-move-tests 12m 🟩
test-target-determinator 11m 🟩🟩🟩
execution-performance / test-target-determinator 11m 🟩🟩🟩
check 11m 🟩🟩🟩
check-dynamic-deps 7m 🟩🟩🟩🟩
rust-cargo-deny 7m 🟩🟩🟩🟩
rust-doc-tests 6m 🟩
rust-doc-tests 5m 🟩
rust-doc-tests 5m 🟩
fetch-last-released-docker-image-tag 5m 🟩🟩🟩
general-lints 2m 🟩🟩🟩🟩

🚨 1 job on the last run was significantly faster/slower than expected

Job Duration vs 7d avg Delta
execution-performance / single-node-performance 24m 19m +28%

settingsfeedbackdocs ⋅ learn more about trunk.io

Comment on lines +1 to +38
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

use crate::common::types::{CliCommand, CliResult, CliTypedResult};
use async_trait::async_trait;
use clap::Parser;

/// Tool for operations related to Aptos Workspace
#[derive(Parser)]
pub enum WorkspaceTool {
Run(RunWorkspace),
}

impl WorkspaceTool {
pub async fn execute(self) -> CliResult {
use WorkspaceTool::*;

match self {
Run(cmd) => cmd.execute_serialized_without_logger().await,
}
}
}

#[derive(Parser)]
pub struct RunWorkspace;

#[async_trait]
impl CliCommand<()> for RunWorkspace {
fn command_name(&self) -> &'static str {
"RunWorkspace"
}

async fn execute(self) -> CliTypedResult<()> {
aptos_workspace_server::run_all_services().await?;

Ok(())
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is the only new logic this PR adds. Everything else is just moving things around.

Copy link
Contributor

@0xmaayan 0xmaayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM

  • I didn't see we output a warning when they are trying to spin up the server but docker is not on/installed on their machine
  • What is the (hidden) command we use to spin up this server?

return Ok(())
}
res = all_services_up => {
match res.context("one or more services failed to start") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we know what services?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are supposed to, but there's some funky stuff happening with error propagation.

My observation/theory is that when we have one service failing, other services that depend on it will likely short-cutting it thus preventing the original message from being shown. Let me double check the error propagation chain and make sure this gets fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good enough for now, let's add a TODO to see if we can fix it later

@vgao1996
Copy link
Contributor Author

vgao1996 commented Dec 5, 2024

@0xmaayan

What is the (hidden) command we use to spin up this server?

aptos workspace run no additional options needed

I didn't see we output a warning when they are trying to spin up the server but docker is not on/installed on their machine

Yes, I have another PR coming that will tackle this and a few other issues

Copy link
Contributor

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

return Ok(())
}
res = all_services_up => {
match res.context("one or more services failed to start") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good enough for now, let's add a TODO to see if we can fix it later

@vgao1996 vgao1996 enabled auto-merge (squash) December 11, 2024 21:36
@vgao1996 vgao1996 force-pushed the cli-localnet-workspace branch from f49d7ae to e18b2fa Compare December 11, 2024 22:33

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@vgao1996 vgao1996 force-pushed the cli-localnet-workspace branch from e18b2fa to bceccd4 Compare December 11, 2024 23:04

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672

Compatibility test results for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672 (PR)
1. Check liveness of validators at old version: 3c6e693a27339e73520f41030dce8fc9cd504967
compatibility::simple-validator-upgrade::liveness-check : committed: 14317.84 txn/s, latency: 2309.52 ms, (p50: 1700 ms, p70: 1900, p90: 3000 ms, p99: 18200 ms), latency samples: 470380
2. Upgrading first Validator to new version: bceccd4e7e8caa990afec144557db7dced1ed672
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 4946.64 txn/s, latency: 5850.40 ms, (p50: 6400 ms, p70: 7000, p90: 7200 ms, p99: 7400 ms), latency samples: 95980
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 2832.38 txn/s, submitted: 2832.69 txn/s, expired: 0.31 txn/s, latency: 6843.23 ms, (p50: 7400 ms, p70: 7500, p90: 7700 ms, p99: 7800 ms), latency samples: 176021
3. Upgrading rest of first batch to new version: bceccd4e7e8caa990afec144557db7dced1ed672
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7154.86 txn/s, latency: 3990.95 ms, (p50: 4500 ms, p70: 4600, p90: 5000 ms, p99: 5400 ms), latency samples: 133920
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7366.14 txn/s, latency: 4464.90 ms, (p50: 4800 ms, p70: 4900, p90: 5100 ms, p99: 5200 ms), latency samples: 242980
4. upgrading second batch to new version: bceccd4e7e8caa990afec144557db7dced1ed672
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 12455.19 txn/s, latency: 2213.39 ms, (p50: 2400 ms, p70: 2400, p90: 2800 ms, p99: 3000 ms), latency samples: 214420
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 12719.74 txn/s, latency: 2474.57 ms, (p50: 2400 ms, p70: 2400, p90: 3300 ms, p99: 5300 ms), latency samples: 406440
5. check swarm health
Compatibility test for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on bceccd4e7e8caa990afec144557db7dced1ed672

two traffics test: inner traffic : committed: 14595.34 txn/s, latency: 2718.94 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3500 ms), latency samples: 5549520
two traffics test : committed: 100.01 txn/s, latency: 1416.57 ms, (p50: 1400 ms, p70: 1400, p90: 1500 ms, p99: 1900 ms), latency samples: 1780
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.575, avg: 1.505", "ConsensusProposalToOrdered: max: 0.322, avg: 0.293", "ConsensusOrderedToCommit: max: 0.379, avg: 0.370", "ConsensusProposalToCommit: max: 0.672, avg: 0.662"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.79s no progress at version 53401 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.69s no progress at version 2611528 (avg 0.69s) [limit 16].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672

Compatibility test results for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672 (PR)
Upgrade the nodes to version: bceccd4e7e8caa990afec144557db7dced1ed672
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1498.86 txn/s, submitted: 1502.45 txn/s, failed submission: 3.59 txn/s, expired: 3.59 txn/s, latency: 2015.18 ms, (p50: 2100 ms, p70: 2100, p90: 2600 ms, p99: 4400 ms), latency samples: 133440
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1288.74 txn/s, submitted: 1290.50 txn/s, failed submission: 1.76 txn/s, expired: 1.76 txn/s, latency: 2324.43 ms, (p50: 2100 ms, p70: 2400, p90: 3900 ms, p99: 10200 ms), latency samples: 117220
5. check swarm health
Compatibility test for 3c6e693a27339e73520f41030dce8fc9cd504967 ==> bceccd4e7e8caa990afec144557db7dced1ed672 passed
Upgrade the remaining nodes to version: bceccd4e7e8caa990afec144557db7dced1ed672
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1425.58 txn/s, submitted: 1429.67 txn/s, failed submission: 4.09 txn/s, expired: 4.09 txn/s, latency: 2145.52 ms, (p50: 2100 ms, p70: 2400, p90: 2700 ms, p99: 4200 ms), latency samples: 125560
Test Ok

@vgao1996 vgao1996 merged commit 803b7fd into aptos-labs:main Dec 12, 2024
43 of 46 checks passed
jkjun4574 added a commit to jkjun4574/aptos-core that referenced this pull request Dec 12, 2024
Copy link

@jkjun4574 jkjun4574 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

출금

@jkjun4574
Copy link

앱토스랩스 월렛

@jkjun4574
Copy link

출금

@jkjun4574
Copy link

/출금

@jkjun4574
Copy link

Hi there, I'm jkj0585 👋

Welcome to my GitHub profile! I'm passionate about software development and love to contribute to open-source projects. Here you'll find a collection of my work, projects, and contributions.

🔧 Technologies & Tools

  • Programming Languages: Python, JavaScript, Java, C++
  • Web Development: HTML, CSS, React, Node.js
  • Databases: MySQL, PostgreSQL, MongoDB
  • Tools & Platforms: Git, Docker, Kubernetes, AWS, Azure
  • Other: Machine Learning, Data Science, DevOps

📈 GitHub Stats

jkj0585's GitHub stats

🏆 Top Languages

Top Languages

📫 How to reach me

🌟 Projects

Here are a few projects I've worked on:

Feel free to explore my repositories and contribute to any projects that interest you!

Thanks for visiting my profile!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants