Skip to content

Commit

Permalink
Avoid rebuilding containers unnecessarily to reduce job run time.
Browse files Browse the repository at this point in the history
Change-Id: Ibd3734824a4fe129dee6f0d3040765215e40fcb4
  • Loading branch information
jblebrun committed May 20, 2024
1 parent 73edbf1 commit 7a46943
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ all_ensure_no_std: (ensure_no_std "micro_rpc") (ensure_no_std "oak_attestation_v
kokoro_build_binaries_rust: all_enclave_apps oak_restricted_kernel_bin oak_restricted_kernel_simple_io_init_rd_wrapper stage0_bin

kokoro_oak_containers: all_oak_containers_binaries oak_functions_containers_container_bundle_tar
RUST_LOG="debug" cargo nextest run --all-targets --hide-progress-bar --package='oak_containers_hello_world_untrusted_app'
OAK_CONTAINERS_BINARIES_ALREADY_BUILT=1 RUST_LOG="debug" cargo nextest run --all-targets --hide-progress-bar --package='oak_containers_hello_world_untrusted_app'

kokoro_run_tests: all_ensure_no_std
RUST_LOG="debug" cargo nextest run --all-targets --hide-progress-bar --workspace --exclude='oak_containers_hello_world_untrusted_app'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

//! Integration test that launches the trusted app and invokes it.
use std::sync::Once;
use std::{env, sync::Once};

use oak_client::verifier::{AttestationVerifier, InsecureAttestationVerifier};
use oak_containers_launcher::{proto::oak::key_provisioning::v1::GetGroupKeysRequest, Args};
Expand All @@ -33,9 +33,14 @@ fn init_logging() {
}

static INIT_DEPENDENCIES: Lazy<anyhow::Result<()>> = Lazy::new(|| {
// This takes a long time, but we want to make sure everything it up to date.
// TODO(#4195): Stop dependencies from always being rebuilt.
duct::cmd!("just", "all_oak_containers_binaries",).dir(env!("WORKSPACE_ROOT")).run()?;
if env::var("OAK_CONTAINERS_BINARIES_ALREADY_BUILT").unwrap_or_default().is_empty() {
log::info!("Rebuilding all_oak_containers_binaries.");
log::info!(
"To prevent this, set the OAK_CONTAINERS_BINARIES_ALREADY_BUILT environment variable."
);
duct::cmd!("just", "all_oak_containers_binaries",).dir(env!("WORKSPACE_ROOT")).run()?;
}

Ok(())
});

Expand Down

0 comments on commit 7a46943

Please sign in to comment.