Merge branch 'backport/v1.3.1-candidate' into build/v1.3.1-candidate-amd64-20261111

This commit is contained in:
WenyXu
2026-11-11 03:10:50 +00:00
13 changed files with 124 additions and 18 deletions
@@ -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
@@ -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
+4
View File
@@ -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 }}
+6 -3
View File
@@ -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
+4 -1
View File
@@ -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: |
+7
View File
@@ -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 }}
+7
View File
@@ -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 }}
+2
View File
@@ -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 }}
+4 -1
View File
@@ -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
+12
View File
@@ -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
@@ -193,6 +198,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 }}
@@ -207,6 +213,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 }}
@@ -277,6 +284,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:
+4 -1
View File
@@ -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:
+4 -1
View File
@@ -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:
+37 -7
View File
@@ -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):