Skip to content

Commit

Permalink
Standardize on tools directory.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 291745021
  • Loading branch information
amscanne authored and gvisor-bot committed Jan 27, 2020
1 parent 6b43cf7 commit d29e59a
Show file tree
Hide file tree
Showing 263 changed files with 913 additions and 1,281 deletions.
8 changes: 4 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ build:remote --auth_scope="https://www.googleapis.com/auth/cloud-source-tools"

# Add a custom platform and toolchain that builds in a privileged docker
# container, which is required by our syscall tests.
build:remote --host_platform=//test:rbe_ubuntu1604
build:remote --extra_toolchains=//test:cc-toolchain-clang-x86_64-default
build:remote --extra_execution_platforms=//test:rbe_ubuntu1604
build:remote --platforms=//test:rbe_ubuntu1604
build:remote --host_platform=//:rbe_ubuntu1604
build:remote --extra_toolchains=//:cc-toolchain-clang-x86_64-default
build:remote --extra_execution_platforms=//:rbe_ubuntu1604
build:remote --platforms=//:rbe_ubuntu1604
build:remote --crosstool_top=@rbe_default//cc:toolchain
build:remote --jobs=50
build:remote --remote_timeout=3600
Expand Down
49 changes: 46 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package(licenses = ["notice"]) # Apache 2.0

load("@io_bazel_rules_go//go:def.bzl", "go_path", "nogo")
load("@bazel_gazelle//:def.bzl", "gazelle")

package(licenses = ["notice"])

# The sandbox filegroup is used for sandbox-internal dependencies.
package_group(
name = "sandbox",
Expand Down Expand Up @@ -49,9 +49,52 @@ gazelle(name = "gazelle")
# live in the tools subdirectory (unless they are standard).
nogo(
name = "nogo",
config = "tools/nogo.js",
config = "//tools:nogo.js",
visibility = ["//visibility:public"],
deps = [
"//tools/checkunsafe",
],
)

# We need to define a bazel platform and toolchain to specify dockerPrivileged
# and dockerRunAsRoot options, they are required to run tests on the RBE
# cluster in Kokoro.
alias(
name = "rbe_ubuntu1604",
actual = ":rbe_ubuntu1604_r346485",
)

platform(
name = "rbe_ubuntu1604_r346485",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
"@bazel_toolchains//constraints:xenial",
"@bazel_toolchains//constraints/sanitizers:support_msan",
],
remote_execution_properties = """
properties: {
name: "container-image"
value:"docker://gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:93f7e127196b9b653d39830c50f8b05d49ef6fd8739a9b5b8ab16e1df5399e50"
}
properties: {
name: "dockerAddCapabilities"
value: "SYS_ADMIN"
}
properties: {
name: "dockerPrivileged"
value: "true"
}
""",
)

toolchain(
name = "cc-toolchain-clang-x86_64-default",
exec_compatible_with = [
],
target_compatible_with = [
],
toolchain = "@bazel_toolchains//configs/ubuntu16_04_clang/10.0.0/bazel_2.0.0/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
18 changes: 0 additions & 18 deletions benchmarks/defs.bzl

This file was deleted.

74 changes: 37 additions & 37 deletions benchmarks/harness/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "requirement")
load("//tools:defs.bzl", "py_library", "py_requirement")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand All @@ -25,16 +25,16 @@ py_library(
srcs = ["container.py"],
deps = [
"//benchmarks/workloads",
requirement("asn1crypto", False),
requirement("chardet", False),
requirement("certifi", False),
requirement("docker", True),
requirement("docker-pycreds", False),
requirement("idna", False),
requirement("ptyprocess", False),
requirement("requests", False),
requirement("urllib3", False),
requirement("websocket-client", False),
py_requirement("asn1crypto", False),
py_requirement("chardet", False),
py_requirement("certifi", False),
py_requirement("docker", True),
py_requirement("docker-pycreds", False),
py_requirement("idna", False),
py_requirement("ptyprocess", False),
py_requirement("requests", False),
py_requirement("urllib3", False),
py_requirement("websocket-client", False),
],
)

Expand All @@ -47,17 +47,17 @@ py_library(
"//benchmarks/harness:ssh_connection",
"//benchmarks/harness:tunnel_dispatcher",
"//benchmarks/harness/machine_mocks",
requirement("asn1crypto", False),
requirement("chardet", False),
requirement("certifi", False),
requirement("docker", True),
requirement("docker-pycreds", False),
requirement("idna", False),
requirement("ptyprocess", False),
requirement("requests", False),
requirement("six", False),
requirement("urllib3", False),
requirement("websocket-client", False),
py_requirement("asn1crypto", False),
py_requirement("chardet", False),
py_requirement("certifi", False),
py_requirement("docker", True),
py_requirement("docker-pycreds", False),
py_requirement("idna", False),
py_requirement("ptyprocess", False),
py_requirement("requests", False),
py_requirement("six", False),
py_requirement("urllib3", False),
py_requirement("websocket-client", False),
],
)

Expand All @@ -66,27 +66,27 @@ py_library(
srcs = ["ssh_connection.py"],
deps = [
"//benchmarks/harness",
requirement("bcrypt", False),
requirement("cffi", True),
requirement("paramiko", True),
requirement("cryptography", False),
py_requirement("bcrypt", False),
py_requirement("cffi", True),
py_requirement("paramiko", True),
py_requirement("cryptography", False),
],
)

