Fix RocksDB container build compatibility and add manual rocksdb dispatch (#8288)
* Fix RocksDB build compatibility and add manual rocksdb trigger * Upgrade RocksDB defaults and keep grocksdb v1.10.7 * Add manual latest-image trigger inputs for ref and variant * Allow manual latest build to set image tag and source ref * Fix manual variant selection using setup job matrix output
This commit is contained in:
79
.github/workflows/container_latest.yml
vendored
79
.github/workflows/container_latest.yml
vendored
@@ -4,22 +4,58 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: {}
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
source_ref:
|
||||||
|
description: 'Git ref to build (branch, tag, or commit SHA)'
|
||||||
|
required: true
|
||||||
|
default: 'master'
|
||||||
|
image_tag:
|
||||||
|
description: 'Docker tag to publish (without variant suffix)'
|
||||||
|
required: true
|
||||||
|
default: 'latest'
|
||||||
|
variant:
|
||||||
|
description: 'Variant to build manually'
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
default: all
|
||||||
|
options:
|
||||||
|
- all
|
||||||
|
- standard
|
||||||
|
- large_disk
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
setup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
variants: ${{ steps.set-variants.outputs.variants }}
|
||||||
|
steps:
|
||||||
|
- name: Select variants for this run
|
||||||
|
id: set-variants
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.variant }}" != "all" ]; then
|
||||||
|
variants="[\"${{ github.event.inputs.variant }}\"]"
|
||||||
|
else
|
||||||
|
variants='["standard","large_disk"]'
|
||||||
|
fi
|
||||||
|
echo "variants=$variants" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
needs: [setup]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform: [amd64, arm64, arm, 386]
|
platform: [amd64, arm64, arm, 386]
|
||||||
variant: [standard, large_disk]
|
variant: ${{ fromJSON(needs.setup.outputs.variants) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.source_ref || github.ref }}
|
||||||
- name: Free Disk Space
|
- name: Free Disk Space
|
||||||
run: |
|
run: |
|
||||||
echo "Available disk space before cleanup:"
|
echo "Available disk space before cleanup:"
|
||||||
@@ -55,7 +91,7 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
ghcr.io/chrislusf/seaweedfs
|
ghcr.io/chrislusf/seaweedfs
|
||||||
tags: type=raw,value=latest,suffix=${{ steps.config.outputs.tag_suffix }}
|
tags: type=raw,value=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || 'latest' }},suffix=${{ steps.config.outputs.tag_suffix }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.title=seaweedfs
|
org.opencontainers.image.title=seaweedfs
|
||||||
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
|
||||||
@@ -97,13 +133,13 @@ jobs:
|
|||||||
file: ./docker/Dockerfile.go_build
|
file: ./docker/Dockerfile.go_build
|
||||||
platforms: linux/${{ matrix.platform }}
|
platforms: linux/${{ matrix.platform }}
|
||||||
# Push to GHCR only during build to avoid Docker Hub rate limits
|
# Push to GHCR only during build to avoid Docker Hub rate limits
|
||||||
tags: ghcr.io/chrislusf/seaweedfs:latest${{ steps.config.outputs.tag_suffix }}-${{ matrix.platform }}
|
tags: ghcr.io/chrislusf/seaweedfs:${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || 'latest' }}${{ steps.config.outputs.tag_suffix }}-${{ matrix.platform }}
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
cache-from: type=gha,scope=${{ matrix.variant }}-${{ matrix.platform }}
|
cache-from: type=gha,scope=${{ matrix.variant }}-${{ matrix.platform }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}-${{ matrix.platform }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}-${{ matrix.platform }}
|
||||||
build-args: |
|
build-args: |
|
||||||
BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
BRANCH=${{ github.sha }}
|
BRANCH=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.source_ref || github.sha }}
|
||||||
${{ steps.config.outputs.build_args }}
|
${{ steps.config.outputs.build_args }}
|
||||||
- name: Clean up build artifacts
|
- name: Clean up build artifacts
|
||||||
if: always()
|
if: always()
|
||||||
@@ -115,14 +151,16 @@ jobs:
|
|||||||
|
|
||||||
create-manifest:
|
create-manifest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [setup, build]
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
variant: [standard, large_disk]
|
variant: ${{ fromJSON(needs.setup.outputs.variants) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.source_ref || github.ref }}
|
||||||
|
|
||||||
- name: Configure variant
|
- name: Configure variant
|
||||||
id: config
|
id: config
|
||||||
@@ -140,7 +178,7 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
chrislusf/seaweedfs
|
chrislusf/seaweedfs
|
||||||
ghcr.io/chrislusf/seaweedfs
|
ghcr.io/chrislusf/seaweedfs
|
||||||
tags: type=raw,value=latest,suffix=${{ steps.config.outputs.tag_suffix }}
|
tags: type=raw,value=${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || 'latest' }},suffix=${{ steps.config.outputs.tag_suffix }}
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -162,14 +200,15 @@ jobs:
|
|||||||
- name: Create and push manifest
|
- name: Create and push manifest
|
||||||
run: |
|
run: |
|
||||||
SUFFIX="${{ steps.config.outputs.tag_suffix }}"
|
SUFFIX="${{ steps.config.outputs.tag_suffix }}"
|
||||||
|
BASE_TAG="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || 'latest' }}"
|
||||||
|
|
||||||
# Create manifest on GHCR first (no rate limits)
|
# Create manifest on GHCR first (no rate limits)
|
||||||
echo "Creating GHCR manifest (no rate limits)..."
|
echo "Creating GHCR manifest (no rate limits)..."
|
||||||
docker buildx imagetools create -t ghcr.io/chrislusf/seaweedfs:latest${SUFFIX} \
|
docker buildx imagetools create -t ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX} \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-amd64 \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-amd64 \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-arm64 \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm64 \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-arm \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-386
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-386
|
||||||
|
|
||||||
# Copy the complete multi-arch image from GHCR to Docker Hub
|
# Copy the complete multi-arch image from GHCR to Docker Hub
|
||||||
# This only requires one pull from GHCR (no rate limit) and one push to Docker Hub
|
# This only requires one pull from GHCR (no rate limit) and one push to Docker Hub
|
||||||
@@ -205,16 +244,16 @@ jobs:
|
|||||||
# Use crane or skopeo to copy, fallback to docker if not available
|
# Use crane or skopeo to copy, fallback to docker if not available
|
||||||
if command -v crane &> /dev/null; then
|
if command -v crane &> /dev/null; then
|
||||||
echo "Using crane to copy..."
|
echo "Using crane to copy..."
|
||||||
retry_with_backoff crane copy ghcr.io/chrislusf/seaweedfs:latest${SUFFIX} chrislusf/seaweedfs:latest${SUFFIX}
|
retry_with_backoff crane copy ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX} chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}
|
||||||
elif command -v skopeo &> /dev/null; then
|
elif command -v skopeo &> /dev/null; then
|
||||||
echo "Using skopeo to copy..."
|
echo "Using skopeo to copy..."
|
||||||
retry_with_backoff skopeo copy --all docker://ghcr.io/chrislusf/seaweedfs:latest${SUFFIX} docker://chrislusf/seaweedfs:latest${SUFFIX}
|
retry_with_backoff skopeo copy --all docker://ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX} docker://chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}
|
||||||
else
|
else
|
||||||
echo "Using docker buildx imagetools (pulling 4 images from Docker Hub)..."
|
echo "Using docker buildx imagetools (pulling 4 images from Docker Hub)..."
|
||||||
# Fallback: create manifest directly on Docker Hub (pulls from Docker Hub - rate limited)
|
# Fallback: create manifest directly on Docker Hub (pulls from Docker Hub - rate limited)
|
||||||
retry_with_backoff docker buildx imagetools create -t chrislusf/seaweedfs:latest${SUFFIX} \
|
retry_with_backoff docker buildx imagetools create -t chrislusf/seaweedfs:${BASE_TAG}${SUFFIX} \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-amd64 \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-amd64 \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-arm64 \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm64 \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-arm \
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-arm \
|
||||||
ghcr.io/chrislusf/seaweedfs:latest${SUFFIX}-386
|
ghcr.io/chrislusf/seaweedfs:${BASE_TAG}${SUFFIX}-386
|
||||||
fi
|
fi
|
||||||
|
|||||||
35
.github/workflows/container_release_unified.yml
vendored
35
.github/workflows/container_release_unified.yml
vendored
@@ -4,7 +4,24 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
workflow_dispatch: {}
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
variant:
|
||||||
|
description: 'Variant to build manually'
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
default: all
|
||||||
|
options:
|
||||||
|
- all
|
||||||
|
- normal
|
||||||
|
- large_disk
|
||||||
|
- full
|
||||||
|
- large_disk_full
|
||||||
|
- rocksdb
|
||||||
|
rocksdb_version:
|
||||||
|
description: 'RocksDB git tag to use when variant=rocksdb'
|
||||||
|
required: false
|
||||||
|
default: 'v10.10.1'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -17,6 +34,10 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
github.event_name != 'workflow_dispatch' ||
|
||||||
|
github.event.inputs.variant == 'all' ||
|
||||||
|
github.event.inputs.variant == matrix.variant
|
||||||
strategy:
|
strategy:
|
||||||
# Build sequentially to avoid rate limits
|
# Build sequentially to avoid rate limits
|
||||||
max-parallel: 2
|
max-parallel: 2
|
||||||
@@ -138,6 +159,7 @@ jobs:
|
|||||||
${{ matrix.build_args }}
|
${{ matrix.build_args }}
|
||||||
BUILDKIT_INLINE_CACHE=1
|
BUILDKIT_INLINE_CACHE=1
|
||||||
BRANCH=${{ github.sha }}
|
BRANCH=${{ github.sha }}
|
||||||
|
${{ matrix.variant == 'rocksdb' && format('ROCKSDB_VERSION={0}', github.event.inputs.rocksdb_version || 'v10.10.1') || '' }}
|
||||||
|
|
||||||
- name: Clean up build artifacts
|
- name: Clean up build artifacts
|
||||||
if: always()
|
if: always()
|
||||||
@@ -148,7 +170,13 @@ jobs:
|
|||||||
copy-to-dockerhub:
|
copy-to-dockerhub:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build]
|
needs: [build]
|
||||||
if: github.event_name != 'pull_request'
|
if: |
|
||||||
|
github.event_name != 'pull_request' &&
|
||||||
|
(
|
||||||
|
github.event_name != 'workflow_dispatch' ||
|
||||||
|
github.event.inputs.variant == 'all' ||
|
||||||
|
github.event.inputs.variant == matrix.variant
|
||||||
|
)
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
variant: [normal, large_disk, full, large_disk_full, rocksdb]
|
variant: [normal, large_disk, full, large_disk_full, rocksdb]
|
||||||
@@ -226,6 +254,7 @@ jobs:
|
|||||||
helm-release:
|
helm-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [copy-to-dockerhub]
|
needs: [copy-to-dockerhub]
|
||||||
|
if: github.event_name == 'push'
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pages: write
|
pages: write
|
||||||
@@ -241,5 +270,3 @@ jobs:
|
|||||||
helm_version: "3.18.4"
|
helm_version: "3.18.4"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
rocksdb_version:
|
rocksdb_version:
|
||||||
description: 'RocksDB git tag or branch to build (e.g. v10.5.1)'
|
description: 'RocksDB git tag or branch to build (e.g. v10.10.1)'
|
||||||
required: true
|
required: true
|
||||||
default: 'v10.5.1'
|
default: 'v10.10.1'
|
||||||
seaweedfs_ref:
|
seaweedfs_ref:
|
||||||
description: 'SeaweedFS git tag, branch, or commit to build'
|
description: 'SeaweedFS git tag, branch, or commit to build'
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FROM golang:1.24 AS builder
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||||
|
|
||||||
ARG ROCKSDB_VERSION=v10.5.1
|
ARG ROCKSDB_VERSION=v10.10.1
|
||||||
ENV ROCKSDB_VERSION=${ROCKSDB_VERSION}
|
ENV ROCKSDB_VERSION=${ROCKSDB_VERSION}
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FROM golang:1.24 AS builder
|
|||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||||
|
|
||||||
ARG ROCKSDB_VERSION=v10.5.1
|
ARG ROCKSDB_VERSION=v10.10.1
|
||||||
ENV ROCKSDB_VERSION=${ROCKSDB_VERSION}
|
ENV ROCKSDB_VERSION=${ROCKSDB_VERSION}
|
||||||
|
|
||||||
# build RocksDB
|
# build RocksDB
|
||||||
|
|||||||
Reference in New Issue
Block a user