buildbot-clangd-ubuntu-clang improvements
* fixed worker path in deployment
* compiling grpc locally to work around TSan issue in grpc
diff --git a/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile b/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
index 5a07d2f..f1ec85c 100644
--- a/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
+++ b/buildbot/google/docker/buildbot-clangd-ubuntu-clang/Dockerfile
@@ -13,7 +13,6 @@
# Use the image from NVIDIA as base
FROM ubuntu:18.04
-
# install build tools
RUN apt-get update; \
apt-get install -y software-properties-common apt-transport-https ca-certificates \
@@ -21,15 +20,14 @@
# install ccache for local caching of builds
ccache \
# install python for buildbot and LIT
- python3 python3-pip python3-psutil \
- # clangd requires libgrpc and protobuf for remote index, see
- # https://github.com/llvm/llvm-project/tree/master/clang-tools-extra/clangd/index/remote#system-installed-libraries
- libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-compiler-grpc ; \
+ python3 python3-pip python3-psutil ; \
# clean apt cache to reduce image size
apt-get clean
# install latest LLVM release
-RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
+RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)";\
+ # clean apt cache to reduce image size
+ apt-get clean
# configure default versions of LLVM tools
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100 ;\
@@ -50,6 +48,19 @@
# install build bot (server was at 2.8.5-dev at time of writing)
RUN pip3 install buildbot-worker==2.8.4
+# build and install grpc for clangd remote index, based on instructions
+# https://github.com/llvm/llvm-project/tree/master/clang-tools-extra/clangd/index/remote#building-from-sources
+# The grpc version shipped with Ubuntu 18.04 crashes on TSan checks.
+ENV GRPC_INSTALL_PATH=/usr/local/lib/grpc
+RUN cd /tmp ; \
+ git clone -b v1.33.2 --depth 1 --recursive --shallow-submodules https://github.com/grpc/grpc ; \
+ cd grpc ; \
+ mkdir build; cd build ; \
+ cmake -G Ninja -DgRPC_INSTALL=ON -DCMAKE_INSTALL_PREFIX=${GRPC_INSTALL_PATH} -DCMAKE_BUILD_TYPE=Release .. ; \
+ cmake --build . --target install ; \
+ #clean up sources to reduce image size
+ cd / ; rm -rf /tmp/grpc
+
# Workaround permissions issues when writing to named volumes
# https://github.com/docker/compose/issues/3270#issuecomment-206214034
RUN mkdir -p /vol/test /vol/ccache /vol/worker ; \
diff --git a/buildbot/google/docker/buildbot-clangd-ubuntu-clang/VERSION b/buildbot/google/docker/buildbot-clangd-ubuntu-clang/VERSION
index d00491f..0cfbf08 100644
--- a/buildbot/google/docker/buildbot-clangd-ubuntu-clang/VERSION
+++ b/buildbot/google/docker/buildbot-clangd-ubuntu-clang/VERSION
@@ -1 +1 @@
-1
+2
diff --git a/buildbot/google/terraform/main.tf b/buildbot/google/terraform/main.tf
index b0d7091..71f50cb 100644
--- a/buildbot/google/terraform/main.tf
+++ b/buildbot/google/terraform/main.tf
@@ -345,7 +345,7 @@
spec {
container {
- image = "${var.gcp_config.gcr_prefix}/buildbot-clangd-ubuntu-clang:1"
+ image = "${var.gcp_config.gcr_prefix}/buildbot-clangd-ubuntu-clang:2"
name = "buildbot-clangd-ubuntu-clang"
# reserve "<number of cores>-1" for this image, kubernetes also
@@ -371,8 +371,8 @@
name = "ccache-vol"
}
volume_mount {
- mount_path = "/vol/buildbot"
- name = "buildbot-vol"
+ mount_path = "/vol/worker"
+ name = "worker-vol"
}
}
# select which node pool to deploy to
@@ -395,7 +395,7 @@
empty_dir {}
}
volume {
- name = "buildbot-vol"
+ name = "worker-vol"
empty_dir {}
}