Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 121 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ name: Release
# 1. build-amd64 / build-arm64 (parallel) — compile on native GitHub-hosted runners
# (ubuntu-latest + ubuntu-24.04-arm). Each job uploads its per-arch staging
# tree as a workflow artifact. arm64 is not emulated under QEMU.
# 2. publish — assemble the multi-arch Docker image from those prebuilt binaries
# (Dockerfile.runtime does no compilation), push to GHCR, package tarballs,
# and create the GitHub Release.
# 2. publish-image / publish-proxy-image (parallel after build) — assemble the
# multi-arch Docker images from those prebuilt binaries (Dockerfile.runtime
# and Dockerfile.proxy-runtime do no compilation), push both to GHCR.
# 3. publish-release — package tarballs, standalone CLI binaries, and create the
# GitHub Release.
#
# Compilation caches use GitHub Actions cache (sccache + Swatinem/rust-cache) instead
# of the self-hosted runner hostPath used by CI.
Expand Down Expand Up @@ -36,6 +38,7 @@ env:
CHDB_RUST_REF: feat_arrow_insert
REGISTRY: ghcr.io
IMAGE_NAME: hyperbyte-cloud/hyperbytedb
PROXY_IMAGE_NAME: hyperbyte-cloud/hyperbytedb-proxy

jobs:
build-amd64:
Expand Down Expand Up @@ -65,10 +68,10 @@ jobs:
bash .github/scripts/run-in-rust-container.sh \
'bash .github/scripts/rust-container-setup.sh && \
sccache --zero-stats && \
cargo build --release --locked -p hyperbytedb --bin hyperbytedb -p hyperbytedb-cli --bin hyperbytedb-cli && \
cargo build --release --locked -p hyperbytedb --bin hyperbytedb -p hyperbytedb-cli --bin hyperbytedb-cli -p hyperbytedb-proxy --bin hyperbytedb-proxy && \
sccache --show-stats && \
mkdir -p release-staging/amd64 && \
cp target/release/hyperbytedb target/release/hyperbytedb-cli /usr/local/lib/libchdb.so release-staging/amd64/'
cp target/release/hyperbytedb target/release/hyperbytedb-cli target/release/hyperbytedb-proxy /usr/local/lib/libchdb.so release-staging/amd64/'

- name: Upload amd64 staging artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -104,10 +107,10 @@ jobs:
bash .github/scripts/run-in-rust-container.sh \
'bash .github/scripts/rust-container-setup.sh && \
sccache --zero-stats && \
cargo build --release --locked -p hyperbytedb --bin hyperbytedb -p hyperbytedb-cli --bin hyperbytedb-cli && \
cargo build --release --locked -p hyperbytedb --bin hyperbytedb -p hyperbytedb-cli --bin hyperbytedb-cli -p hyperbytedb-proxy --bin hyperbytedb-proxy && \
sccache --show-stats && \
mkdir -p release-staging/arm64 && \
cp target/release/hyperbytedb target/release/hyperbytedb-cli /usr/local/lib/libchdb.so release-staging/arm64/'
cp target/release/hyperbytedb target/release/hyperbytedb-cli target/release/hyperbytedb-proxy /usr/local/lib/libchdb.so release-staging/arm64/'

- name: Upload arm64 staging artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -141,6 +144,7 @@ jobs:
chmod +x "release-staging/${arch}/hyperbytedb" "release-staging/${arch}/hyperbytedb-cli"
test -f "release-staging/${arch}/hyperbytedb"
test -f "release-staging/${arch}/hyperbytedb-cli"
test -f "release-staging/${arch}/hyperbytedb-proxy"
test -s "release-staging/${arch}/libchdb.so"
done
ls -lh release-staging/*/*
Expand Down Expand Up @@ -193,10 +197,85 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

publish-proxy-image:
name: Publish proxy container image
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64]
steps:
- uses: actions/checkout@v4

- name: Download prebuilt binaries
uses: actions/download-artifact@v4
with:
name: release-staging-amd64
path: release-staging/amd64

- uses: actions/download-artifact@v4
with:
name: release-staging-arm64
path: release-staging/arm64

- name: Verify proxy binary
run: |
set -euo pipefail
for arch in amd64 arm64; do
chmod +x "release-staging/${arch}/hyperbytedb-proxy"
test -f "release-staging/${arch}/hyperbytedb-proxy"
done
ls -lh release-staging/*/hyperbytedb-proxy

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry (PAT)
if: vars.GHCR_AUTH == 'pat'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PAT }}

- name: Log in to GitHub Container Registry (GITHUB_TOKEN)
if: vars.GHCR_AUTH != 'pat'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.PROXY_IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}

- name: Build and push multi-arch proxy image
uses: docker/build-push-action@v6
with:
context: release-staging
file: Dockerfile.proxy-runtime
platforms: linux/amd64,linux/arm64
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

publish-release:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64, publish-image]
needs: [build-amd64, build-arm64, publish-image, publish-proxy-image]
if: github.ref_type == 'tag'
steps:
- name: Download prebuilt binaries
Expand All @@ -216,17 +295,32 @@ jobs:
run: |
set -euo pipefail
for arch in amd64 arm64; do
chmod +x "release-staging/${arch}/hyperbytedb" "release-staging/${arch}/hyperbytedb-cli"
chmod +x "release-staging/${arch}/hyperbytedb" \
"release-staging/${arch}/hyperbytedb-cli" \
"release-staging/${arch}/hyperbytedb-proxy"
done
mkdir -p out
declare -A ARCHES=( [amd64]=x86_64 [arm64]=aarch64 )
for src in "${!ARCHES[@]}"; do
dst="${ARCHES[$src]}"

