mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 15:00:43 +02:00
* ci: cancel superseded workflow runs on PR pushes
PR-triggered workflows without a concurrency group keep running (and
holding runner slots) after a force-push or quick follow-up commit
supersedes them. Add the same group/cancel-in-progress block the go
workflow already uses, keyed on head_ref, to the remaining PR workflows.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* ci: key concurrency groups on PR number or ref, not head_ref
github.head_ref is empty on tag pushes and manual runs (every run then
shares one group and cancels the last) and collides across forks when
two PRs share a branch name. pull_request.number is unique per PR;
github.ref covers push/tag/dispatch. Applied to all workflows using the
pattern, including pre-existing ones.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* ci: restrict cancel-in-progress to PR and branch-push runs
* ci: serialize container_latest manual runs by destination tag
Two workflow_dispatch runs sharing an image_tag could otherwise build
concurrently: their per-arch images publish to the same platform tags,
so one run's create-manifest job can combine platforms from different
source refs. Group dispatch runs by the destination tag (with
cancel-in-progress already disabled for non-PR/non-branch events) so
same-tag publishes queue instead of interleaving.
* ci: serialize manual publish runs by destination tag in remaining container workflows
* ci: group foundationdb release dispatch runs by release tag
A manual run now shares the tag-push concurrency group for the same
release, so a re-publish of a tag queues behind (or ahead of) the push
run instead of racing it on the same image tag.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* ci: serialize foundationdb_version dispatch runs by destination tag
Two manual runs resolving to the same docker tag now share a concurrency
group (explicit image_tag, else the computed
foundationdb_<fdb>_seaweedfs_<ref> default), so they queue instead of
racing pushes to the same tag.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* ci: drop unsupported toLower() from foundationdb_version concurrency group
* ci: key rocksdb_version dispatch group on its published tag
* ci: queue publish runs via turnstyle instead of cancel-free shared groups
* Revert "ci: queue publish runs via turnstyle instead of cancel-free shared groups"
This reverts commit 039148f8d5.
* ci: queue same-tag publish runs instead of replacing the pending one
Dispatch/tag-only workflows can never cancel in progress, so opt their
concurrency groups into queue: max — up to 100 same-tag publishes wait
in line rather than each new dispatch cancelling the pending one.
---------
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
125 lines
4.2 KiB
YAML
125 lines
4.2 KiB
YAML
name: "docker: build rocksdb image by version"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
rocksdb_version:
|
|
description: 'RocksDB git tag or branch to build (e.g. v10.10.1)'
|
|
required: true
|
|
default: 'v10.10.1'
|
|
seaweedfs_ref:
|
|
description: 'SeaweedFS git tag, branch, or commit to build'
|
|
required: true
|
|
default: 'master'
|
|
image_tag:
|
|
description: 'Optional Docker tag suffix (defaults to rocksdb_<rocksdb>_seaweedfs_<ref>)'
|
|
required: false
|
|
default: ''
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.inputs.image_tag || format('rocksdb_{0}_seaweedfs_{1}', github.event.inputs.rocksdb_version, github.event.inputs.seaweedfs_ref) }}
|
|
cancel-in-progress: false
|
|
queue: max
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-rocksdb-image:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v2
|
|
|
|
- name: Prepare Docker tag
|
|
id: tag
|
|
env:
|
|
ROCKSDB_VERSION_INPUT: ${{ inputs.rocksdb_version }}
|
|
SEAWEEDFS_REF_INPUT: ${{ inputs.seaweedfs_ref }}
|
|
CUSTOM_TAG_INPUT: ${{ inputs.image_tag }}
|
|
run: |
|
|
set -euo pipefail
|
|
sanitize() {
|
|
local value="$1"
|
|
value="${value,,}"
|
|
value="${value// /-}"
|
|
value="${value//[^a-z0-9_.-]/-}"
|
|
value="${value#-}"
|
|
value="${value%-}"
|
|
printf '%s' "$value"
|
|
}
|
|
version="${ROCKSDB_VERSION_INPUT}"
|
|
seaweed="${SEAWEEDFS_REF_INPUT}"
|
|
tag="${CUSTOM_TAG_INPUT}"
|
|
if [ -z "$version" ]; then
|
|
echo "RocksDB version input is required." >&2
|
|
exit 1
|
|
fi
|
|
if [ -z "$seaweed" ]; then
|
|
echo "SeaweedFS ref input is required." >&2
|
|
exit 1
|
|
fi
|
|
sanitized_version="$(sanitize "$version")"
|
|
if [ -z "$sanitized_version" ]; then
|
|
echo "Unable to sanitize RocksDB version '$version'." >&2
|
|
exit 1
|
|
fi
|
|
sanitized_seaweed="$(sanitize "$seaweed")"
|
|
if [ -z "$sanitized_seaweed" ]; then
|
|
echo "Unable to sanitize SeaweedFS ref '$seaweed'." >&2
|
|
exit 1
|
|
fi
|
|
if [ -z "$tag" ]; then
|
|
tag="rocksdb_${sanitized_version}_seaweedfs_${sanitized_seaweed}"
|
|
fi
|
|
tag="${tag,,}"
|
|
tag="${tag// /-}"
|
|
tag="${tag//[^a-z0-9_.-]/-}"
|
|
tag="${tag#-}"
|
|
tag="${tag%-}"
|
|
if [ -z "$tag" ]; then
|
|
echo "Resulting Docker tag is empty." >&2
|
|
exit 1
|
|
fi
|
|
echo "docker_tag=$tag" >> "$GITHUB_OUTPUT"
|
|
echo "full_image=chrislusf/seaweedfs:$tag" >> "$GITHUB_OUTPUT"
|
|
echo "seaweedfs_ref=$seaweed" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push image
|
|
id: build
|
|
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v2
|
|
with:
|
|
context: ./docker
|
|
push: true
|
|
file: ./docker/Dockerfile.rocksdb_large
|
|
build-args: |
|
|
ROCKSDB_VERSION=${{ inputs.rocksdb_version }}
|
|
BRANCH=${{ inputs.seaweedfs_ref }}
|
|
platforms: linux/amd64
|
|
tags: ${{ steps.tag.outputs.full_image }}
|
|
labels: |
|
|
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.vendor=Chris Lu
|
|
|
|
- name: Sign
|
|
uses: ./.github/actions/sign-image
|
|
with:
|
|
images: chrislusf/seaweedfs@${{ steps.build.outputs.digest }}
|