gpt4 book ai didi

java - 连接到 bazel-buildfarm 上的远程 Bazel master 时为 "Unavaliable io exception"

转载 作者:行者123 更新时间:2023-11-30 01:44:04 24 4
gpt4 key购买 nike

我想使用 bazel-buildfarm 设置一个小型 POC 远程区域,其中包含 1 个主节点 (192.168.60.99) 和 1 个工作节点 (192.168.60.98) 。两者都是配备 Vagrant 的 CentOS 7 机器。当从网络中的Ubuntu工作站(第三台机器)连接时,出现以下错误:

$ 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:

telnet 192.168.60.99 8980
Trying 192.168.60.99...
Connected to 192.168.60.99.
Escape character is '^]'.
第三台 Ubuntu 机器的

.bazelrc 文件:

$ cat ~/.bazelrc
build --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --strategy=Closure=remote --remote_executor=192.168.60.99:8980

Buildfarm 设置

两者都获得了 buildfarm git 存储库的克隆。 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 机器上运行良好。

主服务器

bazel run //src/main/java/build/buildfarm:buildfarm-server $(pwd)/examples/server.config.example

worker

bazel run //src/main/java/build/buildfarm:buildfarm-operationqueue-worker $(pwd)/examples/worker.config.example --distdir ~/distdir/

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

[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

最佳答案

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

--remote_executor=grpc://192.168.60.99:8980

如果没有协议(protocol),就会发生UNAVAILABLE: io 异常。目前没有关于此问题的文档。

关于java - 连接到 bazel-buildfarm 上的远程 Bazel master 时为 "Unavaliable io exception",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58825784/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com