-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
⏱️ 3h 40m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
// 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(()) | ||
} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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") { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Yes, I have another PR coming that will tackle this and a few other issues |
There was a problem hiding this 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") { |
There was a problem hiding this comment.
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
f49d7ae
to
e18b2fa
Compare
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.
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.
e18b2fa
to
bceccd4
Compare
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.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
…ce (aptos-labs#15508)" This reverts commit 803b7fd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
출금
앱토스랩스 월렛 |
출금 |
/출금 |
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
📈 GitHub Stats🏆 Top Languages📫 How to reach me
🌟 ProjectsHere 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! |
This PR adds a new hidden command (
aptos workspace
) to the CLI. Based on our previous discussion, this is the easiest way to distributeaptos-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 theaptos-localnet
crate.