bazel

make Bazel use python 3

血红的双手。 提交于 2021-02-10 11:57:17
问题 I would like to run my py_test with python 3 in Bazel. py_library( name = "foo", srcs = ["foo.py"] ) py_test( name = "foo_test", srcs = glob(["foo_test.py",]), deps = [":foo"] ) py_runtime( name = "python-3.6.3", files = [], interpreter_path = "/usr/local/bin/python3", ) I was able to achieve this using command bazel test --python_top=//path/to/foo:python-3.6.3 foo_test However, I would like to import python3 to bazel sandbox with new_http_archive and provide the interpreter_path for the py

【Kubernetes社区之路】kubernetes机器人指令介绍

泄露秘密 提交于 2021-02-09 14:12:19
Prow 是kubernetes社区使用的CI/CD系统,基于kubernetes实现,它提供了一系列 /foo 格式的命令供用户使用。使用这些指令,可以让机器人完成相应的工作,例如,当你提交PR后,可以使用 /assign @<somebody> 命令来指定一个owner来审核你的PR。 当开发者提交PR(Pull Request)到kubernetes社区时,机器人会自动回复你,并在回复中指示当前PR的状态或者指示你下一步该如何做,别人也会在你的PR中回复一些机器人命令,所以,做为开发者有必要清楚的了解常用的一些命令。 下面介绍一些比较常见的命令,更多的命令可以查阅官方介绍( https://prow.k8s.io/command-help)。 TODO: 或许可以按照标签操作类、流程控制类、其他来分类 重跑失败的用例:/retest 顾名思义,这个命令用于重新执行失败的测试(有时自动化测试会因环境因素而失败),由于只有PR才会触发自动化测试,所以这个命令仅用于PR中。 用法举例: /retest : 重启失败的测试 使用条件: 只能用于可信的PR,即包含 ok-to-test 标签的PR; 任何人都可以使用; 命令效果: 重新启动失败的测试; 图示如下: 手动触发测试用途:/test /test 用于手动执行某个或全部测试用例,有些用例并没包括在自动化测试用例范围内

Single or multiple bazel WORKSPACE should be used for monolithic repo?

好久不见. 提交于 2021-02-08 11:17:17
问题 We put all products and libraries in one monolithic git repository. Its layout looks like this: - FooProduct - BarProduct - BazLibrary - 3rd_party |- fftw |- msgpack |- zlib At current, we are using CMake to control the build. As CMake has separated config, generate and build phase, it would take extremely long time to run if you generate all things together. To avoid this, we give top-level CMakeLists.txt for each part, and referring peer projects by up-level add_subirectory calls. For

Dependency archiving for airgapped network

爷,独闯天下 提交于 2021-02-08 09:24:11
问题 I am trying to use Bazel in a network which is not connected to the internet. Even without using any special libraries, Bazel still needs to download some dependencies via HTTP. I was advised to try and set up an HTTP proxy server which will cache the files which Bazel downloads, and then transfer the proxy server along with its cache into our isolated network. In order for this to work, I need to be able to operate the proxy in two modes: When creating the cache, the proxy caches all

how to use clang++ instead g++ in Bazel

穿精又带淫゛_ 提交于 2021-02-06 15:18:30
问题 I want to use clang++ instead g++ to compile my c++ files while g++ is the system's default compiler. I have tried sudo update-alternatives --install c++ c++ /home/guo/bin/clang++ 100 and set CC environment. But they doesn't work. Bazel still uses g++ as compiler. After an hour, Bazel uses clang++. But an error occurred. ERROR: /home/guo/utils/lib/BUILD:2:1: C++ compilation of rule '//utils/lib:get_pdf' failed: linux-sandbox failed: error executing command /home/guo/.cache/bazel/_bazel_guo

how to use clang++ instead g++ in Bazel

五迷三道 提交于 2021-02-06 15:16:05
问题 I want to use clang++ instead g++ to compile my c++ files while g++ is the system's default compiler. I have tried sudo update-alternatives --install c++ c++ /home/guo/bin/clang++ 100 and set CC environment. But they doesn't work. Bazel still uses g++ as compiler. After an hour, Bazel uses clang++. But an error occurred. ERROR: /home/guo/utils/lib/BUILD:2:1: C++ compilation of rule '//utils/lib:get_pdf' failed: linux-sandbox failed: error executing command /home/guo/.cache/bazel/_bazel_guo

Softmax Cross Entropy implementation in Tensorflow Github Source Code

我的梦境 提交于 2021-01-29 22:23:59
问题 I am trying to implement a Softmax Cross-Entropy loss in python. So, I was looking at the implementation of Softmax Cross-Entropy loss in the GitHub Tensorflow repository. I am trying to understand it but I run into a loop of three functions and I don't understand which line of code in the function is computing the Loss? The function softmax_cross_entropy_with_logits_v2(labels, logits, axis=-1, name=None) returns the function softmax_cross_entropy_with_logits_v2_helper(labels=labels, logits

How to emulate float/double/real in Bazel?

被刻印的时光 ゝ 提交于 2021-01-29 09:45:37
问题 Bazel (0.26.0) does not support float types as you can read here. However, I would like to compute some magic (floating-point) number store them in string as shown here: def magicNumber(): fileStr = "" count = 200 for i in range(0, count-1): v = i / count fileStr += str(v) + " " return fileStr I want to use Bazel-only features to achieve this. It is clear to me that I could also place my computation for instance in batch/shell script, but I want stick to Bazel-only features. Any ideas how to

Mingw-w64 toolchain for Bazel (Ubuntu 20.04.1 )

不打扰是莪最后的温柔 提交于 2021-01-29 07:00:14
问题 I am trying to create my toolchain for mingw-w64 on Ubuntu with Bazel. I am following this tutorial: https://docs.bazel.build/versions/master/tutorial/cc-toolchain-config.html. However, when I try to adapt the compilers paths to the paths of my mingw64 installation i get the following error: bazel build --config=mingw_config -s //main:hello-world --verbose_failures Starting local Bazel server and connecting to it... INFO: Analyzed target //main:hello-world (16 packages loaded, 46 targets

Mingw-w64 toolchain for Bazel (Ubuntu 20.04.1 )

元气小坏坏 提交于 2021-01-29 06:58:17
问题 I am trying to create my toolchain for mingw-w64 on Ubuntu with Bazel. I am following this tutorial: https://docs.bazel.build/versions/master/tutorial/cc-toolchain-config.html. However, when I try to adapt the compilers paths to the paths of my mingw64 installation i get the following error: bazel build --config=mingw_config -s //main:hello-world --verbose_failures Starting local Bazel server and connecting to it... INFO: Analyzed target //main:hello-world (16 packages loaded, 46 targets