Skip to content

Commit

Permalink
Merge pull request #3281 from golemfactory/provider/add-self-test-com…
Browse files Browse the repository at this point in the history
…mand

Add self-test command to provider cli
  • Loading branch information
nieznanysprawiciel authored Jul 30, 2024
2 parents 83d4600 + 48e25db commit 8483435
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion agent/provider/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async fn main() -> anyhow::Result<()> {

let cli_args = StartupConfig::from_args();
match &cli_args.commands {
Commands::Run(_) => (), // logging is handled by ProviderAgent
Commands::Run(_) => (), // logging is handled by ProviderAgent
Commands::SelfTest(_) => (), // logging is handled by ProviderAgent
_ => {
ya_file_logging::start_logger("info", None, &[], false)?;
}
Expand Down Expand Up @@ -42,6 +43,12 @@ async fn main() -> anyhow::Result<()> {

Ok(())
}
Commands::SelfTest(args) => {
let agent = ProviderAgent::new(args, config).await?.start();
agent.send(Shutdown).await??;
log::info!("Self-test finished. Exiting...");
Ok(())
}
Commands::Config(config_cmd) => config_cmd.run(config),
Commands::Preset(presets_cmd) => presets_cmd.run(config),
Commands::PreInstall(preinstall_cmd) => preinstall_cmd.run(config),
Expand Down
2 changes: 2 additions & 0 deletions agent/provider/src/startup_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ pub struct StartupConfig {
pub enum Commands {
/// Run provider agent
Run(RunConfig),
/// Dry run provider agent to check configuration and test runtimes.
SelfTest(RunConfig),
/// Configure provider agent
Config(ConfigConfig),
/// Manage offer presets
Expand Down

0 comments on commit 8483435

Please sign in to comment.