首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当连接到bazel-buildfarm上的远程Bazel master时,出现"Unavaliable io exception“

当连接到bazel-buildfarm上的远程Bazel master时,出现"Unavaliable io exception“
EN

Stack Overflow用户
提问于 2019-11-13 03:55:04
回答 1查看 303关注 0票数 1

我想使用bazel-buildfarm设置一个具有1x主机(192.168.60.99)和1x工作器(192.168.60.98)的小型POC远程区域。这两台机器都是配置了Vagrant的CentOS 7计算机。从网络中的Ubuntu工作站(第三台机器)连接时,出现以下错误:

代码语言:javascript
运行
复制
$ bazel build --verbose_failures //projects/myproj:app
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
 Inherited 'common' options: --isatty=1 --terminal_columns=229
INFO: Reading rc options for 'build' from /home/user/tests/ecommerce/.bazelrc:
 'build' options: --strategy=TypeScriptCompile=worker --strategy=AngularTemplateCompile=worker --symlink_prefix=dist/ --define=compile=legacy --incompatible_strict_action_env --experimental_allow_incremental_repository_updates --distdir=third_party/_distdir
INFO: Reading rc options for 'build' from /home/user/.bazelrc:
 'build' options: --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --strategy=Closure=remote --remote_executor=192.168.60.99:8980
INFO: Writing tracer profile to '/home/user/.cache/bazel/_bazel_user/24700f1ad3e201a00a1c26bd59dc6502/command.profile.gz'
INFO: Invocation ID: 569b59ca-edcb-4922-92a0-b6f0b5ca2819
ERROR: Failed to query remote execution capabilities: UNAVAILABLE: io exception

网络连接正常,我甚至可以使用telnet连接到Bazel:

代码语言:javascript
运行
复制
telnet 192.168.60.99 8980
Trying 192.168.60.99...
Connected to 192.168.60.99.
Escape character is '^]'.

第三台Ubuntu机器的.bazelrc文件:

代码语言:javascript
运行
复制
$ cat ~/.bazelrc
build --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --strategy=Closure=remote --remote_executor=192.168.60.99:8980

构建场设置

两个人都有一份建筑农场git repo的克隆。使用The example config files。就在服务器上,我用192.168.60.99 (主服务器ip)替换了localhost

我知道不推荐使用bazel run。但在缺乏better alternatives that works的情况下,我的想法是首先让文档化的方式工作(Bazel本身没有提到任何替代方案)。由于甚至bazel run都不能工作,我认为我的安装出了问题。

所有机器都使用1.1.0版本,这是在撰写本文时最新的稳定版本。这绝对是bazel-buildfarm的问题,因为本地构建在Ubuntu机器上运行得很好。

主服务器

代码语言:javascript
运行
复制
bazel run //src/main/java/build/buildfarm:buildfarm-server $(pwd)/examples/server.config.example

工人

代码语言:javascript
运行
复制
bazel run //src/main/java/build/buildfarm:buildfarm-operationqueue-worker $(pwd)/examples/worker.config.example --distdir ~/distdir/

distdir是我们公司代理的一种变通方法,它使用MITM攻击来操纵文件。由于Bazel不允许这样做,我手动下载了它的jdk的受影响文件:

代码语言:javascript
运行
复制
[vagrant@localhost bazel-buildfarm]$ l ~/distdir/
total 188M
-rw-rw-r--. 1 vagrant vagrant 188M Jan 17  2019 zulu11.2.3-jdk11.0.1-linux_x64.tar.gz
EN

回答 1

Stack Overflow用户

发布于 2019-11-14 02:44:46

如果使用Bazel >= 1.0,我们需要在.bazelrc中指定协议grpc,如下所示:

代码语言:javascript
运行
复制
--remote_executor=grpc://192.168.60.99:8980

如果没有该协议,则会发生UNAVAILABLE: io exception。目前还没有关于这个问题的文档。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58825784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档