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
26 changes: 13 additions & 13 deletions .github/workflows/deploy-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ on:
description: 'The environment to deploy to. "staging" or "production"'
required: true
default: 'staging'
keep_current_bucket:
push_to_active:
description: >-
Deploy onto whichever Blue/Green bucket is currently live, instead of
the normal release toggle. This workflow never touches packages, so
the other bucket is likely several releases stale - toggling to it
would make those stale packages live again. Leave this true unless
you specifically want to stage static changes on the inactive side
first.
If true, deploy static assets onto the currently live Blue/Green
prefix and do not rotate CloudFront. If false, deploy static assets
onto the inactive prefix and rotate CloudFront to it.
required: true
type: boolean
default: true
Expand All @@ -24,7 +21,10 @@ env:

jobs:
deploy-static:
runs-on: [altinity-style-checker-aarch64, altinity-on-demand]
runs-on: ${{
inputs.release_environment == 'staging' && 'arc-runners-clickhouse-signer' ||
inputs.release_environment == 'production' && 'arc-runners-clickhouse-signer-prod'
}}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -55,15 +55,15 @@ jobs:

- name: Run static deploy playbook
run: |
echo "Deploying static site assets (installer.sh, landing page, CloudFront routing) to ${{ inputs.release_environment }}..."
echo "Keep current bucket (skip Blue/Green toggle): ${{ inputs.keep_current_bucket }}"
if ! ansible-playbook -i release/packaging/ansible/inventory/localhost.yml \
echo "Deploying static site assets to ${{ inputs.release_environment }}..."
echo "push_to_active=${{ inputs.push_to_active }} (true=stay on live prefix, false=rotate Blue/Green)"
if ! ansible-playbook -i tests/ci/release/packaging/ansible/inventory/localhost.yml \
-e aws_region="$AWS_REGION" \
-e repo_dns_name="$REPO_DNS_NAME" \
-e repo_name="$REPO_NAME" \
-e repo_subtitle="$REPO_SUBTITLE" \
-e push_to_active=${{ inputs.keep_current_bucket }} \
release/packaging/ansible/deploy-static.yml; then
-e push_to_active=${{ inputs.push_to_active }} \
tests/ci/release/packaging/ansible/deploy-static.yml; then
echo "Ansible playbook failed"
exit 1
fi
37 changes: 35 additions & 2 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
image_archives_path: ${{ steps.set_path.outputs.image_archives_path }}
steps:
- name: Docker Hub Login
uses: docker/login-action@v2
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
Expand All @@ -69,9 +69,42 @@ jobs:
echo "Pulling the image"
docker pull $IMAGE

# Create container for version and symtable checks
echo "Creating container for checks..."
CONTAINER_ID=$(docker create $IMAGE $COMPONENT --version)

# Check if binary has symbol table (not stripped)
echo "Checking if binary has symtable..."
# Try common binary locations
BINARY_PATH=""
for path in "/usr/bin/clickhouse" "/usr/bin/$COMPONENT"; do
if docker cp "$CONTAINER_ID:$path" /tmp/clickhouse-check 2>/dev/null; then
BINARY_PATH="$path"
break
fi
done

if [ -z "$BINARY_PATH" ]; then
echo "✗ Could not find clickhouse binary in container"
docker rm "$CONTAINER_ID"
exit 1
fi

echo "Found binary at $BINARY_PATH"
if readelf -S /tmp/clickhouse-check | grep -q '\.symtab'; then
echo "✓ Binary has symtable"
else
echo "✗ Binary is missing symtable"
docker rm "$CONTAINER_ID"
rm -f /tmp/clickhouse-check
exit 1
fi
rm -f /tmp/clickhouse-check

# Get version and clean it up
echo "Getting version from image..."
VERSION_OUTPUT=$(docker run --rm $IMAGE $COMPONENT --version)
VERSION_OUTPUT=$(docker start -a "$CONTAINER_ID")
docker rm "$CONTAINER_ID"
echo "Raw version output: $VERSION_OUTPUT"

# Extract just the version number
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/final-production-sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Final production SBOM

on:
workflow_dispatch:
inputs:
release_tag:
description: Release tag, for example v26.6.4.20001.altinityantalya
required: true
type: string
build_run_id:
description: Optional MasterCI run ID; auto-detected when omitted
required: false
type: string
release:
types: [published]

permissions:
contents: read
actions: read

jobs:
final-sbom:
name: Build final production SBOM
runs-on: ubuntu-24.04
timeout-minutes: 120
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.release_tag }}
BUILD_RUN_ID: ${{ inputs.build_run_id }}
steps:
- name: Checkout exact release
uses: actions/checkout@v6
with:
ref: ${{ env.RELEASE_TAG }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: utils/final_sbom/requirements.txt

- name: Install verification dependencies
run: |
python -m pip install -r utils/final_sbom/requirements.txt
- name: Test SBOM tooling
run: python -m unittest discover -s utils/final_sbom/tests -v

- name: Collect immutable release evidence
run: |
args=(
--tag "$RELEASE_TAG"
--repo "$GITHUB_REPOSITORY"
--github-token "$GH_TOKEN"
--output-dir sbom-work/evidence
--require-container
)
if [[ -n "$BUILD_RUN_ID" ]]; then
args+=(--build-run-id "$BUILD_RUN_ID")
fi
python utils/final_sbom/collect_release_evidence.py "${args[@]}"
- name: Generate and validate final SBOM
run: |
python utils/final_sbom/generate_final_sbom.py \
--evidence-dir sbom-work/evidence \
--output-dir sbom-work/final
python -m spdx_tools.spdx.clitools.pyspdxtools \
-i sbom-work/final/*-production.spdx.json
python utils/final_sbom/verify_outputs.py sbom-work/final
- name: Publish workflow artifact
uses: actions/upload-artifact@v4
with:
name: final-sbom-${{ env.RELEASE_TAG }}
path: |
sbom-work/final/*
sbom-work/evidence/evidence.json
sbom-work/evidence/container-manifest.json
sbom-work/evidence/system-licenses.jsonl
sbom-work/evidence/*-build-components.txt
if-no-files-found: error
retention-days: 90
2 changes: 1 addition & 1 deletion .github/workflows/repo-sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
echo "$server_version" | grep "altinity" || FAILED_SERVER=true

# Start server and test
sudo -u clickhouse clickhouse-server --config-file /etc/clickhouse-server/config.xml --daemon
clickhouse su clickhouse:clickhouse clickhouse-server --config-file /etc/clickhouse-server/config.xml --daemon
sleep 10
clickhouse-client -q 'SELECT 1'

Expand Down
Loading
Loading