NAME="hyperbytedb-${TAG}-linux-${dst}"
tar -C "release-staging/${src}" -czf "out/${NAME}.tar.gz" \
hyperbytedb hyperbytedb-cli libchdb.so
hyperbytedb hyperbytedb-cli hyperbytedb-proxy libchdb.so
( cd out && sha256sum "${NAME}.tar.gz" > "${NAME}.tar.gz.sha256" )
ls -lh "out/${NAME}.tar.gz" "out/${NAME}.tar.gz.sha256"

CLI_NAME="hyperbytedb-cli-${TAG}-linux-${dst}"
cp "release-staging/${src}/hyperbytedb-cli" "out/${CLI_NAME}"
gzip -f "out/${CLI_NAME}"
( cd out && sha256sum "${CLI_NAME}.gz" > "${CLI_NAME}.gz.sha256" )
ls -lh "out/${CLI_NAME}.gz" "out/${CLI_NAME}.gz.sha256"

PROXY_NAME="hyperbytedb-proxy-${TAG}-linux-${dst}"
cp "release-staging/${src}/hyperbytedb-proxy" "out/${PROXY_NAME}"
gzip -f "out/${PROXY_NAME}"
( cd out && sha256sum "${PROXY_NAME}.gz" > "${PROXY_NAME}.gz.sha256" )
ls -lh "out/${PROXY_NAME}.gz" "out/${PROXY_NAME}.gz.sha256"
done

- name: Verify release artifacts
Expand All @@ -239,9 +333,17 @@ jobs:
test -s "${tarball}"
test -s "out/hyperbytedb-${TAG}-linux-${arch}.tar.gz.sha256"
listing="$(tar -tzf "${tarball}")"
for entry in hyperbytedb hyperbytedb-cli libchdb.so; do
for entry in hyperbytedb hyperbytedb-cli hyperbytedb-proxy libchdb.so; do
grep -qx "${entry}" <<<"${listing}"
done

cli="out/hyperbytedb-cli-${TAG}-linux-${arch}.gz"
test -s "${cli}"
test -s "${cli}.sha256"

proxy="out/hyperbytedb-proxy-${TAG}-linux-${arch}.gz"
test -s "${proxy}"
test -s "${proxy}.sha256"
done
ls -lh out/

Expand All @@ -257,3 +359,11 @@ jobs:
out/hyperbytedb-${{ github.ref_name }}-linux-x86_64.tar.gz.sha256
out/hyperbytedb-${{ github.ref_name }}-linux-aarch64.tar.gz
out/hyperbytedb-${{ github.ref_name }}-linux-aarch64.tar.gz.sha256
out/hyperbytedb-cli-${{ github.ref_name }}-linux-x86_64.gz
out/hyperbytedb-cli-${{ github.ref_name }}-linux-x86_64.gz.sha256
out/hyperbytedb-cli-${{ github.ref_name }}-linux-aarch64.gz
out/hyperbytedb-cli-${{ github.ref_name }}-linux-aarch64.gz.sha256
out/hyperbytedb-proxy-${{ github.ref_name }}-linux-x86_64.gz
out/hyperbytedb-proxy-${{ github.ref_name }}-linux-x86_64.gz.sha256
out/hyperbytedb-proxy-${{ github.ref_name }}-linux-aarch64.gz
out/hyperbytedb-proxy-${{ github.ref_name }}-linux-aarch64.gz.sha256
26 changes: 26 additions & 0 deletions Dockerfile.proxy-runtime
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1
#
# Release runtime image for hyperbytedb-proxy assembled from PREBUILT binaries.
# The release workflow (.github/workflows/release.yml) compiles the proxy per
# architecture in parallel on GitHub-hosted runners, uploads staging artifacts,
# and points this Dockerfile at the merged tree as its build context:
#
# release-staging/
# amd64/{hyperbytedb-proxy, ...}
# arm64/{hyperbytedb-proxy, ...}
FROM debian:bookworm-slim

ARG TARGETARCH

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY ${TARGETARCH}/hyperbytedb-proxy /usr/local/bin/hyperbytedb-proxy

EXPOSE 8086

ENV HYPERBYTEDB_PROXY_LISTEN=0.0.0.0:8086 \
HYPERBYTEDB_PROXY_BACKEND_PORT=8086

ENTRYPOINT ["/usr/local/bin/hyperbytedb-proxy"]
4 changes: 2 additions & 2 deletions deploy/examples/single-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
namespace: default
spec:
replicas: 1
image: hyperbytedb:latest
version: "0.8.3"
image: ghcr.io/hyperbyte-cloud/hyperbytedb
version: "0.8.3-beta"
server:
port: 8086
storage:
Expand Down
4 changes: 2 additions & 2 deletions deploy/examples/three-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
namespace: default
spec:
replicas: 3
image: hyperbytedb:latest
version: "0.8.3"
image: ghcr.io/hyperbyte-cloud/hyperbytedb
version: "0.8.3-beta"
server:
port: 8086
requestTimeoutSecs: 30
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if [ -z "$version" ]; then
exit 1
fi

image="$registry/hyperbytedb:v$version"
image="$registry/hyperbytedb:$version"
latest="$registry/hyperbytedb:latest"

# Use a dedicated builder so we don't clobber the default `docker` driver
Expand Down
Loading