194 lines
7.6 KiB
YAML
194 lines
7.6 KiB
YAML
# RuVector-Postgres Docker Hub Publication
|
|
# Publishes multi-arch Docker images to Docker Hub on release
|
|
#
|
|
# Triggers:
|
|
# - On release creation (v* tags)
|
|
# - Manual workflow dispatch
|
|
#
|
|
# Images published:
|
|
# - ruvector/ruvector-postgres:latest
|
|
# - ruvector/ruvector-postgres:2.0.0
|
|
# - ruvector/ruvector-postgres:2.0.0-pg17
|
|
# - ruvector/ruvector-postgres:pg17
|
|
# - (Same for pg14, pg15, pg16)
|
|
|
|
name: Docker Hub Publish
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to publish (e.g., 2.0.0)'
|
|
required: true
|
|
default: '2.0.0'
|
|
pg_versions:
|
|
description: 'PostgreSQL versions (comma-separated)'
|
|
required: false
|
|
default: '14,15,16,17'
|
|
|
|
env:
|
|
DOCKER_REGISTRY: ruvector
|
|
IMAGE_NAME: ruvector-postgres
|
|
RUST_VERSION: '1.83'
|
|
|
|
jobs:
|
|
# ============================================================================
|
|
# Build and Push Docker Images
|
|
# ============================================================================
|
|
build-and-push:
|
|
name: Build & Push PG${{ matrix.pg_version }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
pg_version: [14, 15, 16, 17]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract version
|
|
id: version
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "release" ]; then
|
|
VERSION="${{ github.event.release.tag_name }}"
|
|
VERSION="${VERSION#v}"
|
|
else
|
|
VERSION="${{ github.event.inputs.version }}"
|
|
fi
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Building version: $VERSION"
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Generate Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=raw,value=${{ steps.version.outputs.version }}-pg${{ matrix.pg_version }}
|
|
type=raw,value=v${{ steps.version.outputs.version }}-pg${{ matrix.pg_version }}
|
|
type=raw,value=pg${{ matrix.pg_version }}
|
|
type=raw,value=latest,enable=${{ matrix.pg_version == 17 }}
|
|
type=raw,value=${{ steps.version.outputs.version }},enable=${{ matrix.pg_version == 17 }}
|
|
type=raw,value=v${{ steps.version.outputs.version }},enable=${{ matrix.pg_version == 17 }}
|
|
labels: |
|
|
org.opencontainers.image.title=RuVector PostgreSQL Extension v2
|
|
org.opencontainers.image.description=High-performance vector database extension for PostgreSQL with 230+ SQL functions
|
|
org.opencontainers.image.vendor=ruv.io
|
|
ruvector.pg.version=${{ matrix.pg_version }}
|
|
ruvector.features=attention,gnn,hybrid,tenancy,healing,learning,hyperbolic,graph,gated-transformer,integrity
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: crates/ruvector-postgres/docker/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
PG_VERSION=${{ matrix.pg_version }}
|
|
RUST_VERSION=${{ env.RUST_VERSION }}
|
|
cache-from: type=gha,scope=pg${{ matrix.pg_version }}
|
|
cache-to: type=gha,mode=max,scope=pg${{ matrix.pg_version }}
|
|
|
|
- name: Test published image
|
|
run: |
|
|
docker pull ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-pg${{ matrix.pg_version }}
|
|
|
|
docker run -d \
|
|
--name ruvector-test-${{ matrix.pg_version }} \
|
|
-e POSTGRES_USER=ruvector \
|
|
-e POSTGRES_PASSWORD=ruvector \
|
|
-e POSTGRES_DB=ruvector_test \
|
|
${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-pg${{ matrix.pg_version }}
|
|
|
|
# Wait for PostgreSQL to start
|
|
sleep 30
|
|
|
|
# Verify extension
|
|
docker exec ruvector-test-${{ matrix.pg_version }} \
|
|
psql -U ruvector -d ruvector_test -c "CREATE EXTENSION IF NOT EXISTS ruvector; SELECT ruvector_version();"
|
|
|
|
# Cleanup
|
|
docker rm -f ruvector-test-${{ matrix.pg_version }}
|
|
|
|
# ============================================================================
|
|
# Update Docker Hub Description
|
|
# ============================================================================
|
|
update-description:
|
|
name: Update Docker Hub Description
|
|
runs-on: ubuntu-latest
|
|
needs: build-and-push
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Update Docker Hub description
|
|
uses: peter-evans/dockerhub-description@v4
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
repository: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
readme-filepath: crates/ruvector-postgres/docker/README.md
|
|
short-description: "RuVector v2 - High-performance PostgreSQL vector extension with 230+ SQL functions, SIMD, Flash Attention, GNN, hybrid search"
|
|
|
|
# ============================================================================
|
|
# Publication Summary
|
|
# ============================================================================
|
|
summary:
|
|
name: Publication Summary
|
|
runs-on: ubuntu-latest
|
|
needs: [build-and-push, update-description]
|
|
if: always()
|
|
|
|
steps:
|
|
- name: Generate summary
|
|
run: |
|
|
echo "## Docker Hub Publication Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Published Images" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "| Image | PostgreSQL | Status |" >> $GITHUB_STEP_SUMMARY
|
|
echo "|-------|------------|--------|" >> $GITHUB_STEP_SUMMARY
|
|
echo "| \`${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest\` | 17 | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| \`${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:pg17\` | 17 | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| \`${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:pg16\` | 16 | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| \`${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:pg15\` | 15 | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
echo "| \`${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:pg14\` | 14 | ✅ |" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Quick Start" >> $GITHUB_STEP_SUMMARY
|
|
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
|
|
echo "docker pull ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY
|
|
echo "docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=secret ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY
|
|
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|