Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert remote execution from tower to grpcio #7256

Merged
merged 3 commits into from Feb 18, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+562 −569
Diff settings

Always

Just for now

Revert "Switch operation getting to tower (#7108)"

This reverts commit 0375b30.
  • Loading branch information...
illicitonion committed Feb 18, 2019
commit 04c452a4a38f73daa85dd358386e49fc913371f0
Copy path View file

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -15,13 +15,12 @@ fs = { path = "../fs" }
futures = "^0.1.16"
# TODO: Switch to a release once https://github.com/alexcrichton/futures-timer/pull/11 and https://github.com/alexcrichton/futures-timer/pull/12 merge
futures-timer = { git = "https://github.com/pantsbuild/futures-timer", rev = "0b747e565309a58537807ab43c674d8951f9e5a0" }
grpcio = { git = "https://github.com/pantsbuild/grpc-rs.git", rev = "4dfafe9355dc996d7d0702e7386a6fedcd9734c0", default_features = false, features = ["protobuf-codec"] }
h2 = "0.1.13"
hashing = { path = "../hashing" }
http = "0.1"
log = "0.4"
parking_lot = "0.6"
prost = "0.4"
prost-types = "0.4"
protobuf = { version = "2.0.4", features = ["with-bytes"] }
resettable = { path = "../resettable" }
sha2 = "0.8"
@@ -10,7 +10,6 @@ bytes = "0.4.5"
futures = "^0.1.16"
grpcio = { git = "https://github.com/pantsbuild/grpc-rs.git", rev = "4dfafe9355dc996d7d0702e7386a6fedcd9734c0", default_features = false, features = ["protobuf-codec"] }
hashing = { path = "../../hashing" }
log = "0.4"
prost = "0.4"
prost-derive = "0.4"
prost-types = "0.4"
@@ -176,11 +176,9 @@ fn generate_for_tower(thirdpartyprotobuf: &Path, out_dir: PathBuf) {
.enable_server(true)
.enable_client(true)
.build(
&[
PathBuf::from("build/bazel/remote/execution/v2/remote_execution.proto"),
PathBuf::from("google/rpc/code.proto"),
PathBuf::from("google/rpc/error_details.proto"),
],
&[PathBuf::from(
"build/bazel/remote/execution/v2/remote_execution.proto",
)],
&std::fs::read_dir(&thirdpartyprotobuf)
.unwrap()
.into_iter()
@@ -1,7 +1,4 @@
use bytes::BytesMut;
use hashing;
use log::error;
use prost::Message;

impl<'a> From<&'a hashing::Digest> for crate::remote_execution::Digest {
fn from(d: &hashing::Digest) -> Self {
@@ -100,47 +97,6 @@ impl From<crate::build::bazel::remote::execution::v2::ExecuteRequest>
}
}

// This should only be used in test contexts. It should be deleted when the mock systems use tower.
impl Into<grpcio::RpcStatus> for crate::google::rpc::Status {
fn into(self) -> grpcio::RpcStatus {
let mut buf = BytesMut::with_capacity(self.encoded_len());
self.encode(&mut buf).unwrap();
grpcio::RpcStatus {
status: self.code.into(),
details: None,
status_proto_bytes: Some(buf.to_vec()),
}
}
}

// TODO: Use num_enum or similar here when TryInto is stable.
pub fn code_from_i32(i: i32) -> crate::google::rpc::Code {
use crate::google::rpc::Code::*;
match i {
0 => Ok,
1 => Cancelled,
2 => Unknown,
3 => InvalidArgument,
4 => DeadlineExceeded,
5 => NotFound,
6 => AlreadyExists,
7 => PermissionDenied,
8 => ResourceExhausted,
9 => FailedPrecondition,
10 => Aborted,
11 => OutOfRange,
12 => Unimplemented,
13 => Internal,
14 => Unavailable,
15 => DataLoss,
16 => Unauthenticated,
_ => {
error!("Unknown grpc error code: {}, default to Unknown", i);
Unknown
}
}
}

pub fn prost_any_to_gcprio_any(any: prost_types::Any) -> protobuf::well_known_types::Any {
let prost_types::Any { type_url, value } = any;
let mut dst = protobuf::well_known_types::Any::new();
@@ -13,6 +13,5 @@ mod gen_for_tower;
pub use crate::gen_for_tower::*;

mod conversions;
pub use crate::conversions::code_from_i32;
mod verification;
pub use crate::verification::verify_directory_canonical;
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.