Skip to content

Commit

Permalink
Add debug output for canister installation in testnet deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
derlerd-dfinity committed Dec 8, 2021
1 parent e10e3c1 commit c32d185
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
39 changes: 28 additions & 11 deletions rs/rust_canisters/canister_test/src/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,36 @@ impl Wasm {
install = install.with_memory_allocation(memory_allocation);
}

let canister_id = canister.canister_id;
println!(
"Attempting to install wasm into canister with ID: {}",
canister_id
);
match install.install(&mut canister, init_payload.clone()).await {
Ok(()) => return Ok(()),
Err(e) => match backoff.next_backoff() {
Some(interval) => {
std::thread::sleep(interval);
}
None => {
return Err(format!(
"Canister installation timed out. Last error was: {}",
e
));
Ok(()) => {
println!(
"Successfully installed wasm into canister with ID: {}",
canister_id
);
return Ok(());
}
Err(e) => {
eprintln!(
"Installation of wasm into cansiter with ID: {} failed with: {}",
canister_id, e
);
match backoff.next_backoff() {
Some(interval) => {
std::thread::sleep(interval);
}
None => {
return Err(format!(
"Canister installation timed out. Last error was: {}",
e
));
}
}
},
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion testnet/ansible/roles/ic_guest/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{% endif %}
tar xzf "{{ ic_media_path }}"/config.tgz -C "{{ ic_media_path }}" "./$NODE0_NAME"
"{{ ic_media_path }}/bin/ic-nns-init" \
timeout 600 "{{ ic_media_path }}/bin/ic-nns-init" \
--url "$NNS_URL" \
--registry-local-store-dir "{{ ic_media_path }}/$NODE0_NAME/ic_registry_local_store" \
$GOVERNANCE_PB \
Expand Down

0 comments on commit c32d185

Please sign in to comment.