Skip to content

Commit

Permalink
fix: try to fix anda_bot bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jan 20, 2025
1 parent b4697ad commit d96b86d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion agents/anda_bot/nitro_enclave/amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN mv linux-amd64/dnsproxy ./ && chmod +x dnsproxy
RUN wget -O ic_tee_nitro_gateway https://github.com/ldclabs/ic-tee/releases/download/v0.2.10/ic_tee_nitro_gateway
RUN chmod +x ic_tee_nitro_gateway

RUN wget -O anda_bot https://github.com/ldclabs/anda/releases/download/v0.2.6/anda_bot
RUN wget -O anda_bot https://github.com/ldclabs/anda/releases/download/v0.2.7/anda_bot
RUN chmod +x anda_bot

FROM --platform=linux/amd64 debian:bookworm-slim AS runtime
Expand Down
19 changes: 13 additions & 6 deletions agents/anda_bot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,21 @@ async fn bootstrap(cli: Cli) -> Result<(), BoxError> {
key: cose_setting_key.into(),
version: 0,
};
let encrypted_cfg = if let Ok(setting) = tee.setting_get(&encrypted_cfg_path).await {
let encrypted_cfg = decrypt_payload(&setting, &admin_master_secret, &[])?;
let encrypted_cfg = match tee.setting_get(&encrypted_cfg_path).await {
Ok(setting) => {
let encrypted_cfg = decrypt_payload(&setting, &admin_master_secret, &[])?;

config::Conf::from_toml(&String::from_utf8(encrypted_cfg)?)?
} else {
log::info!("encrypted_cfg not found:\n{:?}", &encrypted_cfg_path);
config::Conf::from_toml(&String::from_utf8(encrypted_cfg)?)?
}
Err(err) => {
log::info!(
"get encrypted_cfg error: {:?}\n{:?}",
err,
&encrypted_cfg_path
);

cfg.clone()
cfg.clone()
}
};

// LL Models
Expand Down

0 comments on commit d96b86d

Please sign in to comment.