diff --git a/containers/README.md b/containers/README.md index d054770..ee09aa6 100644 --- a/containers/README.md +++ b/containers/README.md @@ -1,5 +1,6 @@ # Overview -This folder contains files related to the machines running the build/test/checks for the merge guards. +This folder contains files related to the machines running the build/test/checks +for the merge guards. ## Scripts The scripts are written in bash (for Linux) and powershell (for Windows). @@ -8,4 +9,12 @@ The scripts are written in bash (for Linux) and powershell (for Windows). Build the docker image and run it locally. This is useful for testing it. ### build_deploy.(sh|ps1) -Build the docker and deploy it to the GCP registry. This is useful for deploying it in the Kubernetes cluster. \ No newline at end of file +Build the docker and deploy it to the GCP registry. This is useful for deploying +it in the Kubernetes cluster. + +`buildkite-linux` has a cloudbuild.yaml and can be build / deployed by running +`gcloud builds submit --config ./cloudbuild.yaml`. + +Note that some of the images are stored at +us-central1-docker.pkg.dev/llvm-premerge-checks/docker/ and some at +gcr.io/llvm-premerge-checks/ . Prefer a former one if possible. \ No newline at end of file diff --git a/containers/buildbot-windows/cloudbuild.yaml b/containers/buildbot-windows/cloudbuild.yaml index 2e6b3bd..b08e429 100644 --- a/containers/buildbot-windows/cloudbuild.yaml +++ b/containers/buildbot-windows/cloudbuild.yaml @@ -6,11 +6,11 @@ steps: - name: 'gcr.io/${PROJECT_ID}/windows-builder' args: ['--image','windows-cloud/global/images/windows-server-2019-dc-core-for-containers-v20230113', - '--network', 'vpc-network', - '--subnetwork', 'subnetwork', - '--region', 'europe-west3', - '--zone', 'europe-west3-c', + #'--network', 'vpc-network', + #'--subnetwork', 'subnetwork', + #'--region', 'europe-west3', + #'--zone', 'europe-west3-c', '--machineType', "n2-standard-16", - '--diskType', 'pd-ssd', - '--command', 'gcloud auth configure-docker --quiet && docker build -t gcr.io/${PROJECT_ID}/buildkite-premerge-windows:latest . && docker push gcr.io/${PROJECT_ID}/buildkite-premerge-windows:latest'] + #'--diskType', 'pd-ssd', + '--command', 'gcloud auth configure-docker --quiet && docker build -t gcr.io/${PROJECT_ID}/buildkite-premerge-windows:latest . && docker push us-central1-docker.pkg.dev/llvm-premerge-checks/docker/buildkite-windows:latest'] timeout: 7200s \ No newline at end of file diff --git a/containers/buildkite-linux/Dockerfile b/containers/buildkite-linux/Dockerfile index 7c8abf3..ba995b4 100644 --- a/containers/buildkite-linux/Dockerfile +++ b/containers/buildkite-linux/Dockerfile @@ -83,6 +83,7 @@ RUN echo 'install buildkite' ;\ apt-get clean; COPY --chown=buildkite-agent:buildkite-agent pre-checkout /etc/buildkite-agent/hooks +COPY --chown=buildkite-agent:buildkite-agent post-checkout /etc/buildkite-agent/hooks # buildkite working directory VOLUME /var/lib/buildkite-agent diff --git a/containers/buildkite-linux/post-checkout b/containers/buildkite-linux/post-checkout new file mode 100755 index 0000000..7f6baf9 --- /dev/null +++ b/containers/buildkite-linux/post-checkout @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://llvm.org/LICENSE.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# See https://buildkite.com/docs/agent/v3/hooks#job-lifecycle-hooks +# The `post-checkout` hook runs after checkout. + +# Pull changes from origin/main so that diff origin/main...HEAD will show a +# correct diff of Pull Requests that have multiple commits. + +set -euo pipefail +git fetch origin main:main diff --git a/kubernetes/buildkite/service-test.yaml b/kubernetes/buildkite/service-test.yaml index bb708d9..9a0aa80 100644 --- a/kubernetes/buildkite/service-test.yaml +++ b/kubernetes/buildkite/service-test.yaml @@ -34,7 +34,7 @@ spec: spec: containers: - name: runner - image: gcr.io/llvm-premerge-checks/buildkite-linux:latest + image: us-central1-docker.pkg.dev/llvm-premerge-checks/docker/buildkite-linux:latest resources: limits: cpu: 2 diff --git a/kubernetes/buildkite/service.yaml b/kubernetes/buildkite/service.yaml index 1276c1e..1338219 100644 --- a/kubernetes/buildkite/service.yaml +++ b/kubernetes/buildkite/service.yaml @@ -34,7 +34,7 @@ spec: spec: containers: - name: buildkite-premerge-debian - image: gcr.io/llvm-premerge-checks/buildkite-linux:latest + image: us-central1-docker.pkg.dev/llvm-premerge-checks/docker/buildkite-linux:latest resources: limits: cpu: 2