mlir-nvidia: updating container
diff --git a/buildbot/google/docker/build_run.sh b/buildbot/google/docker/build_run.sh index 659c455..c9e3215 100755 --- a/buildbot/google/docker/build_run.sh +++ b/buildbot/google/docker/build_run.sh
@@ -39,7 +39,7 @@ # Define arguments for mounting the volumes # These differ on Windows and Linux -VOLUMES="-v ${SECRET_STORAGE}:/vol/secrets -v workertest:/vol/test" +VOLUMES="-v ${SECRET_STORAGE}:/vol/secrets -v workertest:/vol/test -v workercache:/vol/ccache" if [ -n "${OS+x}" ] && [[ "${OS}" == "Windows_NT" ]] ; then VOLUMES="-v ${SECRET_STORAGE}:c:\\volumes\\secrets -v workertest:c:\volumes\\test -v workercache:c:\sccache" fi
diff --git a/buildbot/google/docker/buildbot-mlir-nvidia/Dockerfile b/buildbot/google/docker/buildbot-mlir-nvidia/Dockerfile index 0c21440..b79d14f 100644 --- a/buildbot/google/docker/buildbot-mlir-nvidia/Dockerfile +++ b/buildbot/google/docker/buildbot-mlir-nvidia/Dockerfile
@@ -17,8 +17,11 @@ # install build tools RUN apt-get update; \ apt-get install -y software-properties-common apt-transport-https ca-certificates \ - clang-8 lld-8 ninja-build git wget gnupg ccache \ - python python-pip python-psutil pybind11-dev ;\ + clang-8 lld-8 ninja-build git wget gnupg ccache \ + python3 python3-pip python3-psutil pybind11-dev \ + # dumb-init recommended in + # https://hub.docker.com/r/buildbot/buildbot-worker/dockerfile + dumb-init;\ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100 ;\ update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100 ;\ update-alternatives --install /usr/bin/lld lld /usr/bin/lld-8 100 @@ -45,16 +48,27 @@ apt-get update ;\ apt-get install -y vulkan-sdk -# install (old) build bot version -# this version of build bot requires python2! -RUN pip install buildbot-slave==0.8.11 +# Install build bot (server was at 2.8.5-dev at time of writing). +RUN pip3 install buildbot-worker==2.8.4 -# Volume to mount secrets into the container -VOLUME /secrets +# 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 ; \ + chmod -R 777 /vol -# create user account, some test fail if run as root +# Volume to mount secrets into the container. +VOLUME /vol/secrets +# Volume to store data for local, manual testing of the container. +VOLUME /vol/test +# Volume to store ccache. +VOLUME /vol/ccache +ENV CCACHE_DIR=/vol/ccache +# Volume for worker working directory. +VOLUME /vol/worker + +# Create user account, some tests fail if run as root. RUN useradd buildbot --create-home -WORKDIR /home/buildbot +WORKDIR /vol/worker # copy startup script COPY run.sh /home/buildbot/ @@ -68,10 +82,6 @@ # Ports: # 9990 - production # 9994 - integration -ENV BUILDBOT_PORT="9990" +ENV BUILDBOT_PORT="9994" -# Set up buildbot host and maintainer info. -RUN mkdir -p "${WORKER_NAME}/info/" ;\ - echo "Christian Kühnel <kuhnel@google.com>" > "${WORKER_NAME}/info/admin" - -CMD ./run.sh +CMD /home/buildbot/run.sh
diff --git a/buildbot/google/docker/buildbot-mlir-nvidia/VERSION b/buildbot/google/docker/buildbot-mlir-nvidia/VERSION index 8351c19..60d3b2f 100644 --- a/buildbot/google/docker/buildbot-mlir-nvidia/VERSION +++ b/buildbot/google/docker/buildbot-mlir-nvidia/VERSION
@@ -1 +1 @@ -14 +15
diff --git a/buildbot/google/docker/buildbot-mlir-nvidia/run.sh b/buildbot/google/docker/buildbot-mlir-nvidia/run.sh index 07cc98f..298aa0e 100755 --- a/buildbot/google/docker/buildbot-mlir-nvidia/run.sh +++ b/buildbot/google/docker/buildbot-mlir-nvidia/run.sh
@@ -12,7 +12,11 @@ set -eu # Read the worker password from a mounted file. -WORKER_PASSWORD=$(cat /secrets/token) +WORKER_PASSWORD=$(cat /vol/secrets/token) + +# Set up buildbot host and maintainer info. +mkdir -p "${WORKER_NAME}/info/" +echo "Christian Kuehnel <kuhnel@google.com>" > "${WORKER_NAME}/info/admin" # generate the host information of this worker ( @@ -51,14 +55,10 @@ # create the folder structure echo "creating worker ${WORKER_NAME} at port ${BUILDBOT_PORT}..." -buildslave create-slave --keepalive=200 "${WORKER_NAME}" \ +buildbot-worker create-worker --keepalive=200 "${WORKER_NAME}" \ lab.llvm.org:${BUILDBOT_PORT} "${WORKER_NAME}" "${WORKER_PASSWORD}" -# start the daemon, this command return immetiately +# start the worker, based on +# https://hub.docker.com/r/buildbot/buildbot-worker/dockerfile echo "starting worker..." -buildslave start "${WORKER_NAME}" - -# To keep the container running and produce log outputs: dump the worker -# log to stdout -echo "Following worker log..." -tail -f ${WORKER_NAME}/twistd.log +/usr/bin/dumb-init twistd --pidfile= --nodaemon -l - --python="${WORKER_NAME}/buildbot.tac" \ No newline at end of file
diff --git a/buildbot/google/terraform/deployment-mlir-nvidia-production.yaml b/buildbot/google/terraform/deployment-mlir-nvidia-production.yaml index ff5f52a..c758c98 100644 --- a/buildbot/google/terraform/deployment-mlir-nvidia-production.yaml +++ b/buildbot/google/terraform/deployment-mlir-nvidia-production.yaml
@@ -27,7 +27,7 @@ spec: containers: # the image and version we want to run - - image: gcr.io/sanitizer-bots/buildbot-mlir-nvidia:14 + - image: gcr.io/sanitizer-bots/buildbot-mlir-nvidia:15 name: mlir-nvidia-production env: # connect to production environment, running at port 9990 @@ -48,9 +48,17 @@ nvidia.com/gpu: "1" volumeMounts: # mount the secrets into a folder - - mountPath: /secrets + - mountPath: /vol/secrets mountPropagation: None name: buildbot-token + # storage for ccache + - mountPath: /vol/ccache + mountPropagation: None + name: ccache-vol + # work directory of buildbot + - mountPath: /vol/buildbot + mountPropagation: None + name: buildbot-vol # specify the nood pool on which to deploy nodeSelector: pool: nvidia-16core-pool @@ -61,3 +69,8 @@ secret: optional: false secretName: password-mlir-nvidia + - name: ccache-vol + emptyDir: {} + - name: buildbot-vol + emptyDir: {} +
diff --git a/buildbot/google/terraform/deployment-mlir-nvidia-staging.yaml b/buildbot/google/terraform/deployment-mlir-nvidia-staging.yaml index ce2334c..cde3230 100644 --- a/buildbot/google/terraform/deployment-mlir-nvidia-staging.yaml +++ b/buildbot/google/terraform/deployment-mlir-nvidia-staging.yaml
@@ -28,7 +28,7 @@ spec: containers: # the image and version we want to run - - image: gcr.io/sanitizer-bots/buildbot-mlir-nvidia:14 + - image: gcr.io/sanitizer-bots/buildbot-mlir-nvidia:15 name: mlir-nvidia-staging # set environment variables env: @@ -63,3 +63,29 @@ secret: optional: false secretName: password-mlir-nvidia + # mount the secrets into a folder + - mountPath: /vol/secrets + mountPropagation: None + name: buildbot-token + # storage for ccache + - mountPath: /vol/ccache + mountPropagation: None + name: ccache-vol + # work directory of buildbot + - mountPath: /vol/buildbot + mountPropagation: None + name: buildbot-vol + # specify the nood pool on which to deploy + nodeSelector: + pool: nvidia-16core-pool + restartPolicy: Always + volumes: + # declare the secret as a volume so we can mount it + - name: buildbot-token + secret: + optional: false + secretName: password-mlir-nvidia + - name: ccache-vol + emptyDir: {} + - name: buildbot-vol + emptyDir: {}