py_library(
name = "tunnel_dispatcher",
srcs = ["tunnel_dispatcher.py"],
deps = [
requirement("asn1crypto", False),
requirement("chardet", False),
requirement("certifi", False),
requirement("docker", True),
requirement("docker-pycreds", False),
requirement("idna", False),
requirement("pexpect", True),
requirement("ptyprocess", False),
requirement("requests", False),
requirement("urllib3", False),
requirement("websocket-client", False),
py_requirement("asn1crypto", False),
py_requirement("chardet", False),
py_requirement("certifi", False),
py_requirement("docker", True),
py_requirement("docker-pycreds", False),
py_requirement("idna", False),
py_requirement("pexpect", True),
py_requirement("ptyprocess", False),
py_requirement("requests", False),
py_requirement("urllib3", False),
py_requirement("websocket-client", False),
],
)
4 changes: 2 additions & 2 deletions benchmarks/harness/machine_producers/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "requirement")
load("//tools:defs.bzl", "py_library", "py_requirement")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand Down Expand Up @@ -31,7 +31,7 @@ py_library(
deps = [
"//benchmarks/harness:machine",
"//benchmarks/harness/machine_producers:machine_producer",
requirement("PyYAML", False),
py_requirement("PyYAML", False),
],
)

Expand Down
24 changes: 12 additions & 12 deletions benchmarks/runner/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "py_test", "requirement")
load("//tools:defs.bzl", "py_library", "py_requirement", "py_test")

package(licenses = ["notice"])

Expand Down Expand Up @@ -28,15 +28,15 @@ py_library(
"//benchmarks/suites:startup",
"//benchmarks/suites:sysbench",
"//benchmarks/suites:syscall",
requirement("click", True),
py_requirement("click", True),
],
)

py_library(
name = "commands",
srcs = ["commands.py"],
deps = [
requirement("click", True),
py_requirement("click", True),
],
)

Expand All @@ -50,14 +50,14 @@ py_test(
],
deps = [
":runner",
requirement("click", True),
requirement("attrs", False),
requirement("atomicwrites", False),
requirement("more-itertools", False),
requirement("pathlib2", False),
requirement("pluggy", False),
requirement("py", False),
requirement("pytest", True),
requirement("six", False),
py_requirement("click", True),
py_requirement("attrs", False),
py_requirement("atomicwrites", False),
py_requirement("more-itertools", False),
py_requirement("pathlib2", False),
py_requirement("pluggy", False),
py_requirement("py", False),
py_requirement("pytest", True),
py_requirement("six", False),
],
)
3 changes: 1 addition & 2 deletions benchmarks/tcp/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("//tools:defs.bzl", "cc_binary", "go_binary")

package(licenses = ["notice"])

Expand Down
19 changes: 9 additions & 10 deletions benchmarks/workloads/ab/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "py_test", "requirement")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar", "py_library", "py_requirement", "py_test")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand All @@ -17,14 +16,14 @@ py_test(
python_version = "PY3",
deps = [
":ab",
requirement("attrs", False),
requirement("atomicwrites", False),
requirement("more-itertools", False),
requirement("pathlib2", False),
requirement("pluggy", False),
requirement("py", False),
requirement("pytest", True),
requirement("six", False),
py_requirement("attrs", False),
py_requirement("atomicwrites", False),
py_requirement("more-itertools", False),
py_requirement("pathlib2", False),
py_requirement("pluggy", False),
py_requirement("py", False),
py_requirement("pytest", True),
py_requirement("six", False),
],
)

Expand Down
19 changes: 9 additions & 10 deletions benchmarks/workloads/absl/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "py_test", "requirement")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar", "py_library", "py_requirement", "py_test")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand All @@ -17,14 +16,14 @@ py_test(
python_version = "PY3",
deps = [
":absl",
requirement("attrs", False),
requirement("atomicwrites", False),
requirement("more-itertools", False),
requirement("pathlib2", False),
requirement("pluggy", False),
requirement("py", False),
requirement("pytest", True),
requirement("six", False),
py_requirement("attrs", False),
py_requirement("atomicwrites", False),
py_requirement("more-itertools", False),
py_requirement("pathlib2", False),
py_requirement("pluggy", False),
py_requirement("py", False),
py_requirement("pytest", True),
py_requirement("six", False),
],
)

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/workloads/curl/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/workloads/ffmpeg/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand Down
19 changes: 9 additions & 10 deletions benchmarks/workloads/fio/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("//benchmarks:defs.bzl", "py_library", "py_test", "requirement")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar", "py_library", "py_requirement", "py_test")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand All @@ -17,14 +16,14 @@ py_test(
python_version = "PY3",
deps = [
":fio",
requirement("attrs", False),
requirement("atomicwrites", False),
requirement("more-itertools", False),
requirement("pathlib2", False),
requirement("pluggy", False),
requirement("py", False),
requirement("pytest", True),
requirement("six", False),
py_requirement("attrs", False),
py_requirement("atomicwrites", False),
py_requirement("more-itertools", False),
py_requirement("pathlib2", False),
py_requirement("pluggy", False),
py_requirement("py", False),
py_requirement("pytest", True),
py_requirement("six", False),
],
)

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/workloads/httpd/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defs.bzl", "pkg_tar")

package(
default_visibility = ["//benchmarks:__subpackages__"],
Expand Down
Loading

0 comments on commit d29e59a

Please sign in to comment.