Skip to content

Commit

Permalink
chore: provision uploaders on upscale when specified
Browse files Browse the repository at this point in the history
The uploader provisioning should only run when either of the uploader counts have been supplied.

This prevents the need to supply the secret key for the funding wallet on other types of upscales
where it is not relevant.
  • Loading branch information
jacderida committed Jan 21, 2025
1 parent d635867 commit cc4ce74
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,17 @@ async fn main() -> Result<()> {
}

if desired_uploader_vm_count.is_some() && ant_version.is_none() {
return Err(eyre!("The --ant-version argument is required when --desired-uploader-vm-count is used"));
return Err(eyre!(
"The ant version is required to upscale the uploaders"
));
}

if (desired_uploader_vm_count.is_some() || desired_uploaders_count.is_some())
&& funding_wallet_secret_key.is_none()
{
return Err(eyre!(
"The funding wallet secret key is required to upscale the uploaders"
));
}

println!("Upscaling deployment...");
Expand Down
7 changes: 4 additions & 3 deletions src/upscale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ impl TestnetDeployer {
let initial_network_contacts_url = get_bootstrap_cache_url(&initial_ip_addr);
debug!("Retrieved initial peer {initial_multiaddr} and initial network contacts {initial_network_contacts_url}");

let should_provision_private_nodes = desired_private_node_vm_count > 0;

if !is_bootstrap_deploy {
self.wait_for_ssh_availability_on_new_machines(
AnsibleInventoryType::PeerCacheNodes,
Expand Down Expand Up @@ -258,6 +256,7 @@ impl TestnetDeployer {
}
}

let should_provision_private_nodes = desired_private_node_vm_count > 0;
if should_provision_private_nodes {
println!("Private node provisioning will be skipped during upscale");
// TODO: Reenable this after examining and fixing the problems.
Expand Down Expand Up @@ -305,7 +304,9 @@ impl TestnetDeployer {
}
}

if !is_bootstrap_deploy {
let should_provision_uploaders = options.desired_uploaders_count.is_some()
|| options.desired_uploader_vm_count.is_some();
if should_provision_uploaders {
self.wait_for_ssh_availability_on_new_machines(
AnsibleInventoryType::Uploaders,
&options.current_inventory,
Expand Down

0 comments on commit cc4ce74

Please sign in to comment.