Skip to content

Commit

Permalink
Merge 384ad5b into b8e78b6
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Feb 23, 2021
2 parents b8e78b6 + 384ad5b commit 20ad3c9
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 46 deletions.
1 change: 0 additions & 1 deletion src/rust/engine/process_execution/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ impl CommandRunner {
crate::remote::populate_fallible_execution_result(
self.file_store.clone(),
action_result,
vec![],
platform,
true,
)
Expand Down
28 changes: 0 additions & 28 deletions src/rust/engine/process_execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ pub use log::Level;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};
use std::convert::TryFrom;
use std::ops::AddAssign;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use store::UploadSummary;
use workunit_store::{with_workunit, UserMetadataItem, WorkunitMetadata, WorkunitStore};

use async_semaphore::AsyncSemaphore;
Expand Down Expand Up @@ -350,32 +347,7 @@ pub struct FallibleProcessResultWithPlatform {
pub stderr_digest: Digest,
pub exit_code: i32,
pub platform: Platform,

// It's unclear whether this should be a Snapshot or a digest of a Directory. A Directory digest
// is handy, so let's try that out for now.
pub output_directory: hashing::Digest,

pub execution_attempts: Vec<ExecutionStats>,
}

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct ExecutionStats {
uploaded_bytes: usize,
uploaded_file_count: usize,
upload: Duration,
remote_queue: Option<Duration>,
remote_input_fetch: Option<Duration>,
remote_execution: Option<Duration>,
remote_output_store: Option<Duration>,
was_cache_hit: bool,
}

impl AddAssign<UploadSummary> for ExecutionStats {
fn add_assign(&mut self, summary: UploadSummary) {
self.uploaded_file_count += summary.uploaded_file_count;
self.uploaded_bytes += summary.uploaded_file_bytes;
self.upload += summary.upload_wall_time;
}
}

#[derive(Clone)]
Expand Down
2 changes: 0 additions & 2 deletions src/rust/engine/process_execution/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ export {}
stderr_digest,
exit_code: child_results.exit_code,
output_directory: output_snapshot.digest,
execution_attempts: vec![],
platform,
})
}
Expand All @@ -637,7 +636,6 @@ export {}
stderr_digest: hashing::EMPTY_DIGEST,
exit_code: -libc::SIGTERM,
output_directory: hashing::EMPTY_DIGEST,
execution_attempts: vec![],
platform,
})
}
Expand Down
3 changes: 0 additions & 3 deletions src/rust/engine/process_execution/src/local_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ async fn stdout() {
assert_eq!(result.stderr_bytes, "".as_bytes());
assert_eq!(result.original.exit_code, 0);
assert_eq!(result.original.output_directory, EMPTY_DIGEST);
assert_eq!(result.original.execution_attempts, vec![]);
}

#[tokio::test]
Expand All @@ -61,7 +60,6 @@ async fn stdout_and_stderr_and_exit_code() {
assert_eq!(result.stderr_bytes, "bar".as_bytes());
assert_eq!(result.original.exit_code, 1);
assert_eq!(result.original.output_directory, EMPTY_DIGEST);
assert_eq!(result.original.execution_attempts, vec![]);
}

#[tokio::test]
Expand Down Expand Up @@ -161,7 +159,6 @@ async fn output_files_none() {
assert_eq!(result.stderr_bytes, "".as_bytes());
assert_eq!(result.original.exit_code, 0);
assert_eq!(result.original.output_directory, EMPTY_DIGEST);
assert_eq!(result.original.execution_attempts, vec![]);
}

#[tokio::test]
Expand Down
13 changes: 3 additions & 10 deletions src/rust/engine/process_execution/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use workunit_store::{
};

use crate::{
Context, ExecutionStats, FallibleProcessResultWithPlatform, MultiPlatformProcess, Platform,
Process, ProcessCacheScope, ProcessMetadata,
Context, FallibleProcessResultWithPlatform, MultiPlatformProcess, Platform, Process,
ProcessCacheScope, ProcessMetadata,
};
use grpc_util::headers_to_interceptor_fn;

Expand Down Expand Up @@ -501,7 +501,6 @@ impl CommandRunner {
populate_fallible_execution_result(
self.store.clone(),
action_result,
vec![],
self.platform,
false,
)
Expand Down Expand Up @@ -735,7 +734,6 @@ impl CommandRunner {
&process.description,
process.timeout,
start_time.elapsed(),
Vec::new(),
self.platform,
)
.await;
Expand Down Expand Up @@ -1085,7 +1083,6 @@ pub async fn populate_fallible_execution_result_for_timeout(
description: &str,
timeout: Option<Duration>,
elapsed: Duration,
execution_attempts: Vec<ExecutionStats>,
platform: Platform,
) -> Result<FallibleProcessResultWithPlatform, String> {
let timeout_msg = if let Some(timeout) = timeout {
Expand All @@ -1101,7 +1098,6 @@ pub async fn populate_fallible_execution_result_for_timeout(
stderr_digest: hashing::EMPTY_DIGEST,
exit_code: -libc::SIGTERM,
output_directory: hashing::EMPTY_DIGEST,
execution_attempts,
platform,
})
}
Expand All @@ -1116,7 +1112,6 @@ pub async fn populate_fallible_execution_result_for_timeout(
pub fn populate_fallible_execution_result(
store: Store,
action_result: &remexec::ActionResult,
execution_attempts: Vec<ExecutionStats>,
platform: Platform,
treat_tree_digest_as_final_directory_hack: bool,
) -> BoxFuture<Result<FallibleProcessResultWithPlatform, String>> {
Expand All @@ -1137,7 +1132,6 @@ pub fn populate_fallible_execution_result(
stderr_digest,
exit_code,
output_directory,
execution_attempts,
platform,
})
},
Expand Down Expand Up @@ -1391,8 +1385,7 @@ pub async fn check_action_cache(
Ok(action_result) => {
let action_result = action_result.into_inner();
let response =
populate_fallible_execution_result(store.clone(), &action_result, vec![], platform, false)
.await?;
populate_fallible_execution_result(store.clone(), &action_result, platform, false).await?;
if eager_fetch {
future::try_join_all(vec![
store.ensure_local_has_file(response.stdout_digest).boxed(),
Expand Down
2 changes: 0 additions & 2 deletions src/rust/engine/process_execution/src/remote_cache_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl MockLocalCommandRunner {
stderr_digest: EMPTY_DIGEST,
exit_code,
output_directory: EMPTY_DIGEST,
execution_attempts: vec![],
platform: Platform::current().unwrap(),
}),
call_counter,
Expand Down Expand Up @@ -564,7 +563,6 @@ async fn make_action_result_basic() {
exit_code: 102,
platform: Platform::Linux,
output_directory: directory_digest,
execution_attempts: Vec::new(),
};

let (action_result, digests) = runner
Expand Down

0 comments on commit 20ad3c9

Please sign in to comment.