From ede4b5255c44a0fc06212941658c54617422d4a4 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Thu, 5 Nov 2026 02:40:14 +0000 Subject: [PATCH 1/2] fix(ci): prepare Ubuntu build runners and default EC2 disks to 500 GiB (#10156) * ci: share Linux runner dependency setup for builds and benchmarks Signed-off-by: WenyXu * ci: configure EC2 build runner volumes with a 500 GiB default Signed-off-by: WenyXu --------- Signed-off-by: WenyXu (cherry picked from commit c02e1f58af1b272e0d286b5fdf8d534b323168d2) Signed-off-by: WenyXu --- .../actions/build-linux-artifacts/action.yml | 5 +++ .../action.yml | 32 ++++++++++++-- .github/scripts/ci-runners.md | 9 ++-- .github/workflows/agent-observability.yml | 5 ++- .github/workflows/dev-build.yml | 7 +++ .github/workflows/nightly-build.yml | 7 +++ .github/workflows/oswal-s3-bench.yml | 5 ++- .github/workflows/release.yml | 12 +++++ .github/workflows/tracesbench.yml | 5 ++- .github/workflows/vmbench-long-range.yml | 5 ++- tests/perf/test_ci_runner_scripts.py | 44 ++++++++++++++++--- 11 files changed, 118 insertions(+), 18 deletions(-) rename .github/actions/{setup-benchmark => setup-linux-runner}/action.yml (60%) diff --git a/.github/actions/build-linux-artifacts/action.yml b/.github/actions/build-linux-artifacts/action.yml index 26028485061..a16c1a72405 100644 --- a/.github/actions/build-linux-artifacts/action.yml +++ b/.github/actions/build-linux-artifacts/action.yml @@ -50,6 +50,11 @@ inputs: runs: using: composite steps: + - name: Set up Linux runner + uses: ./.github/actions/setup-linux-runner + with: + tools: make shasum + - name: Run integration test if: ${{ inputs.disable-run-tests == 'false' }} shell: bash diff --git a/.github/actions/setup-benchmark/action.yml b/.github/actions/setup-linux-runner/action.yml similarity index 60% rename from .github/actions/setup-benchmark/action.yml rename to .github/actions/setup-linux-runner/action.yml index a446a78a2c3..95de8e465c5 100644 --- a/.github/actions/setup-benchmark/action.yml +++ b/.github/actions/setup-linux-runner/action.yml @@ -1,19 +1,41 @@ -name: Set up benchmark dependencies +name: Set up Linux runner dependencies description: Reuse installed tools and install missing dependencies on an Ubuntu self-hosted runner +inputs: + tools: + description: Space-separated commands to install if missing (Ubuntu package names, except shasum) + required: false + default: curl + expected-architecture: + description: Optional uname architecture required by the workload + required: false + default: '' runs: using: composite steps: - name: Check host and install missing tools shell: bash + env: + REQUIRED_TOOLS: ${{ inputs.tools }} + EXPECTED_ARCH: ${{ inputs.expected-architecture }} run: | set -euo pipefail - [[ "$(uname -m)" == x86_64 ]] + if [[ -n "$EXPECTED_ARCH" ]]; then + [[ "$(uname -m)" == "$EXPECTED_ARCH" ]] + fi command -v git missing=() - for tool in curl jq python3 rsync; do - command -v "$tool" >/dev/null || missing+=("$tool") + read -r -a tools <<< "$REQUIRED_TOOLS" + for tool in "${tools[@]}"; do + if ! command -v "$tool" >/dev/null; then + case "$tool" in + shasum) missing+=(libdigest-sha-perl) ;; + *) missing+=("$tool") ;; + esac + fi done if ((${#missing[@]})); then + . /etc/os-release + [[ "$ID" == ubuntu ]] sudo -n apt-get update sudo -n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get install -y --no-install-recommends "${missing[@]}" fi @@ -24,6 +46,8 @@ runs: if ! command -v docker >/dev/null; then . /etc/os-release [[ "$ID" == ubuntu ]] + sudo -n apt-get update + sudo -n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get install -y --no-install-recommends curl ca-certificates sudo -n install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo -n tee /etc/apt/keyrings/docker.asc >/dev/null sudo -n chmod a+r /etc/apt/keyrings/docker.asc diff --git a/.github/scripts/ci-runners.md b/.github/scripts/ci-runners.md index 6e4b2b3a4f7..657d76866dd 100644 --- a/.github/scripts/ci-runners.md +++ b/.github/scripts/ci-runners.md @@ -31,9 +31,12 @@ swappiness 10, disables systemd-oomd and background automatic updates, and sets `OOMPolicy=continue` on the runner service. Explicit setup package installation remains enabled. -Both benchmark jobs call `.github/actions/setup-benchmark` after checkout. It -reuses existing tools, installs missing curl/jq/python3/rsync, installs Docker CE -if absent, and checks Docker access. Missing packages require passwordless sudo; +Benchmark jobs call `.github/actions/setup-linux-runner` after checkout with +`tools: curl jq python3 rsync` and require x86_64. Linux artifact builds reuse +the same action with `tools: make shasum` on either amd64 or arm64; the RISC-V +cross-build calls it on amd64 too. The action reuses installed commands, maps +`shasum` to Ubuntu package `libdigest-sha-perl`, installs Docker CE if absent, +and checks Docker access. Missing packages require passwordless sudo; Aliyun's prepared image normally provides the tools and Docker already. Existing Docker installations are preserved, so exact versions need not match between providers. Provisioning must establish Docker permissions before starting the diff --git a/.github/workflows/agent-observability.yml b/.github/workflows/agent-observability.yml index d265801d4a0..b4b706f0622 100644 --- a/.github/workflows/agent-observability.yml +++ b/.github/workflows/agent-observability.yml @@ -275,7 +275,10 @@ jobs: path: greptimedb persist-credentials: false - name: Set up benchmark dependencies - uses: ./greptimedb/.github/actions/setup-benchmark + uses: ./greptimedb/.github/actions/setup-linux-runner + with: + tools: curl jq python3 rsync + expected-architecture: x86_64 - name: Check Docker on ephemeral Linux host shell: bash run: | diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 563435b708e..d867c34f8ee 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -4,6 +4,11 @@ name: GreptimeDB Development Build on: workflow_dispatch: # Allows you to run this workflow manually. inputs: + ec2_volume_size: + description: Root volume size in GiB for each EC2 build runner + type: number + required: false + default: 500 large-page-size: description: Build GreptimeDB with large page size (65536). type: boolean @@ -133,6 +138,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} @@ -147,6 +153,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index c78ca4dc5b9..3b21d614aa0 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -9,6 +9,11 @@ on: - cron: '0 0 * * 1-5' workflow_dispatch: # Allows you to run this workflow manually. inputs: + ec2_volume_size: + description: Root volume size in GiB for each EC2 build runner + type: number + required: false + default: 500 linux_amd64_runner: type: choice description: The runner uses to build linux-amd64 artifacts @@ -113,6 +118,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} @@ -127,6 +133,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} diff --git a/.github/workflows/oswal-s3-bench.yml b/.github/workflows/oswal-s3-bench.yml index c31dfe8f1c3..9ac7b79c6f6 100644 --- a/.github/workflows/oswal-s3-bench.yml +++ b/.github/workflows/oswal-s3-bench.yml @@ -150,7 +150,10 @@ jobs: path: greptimedb persist-credentials: false - name: Set up benchmark dependencies - uses: ./greptimedb/.github/actions/setup-benchmark + uses: ./greptimedb/.github/actions/setup-linux-runner + with: + tools: curl jq python3 rsync + expected-architecture: x86_64 - uses: astral-sh/setup-uv@v6 - name: Start the MinIO fixture if: inputs.smoke diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 948391b2aa3..b58e9c352c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,11 @@ on: workflow_dispatch: # Allows you to run this workflow manually. # Notes: The GitHub Actions ONLY support 10 inputs; this final input is the tenth. inputs: + ec2_volume_size: + description: Root volume size in GiB for each EC2 build runner + type: number + required: false + default: 500 linux_amd64_runner: type: choice description: The runner uses to build linux-amd64 artifacts @@ -192,6 +197,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_AMD64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} @@ -206,6 +212,7 @@ jobs: aws-region: ${{ vars.EC2_RUNNER_REGION }} github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} image-id: ${{ vars.EC2_RUNNER_LINUX_ARM64_IMAGE_ID }} + ec2-volume-size: ${{ inputs.ec2_volume_size || 500 }} security-group-id: ${{ vars.EC2_RUNNER_SECURITY_GROUP_ID }} subnet-id: ${{ vars.EC2_RUNNER_SUBNET_ID }} @@ -275,6 +282,11 @@ jobs: fetch-depth: 0 persist-credentials: false + - name: Set up Linux runner + uses: ./.github/actions/setup-linux-runner + with: + tools: make shasum + - name: Prepare riscv64 dev-builder image shell: bash env: diff --git a/.github/workflows/tracesbench.yml b/.github/workflows/tracesbench.yml index 049faaef1a7..03b5b6efa1d 100644 --- a/.github/workflows/tracesbench.yml +++ b/.github/workflows/tracesbench.yml @@ -305,7 +305,10 @@ jobs: path: greptimedb persist-credentials: false - name: Set up benchmark dependencies - uses: ./greptimedb/.github/actions/setup-benchmark + uses: ./greptimedb/.github/actions/setup-linux-runner + with: + tools: curl jq python3 rsync + expected-architecture: x86_64 - name: Checkout matching benchmark tools uses: actions/checkout@v4 with: diff --git a/.github/workflows/vmbench-long-range.yml b/.github/workflows/vmbench-long-range.yml index aaf2dd7f437..cdf1cebf19c 100644 --- a/.github/workflows/vmbench-long-range.yml +++ b/.github/workflows/vmbench-long-range.yml @@ -266,7 +266,10 @@ jobs: path: greptimedb persist-credentials: false - name: Set up benchmark dependencies - uses: ./greptimedb/.github/actions/setup-benchmark + uses: ./greptimedb/.github/actions/setup-linux-runner + with: + tools: curl jq python3 rsync + expected-architecture: x86_64 - name: Checkout matching benchmark tools uses: actions/checkout@v4 with: diff --git a/tests/perf/test_ci_runner_scripts.py b/tests/perf/test_ci_runner_scripts.py index c703e41c62b..e24cf5f3e71 100644 --- a/tests/perf/test_ci_runner_scripts.py +++ b/tests/perf/test_ci_runner_scripts.py @@ -158,9 +158,11 @@ class ProviderConfigTest(unittest.TestCase): -class BenchmarkSetupTest(unittest.TestCase): - def run_setup(self, missing_tools="", docker_installed=True, docker_ready=True): - action = (SCRIPTS.parent / "actions/setup-benchmark/action.yml").read_text() +class LinuxRunnerSetupTest(unittest.TestCase): + def run_setup(self, missing_tools="", docker_installed=True, docker_ready=True, + tools="curl jq python3 rsync", architecture="x86_64", + expected_arch="x86_64", docker_access=True, expect_success=True): + action = (SCRIPTS.parent / "actions/setup-linux-runner/action.yml").read_text() steps = re.findall(r" run: \|\n((?: .*\n|\n)+)", action) self.assertEqual(len(steps), 2) script = "\n".join(textwrap.dedent(step) for step in steps) @@ -168,9 +170,9 @@ class BenchmarkSetupTest(unittest.TestCase): # changes availability, so the second pass must perform no mutations. prelude = r""" function . { ID=ubuntu; VERSION_CODENAME=noble; } -uname() { echo x86_64; } +uname() { echo "$TEST_ARCH"; } dpkg() { echo amd64; } -curl() { echo fixture-key; } +curl() { printf 'curl %s\n' "$*" >> "$CALLS"; echo fixture-key; } command() { if [[ "$1" == -v ]]; then if [[ "$2" == docker ]]; then [[ "$DOCKER_INSTALLED" == true ]]; return; fi @@ -179,7 +181,7 @@ command() { fi builtin command "$@" } -docker() { [[ "$DOCKER_READY" == true ]]; } +docker() { [[ "$DOCKER_READY" == true && "$DOCKER_ACCESS" == true ]]; } sudo() { printf '%s\n' "$*" >> "$CALLS" if [[ "$*" == *' apt-get install '* ]]; then @@ -196,10 +198,17 @@ sudo() { calls.touch() env = os.environ | {"CALLS": str(calls), "MISSING_TOOLS": missing_tools, "DOCKER_INSTALLED": str(docker_installed).lower(), - "DOCKER_READY": str(docker_ready).lower()} + "DOCKER_READY": str(docker_ready).lower(), + "DOCKER_ACCESS": str(docker_access).lower(), + "REQUIRED_TOOLS": tools, "TEST_ARCH": architecture, + "EXPECTED_ARCH": expected_arch} result = subprocess.run(["bash", "-c", prelude + script + '\nprintf "SECOND PASS\\n" >> "$CALLS"\n' + script], env=env, capture_output=True, text=True) + if not expect_success: + self.assertNotEqual(result.returncode, 0) + self.assertNotIn("SECOND PASS", calls.read_text()) + return calls.read_text() self.assertEqual(result.returncode, 0, result.stderr) first, second = calls.read_text().split("SECOND PASS\n") self.assertEqual(second, "", "Second setup must reuse installed dependencies") @@ -218,11 +227,32 @@ sudo() { calls = self.run_setup(docker_installed=False, docker_ready=False) self.assertIn("NEEDRESTART_MODE=l", calls) self.assertIn("docker-ce docker-ce-cli containerd.io docker-buildx-plugin", calls) + self.assertLess(calls.index("--no-install-recommends curl ca-certificates"), + calls.index("curl -fsSL https://download.docker.com/linux/ubuntu/gpg")) self.assertIn("systemctl enable --now docker", calls) def test_existing_stopped_docker_is_started_without_installation(self): self.assertEqual(self.run_setup(docker_ready=False), "-n systemctl enable --now docker\n") + def test_release_tools_on_both_architectures(self): + for architecture in ("x86_64", "aarch64"): + with self.subTest(architecture=architecture): + calls = self.run_setup(missing_tools="make shasum", tools="make shasum", + architecture=architecture, expected_arch="") + self.assertEqual(calls.splitlines(), [ + "-n apt-get update", + "-n env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l " + "apt-get install -y --no-install-recommends make libdigest-sha-perl", + ]) + + def test_benchmark_rejects_arm_before_installing(self): + self.assertEqual(self.run_setup(missing_tools="jq", architecture="aarch64", + expect_success=False), "") + + def test_inaccessible_docker_fails_even_after_starting_service(self): + calls = self.run_setup(docker_access=False, expect_success=False) + self.assertEqual(calls, "-n systemctl enable --now docker\n") + class AwsProvisionTest(unittest.TestCase): def test_host_policy_matches_aliyun_before_runner_activation(self): From 1368084b43ede8d111be0b0996cc79c66938538c Mon Sep 17 00:00:00 2001 From: LFC <990479+MichaelScofield@users.noreply.github.com> Date: Wed, 4 Nov 2026 08:23:09 +0000 Subject: [PATCH 2/2] fix(ci): increase nightly JSONBench runner root volume (#10146) Signed-off-by: luofucong (cherry picked from commit e80cf9a9ae2a412af0b2dd59f63da8b871652a67) Signed-off-by: WenyXu --- .github/actions/start-runner/action.yml | 4 ++++ .github/workflows/nightly-jsonbench.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/actions/start-runner/action.yml b/.github/actions/start-runner/action.yml index 44a5ff3feb3..17f07ae6324 100644 --- a/.github/actions/start-runner/action.yml +++ b/.github/actions/start-runner/action.yml @@ -20,6 +20,9 @@ inputs: image-id: description: The EC2 image id required: true + ec2-volume-size: + description: Root volume size in GiB (uses the AMI default when omitted) + required: false security-group-id: description: The EC2 security group id required: true @@ -61,6 +64,7 @@ runs: with: mode: start ec2-image-id: ${{ inputs.image-id }} + ec2-volume-size: ${{ inputs.ec2-volume-size }} ec2-instance-type: ${{ steps.get-ec2-instance-type.outputs.instance-type }} subnet-id: ${{ inputs.subnet-id }} security-group-id: ${{ inputs.security-group-id }} diff --git a/.github/workflows/nightly-jsonbench.yaml b/.github/workflows/nightly-jsonbench.yaml index d5db6f9ba4a..c246ee1f02c 100644 --- a/.github/workflows/nightly-jsonbench.yaml +++ b/.github/workflows/nightly-jsonbench.yaml @@ -112,6 +112,8 @@ jobs: id: start-linux-runner with: runner: ${{ vars.LARGE_IOPS_RUNNER }} + # Database data, WAL, and compaction files use the root volume. + ec2-volume-size: "500" aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ vars.EC2_RUNNER_REGION }}