From f67fcc0086689b7d587a20a45e31895daf15a2ff Mon Sep 17 00:00:00 2001 From: Yu Yi Date: Mon, 12 Feb 2018 14:38:48 -0500 Subject: [PATCH] container release: clang 7.0.0 (r322167) * clang major version release 6.0.0 -> 7.0.0 (revision r322167) * go minor version release: 1.9.2 -> 1.9.4 * update the sha256 of python-runtime image to include the latest changes. * remove the unnecessary BUILD files from pkg_tar rules. * also we add container-strucuture-test for the local build https://github.com/GoogleCloudPlatform/container-structure-test Tested: * Tested building locally with `container/debian8-clang-fully-loaded/build.sh -l` * Tested with Google Cloud Container Builder `container/debian8-clang-fully-loaded/build.sh -p -c test-debian8-clang-fl -t test-r322167 -a` Change-Id: I7fb57e0c05d4491c1397c8615acac8085dea9390 --- WORKSPACE | 45 ++++++++++++------- container/debian8-clang-fully-loaded/BUILD | 7 +++ container/debian8-clang-fully-loaded/build.sh | 3 ++ .../debian8-clang-fully-loaded/test.yaml | 26 ++++++----- third_party/clang/BUILD | 7 ++- third_party/golang/BUILD | 5 ++- third_party/python/BUILD | 7 ++- 7 files changed, 67 insertions(+), 33 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d5bb580ee..d1465fb33 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -22,9 +22,9 @@ load( # https://docs.bazel.build/versions/master/be/workspace.html#git_repository http_archive( name = "io_bazel_rules_docker", - sha256 = "6329b426670284c4be52969f3f0cf21431ad5012757b6e58c8e0e7014e6e6bdc", - strip_prefix = "rules_docker-119bc3f0a7871d6f25f4d4a2705b9cb19756f9c4", - urls = ["https://github.com/bazelbuild/rules_docker/archive/119bc3f0a7871d6f25f4d4a2705b9cb19756f9c4.tar.gz"], + sha256 = "bc2182a51e19bf1fe5c3c33636b3e2827fac7be34af07690f9d612ca9bf31c3b", + strip_prefix = "rules_docker-4d49182a85c745065e621c145238c5e9420ed91b", + urls = ["https://github.com/bazelbuild/rules_docker/archive/4d49182a85c745065e621c145238c5e9420ed91b.tar.gz"], ) load( @@ -37,14 +37,14 @@ container_repositories() container_pull( name = "debian8", - digest = "sha256:527a326166d399fd2eb12df3fe1186a925ad98ea27857a67914536bfcae0e084", + digest = "sha256:412ef4d53215ff4a95d275ad48fe5196cb51f4f96b99c05058054b3bdf9443c1", registry = "gcr.io", repository = "cloud-marketplace/google/debian8", ) container_pull( name = "debian8-clang", - digest = "sha256:e57978199c9eb156bd7f63773387f3a238adf61acd71c4942ad91da50b4f241f", + digest = "sha256:ac3b1fdc22c0f2b95abe67f2daf33788425fab52d4e6845900bfe1a42443098f", registry = "gcr.io", repository = "cloud-marketplace/google/clang-debian8", ) @@ -79,6 +79,19 @@ container_pull( tag = "16.04", ) +# io_bazel_rules_go is the dependency of container_test rules. +http_archive( + name = "io_bazel_rules_go", + sha256 = "4d8d6244320dd751590f9100cf39fd7a4b75cd901e1f3ffdfd6f048328883695", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.9.0/rules_go-0.9.0.tar.gz", +) + +load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") + +go_rules_dependencies() + +go_register_toolchains() + http_archive( name = "debian_docker", sha256 = "11692d97f7de2680028e6744f68637e7be0544df081840f1a4bb99f53735aeef", @@ -120,8 +133,8 @@ dpkg_src( name = "debian_jessie", arch = "amd64", distro = "jessie", - sha256 = "142cceae78a1343e66a0d27f1b142c406243d7940f626972c2c39ef71499ce61", - snapshot = "20170821T035341Z", + sha256 = "20720c9367e9454dee3d173e4d3fd85ab5530292f4ec6654feb5a810b6bb37ce", + snapshot = "20180130T043019Z", url = "http://snapshot.debian.org/archive", ) @@ -129,8 +142,8 @@ dpkg_src( name = "debian_jessie_backports", arch = "amd64", distro = "jessie-backports", - sha256 = "eba769f0a0bcaffbb82a8b61d4a9c8a0a3299d5111a68daeaf7e50cc0f76e0ab", - snapshot = "20170821T035341Z", + sha256 = "5858e520b7d7fe99bf2bd42864b5084bf86db9044b6fe4bdd98771d1ec7cc2f9", + snapshot = "20180130T043019Z", url = "http://snapshot.debian.org/archive", ) @@ -163,24 +176,24 @@ dpkg_list( # Golang http_file( name = "golang_release", - sha256 = "de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b", - urls = ["https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz"], + sha256 = "15b0937615809f87321a457bb1265f946f9f6e736c563d6c5e0bd2c22e44f779", + urls = ["https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz"], ) # Clang http_file( name = "clang_release", - sha256 = "61699cafb7d8542f30b39eda9fc43b23f13ecbac1d349976374f7555659c2d2f", - urls = ["https://storage.googleapis.com/clang-builds-stable/clang-debian8/clang_r319946.tar.gz"], + sha256 = "2b002d1c6ede1d7627899e97a5da8a3fb81dd7cd3043b3594e4de67397b22d85", + urls = ["https://storage.googleapis.com/clang-builds-stable/clang-debian8/clang_r322167.tar.gz"], ) # Test purpose only. bazel-toolchains repo at release for Bazel 0.10.0. # https://github.com/bazelbuild/bazel-toolchains/releases/tag/acffd62 http_file( name = "bazel_toolchains_test", + sha256 = "f820436a685db00945df1282df7688187b48aeed91c17686023712afcf453996", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/acffd62731b1545c32e1c34e72fd526598ab9a66.tar.gz", - "https://github.com/bazelbuild/bazel-toolchains/archive/acffd62731b1545c32e1c34e72fd526598ab9a66.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/acffd62731b1545c32e1c34e72fd526598ab9a66.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/archive/acffd62731b1545c32e1c34e72fd526598ab9a66.tar.gz", ], - sha256 = "f820436a685db00945df1282df7688187b48aeed91c17686023712afcf453996", ) diff --git a/container/debian8-clang-fully-loaded/BUILD b/container/debian8-clang-fully-loaded/BUILD index c832c805a..a16aa31b8 100644 --- a/container/debian8-clang-fully-loaded/BUILD +++ b/container/debian8-clang-fully-loaded/BUILD @@ -30,6 +30,7 @@ load( "java_layer_packages", "python_layer_packages", ) +load("@io_bazel_rules_docker//contrib:test.bzl", "container_test") cacerts( name = "cacerts", @@ -114,3 +115,9 @@ language_tool_layer( tags = ["manual"], tars = ["//third_party/python:tar"], ) + +container_test( + name = "fl-toolchain-test", + configs = ["test.yaml"], + image = ":fl-toolchain", +) diff --git a/container/debian8-clang-fully-loaded/build.sh b/container/debian8-clang-fully-loaded/build.sh index 2b6d917ff..f0ec844ed 100755 --- a/container/debian8-clang-fully-loaded/build.sh +++ b/container/debian8-clang-fully-loaded/build.sh @@ -107,6 +107,9 @@ main () { if [[ "$LOCAL" = true ]]; then echo "Building container locally." bazel run //container/debian8-clang-fully-loaded:fl-toolchain + echo "Testing container locally." + bazel test //container/debian8-clang-fully-loaded:fl-toolchain-test + echo "Tagging container." docker tag bazel/container/debian8-clang-fully-loaded:fl-toolchain debian8-clang-fully-loaded:latest echo -e "\n" \ "debian8-clang-fully-loaded:lastest container is now available to use.\n" \ diff --git a/container/debian8-clang-fully-loaded/test.yaml b/container/debian8-clang-fully-loaded/test.yaml index 5d8c512eb..6f8ee0c69 100644 --- a/container/debian8-clang-fully-loaded/test.yaml +++ b/container/debian8-clang-fully-loaded/test.yaml @@ -1,8 +1,10 @@ schemaVersion: "1.0.0" + commandTests: - name: 'path' command: ['sh', '-c', 'echo $PATH'] expectedOutput: ['/usr/local/go/bin:/opt/python3.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'] + fileExistenceTests: - name: 'Root' isDirectory: true @@ -30,49 +32,49 @@ fileExistenceTests: shouldExist: true - name: 'sanitizer' isDirectory: true - path: '/usr/local/lib/clang/6.0.0/include/sanitizer' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer' shouldExist: true - name: 'sanitizer-allocator' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/allocator_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/allocator_interface.h' shouldExist: true - name: 'sanitizer-asan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/asan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/asan_interface.h' shouldExist: true - name: 'sanitizer-common_defs' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/common_interface_defs.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/common_interface_defs.h' shouldExist: true - name: 'sanitizer-coverage' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/coverage_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/coverage_interface.h' shouldExist: true - name: 'sanitizer-dfsan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/dfsan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/dfsan_interface.h' shouldExist: true - name: 'sanitizer-esan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/esan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/esan_interface.h' shouldExist: true - name: 'sanitizer-linux_syscall_hooks' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/linux_syscall_hooks.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/linux_syscall_hooks.h' shouldExist: true - name: 'sanitizer-lsan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/lsan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/lsan_interface.h' shouldExist: true - name: 'sanitizer-msan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/msan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/msan_interface.h' shouldExist: true - name: 'sanitizer-tsan_atomic' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/tsan_interface_atomic.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface_atomic.h' shouldExist: true - name: 'sanitizer-tsan' isDirectory: false - path: '/usr/local/lib/clang/6.0.0/include/sanitizer/tsan_interface.h' + path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface.h' shouldExist: true diff --git a/third_party/clang/BUILD b/third_party/clang/BUILD index 458e949a0..e2adc5f84 100644 --- a/third_party/clang/BUILD +++ b/third_party/clang/BUILD @@ -26,11 +26,14 @@ load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") pkg_tar( name = "tar", - srcs = glob(["**/*"]), + srcs = glob( + ["**/*"], + exclude = ["**/BUILD"], + ), package_dir = "/usr/local/", strip_prefix = ".", tags = ["manual"], deps = [ - "@clang_release//file", + "@clang_release//file", ], ) diff --git a/third_party/golang/BUILD b/third_party/golang/BUILD index 4e5cd11d6..121a64be0 100644 --- a/third_party/golang/BUILD +++ b/third_party/golang/BUILD @@ -25,7 +25,10 @@ load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") pkg_tar( name = "tar", - srcs = glob(["**/*"]), + srcs = glob( + ["**/*"], + exclude = ["**/BUILD"], + ), package_dir = "/usr/local/", strip_prefix = ".", tags = ["manual"], diff --git a/third_party/python/BUILD b/third_party/python/BUILD index df812e6ef..ba33b51f7 100644 --- a/third_party/python/BUILD +++ b/third_party/python/BUILD @@ -27,7 +27,10 @@ load("//skylib:container_file_export.bzl", "container_file_export") pkg_tar( name = "tar", - srcs = glob(["**/*"]), + srcs = glob( + ["**/*"], + exclude = ["**/BUILD"], + ), package_dir = "/", strip_prefix = ".", tags = ["manual"], @@ -38,7 +41,7 @@ pkg_tar( # https://github.com/GoogleCloudPlatform/python-runtime/tree/master/python-interpreter-builder container_file_export( name = "python3", - image = "l.gcr.io/google/python@sha256:8c6f86e4cec33f483aaf4155658da424fe37d3e03d3c55a823790eb56a3a8f1a", + image = "l.gcr.io/google/python@sha256:de9ab4346c65a611b1721aeae0633d897f56861a0cda0b40bc032771007ac914", src_path = "/opt/python3.6", tags = ["manual"], )