Skip to content

Commit

Permalink
Fixes to get the process_executor CLI tool working again. (#10435)
Browse files Browse the repository at this point in the history
### Problem

The process_executor fails currently with 1) an untrimmed OAuth token, 2) no workunit store.

### Solution

Trim tokens, and create a workunit store.

### Result

The `process_executor` works for connecting to RBE.
  • Loading branch information
stuhood committed Jul 23, 2020
1 parent 09d3940 commit 43ebd34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/rust/engine/fs/store/src/remote.rs
Expand Up @@ -74,7 +74,12 @@ impl ByteStore {
serverset,
headers: oauth_bearer_token
.iter()
.map(|t| (String::from("authorization"), format!("Bearer {}", t)))
.map(|t| {
(
String::from("authorization"),
format!("Bearer {}", t.trim()),
)
})
.collect(),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/rust/engine/process_execution/src/remote.rs
Expand Up @@ -143,7 +143,7 @@ impl CommandRunner {
if let Some(oauth_bearer_token) = oauth_bearer_token {
headers.insert(
String::from("authorization"),
format!("Bearer {}", oauth_bearer_token),
format!("Bearer {}", oauth_bearer_token.trim()),
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/rust/engine/process_executor/src/main.rs
Expand Up @@ -43,6 +43,7 @@ use process_execution::{
};
use store::{BackoffConfig, Store};
use tokio::runtime::Handle;
use workunit_store::WorkunitStore;

/// A binary which takes args of format:
/// process_executor --env=FOO=bar --env=SOME=value --input-digest=abc123 --input-digest-length=80
Expand All @@ -54,6 +55,8 @@ use tokio::runtime::Handle;
#[tokio::main]
async fn main() {
env_logger::init();
let workunit_store = WorkunitStore::new(false);
workunit_store.init_thread_state(None);

let args = App::new("process_executor")
.arg(
Expand Down

0 comments on commit 43ebd34

Please sign in to comment.