mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-02 18:22:40 +01:00
* ci(release): publish weed-vector binaries
Tagged releases now carry weed-vector_linux_{amd64,arm64}.tar.gz, static
musl builds made the same way as weed-worker's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* docker: carry weed-vector in the image
The image takes a pre-built weed-vector the way it takes weed-worker, or an
empty placeholder where none was built. `vector` runs it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* ci(docker): build weed-vector for the images
The container workflows cross-compile weed-vector for amd64 and arm64
beside weed-worker and place it in the Docker context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* install.sh: add the vector component
`--component vector` installs weed-vector from a release, and `all` adds it
when the release carries one, as it does for the worker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* ci(docker): skip weed-vector for source refs that predate it
The manual latest-image rebuild accepts any source_ref; one without the
engine's server crate now builds its image without weed-vector instead of
failing the Rust job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
* docker: have the vector engine listen beyond loopback
weed-vector listens on 127.0.0.1 by default, which a gateway in another
container cannot reach. `vector` now adds --listen 0.0.0.0:8090 unless a
listen address is given by flag or WEED_VECTOR_LISTEN. The engine registers
its container address for a wildcard listen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UpvafvK8JpagF94MHWqwK
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
430 lines
16 KiB
YAML
430 lines
16 KiB
YAML
name: "rust: build versioned binaries"
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
build-rust-volume-linux:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# Static musl, as the container images ship: a glibc build only
|
|
# starts on distributions at least as new as the runner's.
|
|
- target: x86_64-unknown-linux-musl
|
|
asset_suffix: linux_amd64
|
|
- target: aarch64-unknown-linux-musl
|
|
asset_suffix: linux_arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Set up the musl target
|
|
uses: ./.github/actions/rust-musl-target
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo registry and target
|
|
if: runner.environment == 'github-hosted'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
seaweed-volume/target
|
|
key: rust-release-${{ matrix.target }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
|
restore-keys: |
|
|
rust-release-${{ matrix.target }}-
|
|
|
|
- name: Build Rust volume server (large disk)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --target ${{ matrix.target }} --target-dir target/large-disk
|
|
|
|
- name: Build Rust volume server (normal)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --target ${{ matrix.target }} --no-default-features --target-dir target/normal
|
|
|
|
- name: Package binaries
|
|
run: |
|
|
# Large disk (default, 5bytes feature)
|
|
cp seaweed-volume/target/large-disk/${{ matrix.target }}/release/weed-volume weed-volume-large-disk
|
|
tar czf weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz weed-volume-large-disk
|
|
rm weed-volume-large-disk
|
|
|
|
# Normal volume size
|
|
cp seaweed-volume/target/normal/${{ matrix.target }}/release/weed-volume weed-volume-normal
|
|
tar czf weed-volume_${{ matrix.asset_suffix }}.tar.gz weed-volume-normal
|
|
rm weed-volume-normal
|
|
|
|
- name: Generate md5 checksums
|
|
run: |
|
|
for f in weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz weed-volume_${{ matrix.asset_suffix }}.tar.gz; do
|
|
md5sum "$f" > "$f.md5"
|
|
done
|
|
|
|
- name: Upload release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rust-volume-${{ matrix.asset_suffix }}
|
|
path: |
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
# The Rust maintenance worker: Linux only, because it runs beside the cluster
|
|
# it maintains rather than on a laptop, and its dependency tree (lance, arrow,
|
|
# datafusion) makes every extra target an expensive build.
|
|
build-rust-worker-linux:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# Static musl, as the container images ship: a glibc build only
|
|
# starts on distributions at least as new as the runner's.
|
|
- target: x86_64-unknown-linux-musl
|
|
asset_suffix: linux_amd64
|
|
- target: aarch64-unknown-linux-musl
|
|
asset_suffix: linux_arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
# The upload step is handed a token explicitly; a cargo build script
|
|
# should not find another one sitting in the checkout's git config.
|
|
persist-credentials: false
|
|
|
|
- name: Set up the musl target
|
|
uses: ./.github/actions/rust-musl-target
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo registry and target
|
|
if: runner.environment == 'github-hosted'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
seaweed-worker/target/${{ matrix.target }}/release
|
|
key: rust-worker-release-${{ matrix.target }}-${{ hashFiles('seaweed-worker/Cargo.lock') }}
|
|
restore-keys: |
|
|
rust-worker-release-${{ matrix.target }}-
|
|
|
|
# lance's build scripts compile their own protos and look for a protoc.
|
|
# Point them at the one protoc-bin-vendored ships, which seaweed-worker's
|
|
# own build already uses, so no job depends on a system package and every
|
|
# build sees the same version.
|
|
- name: Use the vendored protoc
|
|
run: |
|
|
cd seaweed-worker
|
|
cargo fetch
|
|
# The version from the lock, not whatever else a restored cache holds.
|
|
version=$(awk '/^name = "protoc-bin-vendored-linux-x86_64"$/{found=1; next} found && /^version = /{gsub(/"/,"",$3); print $3; exit}' Cargo.lock)
|
|
test -n "$version" || { echo "protoc-bin-vendored-linux-x86_64 is not in Cargo.lock" >&2; exit 1; }
|
|
protoc=$(find ~/.cargo/registry/src -path "*protoc-bin-vendored-linux-x86_64-$version/bin/protoc" | head -1)
|
|
test -x "$protoc" || { echo "no vendored protoc $version in the registry" >&2; exit 1; }
|
|
echo "PROTOC=$protoc" >> "$GITHUB_ENV"
|
|
|
|
- name: Build the Rust maintenance worker
|
|
run: |
|
|
cd seaweed-worker
|
|
cargo build --release -p weed-lance-worker --target ${{ matrix.target }}
|
|
|
|
- name: Package binary
|
|
run: |
|
|
cp seaweed-worker/target/${{ matrix.target }}/release/weed-worker weed-worker
|
|
tar czf weed-worker_${{ matrix.asset_suffix }}.tar.gz weed-worker
|
|
rm weed-worker
|
|
md5sum weed-worker_${{ matrix.asset_suffix }}.tar.gz > weed-worker_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
- name: Upload release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
weed-worker_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-worker_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rust-worker-${{ matrix.asset_suffix }}
|
|
path: |
|
|
weed-worker_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-worker_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
# The vector engine behind the S3 Vectors API: Linux only, like the worker,
|
|
# whose lance dependency tree it shares.
|
|
build-rust-vector-linux:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-24.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- target: x86_64-unknown-linux-musl
|
|
asset_suffix: linux_amd64
|
|
- target: aarch64-unknown-linux-musl
|
|
asset_suffix: linux_arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up the musl target
|
|
uses: ./.github/actions/rust-musl-target
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo registry and target
|
|
if: runner.environment == 'github-hosted'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
seaweed-vector/target/${{ matrix.target }}/release
|
|
key: rust-vector-release-${{ matrix.target }}-${{ hashFiles('seaweed-vector/Cargo.lock') }}
|
|
restore-keys: |
|
|
rust-vector-release-${{ matrix.target }}-
|
|
|
|
- name: Use the vendored protoc
|
|
run: |
|
|
cd seaweed-vector
|
|
cargo fetch
|
|
version=$(awk '/^name = "protoc-bin-vendored-linux-x86_64"$/{found=1; next} found && /^version = /{gsub(/"/,"",$3); print $3; exit}' Cargo.lock)
|
|
test -n "$version" || { echo "protoc-bin-vendored-linux-x86_64 is not in Cargo.lock" >&2; exit 1; }
|
|
protoc=$(find ~/.cargo/registry/src -path "*protoc-bin-vendored-linux-x86_64-$version/bin/protoc" | head -1)
|
|
test -x "$protoc" || { echo "no vendored protoc $version in the registry" >&2; exit 1; }
|
|
echo "PROTOC=$protoc" >> "$GITHUB_ENV"
|
|
|
|
- name: Build the vector engine
|
|
run: |
|
|
cd seaweed-vector
|
|
cargo build --release -p weed-vector-server --target ${{ matrix.target }}
|
|
|
|
- name: Package binary
|
|
run: |
|
|
cp seaweed-vector/target/${{ matrix.target }}/release/weed-vector weed-vector
|
|
tar czf weed-vector_${{ matrix.asset_suffix }}.tar.gz weed-vector
|
|
rm weed-vector
|
|
md5sum weed-vector_${{ matrix.asset_suffix }}.tar.gz > weed-vector_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
- name: Upload release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
weed-vector_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-vector_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rust-vector-${{ matrix.asset_suffix }}
|
|
path: |
|
|
weed-vector_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-vector_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
build-rust-volume-darwin:
|
|
permissions:
|
|
contents: write
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- target: x86_64-apple-darwin
|
|
asset_suffix: darwin_amd64
|
|
- target: aarch64-apple-darwin
|
|
asset_suffix: darwin_arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo registry and target
|
|
if: runner.environment == 'github-hosted'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
seaweed-volume/target
|
|
key: rust-release-${{ matrix.target }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
|
restore-keys: |
|
|
rust-release-${{ matrix.target }}-
|
|
|
|
- name: Build Rust volume server (large disk)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --target ${{ matrix.target }} --target-dir target/large-disk
|
|
|
|
- name: Build Rust volume server (normal)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --target ${{ matrix.target }} --no-default-features --target-dir target/normal
|
|
|
|
- name: Package binaries
|
|
run: |
|
|
cp seaweed-volume/target/large-disk/${{ matrix.target }}/release/weed-volume weed-volume-large-disk
|
|
tar czf weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz weed-volume-large-disk
|
|
rm weed-volume-large-disk
|
|
|
|
cp seaweed-volume/target/normal/${{ matrix.target }}/release/weed-volume weed-volume-normal
|
|
tar czf weed-volume_${{ matrix.asset_suffix }}.tar.gz weed-volume-normal
|
|
rm weed-volume-normal
|
|
|
|
- name: Generate md5 checksums
|
|
run: |
|
|
for f in weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz weed-volume_${{ matrix.asset_suffix }}.tar.gz; do
|
|
md5 -r "$f" > "$f.md5"
|
|
done
|
|
|
|
- name: Upload release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rust-volume-${{ matrix.asset_suffix }}
|
|
path: |
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_large_disk_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz
|
|
weed-volume_${{ matrix.asset_suffix }}.tar.gz.md5
|
|
|
|
build-rust-volume-windows:
|
|
permissions:
|
|
contents: write
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache cargo registry and target
|
|
if: runner.environment == 'github-hosted'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
seaweed-volume/target
|
|
key: rust-release-windows-${{ hashFiles('seaweed-volume/Cargo.lock') }}
|
|
restore-keys: |
|
|
rust-release-windows-
|
|
|
|
- name: Build Rust volume server (large disk)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --target-dir target/large-disk
|
|
|
|
- name: Build Rust volume server (normal)
|
|
env:
|
|
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
|
run: |
|
|
cd seaweed-volume
|
|
cargo build --release --no-default-features --target-dir target/normal
|
|
|
|
- name: Package binaries
|
|
shell: bash
|
|
run: |
|
|
cp seaweed-volume/target/large-disk/release/weed-volume.exe weed-volume-large-disk.exe
|
|
7z a weed-volume_large_disk_windows_amd64.zip weed-volume-large-disk.exe
|
|
rm weed-volume-large-disk.exe
|
|
|
|
cp seaweed-volume/target/normal/release/weed-volume.exe weed-volume-normal.exe
|
|
7z a weed-volume_windows_amd64.zip weed-volume-normal.exe
|
|
rm weed-volume-normal.exe
|
|
|
|
- name: Generate md5 checksums
|
|
shell: bash
|
|
run: |
|
|
for f in weed-volume_large_disk_windows_amd64.zip weed-volume_windows_amd64.zip; do
|
|
md5sum "$f" > "$f.md5"
|
|
done
|
|
|
|
- name: Upload release assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
weed-volume_large_disk_windows_amd64.zip
|
|
weed-volume_large_disk_windows_amd64.zip.md5
|
|
weed-volume_windows_amd64.zip
|
|
weed-volume_windows_amd64.zip.md5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: rust-volume-windows_amd64
|
|
path: |
|
|
weed-volume_large_disk_windows_amd64.zip
|
|
weed-volume_large_disk_windows_amd64.zip.md5
|
|
weed-volume_windows_amd64.zip
|
|
weed-volume_windows_amd64.zip.md5
|