Skip to content

Commit

Permalink
Make -ldebug less chatty when using remote caching (#11667)
Browse files Browse the repository at this point in the history
These workunits were flooding `-ldebug`. If a user still wants them at `-ldebug` level to debug remoting, they can use `--log-levels-by-target`. This PR is about setting a sensible default for every day uses.

[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano committed Mar 13, 2021
1 parent 070bc5e commit 0fc6fb7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/python/pants/engine/process.py
Expand Up @@ -505,7 +505,7 @@ async def get_bash() -> BashBinary:
return await Get(BashBinary, BashBinaryRequest(rationale="execute bash scripts"))


@rule(desc="Find binary path", level=LogLevel.DEBUG)
@rule
async def find_binary(request: BinaryPathRequest) -> BinaryPaths:
# If we are not already locating bash, recurse to locate bash to use it as an absolute path in
# our shebang. This avoids mixing locations that we would search for bash into the search paths
Expand Down
3 changes: 3 additions & 0 deletions src/python/pants/option/global_options.py
Expand Up @@ -189,6 +189,9 @@ def from_options(
remote_cache_read = False
remote_cache_write = False
else:
logger.debug(
"`--remote-auth-plugin` succeeded. Remote caching/execution will be attempted."
)
remote_execution_headers = auth_plugin_result.execution_headers
remote_store_headers = auth_plugin_result.store_headers
if (
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/src/cache.rs
Expand Up @@ -131,7 +131,7 @@ impl crate::CommandRunner for CommandRunner {
context2.workunit_store,
"local_cache_read".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
cache_read_future,
Expand Down
19 changes: 11 additions & 8 deletions src/rust/engine/process_execution/src/remote.rs
Expand Up @@ -313,7 +313,7 @@ impl CommandRunner {
parent_id,
&workunit_store,
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
),
Expand All @@ -338,7 +338,7 @@ impl CommandRunner {
parent_id,
&workunit_store,
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
),
Expand All @@ -363,7 +363,7 @@ impl CommandRunner {
parent_id,
&workunit_store,
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
),
Expand All @@ -388,7 +388,7 @@ impl CommandRunner {
parent_id,
&workunit_store,
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
),
Expand Down Expand Up @@ -771,7 +771,8 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"ensure_action_stored_locally".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("ensure action stored locally for {:?}", action)),
..WorkunitMetadata::default()
},
ensure_action_stored_locally(&self.store, &command, &action),
Expand All @@ -785,7 +786,8 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"check_action_cache".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("check action cache for {:?}", action_digest)),
..WorkunitMetadata::default()
},
check_action_cache(
Expand Down Expand Up @@ -813,7 +815,8 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"ensure_action_uploaded".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("ensure action uploaded for {:?}", action_digest)),
..WorkunitMetadata::default()
},
ensure_action_uploaded(&store, command_digest, action_digest, request.input_files),
Expand All @@ -831,7 +834,7 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"run_execute_request".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
timeout_fut,
Expand Down
11 changes: 7 additions & 4 deletions src/rust/engine/process_execution/src/remote_cache.rs
Expand Up @@ -342,7 +342,8 @@ impl CommandRunner {
context.workunit_store.clone(),
"ensure_action_uploaded".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("ensure action uploaded for {:?}", action_digest)),
..WorkunitMetadata::default()
},
crate::remote::ensure_action_uploaded(
Expand Down Expand Up @@ -408,7 +409,8 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"ensure_action_stored_locally".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("ensure action stored locally for {:?}", action)),
..WorkunitMetadata::default()
},
crate::remote::ensure_action_stored_locally(&self.store, &command, &action),
Expand All @@ -425,7 +427,8 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store.clone(),
"check_action_cache".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
desc: Some(format!("check action cache for {:?}", action_digest)),
..WorkunitMetadata::default()
},
crate::remote::check_action_cache(
Expand Down Expand Up @@ -527,7 +530,7 @@ impl crate::CommandRunner for CommandRunner {
context.workunit_store,
"remote_cache_write".to_owned(),
WorkunitMetadata {
level: Level::Debug,
level: Level::Trace,
..WorkunitMetadata::default()
},
cache_write_future,
Expand Down

0 comments on commit 0fc6fb7

Please sign in to comment.