Tag: bazel

bazel安装到0.5.4或更高版本来构buildTensorFlow

我正在用Bazel使用docker build –pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel .构build一个TensorFlow的容器docker build –pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel . 并运行docker run -it $USER/tensorflow-serving-devel如下所示: https : docker run -it $USER/tensorflow-serving-devel 但是,运行./configure命令后,我得到这个错误 root@4489fe3513fc:/serving/tensorflow# ./configure Extracting Bazel installation… You have bazel 0.5.1 installed. Please upgrade your bazel installation to version 0.5.4 or higher to build TensorFlow! Configuration finished root@4489fe3513fc:/serving/tensorflow# cd .. root@4489fe3513fc:/serving# […]

在一个Docker容器中运行sandboxing的bazel

我想在Docker容器中使用bazel来构build。 不过,我总是得到以下警告: 警告:您的系统不支持沙箱执行,因此无法保证操作的密封性。 有关更多信息,请参阅http://bazel.io/docs/bazel-user-manual.html#sandboxing 。 您可以通过–ignore_unsupported_sandboxingclosures此警告。 我确实想使用沙箱。 我知道这是一个特权问题,发生这种情况是因为Docker守护进程删除了一些特权。 我需要什么特权,如此沙盒作品? 注意:仅使用–privileged不是一个选项。

有没有办法得到bazel沙盒目录时不支持沙盒?

我在一个docker集装箱里面运行着bazel。 在本地,当我运行没有标志bazel时,我得到以下警告: 警告:您的系统不支持沙箱执行,因此无法保证操作的密封性。 有关更多信息,请参阅http://bazel.build/docs/bazel-user-manual.html#sandboxing 。 您可以通过–ignore_unsupported_sandboxingclosures此警告。 虽然我失去了一些关于气密性的保证,但是在运行我的任何一个genrules之前,Bazel仍然创build了所有的沙箱目录。 然而,在CI中,我没有看到这个警告,而是在尝试沙箱时遇到失败。 所以我通过了–genrule_strategy=standalone来停止崩溃,但是现在我的genrules正在工作区中执行,我绝对不想这样做。 有没有办法让我得到我在本地看到的行为,显式沙盒调用被禁用,因为他们会失败,但正确复制srcs / deps /数据正确的tmp目录创build仍然发生? 要么我可以通过一个标志触发这种行为,或者我可以做的事情,我的系统说服bazel沙盒不支持呢?

如何加快谷歌云平台上的bazel构build

我正在使用gcr.io/cloud-builders/bazel在Google容器构build上构build我的图像。 从日志看来,似乎大部分时间都是为bazel设置工作区。 这个工作空间不会从构build变成构build,所以我认为可以预先计算并存储在一个新的图像。 如何加快Google云端平台上的这些bazel版本? Already have image (with digest): gcr.io/cloud-builders/bazel Extracting Bazel installation… …………………… Loading: Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_protobuf : new_go_repository is deprecated. Please migrate to go_repository soon. WARNING: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/io_bazel_rules_go/go/def.bzl:137:3: DEPRECATED: com_github_golang_glog : new_go_repository is […]

Bazel:在container_image中包含runfiles

使用container_image规则创buildDocker镜像时,镜像中不存在必要的运行文件。 pkg_tar规则也是如此,看起来实际上是这个问题。 使用下面的BUILD文件,我期望sh_binary tool_b出现在tool_a的运行文件中 。 container_image( name = "my image", base = "@bash//image", directory = "/usr/local/opt", files = [":tool_a"], ) sh_binary( name = "tool_a", visibility = ["//visibility:public"], srcs = ["tool_a.sh"], data = [":tool_b"], ) sh_binary( name = "tool_b", visibility = ["//visibility:public"], srcs = ["tool_b.sh"], ) 然而,图像只包含tool_a.sh和tool_a包装。 我怎样才能包含运行文件呢?

用尽虚拟内存使用Docker Toolbox安装SyntaxNet

尝试使用Docker Toolbox从此Dockerfile安装SyntaxNet时,我耗尽了虚拟内存。 编译Dockerfile时收到这个消息: ERROR: /root/.cache/bazel/_bazel_root/5b21cea144c0077ae150bf0330ff61a0/external/org_tensorflow/tensorflow/core/kernels/BUILD:1921:1: C++ compilation of rule '@org_tensorflow//tensorflow/core/kernels:svd_op' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers … (remaining 115 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. virtual memory exhausted: Cannot allocate memory ____Building complete. ____Elapsed time: 8548.364s, Critical Path: 8051.91s 我有一种感觉,这可以通过更改Bazel的默认作业限制(例如)–jobs –jobs=1 ,但是我不知道我会把它放在Dockerfile中。

端口隔离与泊坞内的bazel

尝试使用docker 特权容器中的bazel和linux来testing端口隔离,并且失败。 我的环境如下(所有的命令从aws上运行的priviliged容器运行): $ uname -a Linux 167-docker99 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64 GNU/Linux builduser@167-docker99:~/ws/bazel-port-isolation$ cat /etc/*-release PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"Bazel version $ bazel version Build label: 0.5.1 Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Tue Jun 6 10:34:11 2017 (1496745251) Build timestamp: 1496745251 Build timestamp […]

在osx上运行docker内bazeltestingenv

试图运行在ProcessBuilder运行java_test 。 简化testing的代码如下: @Test public void testDockerExecutable(){ System.out.println("======== running docker =============="); try { Process p = new ProcessBuilder("docker","version") .inheritIO() .start(); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); } } 从shell直接运行docker version给出了输出: Client: Version: 17.03.1-ce API version: 1.27 Go version: go1.7.5 Git commit: c6d412e Built: Tue Mar 28 00:40:02 2017 OS/Arch: darwin/amd64 Server: Version: […]