From c0b9bef54bd31215850f7636ba5a552b3ea977b0 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 12:44:55 -0700 Subject: [PATCH 1/3] [dashboard] Add start_script.sh for automated deployment --- dashboard/README.md | 44 ++++++++++++++++++++++----------------- dashboard/start_script.sh | 31 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 19 deletions(-) create mode 100755 dashboard/start_script.sh diff --git a/dashboard/README.md b/dashboard/README.md index b887e7051..6a3fc1a2c 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -1,23 +1,29 @@ -# Updating dashboard +# Sanitizer Dashboard -To build a new binary and upload it to the GCE instance: +The dashboard is automatically built and updated from `master` on the GCE instance via [`start_script.sh`](start_script.sh). -``` -go build --ldflags '-linkmode external -extldflags=-static' && \ -gcloud compute ssh --project "sanitizer-bots" --zone "us-east1-d" dashboard-v2 --command "sudo rm -f /opt/sanitizers" && \ -gcloud compute --project "sanitizer-bots" scp --zone "us-east1-d" sanitizers "dashboard-v2:/opt" && \ -gcloud compute ssh --project "sanitizer-bots" --zone "us-east1-d" dashboard-v2 --command "sudo chown root:root /opt/sanitizers" -``` - -or +## Creating the GCE instance +```bash +gcloud compute instances create dashboard-v3 \ + --project="sanitizer-bots" \ + --zone="us-east1-d" \ + --machine-type="e2-micro" \ + --network-tier="STANDARD" \ + --address="35.207.33.19" \ + --tags="http-server,https-server" \ + --no-service-account \ + --no-scopes \ + --shielded-secure-boot \ + --shielded-vtpm \ + --shielded-integrity-monitoring \ + --image-family="debian-13" \ + --image-project="debian-cloud" \ + --boot-disk-size="10GB" \ + --metadata=startup-script='#! /bin/bash +command -v curl >/dev/null || (apt-get -qq update && apt-get -qq install -y curl) +while true; do + curl -fsSL https://raw.githubusercontent.com/google/sanitizers/master/dashboard/start_script.sh | bash >/var/log/sanitizer-dashboard.log 2>&1 + sleep 60 +done' ``` -go build --ldflags '-linkmode external -extldflags=-static' && \ -gcloud compute config-ssh --remove && gcloud compute config-ssh --force-key-file-overwrite && \ -ssh dashboard-v2.us-east1-d.sanitizer-bots "sudo rm -f /opt/sanitizers" && \ -scp sanitizers "dashboard-v2.us-east1-d.sanitizer-bots:/opt" && \ -ssh dashboard-v2.us-east1-d.sanitizer-bots "sudo chown root:root /opt/sanitizers" -``` - -Note: If you get a message about "scp: /opt/sanitizers: Text file busy", wait a -few seconds and try again. diff --git a/dashboard/start_script.sh b/dashboard/start_script.sh new file mode 100755 index 000000000..7c6b607fb --- /dev/null +++ b/dashboard/start_script.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -euo pipefail + +if ! command -v go >/dev/null || ! command -v git >/dev/null || ! command -v lighttpd >/dev/null; then + export DEBIAN_FRONTEND=noninteractive + apt-get -qq update + apt-get -qq install -y golang-go git curl lighttpd + rm -f /var/www/html/index.lighttpd.html +fi + +export HOME="${HOME:-/root}" +REPO_DIR="/tmp/sanitizer-dashboard/sanitizers" + +if [[ ! -d "${REPO_DIR}/.git" ]]; then + rm -rf "${REPO_DIR}" + mkdir -p "$(dirname "${REPO_DIR}")" + git clone --depth=1 https://github.com/google/sanitizers.git "${REPO_DIR}" +else + git -C "${REPO_DIR}" fetch --depth=1 origin master + git -C "${REPO_DIR}" reset --hard FETCH_HEAD +fi + +cd "${REPO_DIR}/dashboard" +go build -o /opt/sanitizers . + +mkdir -p /var/www/html +/opt/sanitizers > /var/www/html/index.new.html +chmod 644 /var/www/html/index.new.html +mv -f /var/www/html/index.new.html /var/www/html/index.html + +sleep 540 From a7e79916cb8cd040ce2c9c5e8b49491ad66fcdba Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 12:49:13 -0700 Subject: [PATCH 2/3] fixup! [dashboard] Add start_script.sh for automated deployment --- dashboard/start_script.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/dashboard/start_script.sh b/dashboard/start_script.sh index 7c6b607fb..6da4578f0 100755 --- a/dashboard/start_script.sh +++ b/dashboard/start_script.sh @@ -27,5 +27,3 @@ mkdir -p /var/www/html /opt/sanitizers > /var/www/html/index.new.html chmod 644 /var/www/html/index.new.html mv -f /var/www/html/index.new.html /var/www/html/index.html - -sleep 540 From b724316a0425c7bde1828d9f9e2ce0e5ca87b0ca Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 7 Oct 2026 12:50:32 -0700 Subject: [PATCH 3/3] fixup! [dashboard] Add start_script.sh for automated deployment --- dashboard/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/README.md b/dashboard/README.md index 6a3fc1a2c..d449a073a 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -24,6 +24,6 @@ gcloud compute instances create dashboard-v3 \ command -v curl >/dev/null || (apt-get -qq update && apt-get -qq install -y curl) while true; do curl -fsSL https://raw.githubusercontent.com/google/sanitizers/master/dashboard/start_script.sh | bash >/var/log/sanitizer-dashboard.log 2>&1 - sleep 60 + sleep 600 done' ```