diff options
author | 2017-04-19 19:01:43 +0200 | |
---|---|---|
committer | 2017-04-20 11:06:47 +0200 | |
commit | 3ffc6a7b47bf2da1fa723343f0e88962d308ee63 (patch) | |
tree | 463ff9fe772e7c31ea567a6a8e32a90695a682a3 /src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java | |
parent | dfcd5da86e2acfd42ca09c7f65e012465ab3e382 (diff) |
OnePlatform auth support for Bazel, in preparation for next version of the API.
TESTED: local server
RELNOTES: n/a
PiperOrigin-RevId: 153599636
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java index 7484dafae9..e7025beee8 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java @@ -41,10 +41,8 @@ import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.protobuf.TextFormat; import com.google.protobuf.TextFormat.ParseException; -import io.grpc.ManagedChannel; import io.grpc.StatusRuntimeException; import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; import java.util.List; import java.util.SortedMap; @@ -90,19 +88,14 @@ final class RemoteSpawnRunner implements SpawnRunner { private static GrpcRemoteExecutor connect(RemoteOptions options) { Preconditions.checkArgument(GrpcRemoteExecutor.isRemoteExecutionOptions(options)); - ManagedChannel channel; - try { - channel = RemoteUtils.createChannel(options.remoteWorker); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - return new GrpcRemoteExecutor(channel, options); + ChannelOptions channelOptions = ChannelOptions.create(options); + return new GrpcRemoteExecutor( + RemoteUtils.createChannel(options.remoteWorker, channelOptions), channelOptions, options); } @Override - public SpawnResult exec( - Spawn spawn, - SpawnExecutionPolicy policy) throws InterruptedException, IOException { + public SpawnResult exec(Spawn spawn, SpawnExecutionPolicy policy) + throws InterruptedException, IOException { ActionExecutionMetadata owner = spawn.getResourceOwner(); if (owner.getOwner() != null) { policy.report(ProgressStatus.EXECUTING); @@ -193,7 +186,7 @@ final class RemoteSpawnRunner implements SpawnRunner { private static void passRemoteOutErr( RemoteActionCache cache, ActionResult result, FileOutErr outErr) - throws CacheNotFoundException { + throws CacheNotFoundException { ImmutableList<byte[]> streams = cache.downloadBlobs(ImmutableList.of(result.getStdoutDigest(), result.getStderrDigest())); outErr.printOut(new String(streams.get(0), UTF_8)); |