Merge branch 'master' into pr_syscall_linux

This commit is contained in:
Andrei Vagin
2019-10-02 13:00:07 -07:00
committed by GitHub
517 changed files with 17753 additions and 5311 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
# limitations under the License.
# Display the current git revision in the info block.
build --workspace_status_command tools/workspace_status.sh
build --stamp --workspace_status_command tools/workspace_status.sh
# Enable remote execution so actions are performed on the remote systems.
build:remote --remote_executor=grpcs://remotebuildexecution.googleapis.com
+32
View File
@@ -83,6 +83,8 @@ Rules:
### Code reviews
Before sending code reviews, run `bazel test ...` to ensure tests are passing.
Code changes are accepted via [pull request][github].
When approved, the change will be submitted by a team member and automatically
@@ -100,6 +102,36 @@ form `b/1234`. These correspond to bugs in our internal bug tracker. Eventually
these bugs will be moved to the GitHub Issues, but until then they can simply be
ignored.
### Build and test with Docker
`scripts/dev.sh` is a convenient script that builds and installs `runsc` as a
new Docker runtime for you. The scripts tries to extract the runtime name from
your local environment and will print it at the end. You can also customize it.
The script creates one regular runtime and another with debug flags enabled.
Here are a few examples:
```bash
# Default case (inside branch my-branch)
$ scripts/dev.sh
...
Runtimes my-branch and my-branch-d (debug enabled) setup.
Use --runtime=my-branch with your Docker command.
docker run --rm --runtime=my-branch --rm hello-world
If you rebuild, use scripts/dev.sh --refresh.
Logs are in: /tmp/my-branch/logs
# --refresh just updates the runtime binary and doesn't restart docker.
$ git/my_branch> scripts/dev.sh --refresh
# Using a custom runtime name
$ git/my_branch> scripts/dev.sh my-runtime
...
Runtimes my-runtime and my-runtime-d (debug enabled) setup.
Use --runtime=my-runtime with your Docker command.
docker run --rm --runtime=my-runtime --rm hello-world
```
### The small print
Contributions made by corporations are covered by a different agreement than the
+1 -1
View File
@@ -22,7 +22,7 @@ bazel-server-start: docker-build
--privileged \
gvisor-bazel \
sh -c "while :; do sleep 100; done" && \
docker exec --user 0:0 -i gvisor-bazel sh -c "groupadd --gid $(GID) gvisor && useradd --uid $(UID) --gid $(GID) -d $(HOME) gvisor"
docker exec --user 0:0 -i gvisor-bazel sh -c "groupadd --gid $(GID) --non-unique gvisor && useradd --uid $(UID) --gid $(GID) -d $(HOME) gvisor"
bazel-server:
docker exec gvisor-bazel true || \
+1 -1
View File
@@ -48,7 +48,7 @@ Make sure the following dependencies are installed:
* Linux 4.14.77+ ([older linux][old-linux])
* [git][git]
* [Bazel][bazel] 0.23.0+
* [Bazel][bazel] 0.28.0+
* [Python][python]
* [Docker version 17.09.0 or greater][docker]
* Gold linker (e.g. `binutils-gold` package on Ubuntu)
+48 -36
View File
@@ -3,19 +3,19 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "313f2c7a23fecc33023563f082f381a32b9b7254f727a7dd2d6380ccc6dfe09b",
sha256 = "513c12397db1bc9aa46dd62f02dd94b49a9b5d17444d49b5a04c5a89f3053c1c",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.3/rules_go-0.19.3.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.3/rules_go-0.19.3.tar.gz",
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.19.5/rules_go-v0.19.5.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.19.5/rules_go-v0.19.5.tar.gz",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
sha256 = "7fc87f4170011201b1690326e8c16c5d802836e3a0d617d8f75c3af2b23180c4",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/0.18.2/bazel-gazelle-0.18.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.2/bazel-gazelle-0.18.2.tar.gz",
],
)
@@ -24,7 +24,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_to
go_rules_dependencies()
go_register_toolchains(
go_version = "1.12.9",
go_version = "1.13.1",
nogo = "@//:nogo",
)
@@ -32,14 +32,26 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies()
# Load protobuf dependencies.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# Load C++ rules.
http_archive(
name = "rules_cc",
sha256 = "67412176974bfce3f4cf8bdaff39784a72ed709fc58def599d1f68710b58d68b",
strip_prefix = "rules_cc-b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip",
"https://github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.zip",
],
)
git_repository(
# Load protobuf dependencies.
http_archive(
name = "com_google_protobuf",
commit = "09745575a923640154bcf307fba8aedff47f240a",
remote = "https://github.com/protocolbuffers/protobuf",
shallow_since = "1558721209 -0700",
sha256 = "532d2575d8c0992065bb19ec5fba13aa3683499726f6055c11b474f91a00bb0c",
strip_prefix = "protobuf-7f520092d9050d96fb4b707ad11a51701af4ce49",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/7f520092d9050d96fb4b707ad11a51701af4ce49.zip",
"https://github.com/protocolbuffers/protobuf/archive/7f520092d9050d96fb4b707ad11a51701af4ce49.zip",
],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
@@ -50,11 +62,11 @@ protobuf_deps()
# See releases at https://releases.bazel.build/bazel-toolchains.html
http_archive(
name = "bazel_toolchains",
sha256 = "e71eadcfcbdb47b4b740eb48b32ca4226e36aabc425d035a18dd40c2dda808c1",
strip_prefix = "bazel-toolchains-0.28.4",
sha256 = "a019fbd579ce5aed0239de865b2d8281dbb809efd537bf42e0d366783e8dec65",
strip_prefix = "bazel-toolchains-0.29.2",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.28.4.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/0.28.4.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.29.2.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/0.29.2.tar.gz",
],
)
@@ -63,6 +75,16 @@ load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
rbe_autoconfig(name = "rbe_default")
http_archive(
name = "rules_pkg",
sha256 = "5bdc04987af79bd27bc5b00fe30f59a858f77ffa0bd2d8143d5b31ad8b1bd71c",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.0/rules_pkg-0.2.0.tar.gz",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
# External repositories, in sorted order.
go_repository(
name = "com_github_cenkalti_backoff",
@@ -184,7 +206,7 @@ go_repository(
go_repository(
name = "org_golang_x_time",
commit = "9d24e82272b4f38b78bc8cff74fa936d31ccd8ef",
commit = "c4c64cad1fd0a1a8dab2523e04e61d35308e131e",
importpath = "golang.org/x/time",
)
@@ -209,32 +231,22 @@ go_repository(
)
# System Call test dependencies.
http_archive(
name = "com_github_gflags_gflags",
sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
strip_prefix = "gflags-2.2.2",
urls = [
"https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz",
"https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
],
)
http_archive(
name = "com_google_absl",
sha256 = "01ba1185a0e6e048e4890f39e383515195bc335f0627cdddc0c325ee68be4434",
strip_prefix = "abseil-cpp-cd86d0d20ab167c33b23d3875db68d1d4bad3a3b",
sha256 = "56775f1283a59e6274c28d99981a9717ff4e0b1161e9129fdb2fcf22531d8d93",
strip_prefix = "abseil-cpp-a0d1e098c2f99694fa399b175a7ccf920762030e",
urls = [
"https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/cd86d0d20ab167c33b23d3875db68d1d4bad3a3b.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/cd86d0d20ab167c33b23d3875db68d1d4bad3a3b.tar.gz",
"https://mirror.bazel.build/github.com/abseil/abseil-cpp/archive/a0d1e098c2f99694fa399b175a7ccf920762030e.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/a0d1e098c2f99694fa399b175a7ccf920762030e.tar.gz",
],
)
http_archive(
name = "com_google_googletest",
sha256 = "db657310d3c5ca2d3f674e3a4b79718d1d39da70604568ee0568ba8e39065ef4",
strip_prefix = "googletest-31200def0dec8a624c861f919e86e4444e6e6ee7",
sha256 = "0a10bea96d8670e5eef948d79d824162b1577bb7889539e49ec786bfc3e48912",
strip_prefix = "googletest-565f1b848215b77c3732bca345fe76a0431d8b34",
urls = [
"https://mirror.bazel.build/github.com/google/googletest/archive/31200def0dec8a624c861f919e86e4444e6e6ee7.tar.gz",
"https://github.com/google/googletest/archive/31200def0dec8a624c861f919e86e4444e6e6ee7.tar.gz",
"https://mirror.bazel.build/github.com/google/googletest/archive/565f1b848215b77c3732bca345fe76a0431d8b34.tar.gz",
"https://github.com/google/googletest/archive/565f1b848215b77c3732bca345fe76a0431d8b34.tar.gz",
],
)
-2
View File
@@ -1,2 +0,0 @@
FROM ubuntu
RUN apt-get -q update && apt-get install -qqy git rsync
-22
View File
@@ -1,22 +0,0 @@
steps:
- name: 'gcr.io/cloud-builders/git'
args: ['fetch', '--all', '--unshallow']
- name: 'gcr.io/cloud-builders/bazel'
args: ['build', ':gopath']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/go-branch', '-f', 'cloudbuild/go.Dockerfile', '.']
- name: 'gcr.io/$PROJECT_ID/go-branch'
args: ['tools/go_branch.sh']
- name: 'gcr.io/cloud-builders/git'
args: ['checkout', 'go']
- name: 'gcr.io/cloud-builders/git'
args: ['clean', '-f']
- name: 'golang'
args: ['go', 'build', './...']
- name: 'gcr.io/cloud-builders/git'
entrypoint: 'bash'
args:
- '-c'
- 'if [[ "$BRANCH_NAME" == "master" ]]; then git push "${_ORIGIN}" go:go; fi'
substitutions:
_ORIGIN: origin
+23
View File
@@ -0,0 +1,23 @@
build_file: "repo/scripts/build.sh"
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73898
keyname: "kokoro-repo-key"
}
}
}
env_vars {
key: "KOKORO_REPO_KEY"
value: "73898_kokoro-repo-key"
}
action {
define_artifacts {
regex: "**/runsc"
regex: "**/runsc.*"
regex: "**/dists/**"
}
}
+1
View File
@@ -0,0 +1 @@
build_file: "repo/scripts/build.sh"
+1 -1
View File
@@ -10,7 +10,7 @@ before_action {
# Configure bazel to access RBE.
bazel_setting {
# Our GCP project name
# Our GCP project name.
project_id: "gvisor-rbe"
# Use RBE for execution as well as caching.
-13
View File
@@ -1,13 +0,0 @@
# Location of bash script that runs the test. The first directory in the path
# is the directory where Kokoro will check out the repo. The rest is the path
# is the path to the test script.
build_file: "repo/kokoro/run_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc-logs.tar.gz"
}
}
+9
View File
@@ -0,0 +1,9 @@
build_file: "repo/scripts/do_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
}
}
+10
View File
@@ -0,0 +1,10 @@
build_file: "repo/scripts/docker_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc_logs_*.tar.gz"
}
}
+20
View File
@@ -0,0 +1,20 @@
build_file: "repo/scripts/go.sh"
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73898
keyname: "kokoro-github-access-token"
}
}
}
env_vars {
key: "KOKORO_GITHUB_ACCESS_TOKEN"
value: "73898_kokoro-github-access-token"
}
env_vars {
key: "KOKORO_GO_PUSH"
value: "true"
}
+1
View File
@@ -0,0 +1 @@
build_file: "repo/scripts/go.sh"
+10
View File
@@ -0,0 +1,10 @@
build_file: "repo/scripts/hostnet_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc_logs_*.tar.gz"
}
}
+10
View File
@@ -0,0 +1,10 @@
build_file: "repo/scripts/kvm_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc_logs_*.tar.gz"
}
}
+9
View File
@@ -0,0 +1,9 @@
build_file: "repo/scripts/make_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
}
}
+10
View File
@@ -0,0 +1,10 @@
build_file: "repo/scripts/overlay_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc_logs_*.tar.gz"
}
}
-13
View File
@@ -1,13 +0,0 @@
# Location of bash script that runs the test. The first directory in the path
# is the directory where Kokoro will check out the repo. The rest is the path
# is the path to the test script.
build_file: "repo/kokoro/run_tests.sh"
action {
define_artifacts {
regex: "**/sponge_log.xml"
regex: "**/sponge_log.log"
regex: "**/outputs.zip"
regex: "**/runsc-logs.tar.gz"
}
}

Some files were not shown because too many files have changed in this diff Show More