mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
Compare commits
165
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9342ee3778 | ||
|
|
f17314ab51 | ||
|
|
421db36ba2 | ||
|
|
bc9e2ff20e | ||
|
|
6626597e93 | ||
|
|
d4736f27b2 | ||
|
|
08c0a55265 | ||
|
|
ac31753a68 | ||
|
|
ec21b897c9 | ||
|
|
6342876392 | ||
|
|
40182a68bc | ||
|
|
eed00c3737 | ||
|
|
b449301a4e | ||
|
|
9e5357782e | ||
|
|
f4e638fa1d | ||
|
|
1e31c6dbf5 | ||
|
|
0f0f3811bf | ||
|
|
53b234558e | ||
|
|
d9c2d99f8f | ||
|
|
e3769592a5 | ||
|
|
c3f4b3e0eb | ||
|
|
438cc8562f | ||
|
|
51ab451f37 | ||
|
|
34927705fa | ||
|
|
d5b4e1352e | ||
|
|
5ef99c1d8d | ||
|
|
8e15110b4f | ||
|
|
f13b763552 | ||
|
|
df30c883fe | ||
|
|
5a1b0abc20 | ||
|
|
b2dd93eac8 | ||
|
|
5f7fefadae | ||
|
|
c09009a74f | ||
|
|
c0509cf499 | ||
|
|
63806b7073 | ||
|
|
504de9b562 | ||
|
|
d80e905fc7 | ||
|
|
799fd10342 | ||
|
|
a91b333658 | ||
|
|
4f70ad015e | ||
|
|
ddd3b3666f | ||
|
|
cdb01f8150 | ||
|
|
b067266e6b | ||
|
|
b3a58506aa | ||
|
|
b42993d24a | ||
|
|
fd4603d657 | ||
|
|
53377bcb5d | ||
|
|
1167ca8cf5 | ||
|
|
512f898600 | ||
|
|
858f8cbad8 | ||
|
|
c819e3fbea | ||
|
|
6ad4b07598 | ||
|
|
65ecb6aa12 | ||
|
|
0a38738076 | ||
|
|
10f8b2d5b1 | ||
|
|
b50d4a9cab | ||
|
|
e0890391ac | ||
|
|
6eb2fb4842 | ||
|
|
63c99183d1 | ||
|
|
a8436a621a | ||
|
|
58d25998d0 | ||
|
|
d91d58ce47 | ||
|
|
4fc41872e3 | ||
|
|
08f9dcb6de | ||
|
|
8a756af348 | ||
|
|
68b6a2ed08 | ||
|
|
fdd3a692d3 | ||
|
|
45cd6033a0 | ||
|
|
d695d101b5 | ||
|
|
813ac74d79 | ||
|
|
4bc7598a43 | ||
|
|
d685709832 | ||
|
|
d1a97f4c3d | ||
|
|
5a54009439 | ||
|
|
911bfe4014 | ||
|
|
737ef68a11 | ||
|
|
bac2196d65 | ||
|
|
c248ab7865 | ||
|
|
12cb707e58 | ||
|
|
aa901b7ac7 | ||
|
|
e0beb59ef0 | ||
|
|
fe14880f4d | ||
|
|
94c3869057 | ||
|
|
652648d9c4 | ||
|
|
a576398662 | ||
|
|
baaa60b24a | ||
|
|
917cf534db | ||
|
|
5ba77af65f | ||
|
|
c2b2ed769b | ||
|
|
d7ae08ecad | ||
|
|
a2b9b37ee5 | ||
|
|
a2ffdce2ec | ||
|
|
6388dfca9b | ||
|
|
a3b68aa37c | ||
|
|
4cba4eb7bf | ||
|
|
249f04e63a | ||
|
|
4ee82977af | ||
|
|
bef1b13b3d | ||
|
|
c2625ddf00 | ||
|
|
b7d6b48921 | ||
|
|
02b9747bd8 | ||
|
|
8581151376 | ||
|
|
e0f8438284 | ||
|
|
a6a3bdef8d | ||
|
|
317d907334 | ||
|
|
d51a79335c | ||
|
|
13334a59b9 | ||
|
|
b924ffabf1 | ||
|
|
1618d613a3 | ||
|
|
3f557b73c8 | ||
|
|
a0f95e16bc | ||
|
|
6c1eec8703 | ||
|
|
eb159f3181 | ||
|
|
4cb52d7705 | ||
|
|
5150168368 | ||
|
|
0c6c6868de | ||
|
|
dc03c3b1f7 | ||
|
|
fcfca3fee3 | ||
|
|
d659228338 | ||
|
|
b11af30cb1 | ||
|
|
7f18576798 | ||
|
|
e23a952878 | ||
|
|
641ab6204b | ||
|
|
e9606c8ecc | ||
|
|
0ef0260844 | ||
|
|
a4a68c885a | ||
|
|
000baf8dfa | ||
|
|
ea6e9d670a | ||
|
|
1202c5ba08 | ||
|
|
b9866bae4f | ||
|
|
09a63031c1 | ||
|
|
f068fe7f09 | ||
|
|
fb5ffb815f | ||
|
|
d350a0ad03 | ||
|
|
f3150c3495 | ||
|
|
8d96985131 | ||
|
|
2143761319 | ||
|
|
518009dcd4 | ||
|
|
7ad8419815 | ||
|
|
9799b82edf | ||
|
|
9886ac0bcf | ||
|
|
9f4b652522 | ||
|
|
017e42633f | ||
|
|
5863e32318 | ||
|
|
d485d2c9cd | ||
|
|
6c473433c5 | ||
|
|
8236c8d136 | ||
|
|
3f5b07475d | ||
|
|
5abb18e678 | ||
|
|
c1afb1b1cb | ||
|
|
89d3016d5e | ||
|
|
ac2857911d | ||
|
|
d9d8942caf | ||
|
|
f39b1abd03 | ||
|
|
2373207b6e | ||
|
|
82cd43a884 | ||
|
|
d1d081fcf2 | ||
|
|
84cd3c621b | ||
|
|
620a1c3f39 | ||
|
|
643784df0d | ||
|
|
9bb33d0e36 | ||
|
|
a1ba470b32 | ||
|
|
5b87b7bc95 | ||
|
|
7506e5f91c | ||
|
|
5c910ad546 |
No files matched your search
@@ -15,7 +15,7 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install cosign
|
||||
uses: sigstore/cosign-installer@v4.1.2
|
||||
uses: sigstore/cosign-installer@v4.1.3
|
||||
|
||||
- name: Sign
|
||||
shell: bash
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4.39.1
|
||||
uses: github/codeql-action/init@v4.39.3
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: go
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below).
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v4.39.1
|
||||
uses: github/codeql-action/autobuild@v4.39.3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -55,4 +55,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4.39.1
|
||||
uses: github/codeql-action/analyze@v4.39.3
|
||||
@@ -180,14 +180,14 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -141,7 +141,7 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -270,13 +270,13 @@ jobs:
|
||||
buildkitd-config: /tmp/buildkitd.toml
|
||||
- name: Login to Docker Hub
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login to GHCR
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -324,7 +324,7 @@ jobs:
|
||||
fi
|
||||
- name: Login to GHCR
|
||||
if: needs.setup.outputs.publish == 'true'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -434,7 +434,7 @@ jobs:
|
||||
output: trivy-results.sarif
|
||||
exit-code: '0'
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
uses: github/codeql-action/upload-sarif@v4.39.1
|
||||
uses: github/codeql-action/upload-sarif@v4.39.3
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
@@ -501,12 +501,12 @@ jobs:
|
||||
ghcr.io/chrislusf/seaweedfs
|
||||
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
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -262,7 +262,7 @@ jobs:
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -352,7 +352,7 @@ jobs:
|
||||
|
||||
- name: Login to GHCR
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -374,7 +374,7 @@ jobs:
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.variant == 'all' || github.event.inputs.variant == matrix.variant
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
@@ -487,7 +487,7 @@ jobs:
|
||||
variant: large_disk
|
||||
steps:
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
@@ -515,7 +515,7 @@ jobs:
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
if: always()
|
||||
uses: github/codeql-action/upload-sarif@v4.39.1
|
||||
uses: github/codeql-action/upload-sarif@v4.39.3
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: trivy-${{ matrix.variant }}
|
||||
@@ -539,13 +539,13 @@ jobs:
|
||||
latest_tag: latest_large_disk
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v4.7.0
|
||||
uses: docker/login-action@v4.8.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -96,7 +96,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -61,6 +61,9 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-e2e-
|
||||
|
||||
- name: Test APT mirror fallback
|
||||
run: python3 test_apt_install.py
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/azure-cli.list /etc/apt/sources.list.d/microsoft-prod.list
|
||||
|
||||
@@ -37,6 +37,13 @@ jobs:
|
||||
with:
|
||||
version: v3.18.4
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Test vector chart resources
|
||||
run: go test ./k8s/charts/seaweedfs/tests -count=1
|
||||
|
||||
- uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.10'
|
||||
@@ -1321,6 +1328,67 @@ jobs:
|
||||
echo "$BOOL_FALSE" | grep -q -- '-status Suspended' || { echo "FAIL: bool false versioning did not Suspend the bucket"; exit 1; }
|
||||
echo "Bucket versioning: YAML bool false suspends consistently with string \"false\""
|
||||
|
||||
echo "=== Testing bucket ttl, replication and disk in one fs.configure ==="
|
||||
FS_CONFIGURE=$(helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=cfgbucket \
|
||||
--set s3.createBuckets[0].ttl=7d \
|
||||
--set-string s3.createBuckets[0].replication=001 \
|
||||
--set s3.createBuckets[0].disk=ssd | grep 'fs.configure -locationPrefix=/buckets/cfgbucket/' || true)
|
||||
echo "$FS_CONFIGURE" | grep -q -- '-ttl=7d -replication=001 -disk=ssd -apply' || { echo "FAIL: bucket fs.configure missing ttl/replication/disk: $FS_CONFIGURE"; exit 1; }
|
||||
echo "Bucket fs.configure: ttl, replication and disk render together"
|
||||
|
||||
FS_CONFIGURE=$(helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=replbucket \
|
||||
--set-string s3.createBuckets[0].replication=002 | grep 'fs.configure -locationPrefix=/buckets/replbucket/' || true)
|
||||
echo "$FS_CONFIGURE" | grep -q -- '/buckets/replbucket/ -replication=002 -apply' || { echo "FAIL: replication-only bucket did not render fs.configure: $FS_CONFIGURE"; exit 1; }
|
||||
echo "Bucket fs.configure: replication without ttl"
|
||||
|
||||
FS_CONFIGURE=$(helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=diskbucket \
|
||||
--set s3.createBuckets[0].disk=ssd | grep 'fs.configure -locationPrefix=/buckets/diskbucket/' || true)
|
||||
echo "$FS_CONFIGURE" | grep -q -- '/buckets/diskbucket/ -disk=ssd -apply' || { echo "FAIL: disk-only bucket did not render fs.configure: $FS_CONFIGURE"; exit 1; }
|
||||
echo "Bucket fs.configure: disk without ttl"
|
||||
|
||||
if helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=numbucket \
|
||||
--set s3.createBuckets[0].replication=0 >/dev/null 2>&1; then
|
||||
echo "FAIL: a numeric replication should fail to render"; exit 1
|
||||
fi
|
||||
echo "Bucket fs.configure: numeric replication is rejected"
|
||||
|
||||
if helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=badbucket \
|
||||
--set-string s3.createBuckets[0].replication=00O >/dev/null 2>&1; then
|
||||
echo "FAIL: a non-digit replication should fail to render"; exit 1
|
||||
fi
|
||||
echo "Bucket fs.configure: non-digit replication is rejected"
|
||||
|
||||
if helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=bigbucket \
|
||||
--set-string s3.createBuckets[0].replication=256 >/dev/null 2>&1; then
|
||||
echo "FAIL: a replication above 255 should fail to render"; exit 1
|
||||
fi
|
||||
FS_CONFIGURE=$(helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=maxbucket \
|
||||
--set-string s3.createBuckets[0].replication=255 | grep 'fs.configure -locationPrefix=/buckets/maxbucket/' || true)
|
||||
echo "$FS_CONFIGURE" | grep -q -- '/buckets/maxbucket/ -replication=255 -apply' || { echo "FAIL: replication 255 should render: $FS_CONFIGURE"; exit 1; }
|
||||
echo "Bucket fs.configure: replication is limited to 000-255"
|
||||
|
||||
FS_CONFIGURE=$(helm template test $CHART_DIR \
|
||||
--set s3.enabled=true \
|
||||
--set s3.createBuckets[0].name=nullbucket \
|
||||
--set s3.createBuckets[0].ttl=7d \
|
||||
--set s3.createBuckets[0].replication=null | grep 'fs.configure -locationPrefix=/buckets/nullbucket/' || true)
|
||||
echo "$FS_CONFIGURE" | grep -q -- '/buckets/nullbucket/ -ttl=7d -apply' || { echo "FAIL: null replication should be treated as unset: $FS_CONFIGURE"; exit 1; }
|
||||
echo "Bucket fs.configure: null replication is unset"
|
||||
|
||||
echo ""
|
||||
echo "=== Testing hook Job labels ==="
|
||||
# The hook Jobs were the only pods in the chart without the standard
|
||||
@@ -2131,7 +2199,7 @@ jobs:
|
||||
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Create kind cluster
|
||||
uses: helm/kind-action@v1.15.1
|
||||
uses: helm/kind-action@v1.15.2
|
||||
|
||||
- name: Verify volume resize hook security contexts
|
||||
run: |
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
name: "rust: vector desktop platforms"
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'seaweed-vector/**'
|
||||
- 'seaweed-worker/**'
|
||||
- 'seaweed-common/**'
|
||||
- 'weed/pb/**'
|
||||
- '.github/workflows/rust-vector-platforms.yml'
|
||||
- 'install.sh'
|
||||
- 'test/installer/**'
|
||||
push:
|
||||
tags: ['*']
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: read
|
||||
concurrency:
|
||||
group: vector-platforms-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
jobs:
|
||||
vector:
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: macos-15-intel
|
||||
suffix: darwin_amd64
|
||||
protoc: macos-x86_64
|
||||
- runner: macos-latest
|
||||
suffix: darwin_arm64
|
||||
protoc: macos-aarch_64
|
||||
- runner: windows-latest
|
||||
suffix: windows_amd64
|
||||
protoc: win32
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 120
|
||||
env:
|
||||
CARGO_BUILD_JOBS: '2'
|
||||
CARGO_PROFILE_TEST_DEBUG: '0'
|
||||
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.13'
|
||||
- uses: actions/cache/restore@v6
|
||||
id: cargo-cache
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-vector/target
|
||||
key: vector-${{ matrix.suffix }}-${{ hashFiles('seaweed-vector/Cargo.lock') }}
|
||||
restore-keys: vector-${{ matrix.suffix }}-
|
||||
- name: Fetch dependencies
|
||||
run: cargo fetch --locked --manifest-path seaweed-vector/Cargo.toml
|
||||
- name: Select vendored protoc
|
||||
env:
|
||||
PROTOC_PACKAGE: protoc-bin-vendored-${{ matrix.protoc }}
|
||||
run: |
|
||||
python - <<'PY'
|
||||
import os, pathlib, tomllib
|
||||
lock=tomllib.loads(pathlib.Path('seaweed-vector/Cargo.lock').read_text())
|
||||
name=os.environ['PROTOC_PACKAGE']
|
||||
version=next(p['version'] for p in lock['package'] if p['name']==name)
|
||||
cargo=pathlib.Path(os.environ.get('CARGO_HOME',pathlib.Path.home()/'.cargo'))
|
||||
executable='protoc.exe' if os.name=='nt' else 'protoc'
|
||||
path=next(cargo.glob(f'registry/src/*/{name}-{version}/bin/{executable}'))
|
||||
with open(os.environ['GITHUB_ENV'],'a') as out: out.write(f'PROTOC={path}\n')
|
||||
PY
|
||||
- name: Build vector engine
|
||||
id: cargo-build
|
||||
run: cargo build --locked --release --manifest-path seaweed-vector/Cargo.toml -p weed-vector-server
|
||||
- name: Test vector crates
|
||||
run: cargo test --locked --release --manifest-path seaweed-vector/Cargo.toml --workspace
|
||||
- name: Test installer
|
||||
run: |
|
||||
if [ "$RUNNER_OS" = "Windows" ]; then
|
||||
BASH_BINARY="$(cygpath -w "$BASH")"
|
||||
export BASH_BINARY
|
||||
fi
|
||||
python -m unittest discover -s test/installer
|
||||
- name: Save compiled dependencies
|
||||
if: ${{ always() && !startsWith(github.ref, 'refs/tags/') && steps.cargo-build.outcome == 'success' && steps.cargo-cache.outputs.cache-hit != 'true' }}
|
||||
uses: actions/cache/save@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-vector/target
|
||||
key: vector-${{ matrix.suffix }}-${{ hashFiles('seaweed-vector/Cargo.lock') }}
|
||||
- name: Package engine
|
||||
env:
|
||||
ASSET_SUFFIX: ${{ matrix.suffix }}
|
||||
run: |
|
||||
python - <<'PY'
|
||||
import hashlib, os, pathlib, tarfile, zipfile
|
||||
suffix=os.environ['ASSET_SUFFIX']
|
||||
binary='weed-vector.exe' if os.name=='nt' else 'weed-vector'
|
||||
source=pathlib.Path('seaweed-vector/target/release')/binary
|
||||
asset=f'weed-vector_{suffix}'+('.zip' if os.name=='nt' else '.tar.gz')
|
||||
if os.name=='nt':
|
||||
with zipfile.ZipFile(asset,'w',zipfile.ZIP_DEFLATED) as archive: archive.write(source,binary)
|
||||
else:
|
||||
with tarfile.open(asset,'w:gz') as archive: archive.add(source,arcname=binary)
|
||||
digest=hashlib.md5(pathlib.Path(asset).read_bytes()).hexdigest()
|
||||
pathlib.Path(asset+'.md5').write_text(f'{digest} {asset}\n')
|
||||
PY
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: vector-${{ matrix.suffix }}
|
||||
path: weed-vector_${{ matrix.suffix }}.*
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: vector
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: vector-*
|
||||
merge-multiple: true
|
||||
- uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
files: weed-vector_*
|
||||
@@ -87,22 +87,17 @@ jobs:
|
||||
# volume, filer, gateway, engine) under mutual TLS, read JWTs
|
||||
# required, and every chunk encrypted by the gateway.
|
||||
hardened: ["", "1"]
|
||||
worker: [""]
|
||||
worker: ["", "1"]
|
||||
# Worker: the admin server and the Lance maintenance worker join the
|
||||
# cluster, for the tests that build vector indexes through a job.
|
||||
include:
|
||||
- volume: go
|
||||
hardened: ""
|
||||
worker: "1"
|
||||
- volume: rust
|
||||
hardened: ""
|
||||
worker: "1"
|
||||
|
||||
env:
|
||||
CARGO_PROFILE_DEV_DEBUG: "0"
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
CARGO_TARGET_DIR: ${{ github.workspace }}/seaweed-vector/target
|
||||
VOLUME_SERVER_IMPL: ${{ matrix.volume }}
|
||||
VECTOR_QUERY_MODE: single
|
||||
VECTOR_FILER_GROUP: vectors-ci
|
||||
VECTOR_TLS: ${{ matrix.hardened }}
|
||||
VECTOR_READ_JWT: ${{ matrix.hardened }}
|
||||
VECTOR_ENCRYPT_VOLUMES: ${{ matrix.hardened }}
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.9', '3.11', '3.12']
|
||||
python-version: ['3.10', '3.11', '3.12']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.9'
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Clone s3-tests
|
||||
run: |
|
||||
@@ -410,7 +410,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.9'
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Clone s3-tests
|
||||
run: |
|
||||
@@ -581,7 +581,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.9'
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Clone s3-tests
|
||||
run: |
|
||||
@@ -810,7 +810,7 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.9'
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Clone s3-tests
|
||||
run: |
|
||||
|
||||
@@ -147,7 +147,6 @@ telemetry/server/telemetry-server
|
||||
__pycache__/
|
||||
/test/s3vectors/weed
|
||||
/test/s3vectors/weed-vector
|
||||
/test/s3vectors/weed-vector-worker
|
||||
/test/s3vectors/weed-vector-cli
|
||||
/test/s3vectors/weed-worker
|
||||
/test/s3vectors/weed-volume
|
||||
|
||||
@@ -17,7 +17,9 @@ SeaweedFS is a simple and highly scalable distributed file system. There are two
|
||||
1. to store billions of files!
|
||||
2. to serve the files fast!
|
||||
|
||||
One `weed` binary serves an S3 object store, a POSIX file system, and a lakehouse with S3 Tables, all over the same data. Each blob is one disk read away, capacity grows by starting another volume server, and cloud storage can be cached or tiered transparently. Both read and write operations have O(1) complexity and can run at the full speed supported by the underlying hardware.
|
||||
One SeaweedFS cluster serves an S3 object store, a POSIX file system, a lakehouse with S3 Tables and a built-in Iceberg REST Catalog, and [vector search with S3 Vector Buckets](#vector-search-with-s3-vector-buckets), all on shared storage. Each blob is one disk read away, capacity grows by starting another volume server, and cloud storage can be cached or tiered transparently. Blob reads and writes have O(1) complexity and can run at the full speed supported by the underlying hardware.
|
||||
|
||||

|
||||
|
||||
- [Download Binaries for different platforms](https://github.com/seaweedfs/seaweedfs/releases/latest)
|
||||
- [Wiki Documentation](https://github.com/seaweedfs/seaweedfs/wiki)
|
||||
@@ -40,6 +42,7 @@ Table of Contents
|
||||
* [Scalable](#scalable)
|
||||
* [The most complete S3 API](#the-most-complete-s3-api)
|
||||
* [A data warehouse with S3 Tables](#a-data-warehouse-with-s3-tables)
|
||||
* [Vector search with S3 Vector Buckets](#vector-search-with-s3-vector-buckets)
|
||||
* [A fast cache for cloud storage](#a-fast-cache-for-cloud-storage)
|
||||
* [Active-active replication and more](#active-active-replication-and-more)
|
||||
* [Architecture](#architecture)
|
||||
@@ -64,6 +67,8 @@ Download the latest binary from the [releases](https://github.com/seaweedfs/seaw
|
||||
curl -fsSL https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/install.sh | bash
|
||||
```
|
||||
|
||||
For SeaweedFS Enterprise binaries, pass `--enterprise` to the script: `... | bash -s -- --enterprise`.
|
||||
|
||||
Then start a ready-to-use S3 object store:
|
||||
|
||||
```bash
|
||||
@@ -204,12 +209,13 @@ On one laptop, [`weed benchmark`][Benchmarks] writes 1KB files at 15,700 per sec
|
||||
|
||||
## The most complete S3 API ##
|
||||
|
||||
The S3 gateway implements the object, bucket, S3 Tables, IAM, and STS APIs on one endpoint, so the AWS SDKs and CLI, rclone, restic, Spark, and Trino work unchanged.
|
||||
The S3 gateway implements the object, bucket, S3 Tables, S3 Vectors, IAM, and STS APIs on one endpoint, so the AWS SDKs and CLI, rclone, restic, Spark, and Trino work unchanged. S3 Vectors uses the `weed-vector` service described [below](#vector-search-with-s3-vector-buckets).
|
||||
|
||||
| API | Operations |
|
||||
| --- | --- |
|
||||
| S3 bucket and object | 73 |
|
||||
| S3 Tables | 36 |
|
||||
| S3 Vectors | 19 |
|
||||
| IAM | 39 |
|
||||
| STS | 5 |
|
||||
|
||||
@@ -223,7 +229,7 @@ The full operation list is in [Amazon S3 API][AmazonS3API], and [Supported APIs
|
||||
|
||||
## A data warehouse with S3 Tables ##
|
||||
|
||||
SeaweedFS is a lakehouse in one system. [S3 Table Buckets][S3TableBucket] hold Apache Iceberg tables by default, or [Lance][LanceCatalog] tables for vectors and multimodal data, and the built-in [Iceberg REST Catalog][IcebergCatalog] and Lance namespace serve them directly. There is no Hive Metastore, Glue, or separate catalog service to deploy, secure, and back up.
|
||||
SeaweedFS is a lakehouse in one system. [S3 Table Buckets][S3TableBucket] hold Apache Iceberg tables by default, or [Lance][LanceCatalog] tables for vectors and multimodal data, and the built-in [Iceberg REST Catalog][IcebergCatalog] and Lance namespace serve them directly. The S3 Tables API and Iceberg REST Catalog share the same namespaces, table metadata, and permissions. There is no Hive Metastore, Glue, or separate catalog service to deploy, secure, and back up.
|
||||
|
||||
* Query engines operate on the same tables at the same time: [Spark][SparkIceberg], [Trino][TrinoIceberg], [Dremio][DremioIceberg], [DuckDB][DuckDBIceberg], [Apache Doris][DorisIceberg], [RisingWave][RisingWaveIceberg], ClickHouse, and [LanceDB][LanceDB]. Catalog commits are atomic compare-and-swap, so concurrent writers are safe. [Lakekeeper][Lakekeeper] can front the same storage with STS-vended credentials. [OLake Go][OLake] is a high-performance, open-source EL (Extract–Load) platform that bridges operational databases and open lakehouse storage - writing Apache Iceberg tables or Parquet files on Amazon S3.
|
||||
* [Automated table maintenance][IcebergMaintenance]: compaction, snapshot expiration, orphan file removal, and manifest rewriting, configured per bucket or table through the S3 Tables maintenance APIs, and the same for [Lance][LanceMaintenance].
|
||||
@@ -232,6 +238,40 @@ SeaweedFS is a lakehouse in one system. [S3 Table Buckets][S3TableBucket] hold A
|
||||
|
||||
`S3_TABLE_BUCKET=warehouse ./weed mini -dir=./data` brings the whole stack up on a laptop.
|
||||
|
||||
## Vector search with S3 Vector Buckets ##
|
||||
|
||||
Keep embeddings alongside your objects and tables in the same SeaweedFS cluster. S3 Vector Buckets expose the AWS S3 Vectors API for semantic search, retrieval-augmented generation (RAG), and recommendations, using Lance tables on SeaweedFS storage.
|
||||
|
||||
* Create vector buckets and indexes; insert, retrieve, list, and delete vectors with the AWS SDKs or CLI pointed at your S3 endpoint.
|
||||
* Find the nearest vectors with cosine or Euclidean distance, filter by metadata, and return distances and metadata with the results.
|
||||
* Control access with `s3vectors:*` IAM actions and vector bucket policies; tag buckets and indexes for organization and access control.
|
||||
|
||||
Install the separate vector engine; the default installer installs only `weed`:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/install.sh | bash -s -- --component vector
|
||||
```
|
||||
|
||||
Release 4.53 provides vector binaries for Linux amd64 and arm64. If your release has no binary for your platform, build from [source](seaweed-vector). From a directory where you want a new checkout:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/seaweedfs/seaweedfs.git
|
||||
cd seaweedfs
|
||||
(cd seaweed-vector && cargo build --release -p weed-vector-server)
|
||||
```
|
||||
|
||||
If you already have a checkout, start at its root and skip the clone and `cd seaweedfs` steps.
|
||||
|
||||
For Windows source builds, set `PROTOC` to a native `protoc.exe` before running Cargo; the [desktop build workflow](.github/workflows/rust-vector-platforms.yml) shows how to select the vendored executable.
|
||||
|
||||
Run the installed `weed-vector` binary alongside the local cluster started with `weed mini` above (or use `seaweed-vector/target/release/weed-vector` after building from source):
|
||||
|
||||
```bash
|
||||
weed-vector --masters=localhost:9333
|
||||
```
|
||||
|
||||
It registers with the master and the S3 gateway discovers it automatically. An AWS S3 Vectors client uses the same S3 endpoint at http://localhost:8333. The vector engine stores its data through the cluster's filers and volume servers, so embeddings share the storage layer's replication and erasure coding. See the [AWS SDK examples](test/s3vectors/s3vectors_test.py) for bucket, index, and query operations.
|
||||
|
||||
## A fast cache for cloud storage ##
|
||||
|
||||
[Cloud Drive][CloudDrive] mounts a bucket from S3, Google Cloud Storage, Azure, Backblaze B2, Wasabi, Storj, or any S3-compatible store into SeaweedFS and serves it at local speed:
|
||||
|
||||
@@ -271,6 +271,10 @@ curl "http://localhost:9333/vol/vacuum?garbageThreshold=0.4"
|
||||
Vacuuming makes a volume read-only, copies live needles to a new volume, and
|
||||
swaps it in.
|
||||
|
||||
The master runs one vacuum at a time. A request that arrives while the
|
||||
automatic vacuum or another request is running does nothing and gets
|
||||
`409 Conflict` with `{"error":"another vacuum is running, try again later"}`.
|
||||
|
||||
### Delete a collection
|
||||
|
||||
```bash
|
||||
|
||||
+8
-10
@@ -3,17 +3,15 @@
|
||||
# unreachable. See docker/Dockerfile.e2e.
|
||||
set -e
|
||||
|
||||
# Every rewrite starts from the pristine list, so a mirror that just failed does
|
||||
# not become the pattern the next rewrite has to match.
|
||||
[ -f /etc/apt/sources.list.orig ] || cp /etc/apt/sources.list /etc/apt/sources.list.orig
|
||||
|
||||
for mirror in azure.archive.ubuntu.com archive.ubuntu.com; do
|
||||
# Any archive host, so this works whether the pristine list came from the
|
||||
# base image (archive.ubuntu.com) or a CI runner (azure.archive.ubuntu.com).
|
||||
sed "s|http://[a-z0-9.]*archive\.ubuntu\.com/ubuntu|http://$mirror/ubuntu|g; s|http://security\.ubuntu\.com/ubuntu|http://$mirror/ubuntu|g" \
|
||||
/etc/apt/sources.list.orig > /etc/apt/sources.list
|
||||
if apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=15 update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=15 install -y \
|
||||
for apt_source in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
[ -f "$apt_source" ] || continue
|
||||
[ -f "$apt_source.orig" ] || cp "$apt_source" "$apt_source.orig"
|
||||
sed -E "s|(https?://)[a-z0-9.]*archive\.ubuntu\.com/ubuntu|\1$mirror/ubuntu|g; s|(https?://)security\.ubuntu\.com/ubuntu|\1$mirror/ubuntu|g" \
|
||||
"$apt_source.orig" > "$apt_source"
|
||||
done
|
||||
if timeout --kill-after=5s 120s apt-get -o Acquire::Retries=1 -o Acquire::http::Timeout=15 -o Acquire::https::Timeout=15 -o APT::Update::Error-Mode=any update && \
|
||||
DEBIAN_FRONTEND=noninteractive timeout --kill-after=5s 180s apt-get -o Acquire::Retries=1 -o Acquire::http::Timeout=15 -o Acquire::https::Timeout=15 install -y \
|
||||
--no-install-recommends --no-install-suggests "$@"; then
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -64,7 +64,7 @@ case "$1" in
|
||||
'master')
|
||||
ARGS="-mdir=/data -volumeSizeLimitMB=1024"
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true master $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true master $ARGS "$@"
|
||||
;;
|
||||
|
||||
'volume')
|
||||
@@ -73,7 +73,7 @@ case "$1" in
|
||||
ARGS="-dir=/data"
|
||||
fi
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true volume $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true volume $ARGS "$@"
|
||||
;;
|
||||
|
||||
'volume-rust')
|
||||
@@ -87,7 +87,7 @@ case "$1" in
|
||||
echo "Use 'volume' for the Go volume server instead." >&2
|
||||
exit 1
|
||||
fi
|
||||
exec /usr/bin/weed-volume $ARGS $@
|
||||
exec /usr/bin/weed-volume $ARGS "$@"
|
||||
;;
|
||||
|
||||
'worker-rust')
|
||||
@@ -119,7 +119,7 @@ case "$1" in
|
||||
ARGS="-dir=/data -master.volumeSizeLimitMB=1024"
|
||||
fi
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true server $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true server $ARGS "$@"
|
||||
;;
|
||||
|
||||
'mini')
|
||||
@@ -128,19 +128,19 @@ case "$1" in
|
||||
ARGS=""
|
||||
fi
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true mini $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true mini $ARGS "$@"
|
||||
;;
|
||||
|
||||
'filer')
|
||||
ARGS=""
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true filer $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true filer $ARGS "$@"
|
||||
;;
|
||||
|
||||
's3')
|
||||
ARGS="-domainName=$S3_DOMAIN_NAME -key.file=$S3_KEY_FILE -cert.file=$S3_CERT_FILE"
|
||||
shift
|
||||
exec /usr/bin/weed -logtostderr=true s3 $ARGS $@
|
||||
exec /usr/bin/weed -logtostderr=true s3 $ARGS "$@"
|
||||
;;
|
||||
|
||||
'shell')
|
||||
@@ -150,6 +150,6 @@ case "$1" in
|
||||
;;
|
||||
|
||||
*)
|
||||
exec /usr/bin/weed $@
|
||||
exec /usr/bin/weed "$@"
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,39 @@
|
||||
# Vector buckets locally
|
||||
|
||||
Run on Linux containers (amd64 or arm64):
|
||||
|
||||
```sh
|
||||
docker compose up -d
|
||||
export AWS_ACCESS_KEY_ID=vector-demo
|
||||
export AWS_SECRET_ACCESS_KEY=vector-demo-secret
|
||||
export AWS_DEFAULT_REGION=us-east-1
|
||||
aws --endpoint-url http://localhost:8333 s3vectors create-index \
|
||||
--vector-bucket-name embeddings --index-name images \
|
||||
--data-type float32 --dimension 3 --distance-metric cosine
|
||||
aws --endpoint-url http://localhost:8333 s3vectors put-vectors \
|
||||
--vector-bucket-name embeddings --index-name images \
|
||||
--vectors '[{"key":"first","data":{"float32":[1,0,0]}}]'
|
||||
aws --endpoint-url http://localhost:8333 s3vectors query-vectors \
|
||||
--vector-bucket-name embeddings --index-name images \
|
||||
--query-vector '{"float32":[1,0,0]}' --top-k 1
|
||||
```
|
||||
|
||||
The engine registers with the master. Wait for that registration before creating
|
||||
an index. The Lance worker builds and refreshes ANN indexes as data grows;
|
||||
queries can scan data before an ANN index is built. The demo's admin UI is at
|
||||
http://localhost:12535 (user `admin`, password `vector-demo`). Demo credentials
|
||||
and plaintext cluster connections are for this local example. Production
|
||||
settings are in the Helm/operator TLS and authentication documentation.
|
||||
|
||||
`docker compose down` preserves the named data volume. Add `-v` to discard it.
|
||||
Override `SEAWEEDFS_IMAGE` to test a newer image. With metrics-enabled engines,
|
||||
append `--metrics-port=9329 --metrics-ip=0.0.0.0` to the vector command and scrape
|
||||
`vector:9329/metrics` inside the Compose network.
|
||||
|
||||
A native development setup can use `weed mini -vector -vectorBucket=embeddings`
|
||||
with `weed-vector` beside `weed` or on PATH. `-vector.binary` selects an explicit
|
||||
binary, and `-vector.metricsPort=9329` enables HTTP readiness and metrics on a
|
||||
compatible engine. The child inherits the cluster's configuration directory and
|
||||
stops with mini. Run `weed-worker` separately for ANN maintenance. `weed shell`
|
||||
provides `s3vectors -operation <Operation> -file request.json` for the same API
|
||||
operations using trusted cluster credentials.
|
||||
@@ -0,0 +1,34 @@
|
||||
services:
|
||||
seaweedfs:
|
||||
image: ${SEAWEEDFS_IMAGE:-chrislusf/seaweedfs:4.53}
|
||||
command: mini -dir=/data -ip=seaweedfs -ip.bind=0.0.0.0 -admin.password=vector-demo -admin.worker.ip=0.0.0.0 -tableBucket=embeddings:LANCE
|
||||
environment: &environment
|
||||
WEED_JWT_FILER_SIGNING_KEY: vector-demo-cluster-key
|
||||
AWS_ACCESS_KEY_ID: vector-demo
|
||||
AWS_SECRET_ACCESS_KEY: vector-demo-secret
|
||||
ports:
|
||||
- "127.0.0.1:8333:8333"
|
||||
- "127.0.0.1:12535:12535"
|
||||
volumes:
|
||||
- data:/data
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, "wget -q -O /dev/null http://127.0.0.1:9333/cluster/status"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
vector:
|
||||
image: ${SEAWEEDFS_IMAGE:-chrislusf/seaweedfs:4.53}
|
||||
command: vector --listen=vector:8090 --masters=seaweedfs:9333
|
||||
environment: *environment
|
||||
depends_on:
|
||||
seaweedfs:
|
||||
condition: service_healthy
|
||||
worker:
|
||||
image: ${SEAWEEDFS_IMAGE:-chrislusf/seaweedfs:4.53}
|
||||
command: worker-rust --admin=seaweedfs:12535 --masters=seaweedfs:9333 --namespace=http://seaweedfs:9101
|
||||
environment: *environment
|
||||
depends_on:
|
||||
seaweedfs:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
data:
|
||||
@@ -0,0 +1,110 @@
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
|
||||
class AptInstallTests(unittest.TestCase):
|
||||
def run_helper(self, sources, fail_action="update", timeout_azure=False):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
apt = root / "apt"
|
||||
(apt / "sources.list.d").mkdir(parents=True)
|
||||
(apt / "sources.list").write_text("")
|
||||
for name, content in sources.items():
|
||||
(apt / name).write_text(content)
|
||||
helper = root / "apt-install"
|
||||
helper.write_text(Path(__file__).with_name("apt-install").read_text()
|
||||
.replace("/etc/apt", str(apt))
|
||||
.replace("/var/lib/apt", str(root / "state")))
|
||||
commands = root / "bin"
|
||||
commands.mkdir()
|
||||
fake_apt = commands / "apt-get"
|
||||
fake_apt.write_text(r"""#!/usr/bin/env python3
|
||||
import json, os, pathlib, sys
|
||||
root = pathlib.Path(os.environ["VECTOR_APT_TEST_ROOT"])
|
||||
apt = root / "apt"
|
||||
sources = [apt / "sources.list", *apt.glob("sources.list.d/*.list"), *apt.glob("sources.list.d/*.sources")]
|
||||
content = "".join(p.read_text() for p in sources)
|
||||
action = next(a for a in sys.argv[1:] if a in ("update", "install", "clean"))
|
||||
with (root / "calls").open("a") as output:
|
||||
output.write(json.dumps({"action": action, "sources": content, "args": sys.argv[1:]}) + "\n")
|
||||
if "azure.archive.ubuntu.com" in content and action == "update" and os.environ["VECTOR_APT_FAIL_ACTION"] == "partial":
|
||||
sys.exit(100 if "APT::Update::Error-Mode=any" in sys.argv else 0)
|
||||
if "azure.archive.ubuntu.com" in content and action == os.environ["VECTOR_APT_FAIL_ACTION"]:
|
||||
sys.exit(100)
|
||||
""")
|
||||
fake_apt.chmod(0o755)
|
||||
fake_timeout = commands / "timeout"
|
||||
fake_timeout.write_text(r"""#!/usr/bin/env python3
|
||||
import json, os, pathlib, sys
|
||||
root = pathlib.Path(os.environ["VECTOR_APT_TEST_ROOT"])
|
||||
apt = root / "apt"
|
||||
sources = [apt / "sources.list", *apt.glob("sources.list.d/*.list"), *apt.glob("sources.list.d/*.sources")]
|
||||
content = "".join(p.read_text() for p in sources)
|
||||
with (root / "calls").open("a") as output:
|
||||
output.write(json.dumps({"action": "timeout", "args": sys.argv[1:]}) + "\n")
|
||||
if os.environ["VECTOR_APT_TIMEOUT_AZURE"] and "azure.archive.ubuntu.com" in content:
|
||||
sys.exit(124)
|
||||
os.execvp(sys.argv[3], sys.argv[3:])
|
||||
""")
|
||||
fake_timeout.chmod(0o755)
|
||||
result = subprocess.run(["/bin/sh", str(helper), "fuse"],
|
||||
env={**os.environ, "PATH": str(commands) + os.pathsep + os.environ["PATH"],
|
||||
"VECTOR_APT_TEST_ROOT": str(root), "VECTOR_APT_FAIL_ACTION": fail_action,
|
||||
"VECTOR_APT_TIMEOUT_AZURE": "1" if timeout_azure else ""},
|
||||
text=True, capture_output=True, timeout=5)
|
||||
calls = [json.loads(line) for line in (root / "calls").read_text().splitlines()] if (root / "calls").exists() else []
|
||||
return result, calls
|
||||
|
||||
def test_fallback_rewrites_all_source_formats(self):
|
||||
for protocol in ("http", "https"):
|
||||
for layout in ("legacy", "deb822", "mixed"):
|
||||
with self.subTest(protocol=protocol, layout=layout):
|
||||
sources = {}
|
||||
if layout in ("legacy", "mixed"):
|
||||
sources["sources.list"] = f"deb {protocol}://azure.archive.ubuntu.com/ubuntu noble main\n"
|
||||
if layout in ("deb822", "mixed"):
|
||||
sources["sources.list.d/ubuntu.sources"] = f"Types: deb\nURIs: {protocol}://azure.archive.ubuntu.com/ubuntu\nSuites: noble\nComponents: main\n"
|
||||
result, calls = self.run_helper(sources)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
installs = [call for call in calls if call["action"] == "install"]
|
||||
self.assertEqual(len(installs), 1)
|
||||
self.assertNotIn("azure.archive.ubuntu.com", installs[0]["sources"])
|
||||
self.assertIn(protocol + "://archive.ubuntu.com", installs[0]["sources"])
|
||||
|
||||
def test_install_failure_also_tries_the_next_mirror(self):
|
||||
result, calls = self.run_helper({"sources.list.d/ubuntu.sources":
|
||||
"Types: deb\nURIs: http://security.ubuntu.com/ubuntu\nSuites: noble-security\nComponents: main\n"},
|
||||
fail_action="install")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
installs = [call for call in calls if call["action"] == "install"]
|
||||
self.assertEqual(len(installs), 2)
|
||||
self.assertIn("azure.archive.ubuntu.com", installs[0]["sources"])
|
||||
self.assertNotIn("azure.archive.ubuntu.com", installs[1]["sources"])
|
||||
|
||||
def test_partial_update_does_not_install_stale_indexes(self):
|
||||
result, calls = self.run_helper({"sources.list": "deb http://azure.archive.ubuntu.com/ubuntu noble main\n"},
|
||||
fail_action="partial")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
installs = [call for call in calls if call["action"] == "install"]
|
||||
self.assertEqual(len(installs), 1)
|
||||
self.assertNotIn("azure.archive.ubuntu.com", installs[0]["sources"])
|
||||
|
||||
def test_timeout_advances_to_the_next_mirror(self):
|
||||
result, calls = self.run_helper({"sources.list": "deb http://azure.archive.ubuntu.com/ubuntu noble main\n"},
|
||||
fail_action="none", timeout_azure=True)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
timeouts = [call for call in calls if call["action"] == "timeout"]
|
||||
self.assertEqual(len(timeouts), 3)
|
||||
for call in timeouts:
|
||||
self.assertEqual(call["args"][0], "--kill-after=5s")
|
||||
self.assertLessEqual(int(call["args"][1].removesuffix("s")), 180)
|
||||
installs = [call for call in calls if call["action"] == "install"]
|
||||
self.assertNotIn("azure.archive.ubuntu.com", installs[0]["sources"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -5,7 +5,7 @@ go 1.26.6
|
||||
require (
|
||||
cloud.google.com/go v0.123.0 // indirect
|
||||
cloud.google.com/go/pubsub v1.51.1
|
||||
cloud.google.com/go/storage v1.67.0
|
||||
cloud.google.com/go/storage v1.69.0
|
||||
github.com/Shopify/sarama v1.38.1
|
||||
github.com/aws/aws-sdk-go v1.55.8
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
@@ -61,7 +61,7 @@ require (
|
||||
github.com/prometheus/client_golang v1.24.1
|
||||
github.com/prometheus/client_model v0.6.3
|
||||
github.com/prometheus/common v0.71.0 // indirect
|
||||
github.com/prometheus/procfs v0.22.0
|
||||
github.com/prometheus/procfs v0.23.0
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/seaweedfs/goexif v1.0.3
|
||||
@@ -84,23 +84,24 @@ require (
|
||||
github.com/xdg-go/scram v1.2.0
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.7.1
|
||||
go.etcd.io/etcd/api/v3 v3.7.3
|
||||
go.etcd.io/etcd/client/v3 v3.7.3
|
||||
go.mongodb.org/mongo-driver v1.17.9
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
gocloud.dev v0.47.0
|
||||
gocloud.dev/pubsub/natspubsub v0.46.0
|
||||
gocloud.dev v0.49.0
|
||||
gocloud.dev/pubsub/natspubsub v0.49.0
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.47.0
|
||||
golang.org/x/crypto v0.58.0
|
||||
golang.org/x/exp v0.0.0-20260813180055-c1d0aacb2297
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e
|
||||
golang.org/x/image v0.46.0
|
||||
golang.org/x/net v0.61.0
|
||||
golang.org/x/net v0.62.0
|
||||
golang.org/x/oauth2 v0.37.0
|
||||
golang.org/x/sys v0.49.0
|
||||
golang.org/x/text v0.43.0 // indirect
|
||||
golang.org/x/tools v0.51.0 // indirect
|
||||
golang.org/x/tools v0.52.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.310.0
|
||||
google.golang.org/genproto v0.0.0-20261012220534-4341edf3f941 // indirect
|
||||
google.golang.org/genproto v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
google.golang.org/grpc v1.86.0-dev.0.20261027044109-d619b5d02089
|
||||
google.golang.org/protobuf v1.36.12
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
@@ -122,10 +123,10 @@ require (
|
||||
github.com/apache/iceberg-go v0.7.0
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3
|
||||
github.com/arangodb/go-driver v1.6.9
|
||||
github.com/aws/aws-sdk-go-v2 v1.47.5
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.6
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.6
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.1
|
||||
github.com/aws/aws-sdk-go-v2 v1.48.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.9
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.9
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.10
|
||||
github.com/cespare/xxhash/v2 v2.3.0
|
||||
github.com/cognusion/imaging v1.0.4
|
||||
github.com/fluent/fluent-logger-golang v1.10.1
|
||||
@@ -144,16 +145,16 @@ require (
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1
|
||||
github.com/parquet-go/parquet-go v0.32.0
|
||||
github.com/pkg/sftp v1.13.12
|
||||
github.com/rabbitmq/amqp091-go v1.15.0
|
||||
github.com/rabbitmq/amqp091-go v1.16.0
|
||||
github.com/rclone/rclone v1.75.1
|
||||
github.com/rdleal/intervalst v1.5.0
|
||||
github.com/redis/go-redis/v9 v9.23.0
|
||||
github.com/schollz/progressbar/v3 v3.19.1
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4
|
||||
github.com/shirou/gopsutil/v4 v4.26.7
|
||||
github.com/shirou/gopsutil/v4 v4.26.10
|
||||
github.com/tarantool/go-option v1.1.0
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.2
|
||||
github.com/testcontainers/testcontainers-go v0.44.0
|
||||
github.com/testcontainers/testcontainers-go v0.45.0
|
||||
github.com/tikv/client-go/v2 v2.0.7
|
||||
github.com/twmb/avro v1.9.0
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
@@ -161,6 +162,7 @@ require (
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.155.1
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3
|
||||
go.uber.org/atomic v1.12.0
|
||||
go.yaml.in/yaml/v3 v3.0.6
|
||||
golang.org/x/sync v0.24.0
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated
|
||||
google.golang.org/grpc/security/advancedtls v1.0.0
|
||||
@@ -174,7 +176,7 @@ require (
|
||||
dario.cat/mergo v1.0.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/internal v0.1.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39 // indirect
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1 // indirect
|
||||
github.com/RoaringBitmap/roaring/v2 v2.26.0 // indirect
|
||||
@@ -183,7 +185,7 @@ require (
|
||||
github.com/anchore/go-lzo v0.1.1 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/apache/thrift v0.24.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/bazelbuild/rules_go v0.46.0 // indirect
|
||||
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
|
||||
@@ -206,7 +208,7 @@ require (
|
||||
github.com/dave/dst v0.27.2 // indirect
|
||||
github.com/diskfs/go-diskfs v1.9.4 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.7.0 // indirect
|
||||
github.com/docker/go-connections v0.8.2 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/dromara/dongle v1.0.1 // indirect
|
||||
github.com/geoarrow/geoarrow-go v0.0.0-20260403143023-f54751c3e3a1 // indirect
|
||||
@@ -235,18 +237,18 @@ require (
|
||||
github.com/lib/pq v1.12.3 // indirect
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
|
||||
github.com/lpar/calendar v0.2.0 // indirect
|
||||
github.com/magiconair/properties v1.8.10 // indirect
|
||||
github.com/magiconair/properties v1.18.12 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/go-archive v0.3.0 // indirect
|
||||
github.com/moby/moby/api v1.55.0 // indirect
|
||||
github.com/moby/moby/client v0.5.0 // indirect
|
||||
github.com/moby/go-archive v0.3.3 // indirect
|
||||
github.com/moby/moby/api v1.56.1 // indirect
|
||||
github.com/moby/moby/client v0.6.2 // indirect
|
||||
github.com/moby/patternmatcher v0.6.1 // indirect
|
||||
github.com/moby/sys/sequential v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.4.1 // indirect
|
||||
github.com/moby/sys/userns v0.1.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/oklog/ulid/v2 v2.1.1 // indirect
|
||||
github.com/oklog/ulid/v2 v2.1.2 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
@@ -275,37 +277,35 @@ require (
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/zeebo/xxh3 v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.46.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.45.0 // indirect
|
||||
go.opentelemetry.io/otel/log v1.47.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.11.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
|
||||
go.uber.org/mock v0.5.2 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.5 // indirect
|
||||
golang.org/x/mod v0.42.0 // indirect
|
||||
gonum.org/v1/gonum v0.17.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.25.3 // indirect
|
||||
cloud.google.com/go/auth v0.24.1-0.20261001053825-dbc26066f70a // indirect
|
||||
cloud.google.com/go/auth v0.24.1 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.3.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.10.0 // indirect
|
||||
cloud.google.com/go/iam v1.14.0 // indirect
|
||||
cloud.google.com/go/monitoring v1.30.0 // indirect
|
||||
cloud.google.com/go/monitoring v1.31.0 // indirect
|
||||
filippo.io/edwards25519 v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.3
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.24.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.13.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.2
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.3
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.1.1 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.9.0 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.61.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.61.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0 // indirect
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1 // indirect
|
||||
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd // indirect
|
||||
github.com/Microsoft/go-winio v0.6.3-0.20251027160822-ad3df93bed29 // indirect
|
||||
@@ -319,22 +319,22 @@ require (
|
||||
github.com/andybalholm/cascadia v1.3.4 // indirect
|
||||
github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc // indirect
|
||||
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.46.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.51.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.47.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.52.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6
|
||||
github.com/aws/smithy-go v1.28.7
|
||||
github.com/aws/smithy-go v1.28.9
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/bradenaw/juniper v0.15.3 // indirect
|
||||
github.com/buengese/sgzip v0.1.1 // indirect
|
||||
@@ -352,7 +352,7 @@ require (
|
||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.4.0 // indirect
|
||||
github.com/ebitengine/purego v0.10.2 // indirect
|
||||
github.com/ebitengine/purego v0.11.2 // indirect
|
||||
github.com/elastic/gosigar v0.14.3 // indirect
|
||||
github.com/emersion/go-message v0.18.2 // indirect
|
||||
github.com/emersion/go-vcard v0.0.0-20260618161152-d854b7e0e2d3 // indirect
|
||||
@@ -369,14 +369,14 @@ require (
|
||||
github.com/go-logr/logr v1.4.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
github.com/go-openapi/errors v0.22.8 // indirect
|
||||
github.com/go-openapi/strfmt v0.27.0 // indirect
|
||||
github.com/go-openapi/errors v0.22.9 // indirect
|
||||
github.com/go-openapi/strfmt v0.27.2 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.30.3 // indirect
|
||||
github.com/go-resty/resty/v2 v2.17.2 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
|
||||
github.com/goccy/go-json v0.10.6 // indirect
|
||||
github.com/goccy/go-json v0.11.2 // indirect
|
||||
github.com/gofrs/flock v0.13.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
||||
@@ -386,7 +386,7 @@ require (
|
||||
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||
github.com/gorilla/sessions v1.4.0
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.31.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-hclog v1.6.3 // indirect
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
||||
@@ -418,8 +418,8 @@ require (
|
||||
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/nats-io/nats.go v1.49.0 // indirect
|
||||
github.com/nats-io/nkeys v0.4.15 // indirect
|
||||
github.com/nats-io/nats.go v1.54.0 // indirect
|
||||
github.com/nats-io/nkeys v0.4.16 // indirect
|
||||
github.com/nats-io/nuid v1.0.1 // indirect
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/ncw/swift/v2 v2.0.5 // indirect
|
||||
@@ -433,7 +433,7 @@ require (
|
||||
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
|
||||
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect
|
||||
github.com/philhofer/fwd v1.2.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.29
|
||||
github.com/pierrec/lz4/v4 v4.1.33
|
||||
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
|
||||
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
|
||||
github.com/pingcap/kvproto v0.0.0-20230403051650-e166ae588106 // indirect
|
||||
@@ -441,7 +441,7 @@ require (
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/xattr v0.4.12 // indirect
|
||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect
|
||||
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 // indirect
|
||||
github.com/relvacode/iso8601 v1.7.0 // indirect
|
||||
github.com/rfjakob/eme v1.2.0 // indirect
|
||||
@@ -455,7 +455,7 @@ require (
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.25-0.20251022131615-eb24eb109368 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.2 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.9.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20260717075258-c6acd6a5bd04 // indirect
|
||||
github.com/tarantool/go-iproto v1.1.0 // indirect
|
||||
@@ -479,11 +479,10 @@ require (
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
github.com/zeebo/errs v1.4.0 // indirect
|
||||
go.etcd.io/bbolt v1.5.0 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.7.1 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.46.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.47.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect
|
||||
go.opentelemetry.io/otel v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.47.0 // indirect
|
||||
@@ -493,7 +492,7 @@ require (
|
||||
go.uber.org/zap v1.28.0 // indirect
|
||||
golang.org/x/term v0.47.0
|
||||
golang.org/x/time v0.16.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261012220534-4341edf3f941 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/validator.v2 v2.0.1 // indirect
|
||||
|
||||
@@ -4,8 +4,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE=
|
||||
cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU=
|
||||
cloud.google.com/go/auth v0.24.1-0.20261001053825-dbc26066f70a h1:jW1ZLFy9oa5ai8LOI40z6s+DL1cO/L1KSm9hVGnibn8=
|
||||
cloud.google.com/go/auth v0.24.1-0.20261001053825-dbc26066f70a/go.mod h1:1dmBXa9xfBvBr39ZnDUDkaaA91ccq9CcqENDgJA4d7c=
|
||||
cloud.google.com/go/auth v0.24.1 h1:NTmd2iJb4DsGIav0KiqFMYI88nMshA2wnFMBatRmoCs=
|
||||
cloud.google.com/go/auth v0.24.1/go.mod h1:1dmBXa9xfBvBr39ZnDUDkaaA91ccq9CcqENDgJA4d7c=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.3.0 h1:FY8oSZpCYoUNv6QxVODuMjQz4IlSOVeiQtZ08vLPz88=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.3.0/go.mod h1:7+2uCm7++XFO+/lN06c2HXpDXb/NMNn2/UwyBPbTnkk=
|
||||
cloud.google.com/go/compute/metadata v0.10.0 h1:pyKMUQSwchgkIBBJGdILqQbs/BNJXqwSA7Ej6LAvvtY=
|
||||
@@ -18,14 +18,14 @@ cloud.google.com/go/logging v1.20.0 h1:l7yzCB8/JSY5PHT9RsaqdT1jaBGbM6KlSJDX210Hl
|
||||
cloud.google.com/go/logging v1.20.0/go.mod h1:ALUaJQZM691Eeujy9kFx0xREq3AMPuGd+pTRZuTYv+w=
|
||||
cloud.google.com/go/longrunning v1.3.0 h1:lZ6c8SJJBmILp/Wnr3vGnBLa0q+cYfSHRCcUfVI2hpI=
|
||||
cloud.google.com/go/longrunning v1.3.0/go.mod h1:wpgLxCn+UA3/TZ1bj/fW39mfDpwVlMPu1xKJyoMt7V0=
|
||||
cloud.google.com/go/monitoring v1.30.0 h1:r/d+JUbyKmJ8b07iznuKfzVzrIXTWxHQ3lBRm3x2LlY=
|
||||
cloud.google.com/go/monitoring v1.30.0/go.mod h1:htlUR0QWVMrjFzZmN4LGnMAve9xB/eduwjmINxVZ8RM=
|
||||
cloud.google.com/go/monitoring v1.31.0 h1:LCuAoYiq8snyL/eDAG/VC73uWFXeax8+YEfmoNGJUrY=
|
||||
cloud.google.com/go/monitoring v1.31.0/go.mod h1:7uk2dIJIf7ra64dI1VuQ0ttoFqvtKjdzq46u6zNP1hU=
|
||||
cloud.google.com/go/pubsub v1.51.1 h1:R3G1wCOxBO7jRpL8x2pdZMv1GAJDF6ax/m2zPOtvTNE=
|
||||
cloud.google.com/go/pubsub v1.51.1/go.mod h1:y2T0IKtW1iWwVvazYaRpqOAFO4gy2+O7dTDt9TWY/5U=
|
||||
cloud.google.com/go/pubsub/v2 v2.7.0 h1:MFrBTZZa6PDWZzCi4NJRsHKMm2w0a4oAaYNqwjgbQTE=
|
||||
cloud.google.com/go/pubsub/v2 v2.7.0/go.mod h1:JaFvWNVRk3Knoil/4M1ECeLOaI9D8drbmJWypQlK5aM=
|
||||
cloud.google.com/go/storage v1.67.0 h1:8xD3NvKuHE4c+b/kmSIVBdTc0BiOjplx+KecKGR9fr8=
|
||||
cloud.google.com/go/storage v1.67.0/go.mod h1:UsS9OgFg/XHOSYakQ8ZtLWWeyGkk1WnmD/GsGfN0BHM=
|
||||
cloud.google.com/go/storage v1.69.0 h1:jAAMC1411HEh78nKsU0Zns+eFj3TnhjAWIhg5Ud/XBM=
|
||||
cloud.google.com/go/storage v1.69.0/go.mod h1:PELYsxTYm2peE4mwLEC1+mS1dA/kUSRUxNv56rOy44g=
|
||||
cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E=
|
||||
cloud.google.com/go/trace v1.16.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0=
|
||||
dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
|
||||
@@ -34,8 +34,8 @@ filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
|
||||
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.3 h1:qgnWTiWs1G7AqcKZegFvkJD1bmXJcaDU3uC0ELSgZ5U=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.3/go.mod h1:XtxD48QPInqoj+GMlcRlXHEYsoOxFnP6w2JgIZ9rDS4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.24.0 h1:5H6YRLGMoC8z5aXpxqcD6FfswI8mwoVNHSecvIoazt4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.24.0/go.mod h1:Sk63W6X/TElfcE2BknMYg0Q9JuCpebgjnHcbs5md4NM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 h1:u93s+zU2JD62im61Bm5CZIc1ZrOJaIAWEg0WOrMVkEo=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1/go.mod h1:oXtinPO4OLj9d1DOTrqrL1oRwGhcqadvAmrl6wTeGlk=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0 h1:xFaZZ+IubdftrDHnGGwZ6QvQ3KHTtWl2MCK+GMt2vxs=
|
||||
@@ -48,20 +48,20 @@ github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 h1:FbH3BbSb4bvGlu
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1/go.mod h1:9V2j0jn9jDEkCkv8w/bKTNppX/d0FVA1ud77xCIP4KA=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.2 h1:tQJdgQjbKKffEiMOKJmcQPkY01eFHRqWIZVefqP44nI=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.2/go.mod h1:kTkpJchXAdO7LGkKZP97a+Ou8TgaF4NT6MHwOIy5uSQ=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.3 h1:zoPQ7KXGgzqeUmNWl+b6IwVAqsb5lROEJhqAmqXQtm0=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.3/go.mod h1:ei/sDx/dwDIUtZE3PQP1u8+qrA+CRy4q7qW+A2MbgB4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0 h1:cuiKf1UVyWHu+XSQghPZR/qEF43JIcuk2CDqMlPiT6M=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0/go.mod h1:9JSyvgXLPAOC4jfhgZg58XeU2FJHsGmxuYSclCFQ4ZY=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/internal v0.1.0 h1:X/bTwe0qpvmvPPutc+LWo7T4cKMqDP9JHP4k+Co9ZB4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/internal v0.1.0/go.mod h1:+kX7ahyFelQ42F3RScM2CFgHJljp0phc/FieKLYVpFI=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 h1:m2xcjRABtG288vnlV3U/PKh/HnPURxZp50RKNUwBxM8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4/go.mod h1:MTUE7ZuZO89FAtAwozGg6AWD83pcdefnEq5gF82MB8s=
|
||||
github.com/Azure/go-ntlmssp v0.1.1 h1:l+FM/EEMb0U9QZE7mKNEDw5Mu3mFiaa2GKOoTSsNDPw=
|
||||
github.com/Azure/go-ntlmssp v0.1.1/go.mod h1:NYqdhxd/8aAct/s4qSYZEerdPuH1liG2/X9DiVTbhpk=
|
||||
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
|
||||
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.9.0 h1:MDT4FxAPve5FnYn6vOL1r7RCRDG+l9cI7a5LlCuHsqA=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.9.0/go.mod h1:Y33QHnf0FfdVewFFISOGe20mkZbxX4H839o955/PoeI=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1 h1:0O6j18nQDoIff6/mtosT5LNU2WehEwp+LqfX6699oqY=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1/go.mod h1:xdYAf5bjkOpsd3auA8riiJW4vneBubt9caavL7626jQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Codefor/geohash v0.0.0-20140723084247-1b41c28e3a9d h1:iG9B49Q218F/XxXNRM7k/vWf7MKmLIS8AcJV9cGN4nA=
|
||||
github.com/Codefor/geohash v0.0.0-20140723084247-1b41c28e3a9d/go.mod h1:RVnhzAX71far8Kc3TQeA0k/dcaEKUnTDSOyet/JCmGI=
|
||||
@@ -75,14 +75,12 @@ github.com/FilenCloudDienste/filen-sdk-go v0.0.39 h1:tgV5jYL6dsXop9TpDTIQU6UwJjw
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39/go.mod h1:0cBhKXQg49XbKZZfk5TCDa3sVLP+xMxZTWL+7KY0XR0=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194 h1:dtOFxSTWWRpkmvXa6ycNiw8dVDu1wkgzcXyVV1VafNc=
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194/go.mod h1:rl0WumSN9gSo775DgvQv+wMQ8rlb0ES/1hU5jkMtLXg=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0 h1:rmzbFS2CkHq0y2L5LkMVWm+QXjjNEXxjmhrJqga/QGk=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0/go.mod h1:iIyrdhveU5Ow84ipRlxtjCOQnIM0DiqSMxuxm50xwZY=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.61.0 h1:BeC1Bub7Ttk33TF8v3ZeQ2L8acvz4ZLqtQuLyJAZquc=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.61.0/go.mod h1:UgG/Xn9+NXb1/ueSczIFxyuya3hs3srFDiZG2JrpJwY=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.61.0 h1:eSgSuKdcpY7RTN1oXSzC6S39rPBImn03ubLMsWK4RRg=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.61.0/go.mod h1:ifhe5teRNcbxg9p353DhOkOgczzL/IBLYFqT1cm1zpM=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.61.0 h1:KhpL26/GviYITHMCEGGqT/l50siFaBCBBKrjv6Z0G/k=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.61.0/go.mod h1:sg6Wqbl0BKKZ5zKnQj2q0qic/3ziF894SCx1LpbX37Y=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0 h1:5y2LR2pripbccOte6BpZ+guv5O5W0OQIfKvUYZrGaAQ=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0/go.mod h1:b3f7EifFRqkVt142USoGIP62uUeZm7ALCPrs1ZjWXYo=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.62.0 h1:tRsXhJnn0w0TNwJpVrB94wsrimzjWKFzdQlUhRdNUzc=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.62.0/go.mod h1:ifhe5teRNcbxg9p353DhOkOgczzL/IBLYFqT1cm1zpM=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0 h1:aPMa5qZU9dp4fU34o+jQgVIPFIOi20oxYg8TLigmZLg=
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0/go.mod h1:sg6Wqbl0BKKZ5zKnQj2q0qic/3ziF894SCx1LpbX37Y=
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1 h1:fxLusCG+GlGY1SM7BYAAiiSFhzKUs5zqs0P8knDqeFU=
|
||||
github.com/IBM/go-sdk-core/v5 v5.23.1/go.mod h1:yO+OQpByKDLTvpEcsFFexgzpeR8eRfCFWAYzxkAu4bk=
|
||||
github.com/Jille/raft-grpc-transport v1.6.1 h1:gN3sjapb+fVbiebS7AfQQgbV2ecTOI7ur7NPPC7Mhoc=
|
||||
@@ -173,50 +171,50 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ
|
||||
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||
github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ=
|
||||
github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk=
|
||||
github.com/aws/aws-sdk-go-v2 v1.47.5 h1:5yA+A+BiXbDq1ZLbYwPViwhEGDMdR0MEhL8Jh2LnLS4=
|
||||
github.com/aws/aws-sdk-go-v2 v1.47.5/go.mod h1:iNIkogrRvFwm+1OQIUOP2lPBtlXZboOIUWiCa+pHEMw=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 h1:GPRlPwz40I2B2VrBEASOA3Bi77NyeqejNLkifosX0rs=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20/go.mod h1:g7PNzKcsOKWb4fkSRBA7BZVAS6Y8IcxzN+nRohhQ1Q8=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.6 h1:MBjkSTLczek/UgiK+EYPIoRTqE7gP8vtW3OFbFo7Nug=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.6/go.mod h1:grRAFzdAZJrwcbasJRg2MPvIrVjtlfXllHssN6+E1JE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.6 h1:NpAFXCU7NzXNkdGK3zQTtsRJ+3v9tZQV0xcdRw8uBdw=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.6/go.mod h1:mcZCoiPnyMvP8VMNbygNX5lLqSlkYJIMPODylQMurOk=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 h1:8gALAAmacnIXh+z6VkdDanv4/IkG5APdg4DZLDTmLog=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1/go.mod h1:Z7IJhJU+poOdJjUR2wpyY21ossQ1XS/R3Lk9Msq5kM4=
|
||||
github.com/aws/aws-sdk-go-v2 v1.48.0 h1:tFU7EJVm7MfyaXLsXdYTZ0Vd6vwt9OljCyqq0gqk0Mc=
|
||||
github.com/aws/aws-sdk-go-v2 v1.48.0/go.mod h1:oeKU5p+TQBnpeLmU42WZLWvzv+ORLn+74n4QVLnm/Z0=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27 h1:3dMP9eEmHVosFN1QiD24IJBKVY8m6iUfVYXqRCT118Q=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27/go.mod h1:KH4PKcqtjy1m0656eqQV2v53xE04ddJzuNloEKqlHkI=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34 h1:Pn7OsMwBLbkZ6OnCxWHAjf0L/22H8cnhxZC0uPwtMtg=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.22.34/go.mod h1:eToXR/Gk1uqpn04eSmdgVXwfS0WvH8aG4eBFr8ygbpU=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.3 h1:vsFkmFrfzODkxVbyuPLscv5j5lC8KbG48LZwV+p56Y0=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.3/go.mod h1:pjQYVtvVBEtlsf2p6nXMsjPuDaWs9GM44FMdHbmnmYU=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 h1:gzIWc3DTPfPbWKrQnmL6BV6WD7NPD1htxzgdk/bQ/Z4=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8/go.mod h1:vvUA5cDAZWGo4R14FZPZfXfJCmgsafOWEq78Kg0D+ug=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 h1:PWv+vG8aCLS8qd+HPdYhK7Vees90aKHWFFQ1AGYD/8E=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8/go.mod h1:xxPZEpflYHJA12366ZGyq66z9dHPCoeCIu99Jck+MPw=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 h1:WOp5De9iWdEHDPh2Kb0tBP3vGBm/dVAuRGh4a4tqduo=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8/go.mod h1:z8W8YgfhbWl62XqcTtK+CxPrE+iHGRVUOtrrbIOp7ZY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 h1:MCIR6iZaCKO4UE0hUvoWWLI6JVjppopV64JfAJaMjng=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23/go.mod h1:pphWFS+z0MmIPivj8c/6bATd1Z+Av7Ust75DPdEFsPA=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.5 h1:/TYsZXdA8UTa+WCtCYSAJIr1vwl0+eho6TUgJGwFFO8=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.5/go.mod h1:qPqp1Uwd/BqdhPufv6oem9j5J7HNsgc2V22dUiDPn+s=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 h1:+PMpWlJYOn2tm7sm6OZ/ZLd4jStl17T7wjNapd1Rczs=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8/go.mod h1:cnG3xZLGQL4c/bt8pjdzlFtZsW7epBBuNS04a5xMjdo=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.4 h1:pPiWfgeNxqluKEph7hvU88kuGKBPOWzO+Dk9t2zqqNs=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.4/go.mod h1:YlwGoIUDG/3kBQbdNOVs/xKZ9J01G8e/6D1mRBj9uTk=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.1 h1:9T6eO8/WXhij4PQaa2WaYsdekSCmT9Hw66Pw0S8do0Q=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.1/go.mod h1:9APRWGLFITKD+xzWSIyT9V7QV4bNlEuIieWlzXgGFlI=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 h1:DzCCWLzcIRQ77F3DEUljud7bEjTgFOIKXP52NmVRyhU=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.1/go.mod h1:xpo/geVldu8payT375WekctUzopG/hBU7miiqItMUlw=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.46.0 h1:fD02zeo2Kc4hlFUvGX3FfA+gGOwd4BBcYgPDHDEzx9Y=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.46.0/go.mod h1:/lB2ILjoT5/q0zSwtHnrJPjXBvjalnEIl0IgSEdvHec=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.51.0 h1:FghdY9ebeZf9iIan9J0xfBEID8arYibNBeZ1XHvs4oA=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.51.0/go.mod h1:wu7uOJ/2nAdenjvhHikeF6j0al99kfPVG6ZDU4e76OY=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 h1:Umtl/0YZhng4xndfW3lKJrYYP7NLEjI6bGXVomwLcs0=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.1/go.mod h1:rRD/dnm7q0HYE/I5TMaPgkWyyUGLcwuxHLABsLnQ3e0=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 h1:orIWdNiLgzrhu/11RcPPKO/SBzUUymbUQuZbSPImghg=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1/go.mod h1:skwM/xsbR/1ReUTesv9BhpJp1VjajR7DWQnuVLwiXsQ=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12 h1:W0yUUzKBA8SofGQ0yZafEUuZq9UxfvijRgdc6vcRQPA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12/go.mod h1:xwKv6vwBNdpPFOxEm/ld4IODZK2s/1ksHvdBqLfH6Gs=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12 h1:lqSi8qvAnKC1vfosImdmOsuiJLr/jdybZX5299beB6Q=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12/go.mod h1:rqPQE2vqkW9YHx5+Gp55sx1wsTM4xtGQLl+TKMjxxrs=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12 h1:uvX2yaL+aMjkmnrLPPlR/zwjoKFRMoNhhJfeGjfk6qc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12/go.mod h1:dicT+2eNhHHqGkxHO7LoXw3QghIUGuzgdmFqaSTopgI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25 h1:rKwkY3Z+fvt2W0msjdNs6uNewPmXzPayQ961oyuWhes=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25/go.mod h1:dBuAadQKd1F4Q4ZOg8gnFmuSHMRE40Pe3IfFwbtC4lE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13 h1:U5HZ8FpTr6tyvulf1nT11Nw4KG1CAsXkuQGdUrIjZ/E=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13/go.mod h1:dUfvCU1NaE+b3vqNENDiJncUQW7Djl5pmgUlcjesVqk=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12 h1:wzAqMZ2O4+ij9HQqIrk+P9PBGacE0wOTuWB7Mo97//I=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12/go.mod h1:/0TfyruByHsOlphzP26xDTRe2DKD0J1I1Uyy2TyP8EI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12 h1:H0IaQayT3TLiGIHiNnleQZTbndDlx7LGZ0NWZ5mDwjA=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12/go.mod h1:YuJJNxaOjnknLIrscBmkLhIpnmg9LzHd25sQRKUboGU=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.10 h1:WBJb2VxRzzKnuN94YWqZPiu5a5zc3IleFqgZnmVCyvU=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.10/go.mod h1:8NhAIBVYkVHq0hIbbzujdoou0VkKwMdG+De9e5oX6qI=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A=
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.47.5 h1:4EezYQsIY0xPbD6u7TbQLfnpicSMQgA8n9paomVV4Zo=
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.47.5/go.mod h1:Yr4VqXnyoyjWnOWJck8BOidkJtleQ1c8ypgd2n0epxE=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.52.4 h1:D+Zmdt3T3P770MrqTmZvalbj6ADO7xA7n+qnNakGvrI=
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.52.4/go.mod h1:dUYH3ia3qEO5ogaWDLp2tjtb4u4Y9xRbae7tOr1ClIA=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 h1:BVjKrtRUtSYKztBCCfE1oAB+d3ViKcW2cKZfserOqMQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6/go.mod h1:eSukFLeLkPMm+1OxDR+F0joauZdyBkF47Ow7MqjZiJw=
|
||||
github.com/aws/smithy-go v1.28.7 h1:h/n1SHrwVtaDYLz8mR1/Kq4Xh4RaFbFW7bOYckg9mfE=
|
||||
github.com/aws/smithy-go v1.28.7/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||
github.com/aws/smithy-go v1.28.9 h1:zkZ058OpNX0iGTK24b+ZUEQSMc11CBA6oO7xtKZfzkY=
|
||||
github.com/aws/smithy-go v1.28.9/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
|
||||
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/bazelbuild/rules_go v0.46.0 h1:CTefzjN/D3Cdn3rkrM6qMWuQj59OBcuOjyIp3m4hZ7s=
|
||||
@@ -389,8 +387,8 @@ github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaft
|
||||
github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/docker-credential-helpers v0.9.8 h1:bIREROb7So6PRlq6KTtdS9MPEjC29OQRkFNlvK2OX8Q=
|
||||
github.com/docker/docker-credential-helpers v0.9.8/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c=
|
||||
github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c=
|
||||
github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
|
||||
github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcykSlxMNc=
|
||||
github.com/docker/go-connections v0.8.2/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
|
||||
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
|
||||
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
||||
github.com/dromara/dongle v1.0.1 h1:si/7UP/EXxnFVZok1cNos70GiMGxInAYMilHQFP5dJs=
|
||||
@@ -407,8 +405,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4A
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
|
||||
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE=
|
||||
github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/ebitengine/purego v0.11.2 h1:WWiTx8rD8zYdOwSj8O/NiNbsOvSAgJMTlyV1XlbUSeU=
|
||||
github.com/ebitengine/purego v0.11.2/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg=
|
||||
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
|
||||
@@ -509,12 +507,12 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
|
||||
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
|
||||
github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I=
|
||||
github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w=
|
||||
github.com/go-openapi/strfmt v0.27.0 h1:kbcTeaD9TXuXD0hhMXzuYa1sdTo6+dWGvwjW93E80IM=
|
||||
github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc=
|
||||
github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug=
|
||||
github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
|
||||
github.com/go-openapi/errors v0.22.9 h1:HI9+SyVYiRzyeBQGv0CbWbQa+u2S0nny7G7AhY+UMiM=
|
||||
github.com/go-openapi/errors v0.22.9/go.mod h1:R73q66sXP2smzAGgFOI4nqtusRK2xN5pYCjsij+KX58=
|
||||
github.com/go-openapi/strfmt v0.27.2 h1:SG32SlbwNy92s0KJiVxt2joJeFdqIYHvwrA0OU6HqzQ=
|
||||
github.com/go-openapi/strfmt v0.27.2/go.mod h1:M4CKsMO0Fb8qR10+1Ra75wCKNNquy+Vj+4LWZrhTo2E=
|
||||
github.com/go-openapi/testify/v2 v2.8.0 h1:19QDx5b57p8KjO2E4sgs/woL4Akp+FGLRlVm2xn0Rho=
|
||||
github.com/go-openapi/testify/v2 v2.8.0/go.mod h1:4gUN8jC+RqOE2qjW/vDmfyTvl5BCht4qL7oca0odrak=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
@@ -546,8 +544,8 @@ github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd
|
||||
github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
|
||||
github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I=
|
||||
github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
|
||||
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
|
||||
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/goccy/go-json v0.11.2 h1:jdZv93Tt4ioR8yW1CoNsvSxrcZlCXAUU1aZXN7gpXUA=
|
||||
github.com/goccy/go-json v0.11.2/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY=
|
||||
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
|
||||
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
|
||||
@@ -563,8 +561,8 @@ github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 h1:gtexQ/VGyN+VVFRXSFig
|
||||
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
|
||||
@@ -649,8 +647,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.31.0 h1:Bd7KaOxzULLxtZ/K5s1aLbWhR0+5RToO65TXHsf3bqQ=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.31.0/go.mod h1:nN7ts3dFXKtCZWc//yfkpcQNKJABg16/uDVAZpLDalo=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@@ -827,8 +825,8 @@ github.com/lpar/calendar v0.2.0 h1:A1kxv6sbvBHFUkd2XotanIRqEXQGreQOeuGhkJqIaRA=
|
||||
github.com/lpar/calendar v0.2.0/go.mod h1:fsVJa4o2NvXYzaCE5RXMadqbZzWEhNCGOUPVHTIZdjc=
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15 h1:YkjVPl/YH5XlJ+/NiwzJtPYXXKRcyjmEUhsDci6YK3c=
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
|
||||
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
|
||||
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/magiconair/properties v1.18.12 h1:sT9zQpvTB3B4gzrX0tmZNTEaGyg8Zw55MFYRE32Mr9I=
|
||||
github.com/magiconair/properties v1.18.12/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
|
||||
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
@@ -865,20 +863,22 @@ github.com/moby/buildkit v0.31.1 h1:j3p55abBl4kiXXPZgYX+6zWgB2aefqHXoPown12fIzU=
|
||||
github.com/moby/buildkit v0.31.1/go.mod h1:YM5iNEbNCc6L1Zt3YWFB/aXNLufvf4Rcu0DPlc9HwQg=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/go-archive v0.3.0 h1:nos4BtzzUIqB406BgQnWGMI4qib9BZ8XUHU+ucv/n1c=
|
||||
github.com/moby/go-archive v0.3.0/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE=
|
||||
github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
|
||||
github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE=
|
||||
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
|
||||
github.com/moby/moby/api v1.55.0 h1:2/sexvQyqIWS8pRSCFddBfpW2qE7vR7FCL+vN8pxwMc=
|
||||
github.com/moby/moby/api v1.55.0/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs=
|
||||
github.com/moby/moby/client v0.5.0 h1:5XhyPk2fuOWf6RlSFa3MkIIgDZkF25xToXW8Q/BH7cc=
|
||||
github.com/moby/moby/client v0.5.0/go.mod h1:rcVpF8ncl9vo5gaIBdol6CnbEtSj1uxMvEV/UrykF/s=
|
||||
github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c=
|
||||
github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk=
|
||||
github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4=
|
||||
github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc=
|
||||
github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U=
|
||||
github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
||||
github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw=
|
||||
github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs=
|
||||
github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk=
|
||||
github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=
|
||||
github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00=
|
||||
github.com/moby/sys/mount v0.3.5/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M=
|
||||
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
|
||||
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
|
||||
github.com/moby/sys/sequential v0.7.0 h1:ASQNGNROJSuOO6LL6bPHbKvuZu6NU8P4ldPWk31zj/8=
|
||||
@@ -913,10 +913,10 @@ github.com/nats-io/jwt/v2 v2.8.1 h1:V0xpGuD/N8Mi+fQNDynXohVvp7ZztevW5io8CUWlPmU=
|
||||
github.com/nats-io/jwt/v2 v2.8.1/go.mod h1:nWnOEEiVMiKHQpnAy4eXlizVEtSfzacZ1Q43LIRavZg=
|
||||
github.com/nats-io/nats-server/v2 v2.11.15 h1:StSf9TINInaZtr4oww2+kXmfwa9SkN//g/LwS19/UJ0=
|
||||
github.com/nats-io/nats-server/v2 v2.11.15/go.mod h1:zwhv8Y0PE3KHyKgznJc/9Xoai638SaJd83zzJ5GJn74=
|
||||
github.com/nats-io/nats.go v1.49.0 h1:yh/WvY59gXqYpgl33ZI+XoVPKyut/IcEaqtsiuTJpoE=
|
||||
github.com/nats-io/nats.go v1.49.0/go.mod h1:fDCn3mN5cY8HooHwE2ukiLb4p4G4ImmzvXyJt+tGwdw=
|
||||
github.com/nats-io/nkeys v0.4.15 h1:JACV5jRVO9V856KOapQ7x+EY8Jo3qw1vJt/9Jpwzkk4=
|
||||
github.com/nats-io/nkeys v0.4.15/go.mod h1:CpMchTXC9fxA5zrMo4KpySxNjiDVvr8ANOSZdiNfUrs=
|
||||
github.com/nats-io/nats.go v1.54.0 h1:vsXoOxjHp/GmPUN+EcI7uOf/uB+iAP+kEsAFNQN0yzA=
|
||||
github.com/nats-io/nats.go v1.54.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k=
|
||||
github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=
|
||||
github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||
@@ -927,8 +927,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
|
||||
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
|
||||
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
|
||||
github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
|
||||
github.com/oklog/ulid/v2 v2.1.2 h1:IEclFb9JNvzYA6MW2SCxbLzcHTVsfqm3PrqGQJH5zec=
|
||||
github.com/oklog/ulid/v2 v2.1.2/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
|
||||
github.com/olivere/elastic/v7 v7.0.32 h1:R7CXvbu8Eq+WlsLgxmKVKPox0oOwAE/2T9Si5BnvK6E=
|
||||
github.com/olivere/elastic/v7 v7.0.32/go.mod h1:c7PVmLe3Fxq77PIfY/bZmxY/TAamBhCzZ8xDOE09a9k=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
@@ -977,8 +977,8 @@ github.com/petermattis/goid v0.0.0-20260113132338-7c7de50cc741/go.mod h1:pxMtw7c
|
||||
github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
|
||||
github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM=
|
||||
github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
|
||||
github.com/pierrec/lz4/v4 v4.1.29 h1:CDQY6qZOLI4DW0Nx6R1vRrifrCeQHnNXkMb0hZWXFjg=
|
||||
github.com/pierrec/lz4/v4 v4.1.29/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4=
|
||||
github.com/pierrec/lz4/v4 v4.1.33 h1:GjG1TJ1V4IzKP8L96muuuDNpTwd7D+l2ccXrjAbe014=
|
||||
github.com/pierrec/lz4/v4 v4.1.33/go.mod h1:7SE9MC2STkNtL4PIwGhjmyVwvILaGI9/COYQNBhKM/c=
|
||||
github.com/pierrre/compare v1.0.2 h1:k4IUsHgh+dbcAOIWCfxVa/7G6STjADH2qmhomv+1quc=
|
||||
github.com/pierrre/compare v1.0.2/go.mod h1:8UvyRHH+9HS8Pczdd2z5x/wvv67krDwVxoOndaIIDVU=
|
||||
github.com/pierrre/geohash v1.0.0 h1:f/zfjdV4rVofTCz1FhP07T+EMQAvcMM2ioGZVt+zqjI=
|
||||
@@ -1014,8 +1014,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
|
||||
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||
github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 h1:jL3a8soXdzuTCcRnKhOmtcsVOObdDTFf4O2B403HPRU=
|
||||
github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||
github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEnkRx9k=
|
||||
github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
|
||||
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
|
||||
@@ -1039,8 +1039,8 @@ github.com/prometheus/common v0.71.0/go.mod h1:CLJ5H8TEsGX8bl31BdMkfhIZ+QmZ9tBPP
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics=
|
||||
github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58=
|
||||
github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4=
|
||||
github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk=
|
||||
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 h1:Y258uzXU/potCYnQd1r6wlAnoMB68BiCkCcCnKx1SH8=
|
||||
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8/go.mod h1:bSJjRokAHHOhA+XFxplld8w2R/dXLH7Z3BZ532vhFwU=
|
||||
github.com/puzpuzpuz/xsync/v3 v3.5.1 h1:GJYJZwO6IdxN/IKbneznS6yPkVC+c3zyY/j19c++5Fg=
|
||||
@@ -1049,8 +1049,8 @@ github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/rabbitmq/amqp091-go v1.15.0 h1:LEQL4/yp48/Wigt6A6XOu18RQRo8ZHtB5I/KZJn+gkw=
|
||||
github.com/rabbitmq/amqp091-go v1.15.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||
github.com/rabbitmq/amqp091-go v1.16.0 h1:1O8oQqnj9hLACoo6CVMgn57z2pLWXvgemhh4GsquV+Y=
|
||||
github.com/rabbitmq/amqp091-go v1.16.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5 h1:K1++Qtk3PvgkiCCiv6Pahju1TMOzKY6VSwiwT7XLAVc=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5/go.mod h1:vCeOPhlXzevN0AFojgh1zsjhetiShy/ArvJ/xkFUDWk=
|
||||
github.com/rclone/go-proton-api v1.0.4 h1:AJW0e9pB4j0hVK4WqyGErFwaI+5MUQWPCtj5FYYxtPg=
|
||||
@@ -1114,8 +1114,8 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=
|
||||
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
|
||||
github.com/shirou/gopsutil/v4 v4.26.7 h1:IXzpHz/dkMRYAhKkOXr1HB6SuzWU3eoyyeWe7g3bNZc=
|
||||
github.com/shirou/gopsutil/v4 v4.26.7/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM=
|
||||
github.com/shirou/gopsutil/v4 v4.26.10 h1:MJN6euesJx53MVEjscYeyRSRcrdIcy3sz5k9nosjldg=
|
||||
github.com/shirou/gopsutil/v4 v4.26.10/go.mod h1:XpkIrcUMQhwte/dGxu57KtnMMFsbKelI7PP23zweKBk=
|
||||
github.com/sigstore/sigstore v1.10.8 h1:1Mgkxvkw4AXMfIP1DOjc6kw0GkUgA8pGVpveN/EfOq4=
|
||||
github.com/sigstore/sigstore v1.10.8/go.mod h1:f9+B/4iaYimvUkySyb2mvc73n3RLqNn24grHZM/ET8M=
|
||||
github.com/sigstore/sigstore-go v1.2.1 h1:YWP/rDbBaEBvtbkj6xtwsSj38ZCFEhTVVadNOXjVe3A=
|
||||
@@ -1153,8 +1153,8 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
|
||||
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.2 h1:jUEsvCMD6fH25J8K/w3q/XnIx8W1lb8+YLaEEHIjHmc=
|
||||
github.com/spiffe/go-spiffe/v2 v2.8.2/go.mod h1:w2CLWKLMTX/PPYUEUPv3ltH0RXsw5S8suwNF46w9/Aw=
|
||||
github.com/spiffe/go-spiffe/v2 v2.9.0 h1:g5qTg3qIP1HXV+GzuyEfSJFVxUCpEP5Ui1OINVJHPB4=
|
||||
github.com/spiffe/go-spiffe/v2 v2.9.0/go.mod h1:w2CLWKLMTX/PPYUEUPv3ltH0RXsw5S8suwNF46w9/Aw=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
@@ -1198,8 +1198,8 @@ github.com/tarantool/go-option v1.1.0 h1:ShoOhNsdL41sRpm4hXCRDjV8H0WzPkd4UnKhLKb
|
||||
github.com/tarantool/go-option v1.1.0/go.mod h1:hMr9z2JXOWlgdCBpCPSL2nwp8718GKYvNBJ+ZuzJbCo=
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.2 h1:9ZtHllun80QX7KS9tqd3dXa+QAu2BfqFtX1ZWcNnaW8=
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.2/go.mod h1:TXxLWhUCgdxXFfelnTSkq+goKRTRj660zxq4/WXPe8k=
|
||||
github.com/testcontainers/testcontainers-go v0.44.0 h1:/Fwh6HY1mIikhnm9e7HwoxGycx0lzRAE0f5VQpjFxzI=
|
||||
github.com/testcontainers/testcontainers-go v0.44.0/go.mod h1:IcnwQrYTO86xHXu5bvMaBH7ATlbS3Qn1M1QWW3c66rE=
|
||||
github.com/testcontainers/testcontainers-go v0.45.0 h1:ss9Stm9KDX6JLgGL4jr2fC5dwpabTbCBsRcGadBPR9k=
|
||||
github.com/testcontainers/testcontainers-go v0.45.0/go.mod h1:VMJZ7M+qhgfEHWNbtjm596OyEOraULSTDaus/h0hmJI=
|
||||
github.com/testcontainers/testcontainers-go/modules/compose v0.44.0 h1:8YcW51jhgpkkiRVe10Wj9TCBthJmoNpU2fK5WSf7TQ8=
|
||||
github.com/testcontainers/testcontainers-go/modules/compose v0.44.0/go.mod h1:0du5YaH5n8Of4bDM/RwIt421Q14kvqrXZ0mB8EjuMoo=
|
||||
github.com/the42/cartconvert v0.0.0-20131203171324-aae784c392b8 h1:I4DY8wLxJXCrMYzDM6lKCGc3IQwJX0PlTLsd3nQqI3c=
|
||||
@@ -1349,36 +1349,36 @@ go.einride.tech/aip v0.83.0 h1:TI21IdeOnLTwZEJ3BxtImIZk6bsN2Q+sd0x99SLiQ+M=
|
||||
go.einride.tech/aip v0.83.0/go.mod h1:E8+wdTApA70odnpFzJgsGogHozC2JCIhFJBKPr8bVig=
|
||||
go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU=
|
||||
go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk=
|
||||
go.etcd.io/etcd/api/v3 v3.7.1 h1:KJG0/DcWGfe3Y1otDf/fsBf0TSSgpxZ5RO/L8SFt73E=
|
||||
go.etcd.io/etcd/api/v3 v3.7.1/go.mod h1:8bXIpCMeV7E3/XL0Ix123ATn3dB+0V7d9zklHbB0m78=
|
||||
go.etcd.io/etcd/api/v3 v3.7.3 h1:2tumepXe+wi7Wab64uUO71K7ISQyUWLGC1DJbbc59sY=
|
||||
go.etcd.io/etcd/api/v3 v3.7.3/go.mod h1:HOR9Qn4gb/1/hVAmYprmlLpvTe6ZgfgNS9Z/+Ty65po=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3 h1:5zMwNu3ycrzCeA5NwOfQbxFRhqq974chq1DrYMua4QI=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3/go.mod h1:/OhzqYrF0U7d1NOk55VMyUQGbYD1WoIe4bJwxb47wOk=
|
||||
go.etcd.io/etcd/client/v3 v3.7.1 h1:0PEMMC0KuZmVIN+RAbdqfkZ45pYTgKVtmBEbRCvZFUg=
|
||||
go.etcd.io/etcd/client/v3 v3.7.1/go.mod h1:ffNqALa8tRCYhYo1F9oR489y23K39Gz+BSR3ApAGYq0=
|
||||
go.etcd.io/etcd/client/v3 v3.7.3 h1:UrXcetgkuSEocaBlQlulQRJlXLEnUAHuBRbHh0lue1Q=
|
||||
go.etcd.io/etcd/client/v3 v3.7.3/go.mod h1:DcPxpqcpV8WIaRi/2waPCx0/Uq8rQUweDJaDYZk1gEE=
|
||||
go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU=
|
||||
go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.46.0 h1:PI8dGkqDaQkwJ8kOopqMhDTbrnK3UIeG/RCHH4HErbo=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.46.0/go.mod h1:nsrN5c/sOLoY2vsPxN/rQ0V0nvGrWJCqcW4UXLtqNG8=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0 h1:B2h3uqicet1CT2N5TOFhS+Gq++9i0/CLmaxvhmhtP5s=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0/go.mod h1:dylvB+ZiiwMvsDij9O84Uy7SijLgHMX4mbkncds+4Sw=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.47.0 h1:Ct6+aaiSO6Nk5SOb6PYcR7iWp+83YF/pL1OJcGqOmbg=
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.47.0/go.mod h1:3N259ss0b1AVOs+fYw7lOO0mcUwNqSIpQ+Zitpuqx00=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 h1:Tq+E65HaNbZTeqcLw6QUhsV+/EIWdkfUH2CQzcrlE5M=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0/go.mod h1:A+EVhDakAj1waJBPhmTszZaSr08ww8MRRKy1nB1rqck=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 h1:MCcYL7J6Vt/X0kjqbMZkekCmwsurbQRbL69vkiye2lk=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0/go.mod h1:3jnStNwSufK+f5ktjL4EPcwtig4rtd81NS70lqHuXl8=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 h1:3g7B90UzBltIDKq1/5mrTGxTnOFDV0ICOhLoxiZ8jlg=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0/go.mod h1:Ef8SuTh59BT7+ofpDxN9z+yOlc4t2GjLmKDgYNJL/NU=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
|
||||
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
|
||||
go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0 h1:qkDYCAFiZXLcs1L4aY+tP2wguQ4kURANqHOQMA2et2s=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0/go.mod h1:tkipS4DRzmpAmvg+Gw4++O1IdDq6TVDnvnYU6cmbQVs=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0 h1:LaLVGJtIzHcvHjVs2OftmKcc+M9mdOqS8vZ1fBD1Yes=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0/go.mod h1:vF6H5sNDuQBJWgSX00iZgbIqk2MZZoVMH0ar5t5bOpw=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0 h1:RuynHbfU8JUEw7DyONgkVYg2SVtsoF28y0LGIr69jgA=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0/go.mod h1:qZF+/lBs71APw8mlnEZcqZHMzqrYrsFiJOv83lX1OGo=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 h1:OFnwLJr+pF3iHrlGSzbxyuo6/6HyBlnlN1CWEJmBVcw=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0/go.mod h1:716wFneO0ov19A2beH5hjfh9AK5z/VWNAtDijp1Y0/g=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.46.0 h1:w53CDeOA/Kurp7yRsegSr6pbbr759dOvJ+yNmWM6Hxs=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.46.0/go.mod h1:BOmGMCbAtvcJiSJ+hLuhgPLdDbimnraSl8irz3iY8sY=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 h1:UFpxOpYPmMNUtOWhdb+nC1WELIgVf8z9higURrbzYU4=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0/go.mod h1:YBGjxe3lt0jtXoEXxGrGhv/jM7oUBUDVK7zhAvNyEjc=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0 h1:QBajQ2SrwQijzHyZbQlPsuIzpl/ll8DY6wPWsajeGcI=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.45.0/go.mod h1:08ZQLjrPLQ6R4kAXvuOvODEer5Yh4CoFvll5qB2BCI8=
|
||||
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.46.0 h1:PR9eAf7o0dQs3hshZNZpE9aW2dXWX/KdDf6pJilVD3U=
|
||||
@@ -1398,8 +1398,8 @@ go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syod
|
||||
go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM=
|
||||
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk=
|
||||
go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 h1:SCrPqH9NE5CmBrOqpjNCiT0X5mGwMyGERXdogfR7Yjw=
|
||||
go.opentelemetry.io/proto/otlp v1.11.1/go.mod h1:wq8W4aSf6bOy8RZyESOeQFr9Pu7wydWX/TY4sgvrTPg=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
@@ -1421,14 +1421,14 @@ go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo=
|
||||
go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q=
|
||||
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
|
||||
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
|
||||
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
|
||||
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
|
||||
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
|
||||
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
|
||||
go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4=
|
||||
go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
|
||||
gocloud.dev v0.47.0 h1:qN4/0vtutn97f1X5ziisf3WXuaFL9AR0FIRnyJRYzgA=
|
||||
gocloud.dev v0.47.0/go.mod h1:OdMnyXQRhM17U0a0DwU57pe0c01qN3lJNmaeeRYW0D0=
|
||||
gocloud.dev/pubsub/natspubsub v0.46.0 h1:cTmJnWOmhb3dYRzX7PvNkq2m5mQdBLFFxZbl/21pfjk=
|
||||
gocloud.dev/pubsub/natspubsub v0.46.0/go.mod h1:hbEEsNt6mGQoonGQi39VOjHfx2f13DOmWouh4hGsfrU=
|
||||
gocloud.dev v0.49.0 h1:02y4IBHX12xiCBK3Nv80IzuCmZXLsOfgpKwMEKzR9O4=
|
||||
gocloud.dev v0.49.0/go.mod h1:uN+hz2x8ieyW5RjeMetvmpV/nRqFOr7DF0CKVY0Owp8=
|
||||
gocloud.dev/pubsub/natspubsub v0.49.0 h1:Jk1bywJ6LvqvBbxOQ0qs0q4aa+ORgg1FzjhTy+5O4cI=
|
||||
gocloud.dev/pubsub/natspubsub v0.49.0/go.mod h1:bmtxptoOPBNAgvTW9tWzoZvw9vzunDoNk6l4cHGd6nc=
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.47.0 h1:iDSspbLlDbPL2avESbDfMNBK4r3B6H04Ejx+/hqh9JE=
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.47.0/go.mod h1:2tSZnGnGLPw2ayW4pVaUmnA1LCjP7rekpXPkaBUZt0o=
|
||||
golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
|
||||
@@ -1449,8 +1449,8 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
|
||||
golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54=
|
||||
golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20260813180055-c1d0aacb2297 h1:YXnL44eJ77R+ji4/ooy8UsXIhz+lbi2Qgdlc8iRN0gY=
|
||||
golang.org/x/exp v0.0.0-20260813180055-c1d0aacb2297/go.mod h1:Mkmymgv+uMpSQ/XxJ/7GpdrdYoqm3u72jEbpCLiJmNk=
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e h1:HgI6W1OolKK6tcV74is+rl9SMT0njsHlp0TbQiGXI/A=
|
||||
golang.org/x/exp v0.0.0-20261014143641-f0251eb4aa3e/go.mod h1:DBoxwWhjaW8DJJw/YeM4zpeOKMC1FMXSblsYy+1mFSw=
|
||||
golang.org/x/image v0.46.0 h1:b1+oYj0Jbp6K5MDT4i4/eZpYlk3V8SJhhDKh6LBHAyQ=
|
||||
golang.org/x/image v0.46.0/go.mod h1:3B3W05VGVQyuXucLINLjXKrqISASfi4Xj+iCVkLMwew=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -1497,8 +1497,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw=
|
||||
golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
|
||||
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
|
||||
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98=
|
||||
@@ -1540,7 +1540,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -1607,8 +1606,8 @@ golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
|
||||
golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI=
|
||||
golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA=
|
||||
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
|
||||
golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated h1:o+aZ1BOj6Hsx/GBdJO/s815sqftjSnrZZwyYTHODvtk=
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated/go.mod h1:qM63CriJ961IHWmnWa9CjZnBndniPt4a3CK0PVB9bIg=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
@@ -1630,10 +1629,10 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20261012220534-4341edf3f941 h1:CXq2XEi5aEyLjjPZIwqrmQH8ZY4ctUwK7uyAx3mjX/U=
|
||||
google.golang.org/genproto v0.0.0-20261012220534-4341edf3f941/go.mod h1:3gK0ehnhP0V7/x3ypGoLyT3d0n6TSi/EcsphIjHrcz4=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261012220534-4341edf3f941 h1:DS/w3N8rsfrwxwgGSj6WhMsPo7aNQGmDx74J81zd0NQ=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261012220534-4341edf3f941/go.mod h1:AuGAdi9KnXss7xbLxIKhCvk+Ro/SxpET/iS45DNYN+M=
|
||||
google.golang.org/genproto v0.0.0-20261019180522-ce908d29299b h1:+t2qGqt6R8CO622uiX1JpnRvRvSOQoVRV0DiPzUjKXg=
|
||||
google.golang.org/genproto v0.0.0-20261019180522-ce908d29299b/go.mod h1:XRIfc1yr5xsbF8xFw5+g7SEmLJX/eQ7MMazTRbnMMvI=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b h1:nB3spRIaSPtxJpxb0k41yljROvm2Jrwfs2pSNdKS5y8=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b/go.mod h1:9N4vtjEwvgQKEdlFVQO0M44ErhecQ9DCSQfGoZ51M6w=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b h1:6WNWHZk91dp4gZ25642OALkuG1UVNZbwENJD19DnB8k=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
|
||||
+87
-42
@@ -7,12 +7,14 @@
|
||||
# curl -fsSL https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/install.sh | bash
|
||||
# curl -fsSL ... | bash -s -- --component volume-rust --large-disk
|
||||
# curl -fsSL ... | bash -s -- --version 4.34 --dir /usr/local/bin
|
||||
# curl -fsSL ... | bash -s -- --enterprise --component all
|
||||
#
|
||||
# Options:
|
||||
# --component COMP Which binary to install: weed, volume-rust, worker-rust, vector, all (default: weed)
|
||||
# --version VER Release version tag (default: latest)
|
||||
# --large-disk Use large disk variant (5-byte offset, 8TB max volume)
|
||||
# --dir DIR Installation directory (default: /usr/local/bin)
|
||||
# --enterprise Install SeaweedFS Enterprise binaries (from seaweedfs/artifactory)
|
||||
# --help Show this help message
|
||||
|
||||
set -euo pipefail
|
||||
@@ -24,6 +26,10 @@ LARGE_DISK=false
|
||||
INSTALL_DIR="/usr/local/bin"
|
||||
WORKER_INSTALLED=false
|
||||
VECTOR_INSTALLED=false
|
||||
VOLUME_INSTALLED=false
|
||||
ENTERPRISE=false
|
||||
# Enterprise assets carry this after the binary name, e.g. weed-vector-enterprise_linux_amd64.tar.gz.
|
||||
EDITION=""
|
||||
|
||||
# Colors (if terminal supports them)
|
||||
if [ -t 1 ]; then
|
||||
@@ -53,6 +59,7 @@ while [ $# -gt 0 ]; do
|
||||
--version) VERSION="$2"; shift 2 ;;
|
||||
--large-disk) LARGE_DISK=true; shift ;;
|
||||
--dir) INSTALL_DIR="$2"; shift 2 ;;
|
||||
--enterprise) ENTERPRISE=true; REPO="seaweedfs/artifactory"; EDITION="-enterprise"; shift ;;
|
||||
--help|-h) usage ;;
|
||||
*) error "Unknown option: $1. Use --help for usage." ;;
|
||||
esac
|
||||
@@ -81,15 +88,22 @@ detect_platform() {
|
||||
}
|
||||
|
||||
# Get latest release tag from GitHub API
|
||||
# The Enterprise repo also releases other products (vfs-*, previews), which can
|
||||
# be its latest release, so take the newest plain version tag like 4.53.
|
||||
get_latest_version() {
|
||||
local url="https://api.github.com/repos/${REPO}/releases/latest"
|
||||
if [ "$ENTERPRISE" = true ]; then
|
||||
url="https://api.github.com/repos/${REPO}/releases?per_page=30"
|
||||
fi
|
||||
local body
|
||||
if command -v curl &>/dev/null; then
|
||||
curl -fsSL "$url" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/'
|
||||
body="$(curl -fsSL "$url")"
|
||||
elif command -v wget &>/dev/null; then
|
||||
wget -qO- "$url" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/'
|
||||
body="$(wget -qO- "$url")"
|
||||
else
|
||||
error "Neither curl nor wget found. Please install one."
|
||||
fi
|
||||
echo "$body" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/' | grep -E '^[0-9]+(\.[0-9]+)+$' | head -1 || true
|
||||
}
|
||||
|
||||
# Download a file
|
||||
@@ -110,17 +124,22 @@ go_asset_name() {
|
||||
if [ "$LARGE_DISK" = true ]; then
|
||||
suffix="${suffix}_large_disk"
|
||||
fi
|
||||
echo "${suffix}.tar.gz"
|
||||
if [ "$ENTERPRISE" = true ]; then
|
||||
suffix="weed-enterprise-${suffix}"
|
||||
fi
|
||||
if [ "$os" = "windows" ]; then
|
||||
echo "${suffix}.zip"
|
||||
else
|
||||
echo "${suffix}.tar.gz"
|
||||
fi
|
||||
}
|
||||
|
||||
# Build Rust volume server asset name
|
||||
rust_asset_name() {
|
||||
local os="$1" arch="$2"
|
||||
local prefix="weed-volume"
|
||||
local prefix="weed-volume${EDITION}"
|
||||
if [ "$LARGE_DISK" = true ]; then
|
||||
prefix="weed-volume_large_disk"
|
||||
else
|
||||
prefix="weed-volume"
|
||||
prefix="${prefix}_large_disk"
|
||||
fi
|
||||
local suffix="${os}_${arch}"
|
||||
if [ "$os" = "windows" ]; then
|
||||
@@ -130,6 +149,19 @@ rust_asset_name() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Enterprise publishes the Rust volume server for linux only.
|
||||
rust_volume_platform_supported() {
|
||||
case "$2" in
|
||||
amd64|arm64) ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
case "$1" in
|
||||
linux) return 0 ;;
|
||||
darwin|windows) [ "$ENTERPRISE" != true ] ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Does a release carry this asset? Answers 0 for yes and 1 for a 404, and stops
|
||||
# the installer on anything else: a rate limit or a network blip must not read
|
||||
# as "this release predates the binary" and quietly skip it.
|
||||
@@ -154,13 +186,25 @@ asset_exists() {
|
||||
# maintains tables through the namespace and never opens a volume file.
|
||||
worker_asset_name() {
|
||||
local os="$1" arch="$2"
|
||||
echo "weed-worker_${os}_${arch}.tar.gz"
|
||||
echo "weed-worker${EDITION}_${os}_${arch}.tar.gz"
|
||||
}
|
||||
|
||||
# The vector engine behind the S3 Vectors API, built like the worker.
|
||||
vector_asset_name() {
|
||||
local os="$1" arch="$2"
|
||||
echo "weed-vector_${os}_${arch}.tar.gz"
|
||||
if [ "$os" = "windows" ]; then
|
||||
echo "weed-vector${EDITION}_${os}_${arch}.zip"
|
||||
else
|
||||
echo "weed-vector${EDITION}_${os}_${arch}.tar.gz"
|
||||
fi
|
||||
}
|
||||
|
||||
vector_platform_supported() {
|
||||
case "$1/$2" in
|
||||
linux/amd64|linux/arm64) return 0 ;;
|
||||
darwin/amd64|darwin/arm64|windows/amd64) [ "$ENTERPRISE" != true ] ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Install a single component
|
||||
@@ -178,7 +222,10 @@ install_component() {
|
||||
download "$download_url" "${tmpdir}/${asset_name}"
|
||||
|
||||
info "Extracting ${asset_name}..."
|
||||
tar xzf "${tmpdir}/${asset_name}" -C "$tmpdir"
|
||||
case "$asset_name" in
|
||||
*.zip) unzip -q "${tmpdir}/${asset_name}" -d "$tmpdir" ;;
|
||||
*) tar xzf "${tmpdir}/${asset_name}" -C "$tmpdir" ;;
|
||||
esac
|
||||
|
||||
# The Go release action puts the binary inside a directory
|
||||
local weed_bin
|
||||
@@ -191,20 +238,16 @@ install_component() {
|
||||
fi
|
||||
|
||||
chmod +x "$weed_bin"
|
||||
install_binary "$weed_bin" "weed"
|
||||
ok "Installed weed to ${INSTALL_DIR}/weed"
|
||||
local dest_name="weed"
|
||||
if [ "$os" = "windows" ]; then
|
||||
dest_name="weed.exe"
|
||||
fi
|
||||
install_binary "$weed_bin" "$dest_name"
|
||||
ok "Installed weed to ${INSTALL_DIR}/${dest_name}"
|
||||
;;
|
||||
|
||||
volume-rust)
|
||||
# Check platform support for Rust volume server
|
||||
case "$os" in
|
||||
linux|darwin|windows) ;;
|
||||
*) error "Rust volume server is not available for ${os}. Supported: linux, darwin, windows" ;;
|
||||
esac
|
||||
case "$arch" in
|
||||
amd64|arm64) ;;
|
||||
*) error "Rust volume server is not available for ${arch}. Supported: amd64, arm64" ;;
|
||||
esac
|
||||
rust_volume_platform_supported "$os" "$arch" || error "The Rust volume server is not available for ${os}/${arch}"
|
||||
|
||||
asset_name="$(rust_asset_name "$os" "$arch")"
|
||||
download_url="https://github.com/${REPO}/releases/download/${VERSION}/${asset_name}"
|
||||
@@ -236,6 +279,7 @@ install_component() {
|
||||
dest_name="weed-volume.exe"
|
||||
fi
|
||||
install_binary "$rust_bin" "$dest_name"
|
||||
VOLUME_INSTALLED=true
|
||||
ok "Installed weed-volume to ${INSTALL_DIR}/${dest_name}"
|
||||
;;
|
||||
|
||||
@@ -272,31 +316,26 @@ install_component() {
|
||||
;;
|
||||
|
||||
vector)
|
||||
# Published for linux amd64/arm64 only, like the worker.
|
||||
case "$os" in
|
||||
linux) ;;
|
||||
*) error "The vector engine is not available for ${os}. Supported: linux" ;;
|
||||
esac
|
||||
case "$arch" in
|
||||
amd64|arm64) ;;
|
||||
*) error "The vector engine is not available for ${arch}. Supported: amd64, arm64" ;;
|
||||
esac
|
||||
vector_platform_supported "$os" "$arch" || error "The vector engine is not available for ${os}/${arch}"
|
||||
|
||||
asset_name="$(vector_asset_name "$os" "$arch")"
|
||||
download_url="https://github.com/${REPO}/releases/download/${VERSION}/${asset_name}"
|
||||
download "$download_url" "${tmpdir}/${asset_name}"
|
||||
|
||||
info "Extracting ${asset_name}..."
|
||||
tar xzf "${tmpdir}/${asset_name}" -C "$tmpdir"
|
||||
|
||||
local vector_bin
|
||||
vector_bin="$(find "$tmpdir" -name 'weed-vector' -type f | head -1)"
|
||||
if [ -z "$vector_bin" ]; then
|
||||
error "Could not find weed-vector binary in archive"
|
||||
local vector_name="weed-vector"
|
||||
if [ "$os" = "windows" ]; then
|
||||
command -v unzip >/dev/null || error "unzip is required for Windows vector archives"
|
||||
unzip -q "${tmpdir}/${asset_name}" -d "$tmpdir"
|
||||
vector_name="weed-vector.exe"
|
||||
else
|
||||
tar xzf "${tmpdir}/${asset_name}" -C "$tmpdir"
|
||||
fi
|
||||
|
||||
local vector_bin
|
||||
vector_bin="$(find "$tmpdir" -name "$vector_name" -type f | head -1)"
|
||||
[ -n "$vector_bin" ] || error "Could not find $vector_name binary in archive"
|
||||
chmod +x "$vector_bin"
|
||||
install_binary "$vector_bin" "weed-vector"
|
||||
install_binary "$vector_bin" "$vector_name"
|
||||
VECTOR_INSTALLED=true
|
||||
ok "Installed weed-vector to ${INSTALL_DIR}/weed-vector"
|
||||
;;
|
||||
@@ -353,7 +392,11 @@ main() {
|
||||
case "$COMPONENT" in
|
||||
all)
|
||||
install_component "weed" "$os" "$arch"
|
||||
install_component "volume-rust" "$os" "$arch"
|
||||
if rust_volume_platform_supported "$os" "$arch"; then
|
||||
install_component "volume-rust" "$os" "$arch"
|
||||
else
|
||||
warn "Skipping the Rust volume server: no build for ${os}/${arch}"
|
||||
fi
|
||||
# The worker is published for linux amd64/arm64 only, and only by
|
||||
# releases new enough to carry it; skip either case rather than fail
|
||||
# an install that has already put two binaries in place.
|
||||
@@ -364,7 +407,7 @@ main() {
|
||||
else
|
||||
install_component "worker-rust" "$os" "$arch"
|
||||
fi
|
||||
if [ "$os" != "linux" ] || { [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; }; then
|
||||
if ! vector_platform_supported "$os" "$arch"; then
|
||||
warn "Skipping the vector engine: no build for ${os}/${arch}"
|
||||
elif ! asset_exists "https://github.com/${REPO}/releases/download/${VERSION}/$(vector_asset_name "$os" "$arch")"; then
|
||||
warn "Skipping the vector engine: ${VERSION} does not carry one"
|
||||
@@ -382,7 +425,7 @@ main() {
|
||||
if [ "$COMPONENT" = "weed" ] || [ "$COMPONENT" = "all" ]; then
|
||||
info " weed: ${INSTALL_DIR}/weed"
|
||||
fi
|
||||
if [ "$COMPONENT" = "volume-rust" ] || [ "$COMPONENT" = "all" ]; then
|
||||
if [ "$VOLUME_INSTALLED" = true ]; then
|
||||
info " weed-volume: ${INSTALL_DIR}/weed-volume"
|
||||
fi
|
||||
if [ "$WORKER_INSTALLED" = true ]; then
|
||||
@@ -395,7 +438,9 @@ main() {
|
||||
info "Quick start:"
|
||||
info " weed master # Start master server"
|
||||
info " weed volume -mserver=localhost:9333 # Start Go volume server"
|
||||
info " weed-volume -mserver localhost:9333 # Start Rust volume server"
|
||||
if [ "$VOLUME_INSTALLED" = true ]; then
|
||||
info " weed-volume -mserver localhost:9333 # Start Rust volume server"
|
||||
fi
|
||||
if [ "$WORKER_INSTALLED" = true ]; then
|
||||
info " weed-worker --admin localhost:12535 # Start the Rust maintenance worker"
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
description: SeaweedFS
|
||||
name: seaweedfs
|
||||
appVersion: "4.53"
|
||||
appVersion: "4.54"
|
||||
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
|
||||
version: 4.53.0
|
||||
version: 4.54.0
|
||||
@@ -687,3 +687,47 @@ generates a new UUID and the license stops matching. See
|
||||
[Master data](#master-data-hostpath-vs-a-claim). Check the binding with
|
||||
`kubectl exec <master-pod> -- curl -s localhost:9333/license/status`
|
||||
(`cluster_uuid` must equal `license_uuid`).
|
||||
|
||||
|
||||
## Vector buckets
|
||||
|
||||
The S3 gateway serves the S3 Vectors API on its existing endpoint. Enable a vector engine and Lance maintenance worker alongside the cluster:
|
||||
|
||||
```yaml
|
||||
s3:
|
||||
enabled: true
|
||||
vector:
|
||||
enabled: true
|
||||
replicas: 1
|
||||
worker:
|
||||
enabled: true
|
||||
admin:
|
||||
enabled: true
|
||||
secret:
|
||||
adminPassword: change-me
|
||||
global:
|
||||
seaweedfs:
|
||||
securityConfig:
|
||||
jwtSigning:
|
||||
filerWrite: true
|
||||
```
|
||||
|
||||
The engine registers its pod address with the masters and stores indexes through the filers and volume servers. Both Go and Rust volume servers use the same setup. The maintenance worker builds and updates ANN indexes; queries can scan data before indexing completes. Enabling filer write signing also requires clients writing directly to the filer HTTP API to supply a signed JWT.
|
||||
|
||||
The bundled engine images support Linux amd64 and arm64. Use `vector.imageOverride` to select a compatible engine build, `vector.masters` for an external cluster, and `vector.resources` to set memory and CPU limits. The cache defaults to 512 MiB and is configured with `vector.readCacheMB`.
|
||||
|
||||
`global.seaweedfs.enableSecurity` provisions and mounts the vector certificate and shared security configuration. With external certificates, provide the `<fullname>-vector-cert` secret (`my-seaweedfs-vector-cert` for release `my`). `fullname` follows `seaweedfs.fullname`, including `fullnameOverride`, `nameOverride`, and DNS-name truncation. Provide this secret alongside the existing CA and client secrets.
|
||||
|
||||
The default `vector.metricsPort: 0` keeps TCP probes. Set `vector.metricsPort: 9329` to serve `/metrics`, `/health`, and `/ready` from the engine; readiness then checks master registration. Images older than 4.54 do not accept the metrics flag, so leave metrics off when pinning `image.tag` or `vector.imageOverride` to one. Enabling `global.seaweedfs.monitoring.enabled` also creates the vector ServiceMonitor. NetworkPolicy includes the configured gRPC and metrics ports.
|
||||
|
||||
|
||||
To provision vector buckets during installation and upgrades, set:
|
||||
|
||||
```yaml
|
||||
vector:
|
||||
enabled: true
|
||||
createBuckets:
|
||||
- embeddings
|
||||
```
|
||||
|
||||
The hook uses the AWS CLI's S3 Vectors API and works with existing SeaweedFS vector releases. It creates missing buckets, preserves existing vector buckets, and fails if the name belongs to an Iceberg bucket. It uses the chart's generated S3 admin credentials, including `s3.credentials.admin.existingSecret`. With a custom `s3.existingConfigSecret` or an external endpoint, set `vector.bucketHook.credentialsSecret` to a Secret containing `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (and optionally `AWS_SESSION_TOKEN`). Key names are configurable. `vector.bucketHook.endpoint` overrides the internal S3 service URL; `caBundleSecret` and `caBundleKey` configure a private HTTPS CA. The hook image and resource limits are configurable under `vector.bucketHook`. For restricted Pod Security, select a non-root-compatible image and configure `vector.bucketHook.podSecurityContext` and `containerSecurityContext`, including `runAsNonRoot` and the image user ID.
|
||||
@@ -3951,6 +3951,970 @@
|
||||
],
|
||||
"title": "Filer Object Size Distribution",
|
||||
"type": "bargauge"
|
||||
},
|
||||
{
|
||||
"type": "row",
|
||||
"title": "S3 Vectors",
|
||||
"collapsed": true,
|
||||
"id": 95,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 139
|
||||
},
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "reqps",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 140
|
||||
},
|
||||
"id": 96,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (type, bucket) (rate(SeaweedFS_s3_request_total{namespace=~\"$NAMESPACE\",type=~\"s3vectors\\\\..*\"}[$__rate_interval]))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{type}} {{bucket}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector API requests by bucket",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "s",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 140
|
||||
},
|
||||
"id": 97,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "histogram_quantile(0.95, sum by (le, bucket) (rate(SeaweedFS_s3_request_seconds_bucket{namespace=~\"$NAMESPACE\",type=\"s3vectors.QueryVectors\"}[$__rate_interval])))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{bucket}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector query p95 latency",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "reqps",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 148
|
||||
},
|
||||
"id": 98,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (type, code) (rate(SeaweedFS_s3_request_total{namespace=~\"$NAMESPACE\",type=~\"s3vectors\\\\..*\",code=~\"[45]..\"}[$__rate_interval]))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{type}} {{code}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector API errors",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "short",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 148
|
||||
},
|
||||
"id": 99,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "last_over_time(SeaweedFS_vector_connected{namespace=~\"$NAMESPACE\"}[5m]) * on (cluster, namespace, instance, job) up{namespace=~\"$NAMESPACE\"}",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{instance}}"
|
||||
}
|
||||
],
|
||||
"title": "Registered vector engines",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "reqps",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 156
|
||||
},
|
||||
"id": 100,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (type, code) (rate(SeaweedFS_vector_request_total{namespace=~\"$NAMESPACE\",code!=\"OK\"}[$__rate_interval]))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{type}} {{code}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector engine request failures",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "short",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 156
|
||||
},
|
||||
"id": 101,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (type) (SeaweedFS_vector_in_flight_requests{namespace=~\"$NAMESPACE\"})",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{type}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector engine requests in flight",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "percentunit",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 164
|
||||
},
|
||||
"id": 102,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "(sum by (cluster, namespace, job, instance) (rate(SeaweedFS_vector_cache_requests_total{namespace=~\"$NAMESPACE\",result=\"hit\"}[$__rate_interval])) or on (cluster, namespace, job, instance) (0 * sum by (cluster, namespace, job, instance) (rate(SeaweedFS_vector_cache_requests_total{namespace=~\"$NAMESPACE\"}[$__rate_interval])))) / sum by (cluster, namespace, job, instance) (rate(SeaweedFS_vector_cache_requests_total{namespace=~\"$NAMESPACE\"}[$__rate_interval]))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{cluster}} {{namespace}} {{instance}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector cache hit ratio",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "bytes",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 164
|
||||
},
|
||||
"id": 103,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "SeaweedFS_vector_cache_bytes{namespace=~\"$NAMESPACE\"}",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{instance}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector cache memory",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "Bps",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 172
|
||||
},
|
||||
"id": 104,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "rate(SeaweedFS_vector_storage_read_bytes_total{namespace=~\"$NAMESPACE\"}[$__rate_interval])",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{instance}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector storage read bandwidth",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"description": "Vector engine metrics require HTTP metrics to be enabled. Gateway bucket labels require vector bucket attribution.",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 4,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"unit": "ops",
|
||||
"unitScale": true
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 172
|
||||
},
|
||||
"id": 105,
|
||||
"links": [],
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "8.1.2",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "sum by (instance) (rate(SeaweedFS_worker_lance_vector_indexes_built_total{namespace=~\"$NAMESPACE\"}[$__rate_interval]))",
|
||||
"range": true,
|
||||
"refId": "A",
|
||||
"legendFormat": "{{instance}}"
|
||||
}
|
||||
],
|
||||
"title": "Vector index maintenance builds",
|
||||
"type": "timeseries"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
@@ -4039,6 +5003,6 @@
|
||||
"timezone": "browser",
|
||||
"title": "SeaweedFS",
|
||||
"uid": "a24009d7-cbda-4443-a132-1cc1c4677304",
|
||||
"version": 1,
|
||||
"version": 2,
|
||||
"weekStart": ""
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if and .Values.vector.enabled .Values.global.seaweedfs.enableSecurity (not .Values.certificates.externalCertificates.enabled)}}
|
||||
apiVersion: cert-manager.io/v1{{ if .Values.global.seaweedfs.certificates.alphacrds }}alpha1{{ end }}
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.fullname" . }}-vector-cert
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name | quote }}
|
||||
app.kubernetes.io/component: vector
|
||||
{{- with include "seaweedfs.commonLabels" $ }}{{ . | nindent 4 }}{{ end }}
|
||||
{{- if .Values.vector.annotations }}
|
||||
annotations:
|
||||
{{- toYaml .Values.vector.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-vector-cert
|
||||
issuerRef:
|
||||
name: {{ include "seaweedfs.fullname" . }}-ca-issuer
|
||||
kind: Issuer
|
||||
commonName: {{ .Values.certificates.commonName }}
|
||||
subject:
|
||||
organizations:
|
||||
- "SeaweedFS CA"
|
||||
dnsNames:
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-vector'
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-vector.{{ include "seaweedfs.namespace" . }}'
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-vector.{{ include "seaweedfs.namespace" . }}.svc'
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-vector.{{ include "seaweedfs.namespace" . }}.svc.cluster.local'
|
||||
{{- if .Values.certificates.dnsNames }}
|
||||
{{- range .Values.certificates.dnsNames }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.certificates.ipAddresses }}
|
||||
ipAddresses:
|
||||
{{- range .Values.certificates.ipAddresses }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
privateKey:
|
||||
algorithm: {{ .Values.certificates.keyAlgorithm }}
|
||||
size: {{ .Values.certificates.keySize }}
|
||||
duration: {{ .Values.certificates.duration }}
|
||||
renewBefore: {{ .Values.certificates.renewBefore }}
|
||||
{{- end }}
|
||||
|
||||
@@ -770,3 +770,15 @@ on install.
|
||||
{{- $context := merge (dict "Values" (omit .Values "commonLabels")) (omit . "Values") -}}
|
||||
{{- include (print .Template.BasePath "/master/master-configmap.yaml") $context | sha256sum -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "seaweedfs.vector.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name | quote }}
|
||||
app.kubernetes.io/component: vector
|
||||
{{- end -}}
|
||||
{{- define "seaweedfs.vector.labels" -}}
|
||||
{{ include "seaweedfs.vector.selectorLabels" . }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
{{- with include "seaweedfs.commonLabels" . }}{{ . | nindent 0 }}{{ end }}
|
||||
{{- end -}}
|
||||
@@ -110,6 +110,18 @@
|
||||
{{- $targets = append $targets (dict "component" "worker" "ports" $ports) }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.vector.enabled }}
|
||||
{{- $ports := list .Values.vector.port }}
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
{{- $ports = append $ports .Values.vector.metricsPort }}
|
||||
{{- end }}
|
||||
{{- $targets = append $targets (dict "component" "vector" "ports" $ports) }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and .Values.vector.enabled .Values.vector.createBuckets }}
|
||||
{{- $targets = append $targets (dict "component" "vector-bucket-hook" "ports" (list)) }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.cosi.enabled }}
|
||||
{{- /* The provisioner sidecar watches the COSI CRs, so it needs the API
|
||||
server; nothing needs to reach the driver itself. */}}
|
||||
@@ -143,7 +155,7 @@
|
||||
every component the chart can produce rather than the ones enabled here,
|
||||
so one values file can still carry overrides for a component this release
|
||||
leaves off. */}}
|
||||
{{- $known := list "master" "filer" "s3" "sftp" "admin" "worker" "volume" "bucket-hook" "volume-resize-hook" "objectstorage-provisioner" "seaweedfs-all-in-one" }}
|
||||
{{- $known := list "vector" "vector-bucket-hook" "master" "filer" "s3" "sftp" "admin" "worker" "volume" "bucket-hook" "volume-resize-hook" "objectstorage-provisioner" "seaweedfs-all-in-one" }}
|
||||
{{- range $vname, $_ := (.Values.volumes | default dict) }}
|
||||
{{- $known = append $known (trimSuffix "-" (printf "volume-%s" $vname)) }}
|
||||
{{- end }}
|
||||
|
||||
@@ -215,8 +215,11 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $createBuckets }}
|
||||
{{- if .ttl }}
|
||||
/bin/echo 'fs.configure -locationPrefix={{ $bucketsFolder }}/{{ .name }}/ -ttl={{ .ttl }} -apply' | /usr/bin/weed shell
|
||||
{{- if not (or (kindIs "invalid" .replication) (and (kindIs "string" .replication) (or (eq .replication "") (regexMatch "^([01][0-9]{2}|2[0-4][0-9]|25[0-5])$" .replication)))) }}
|
||||
{{- fail (printf "createBuckets %s: replication must be a quoted three-digit string from 000 to 255 such as \"001\" (use --set-string)" .name) }}
|
||||
{{- end }}
|
||||
{{- if or .ttl .replication .disk }}
|
||||
/bin/echo 'fs.configure -locationPrefix={{ $bucketsFolder }}/{{ .name }}/{{- with .ttl }} -ttl={{ . }}{{- end }}{{- with .replication }} -replication={{ . }}{{- end }}{{- with .disk }} -disk={{ . }}{{- end }} -apply' | /usr/bin/weed shell
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $createBuckets }}
|
||||
|
||||
@@ -94,6 +94,10 @@ data:
|
||||
cert = "/usr/local/share/ca-certificates/admin/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/admin/tls.key"
|
||||
|
||||
[grpc.vector]
|
||||
cert = "/usr/local/share/ca-certificates/vector/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/vector/tls.key"
|
||||
|
||||
[grpc.worker]
|
||||
cert = "/usr/local/share/ca-certificates/worker/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/worker/tls.key"
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if and .Values.vector.enabled .Values.vector.createBuckets }}
|
||||
{{- $hook := .Values.vector.bucketHook }}
|
||||
{{- $component := "s3" }}
|
||||
{{- $port := .Values.s3.port }}
|
||||
{{- $enabled := .Values.s3.enabled }}
|
||||
{{- $auth := .Values.s3.enableAuth }}
|
||||
{{- $configSecret := .Values.s3.existingConfigSecret }}
|
||||
{{- if and .Values.allInOne.enabled .Values.allInOne.s3.enabled }}
|
||||
{{- $component = "all-in-one" }}
|
||||
{{- $port = .Values.allInOne.s3.port | default .Values.s3.port }}
|
||||
{{- $enabled = true }}
|
||||
{{- $auth = or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }}
|
||||
{{- $configSecret = or .Values.allInOne.s3.existingConfigSecret .Values.s3.existingConfigSecret .Values.filer.s3.existingConfigSecret }}
|
||||
{{- else if and (not $enabled) .Values.filer.s3.enabled }}
|
||||
{{- $component = "filer" }}
|
||||
{{- $port = .Values.filer.s3.port }}
|
||||
{{- $enabled = true }}
|
||||
{{- $auth = .Values.filer.s3.enableAuth }}
|
||||
{{- $configSecret = .Values.filer.s3.existingConfigSecret }}
|
||||
{{- end }}
|
||||
{{- if and (not $enabled) (not $hook.endpoint) }}
|
||||
{{- fail "vector.createBuckets requires an enabled S3 gateway or vector.bucketHook.endpoint" }}
|
||||
{{- end }}
|
||||
{{- range .Values.vector.createBuckets }}
|
||||
{{- if not (kindIs "string" .) }}{{ fail "vector.createBuckets entries must be bucket names" }}{{ end }}
|
||||
{{- if not (and (ge (len .) 3) (le (len .) 63) (regexMatch "^[a-z0-9][a-z0-9-]*[a-z0-9]$" .)) }}
|
||||
{{- fail "vector.createBuckets names must be 3-63 lowercase letters, digits or hyphens" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $credentials := .Values.s3.credentials | default dict }}
|
||||
{{- $admin := $credentials.admin | default dict }}
|
||||
{{- $secret := $hook.credentialsSecret }}
|
||||
{{- $accessKey := $hook.accessKeyKey }}
|
||||
{{- $secretKey := $hook.secretKeyKey }}
|
||||
{{- if and $auth (not $secret) }}
|
||||
{{- if $configSecret }}{{ fail "vector.bucketHook.credentialsSecret is required with s3.existingConfigSecret" }}{{ end }}
|
||||
{{- $secret = $admin.existingSecret | default (printf "%s-s3-secret" (include "seaweedfs.fullname" .)) }}
|
||||
{{- $accessKey = $admin.accessKeyKey | default "admin_access_key_id" }}
|
||||
{{- $secretKey = $admin.secretKeyKey | default "admin_secret_access_key" }}
|
||||
{{- end }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.fullname" . }}-vector-bucket-hook
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name | quote }}
|
||||
app.kubernetes.io/component: vector-bucket-hook
|
||||
{{- with include "seaweedfs.commonLabels" . }}{{ . | nindent 4 }}{{ end }}
|
||||
annotations:
|
||||
helm.sh/hook: post-install,post-upgrade
|
||||
helm.sh/hook-weight: "-5"
|
||||
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
|
||||
spec:
|
||||
backoffLimit: 2
|
||||
activeDeadlineSeconds: 360
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name | quote }}
|
||||
app.kubernetes.io/component: vector-bucket-hook
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
automountServiceAccountToken: false
|
||||
{{- with $hook.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.vector.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.vector.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "seaweedfs.imagePullSecrets" . | nindent 6 }}
|
||||
containers:
|
||||
- name: create-vector-buckets
|
||||
image: {{ $hook.image | quote }}
|
||||
command: ["/bin/sh", "-ec"]
|
||||
args:
|
||||
- |
|
||||
for bucket in {{ range .Values.vector.createBuckets }}{{ . | quote }} {{ end }}; do
|
||||
attempt=0
|
||||
while ! aws --endpoint-url "$S3_ENDPOINT" s3vectors get-vector-bucket --vector-bucket-name "$bucket" >/dev/null 2>/tmp/bucket-error; do
|
||||
if grep -q NotFound /tmp/bucket-error; then
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3vectors create-vector-bucket --vector-bucket-name "$bucket" ||
|
||||
aws --endpoint-url "$S3_ENDPOINT" s3vectors get-vector-bucket --vector-bucket-name "$bucket"
|
||||
break
|
||||
fi
|
||||
if grep -q AccessDenied /tmp/bucket-error; then cat /tmp/bucket-error >&2; exit 1; fi
|
||||
attempt=$((attempt + 1))
|
||||
if [ "$attempt" -ge 60 ]; then cat /tmp/bucket-error >&2; exit 1; fi
|
||||
sleep 5
|
||||
done
|
||||
done
|
||||
env:
|
||||
- name: S3_ENDPOINT
|
||||
value: {{ $hook.endpoint | default (printf "http://%s.%s:%d" (include "seaweedfs.componentName" (list . $component)) (include "seaweedfs.namespace" .) (int $port)) | quote }}
|
||||
- name: AWS_DEFAULT_REGION
|
||||
value: {{ $hook.region | quote }}
|
||||
- name: AWS_EC2_METADATA_DISABLED
|
||||
value: "true"
|
||||
- name: AWS_PAGER
|
||||
value: ""
|
||||
- name: AWS_MAX_ATTEMPTS
|
||||
value: "2"
|
||||
- name: AWS_ACCESS_KEY_ID
|
||||
{{- if $secret }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $secret | quote }}
|
||||
key: {{ $accessKey | quote }}
|
||||
{{- else }}
|
||||
value: seaweedfs
|
||||
{{- end }}
|
||||
- name: AWS_SECRET_ACCESS_KEY
|
||||
{{- if $secret }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $secret | quote }}
|
||||
key: {{ $secretKey | quote }}
|
||||
{{- else }}
|
||||
value: seaweedfs
|
||||
{{- end }}
|
||||
{{- if $hook.credentialsSecret }}
|
||||
- name: AWS_SESSION_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $secret | quote }}
|
||||
key: {{ $hook.sessionTokenKey | quote }}
|
||||
optional: true
|
||||
{{- end }}
|
||||
{{- if $hook.caBundleSecret }}
|
||||
- name: AWS_CA_BUNDLE
|
||||
value: /etc/ssl/vector/ca.crt
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml $hook.containerSecurityContext | nindent 12 }}
|
||||
{{- with $hook.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
{{- if $hook.caBundleSecret }}
|
||||
- name: ca
|
||||
mountPath: /etc/ssl/vector
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
{{- if $hook.caBundleSecret }}
|
||||
- name: ca
|
||||
secret:
|
||||
secretName: {{ $hook.caBundleSecret | quote }}
|
||||
items:
|
||||
- key: {{ $hook.caBundleKey | quote }}
|
||||
path: ca.crt
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,163 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if .Values.vector.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.componentName" (list . "vector") }}
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "seaweedfs.vector.labels" . | nindent 4 }}
|
||||
{{- with .Values.vector.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.vector.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "seaweedfs.vector.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "seaweedfs.vector.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
{{- with .Values.vector.podLabels }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
annotations:
|
||||
{{- with .Values.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
{{- with .Values.vector.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
{{- include "seaweedfs.imagePullSecrets" . | nindent 6 }}
|
||||
automountServiceAccountToken: {{ .Values.global.seaweedfs.automountServiceAccountToken }}
|
||||
{{- with .Values.vector.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.vector.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.vector.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.vector.podSecurityContext (or (not (hasKey .Values.vector.podSecurityContext "enabled")) .Values.vector.podSecurityContext.enabled) }}
|
||||
securityContext:
|
||||
{{- omit .Values.vector.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: vector
|
||||
image: {{ .Values.vector.imageOverride | default (include "seaweedfs.image" .) | quote }}
|
||||
imagePullPolicy: {{ .Values.global.seaweedfs.imagePullPolicy }}
|
||||
{{- $masters := include "seaweedfs.masterServerArg" . }}
|
||||
{{- if .Values.allInOne.enabled }}{{ $masters = include "seaweedfs.cluster.masterAddress" . }}{{ end }}
|
||||
command: ["/bin/sh", "-ec"]
|
||||
args:
|
||||
- 'case "$POD_IP" in *:*) POD_IP="[$POD_IP]";; esac; exec /usr/bin/weed-vector --listen="$POD_IP:{{ .Values.vector.port }}" "$@"'
|
||||
- vector
|
||||
- {{ printf "--masters=%s" (.Values.vector.masters | default $masters) | quote }}
|
||||
- {{ printf "--read-cache-mb=%d" (int .Values.vector.readCacheMB) | quote }}
|
||||
{{- if .Values.filer.filerGroup }}
|
||||
- {{ printf "--filer-group=%s" .Values.filer.filerGroup | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.vector.nprobes }}
|
||||
- {{ printf "--nprobes=%d" (int .Values.vector.nprobes) | quote }}
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- --security-toml=/etc/seaweedfs/security.toml
|
||||
{{- end }}
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
- {{ printf "--metrics-port=%d" (int .Values.vector.metricsPort) | quote }}
|
||||
- --metrics-ip=$(POD_IP)
|
||||
{{- end }}
|
||||
{{- range .Values.vector.extraArgs }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
{{- $env := dict }}
|
||||
{{- include "seaweedfs.mergeExtraEnvironmentVars" (dict "global" .Values.global.seaweedfs "component" .Values.vector "target" $env) }}
|
||||
{{- range $key := keys $env | sortAlpha }}
|
||||
- name: {{ $key }}
|
||||
{{- $value := index $env $key }}
|
||||
{{- if kindIs "map" $value }}
|
||||
valueFrom:
|
||||
{{- toYaml $value | nindent 16 }}
|
||||
{{- else }}
|
||||
value: {{ tpl (toString $value) $ | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: grpc
|
||||
containerPort: {{ .Values.vector.port }}
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.vector.metricsPort }}
|
||||
{{- end }}
|
||||
startupProbe:
|
||||
tcpSocket:
|
||||
port: grpc
|
||||
periodSeconds: 5
|
||||
failureThreshold: 60
|
||||
readinessProbe:
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
httpGet:
|
||||
path: /ready
|
||||
port: metrics
|
||||
{{- else }}
|
||||
tcpSocket:
|
||||
port: grpc
|
||||
{{- end }}
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
httpGet:
|
||||
path: /health
|
||||
port: metrics
|
||||
{{- else }}
|
||||
tcpSocket:
|
||||
port: grpc
|
||||
{{- end }}
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
{{- if or (not (hasKey .Values.vector.containerSecurityContext "enabled")) .Values.vector.containerSecurityContext.enabled }}
|
||||
securityContext:
|
||||
{{- omit .Values.vector.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.vector.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: tmp
|
||||
mountPath: /tmp
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
mountPath: /etc/seaweedfs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
{{- range list "ca" "client" "vector" }}
|
||||
- name: {{ . }}-cert
|
||||
mountPath: /usr/local/share/ca-certificates/{{ . }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: tmp
|
||||
emptyDir: {}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
{{- range list "ca" "client" "vector" }}
|
||||
- name: {{ . }}-cert
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" $ }}-{{ . }}-cert
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if .Values.vector.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.componentName" (list . "vector") }}
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "seaweedfs.vector.labels" . | nindent 4 }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
{{- include "seaweedfs.vector.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
- name: grpc
|
||||
port: {{ .Values.vector.port }}
|
||||
targetPort: grpc
|
||||
{{- if .Values.vector.metricsPort }}
|
||||
- name: metrics
|
||||
port: {{ .Values.vector.metricsPort }}
|
||||
targetPort: metrics
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- if and .Values.vector.enabled .Values.vector.metricsPort .Values.global.seaweedfs.monitoring.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.componentName" (list . "vector") }}
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "seaweedfs.vector.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
{{- with include "seaweedfs.commonLabels" (dict "context" $ "exclude" $.Values.global.seaweedfs.monitoring.additionalLabels) }}{{ . | nindent 4 }}{{ end }}
|
||||
{{- with .Values.global.seaweedfs.monitoring.additionalLabels }}{{ toYaml . | nindent 4 }}{{ end }}
|
||||
{{- with .Values.vector.serviceMonitor.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- port: metrics
|
||||
interval: 30s
|
||||
scrapeTimeout: 5s
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "seaweedfs.vector.selectorLabels" . | nindent 6 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,113 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVectorBucketHook(t *testing.T) {
|
||||
for _, auth := range []bool{false, true} {
|
||||
t.Run(fmt.Sprint(auth), func(t *testing.T) {
|
||||
output, documents := render(t, "s3.enabled=true", "vector.enabled=true", "vector.createBuckets[0]=embeddings", "s3.enableAuth="+fmt.Sprint(auth), "networkPolicy.enabled=true")
|
||||
var found bool
|
||||
for _, document := range documents {
|
||||
metadata := document["metadata"].(map[string]interface{})
|
||||
if document["kind"] == "Job" && strings.HasSuffix(metadata["name"].(string), "-vector-bucket-hook") {
|
||||
found = true
|
||||
if metadata["annotations"].(map[string]interface{})["helm.sh/hook"] != "post-install,post-upgrade" {
|
||||
t.Fatal("missing upgrade hook")
|
||||
}
|
||||
}
|
||||
}
|
||||
if !found || !strings.Contains(output, "s3vectors get-vector-bucket") || !strings.Contains(output, "s3vectors create-vector-bucket") {
|
||||
t.Fatal("missing vector bucket provisioning")
|
||||
}
|
||||
if auth && !strings.Contains(output, "key: \"admin_access_key_id\"") {
|
||||
t.Fatal("missing generated admin credential reference")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorBucketHookRetriesRacesAndRefusesConflicts(t *testing.T) {
|
||||
_, documents := render(t, "s3.enabled=true", "vector.enabled=true", "vector.createBuckets[0]=embeddings")
|
||||
var script string
|
||||
for _, document := range documents {
|
||||
if document["kind"] != "Job" {
|
||||
continue
|
||||
}
|
||||
metadata := document["metadata"].(map[string]interface{})
|
||||
if strings.HasSuffix(metadata["name"].(string), "-vector-bucket-hook") {
|
||||
pod := document["spec"].(map[string]interface{})["template"].(map[string]interface{})["spec"].(map[string]interface{})
|
||||
container := pod["containers"].([]interface{})[0].(map[string]interface{})
|
||||
script = container["args"].([]interface{})[0].(string)
|
||||
}
|
||||
}
|
||||
if script == "" {
|
||||
t.Fatal("missing hook script")
|
||||
}
|
||||
for _, mode := range []string{"missing", "existing", "race", "iceberg", "denied"} {
|
||||
t.Run(mode, func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
stub := `#!/bin/sh
|
||||
shift 2
|
||||
operation=$2
|
||||
case "$operation" in
|
||||
get-vector-bucket)
|
||||
if [ "$BUCKET_MODE" = denied ]; then echo AccessDenied >&2; exit 1; fi
|
||||
if [ "$BUCKET_MODE" = existing ] || { [ -f "$BUCKET_STATE" ] && [ "$BUCKET_MODE" != iceberg ]; }; then exit 0; fi
|
||||
echo NotFoundException >&2; exit 1;;
|
||||
create-vector-bucket)
|
||||
touch "$BUCKET_STATE"
|
||||
if [ "$BUCKET_MODE" = race ] || [ "$BUCKET_MODE" = iceberg ]; then exit 1; fi;;
|
||||
esac
|
||||
`
|
||||
if err := os.WriteFile(filepath.Join(dir, "aws"), []byte(stub), 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
command := exec.Command("sh", "-ec", script)
|
||||
command.Env = append(os.Environ(), "PATH="+dir+":"+os.Getenv("PATH"), "S3_ENDPOINT=http://unused", "BUCKET_MODE="+mode, "BUCKET_STATE="+filepath.Join(dir, "state"))
|
||||
output, err := command.CombinedOutput()
|
||||
wantFailure := mode == "iceberg" || mode == "denied"
|
||||
if (err != nil) != wantFailure {
|
||||
t.Fatalf("mode %s: %v %s", mode, err, output)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorBucketHookRejectsShellNames(t *testing.T) {
|
||||
if _, err := exec.LookPath("helm"); err != nil {
|
||||
t.Skip("helm is not installed")
|
||||
}
|
||||
command := exec.Command("helm", "template", "test", "..", "--set", "s3.enabled=true", "--set", "vector.enabled=true", "--set", "vector.createBuckets[0]=bucket;touch /tmp/invalid")
|
||||
output, err := command.CombinedOutput()
|
||||
if err == nil || !strings.Contains(string(output), "vector.createBuckets names") {
|
||||
t.Fatalf("invalid bucket accepted: %v %s", err, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorBucketHookGatewayModes(t *testing.T) {
|
||||
for _, mode := range []string{"s3", "filer", "allInOne"} {
|
||||
settings := []string{"vector.enabled=true", "vector.createBuckets[0]=embeddings"}
|
||||
component := "s3"
|
||||
switch mode {
|
||||
case "s3":
|
||||
settings = append(settings, "s3.enabled=true", "s3.enableAuth=true")
|
||||
case "filer":
|
||||
settings = append(settings, "s3.enabled=false", "filer.s3.enabled=true", "filer.s3.enableAuth=true")
|
||||
component = "filer"
|
||||
case "allInOne":
|
||||
settings = append(settings, "s3.enabled=false", "allInOne.enabled=true", "allInOne.s3.enabled=true", "allInOne.s3.enableAuth=true")
|
||||
component = "all-in-one"
|
||||
}
|
||||
output, _ := render(t, settings...)
|
||||
if !strings.Contains(output, "http://vector-test-seaweedfs-"+component+".default:8333") || !strings.Contains(output, "key: \"admin_access_key_id\"") {
|
||||
t.Fatalf("missing endpoint or auth for %s", mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"go.yaml.in/yaml/v3"
|
||||
)
|
||||
|
||||
func render(t *testing.T, settings ...string) (string, []map[string]interface{}) {
|
||||
t.Helper()
|
||||
if _, err := exec.LookPath("helm"); err != nil {
|
||||
t.Skip("helm is not installed")
|
||||
}
|
||||
args := []string{"template", "vector-test", ".."}
|
||||
for _, setting := range settings {
|
||||
args = append(args, "--set", setting)
|
||||
}
|
||||
output, err := exec.Command("helm", args...).CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("helm: %v\n%s", err, output)
|
||||
}
|
||||
decoder := yaml.NewDecoder(strings.NewReader(string(output)))
|
||||
var documents []map[string]interface{}
|
||||
for {
|
||||
var document map[string]interface{}
|
||||
if err := decoder.Decode(&document); err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if document != nil {
|
||||
documents = append(documents, document)
|
||||
}
|
||||
}
|
||||
return string(output), documents
|
||||
}
|
||||
|
||||
func TestVectorDeployment(t *testing.T) {
|
||||
_, defaults := render(t)
|
||||
for _, document := range defaults {
|
||||
if strings.HasSuffix(fmt.Sprint(document["metadata"].(map[string]interface{})["name"]), "-vector") {
|
||||
t.Fatal("vector resource enabled by default")
|
||||
}
|
||||
}
|
||||
for _, secure := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("security-%v", secure), func(t *testing.T) {
|
||||
output, documents := render(t, "vector.enabled=true", "vector.metricsPort=9329", "vector.imageOverride=example/metrics-engine:test", "vector.port=8098", "global.seaweedfs.enableSecurity="+fmt.Sprint(secure), "global.seaweedfs.monitoring.enabled=true", "networkPolicy.enabled=true")
|
||||
for _, want := range []string{"--listen=\"$POD_IP:8098\"", "--metrics-port=9329", "path: /ready", "path: /health", "kind: ServiceMonitor"} {
|
||||
if !strings.Contains(output, want) {
|
||||
t.Fatalf("missing %s", want)
|
||||
}
|
||||
}
|
||||
found := false
|
||||
for _, document := range documents {
|
||||
metadata := document["metadata"].(map[string]interface{})
|
||||
if document["kind"] == "Deployment" && strings.HasSuffix(metadata["name"].(string), "-vector") {
|
||||
found = true
|
||||
spec := document["spec"].(map[string]interface{})["template"].(map[string]interface{})["spec"].(map[string]interface{})
|
||||
if spec["nodeSelector"].(map[string]interface{})["kubernetes.io/os"] != "linux" {
|
||||
t.Fatal("vector engine must use Linux image platforms")
|
||||
}
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Fatal("no vector deployment")
|
||||
}
|
||||
if secure && (!strings.Contains(output, "[grpc.vector]") || !strings.Contains(output, "vector-cert")) {
|
||||
t.Fatal("missing vector TLS configuration")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorExistingImagesAndExternalCertificates(t *testing.T) {
|
||||
output, _ := render(t, "vector.enabled=true")
|
||||
start := strings.Index(output, "# Source: seaweedfs/templates/vector/vector-deployment.yaml")
|
||||
deployment := strings.Split(output[start:], "\n---")[0]
|
||||
if strings.Contains(deployment, "--metrics-port") || !strings.Contains(deployment, "tcpSocket:") {
|
||||
t.Fatal("default probes must support existing vector images")
|
||||
}
|
||||
output, _ = render(t, "vector.enabled=true", "global.seaweedfs.enableSecurity=true", "certificates.externalCertificates.enabled=true")
|
||||
if strings.Contains(output, "kind: Certificate") || !strings.Contains(output, "mountPath: /usr/local/share/ca-certificates/vector") {
|
||||
t.Fatal("external vector certificates are not mounted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorIPv6Listen(t *testing.T) {
|
||||
_, docs := render(t, "vector.enabled=true")
|
||||
var args []interface{}
|
||||
for _, doc := range docs {
|
||||
if doc["kind"] != "Deployment" {
|
||||
continue
|
||||
}
|
||||
pod := doc["spec"].(map[string]interface{})["template"].(map[string]interface{})["spec"].(map[string]interface{})
|
||||
c := pod["containers"].([]interface{})[0].(map[string]interface{})
|
||||
if c["name"] == "vector" {
|
||||
args = c["args"].([]interface{})
|
||||
}
|
||||
}
|
||||
for _, ip := range []string{"10.0.0.20", "fd00::20"} {
|
||||
dir := t.TempDir()
|
||||
script := strings.ReplaceAll(args[0].(string), "/usr/bin/weed-vector", "printf '%s\\n'")
|
||||
cmd := exec.Command("sh", "-ec", script, "vector", "--masters=master")
|
||||
cmd.Dir = dir
|
||||
cmd.Env = append(os.Environ(), "POD_IP="+ip)
|
||||
out, err := cmd.CombinedOutput()
|
||||
address := ip
|
||||
if strings.Contains(ip, ":") {
|
||||
address = "[" + ip + "]"
|
||||
}
|
||||
if err != nil || !strings.Contains(string(out), "--listen="+address+":8090") || !strings.Contains(string(out), "--masters=master") {
|
||||
t.Fatalf("%s: %s %v", ip, out, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
func TestVectorAllInOneMasters(t *testing.T) {
|
||||
output, _ := render(t, "vector.enabled=true", "allInOne.enabled=true", "master.enabled=false")
|
||||
if !strings.Contains(output, "--masters=vector-test-seaweedfs-all-in-one.default:9333") {
|
||||
t.Fatal("vector cannot discover all-in-one master")
|
||||
}
|
||||
output, _ = render(t, "vector.enabled=true", "allInOne.enabled=true", "master.enabled=false", "vector.masters=external:9333")
|
||||
if !strings.Contains(output, "--masters=external:9333") {
|
||||
t.Fatal("explicit master override lost")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorNetworkPolicyOverrides(t *testing.T) {
|
||||
output, _ := render(t, "vector.enabled=true", "s3.enabled=true", "vector.createBuckets[0]=embeddings", "networkPolicy.enabled=true", "networkPolicy.components.vector.extraIngress[0].ports[0].port=9329", "networkPolicy.egress.enabled=true", "networkPolicy.components.vector-bucket-hook.extraEgress[0].ports[0].port=443")
|
||||
if !strings.Contains(output, "port: 9329") || !strings.Contains(output, "port: 443") {
|
||||
t.Fatal("vector network overrides missing")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorMetricsDefaultImage(t *testing.T) {
|
||||
output, _ := render(t, "vector.enabled=true", "vector.metricsPort=9329")
|
||||
for _, want := range []string{"--metrics-port=9329", "path: /ready", "path: /health"} {
|
||||
if !strings.Contains(output, want) {
|
||||
t.Fatalf("default image missing %q", want)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1083,12 +1083,16 @@ filer:
|
||||
# You may specify buckets to be created during the install or upgrade process.
|
||||
# Buckets may be exposed publicly by setting `anonymousRead` to `true`
|
||||
# ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d)
|
||||
# replication (e.g., 001) and disk (e.g., ssd) apply to writes into the bucket
|
||||
# removing ttl, replication or disk later keeps the stored rule; set a new value instead
|
||||
# objectLock enables S3 Object Lock (irreversible, forces versioning)
|
||||
# versioning: Enabled or Suspended (or bool true/false)
|
||||
# createBuckets:
|
||||
# - name: bucket-a
|
||||
# anonymousRead: true
|
||||
# ttl: 7d
|
||||
# replication: "001"
|
||||
# disk: ssd
|
||||
# objectLock: true
|
||||
# versioning: Enabled
|
||||
# - name: bucket-b
|
||||
@@ -1165,12 +1169,16 @@ s3:
|
||||
# You may specify buckets to be created during the install or upgrade process.
|
||||
# Buckets may be exposed publicly by setting `anonymousRead` to `true`
|
||||
# ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d)
|
||||
# replication (e.g., 001) and disk (e.g., ssd) apply to writes into the bucket
|
||||
# removing ttl, replication or disk later keeps the stored rule; set a new value instead
|
||||
# objectLock enables S3 Object Lock (irreversible, forces versioning)
|
||||
# versioning: Enabled or Suspended (or bool true/false)
|
||||
# createBuckets:
|
||||
# - name: bucket-a
|
||||
# anonymousRead: true
|
||||
# ttl: 7d
|
||||
# replication: "001"
|
||||
# disk: ssd
|
||||
# objectLock: true
|
||||
# versioning: Enabled
|
||||
# - name: bucket-b
|
||||
@@ -1733,6 +1741,60 @@ admin:
|
||||
serviceMonitor:
|
||||
annotations: {}
|
||||
|
||||
vector:
|
||||
enabled: false
|
||||
imageOverride: null
|
||||
replicas: 1
|
||||
port: 8090
|
||||
metricsPort: 0
|
||||
masters: ""
|
||||
readCacheMB: 512
|
||||
nprobes: null
|
||||
extraArgs: []
|
||||
extraEnvironmentVars: {}
|
||||
podLabels: {}
|
||||
podAnnotations: {}
|
||||
annotations: {}
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
tolerations: []
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/arch
|
||||
operator: In
|
||||
values: [amd64, arm64]
|
||||
resources: {}
|
||||
podSecurityContext: {}
|
||||
containerSecurityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop: [ALL]
|
||||
serviceMonitor:
|
||||
annotations: {}
|
||||
createBuckets: []
|
||||
bucketHook:
|
||||
podSecurityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containerSecurityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities:
|
||||
drop: [ALL]
|
||||
image: amazon/aws-cli:2.39.6
|
||||
endpoint: ""
|
||||
region: us-east-1
|
||||
credentialsSecret: ""
|
||||
accessKeyKey: AWS_ACCESS_KEY_ID
|
||||
secretKeyKey: AWS_SECRET_ACCESS_KEY
|
||||
sessionTokenKey: AWS_SESSION_TOKEN
|
||||
caBundleSecret: ""
|
||||
caBundleKey: tls.crt
|
||||
resources: {}
|
||||
|
||||
worker:
|
||||
enabled: false
|
||||
imageOverride: null
|
||||
@@ -1953,12 +2015,16 @@ allInOne:
|
||||
# You may specify buckets to be created during the install process.
|
||||
# Buckets may be exposed publicly by setting `anonymousRead` to `true`
|
||||
# ttl format: [1-255][m|h|d|w|M|y] (e.g., 7d)
|
||||
# replication (e.g., 001) and disk (e.g., ssd) apply to writes into the bucket
|
||||
# removing ttl, replication or disk later keeps the stored rule; set a new value instead
|
||||
# objectLock enables S3 Object Lock (irreversible, forces versioning)
|
||||
# versioning: Enabled or Suspended (or bool true/false)
|
||||
# createBuckets:
|
||||
# - name: bucket-a
|
||||
# anonymousRead: true
|
||||
# ttl: 7d
|
||||
# replication: "001"
|
||||
# disk: ssd
|
||||
# objectLock: true
|
||||
# versioning: Enabled
|
||||
# - name: bucket-b
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1080" height="650" viewBox="0 0 1080 650" role="img" aria-labelledby="title description">
|
||||
<title id="title">SeaweedFS: one cluster for objects, files, tables, and vectors</title>
|
||||
<desc id="description">S3 object storage, a POSIX file system, table buckets with a built-in Iceberg REST Catalog and Lance namespace, and S3 Vector Buckets share one SeaweedFS storage cluster. Masters coordinate the cluster, filers manage namespaces and metadata, and volume servers store replicated or erasure-coded blobs. Cloud caching, cloud tiering, and cross-cluster replication extend the cluster.</desc>
|
||||
<defs>
|
||||
<marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M 0 0 L 10 5 L 0 10 z" fill="#75928e"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="1080" height="650" rx="20" fill="#f5f9f8"/>
|
||||
<g font-family="Arial, Helvetica, sans-serif">
|
||||
<text x="40" y="43" fill="#0f766e" font-size="15" font-weight="700" letter-spacing="2">SEAWEEDFS</text>
|
||||
<text x="40" y="86" fill="#163832" font-size="32" font-weight="700">One cluster. Objects, files, tables, vectors.</text>
|
||||
|
||||
<!-- Four ways to use the same storage cluster. -->
|
||||
<g>
|
||||
<rect x="40" y="116" width="238" height="184" rx="14" fill="#fff" stroke="#cbded8"/>
|
||||
<g transform="translate(62 136)" fill="none" stroke="#187b67" stroke-width="2.2" stroke-linejoin="round">
|
||||
<path d="m0 10 18-9 18 9-18 9z M0 10v21l18 9 18-9V10 M18 19v21"/>
|
||||
</g>
|
||||
<text x="62" y="207" fill="#163832" font-size="22" font-weight="700">Object storage</text>
|
||||
<text x="62" y="237" fill="#48635e" font-size="18">S3 API</text>
|
||||
<text x="62" y="261" fill="#48635e" font-size="17">Apps, backups, media</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="294" y="116" width="238" height="184" rx="14" fill="#fff" stroke="#cbded8"/>
|
||||
<g transform="translate(316 140)" fill="none" stroke="#2676a3" stroke-width="2.2" stroke-linejoin="round">
|
||||
<path d="M0 7V2h15l6 6h17v27H0V7z M0 12h38"/>
|
||||
</g>
|
||||
<text x="316" y="207" fill="#163832" font-size="22" font-weight="700">File system</text>
|
||||
<text x="316" y="237" fill="#48635e" font-size="18">POSIX / FUSE</text>
|
||||
<text x="316" y="261" fill="#48635e" font-size="17">WebDAV, SFTP, HDFS</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="548" y="116" width="238" height="184" rx="14" fill="#fff" stroke="#cbded8"/>
|
||||
<g transform="translate(570 138)" fill="none" stroke="#7a62ab" stroke-width="2.2" stroke-linejoin="round">
|
||||
<rect x="0" y="0" width="38" height="36" rx="3"/>
|
||||
<path d="M0 12h38 M0 24h38 M13 12v24 M26 12v24"/>
|
||||
</g>
|
||||
<text x="570" y="207" fill="#163832" font-size="22" font-weight="700">Table buckets</text>
|
||||
<text x="570" y="237" fill="#48635e" font-size="18">S3 Tables</text>
|
||||
<text x="570" y="261" fill="#48635e" font-size="17">Iceberg REST Catalog</text>
|
||||
<text x="570" y="285" fill="#48635e" font-size="17">Lance namespace</text>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="802" y="116" width="238" height="184" rx="14" fill="#e4f5ee" stroke="#187b67" stroke-width="1.5"/>
|
||||
<g transform="translate(824 138)" fill="none" stroke="#187b67" stroke-width="2.2">
|
||||
<path d="m5 29 13-22 18 22H5z M18 7v30 M5 29l13 8 18-8"/>
|
||||
<g fill="#e4f5ee">
|
||||
<circle cx="5" cy="29" r="4"/>
|
||||
<circle cx="18" cy="7" r="4"/>
|
||||
<circle cx="36" cy="29" r="4"/>
|
||||
<circle cx="18" cy="37" r="4"/>
|
||||
</g>
|
||||
</g>
|
||||
<text x="824" y="207" fill="#163832" font-size="22" font-weight="700">Vector buckets</text>
|
||||
<text x="824" y="237" fill="#266354" font-size="18">S3 Vectors</text>
|
||||
<text x="824" y="261" fill="#266354" font-size="17">Search, RAG, embeddings</text>
|
||||
</g>
|
||||
|
||||
<!-- A shared connection expresses capabilities, not request routing. -->
|
||||
<path d="M159 300v28h762v-28 M413 300v28 M667 300v28 M540 328v30" fill="none" stroke="#75928e" stroke-width="2" marker-end="url(#arrow)"/>
|
||||
<rect x="40" y="362" width="1000" height="174" rx="16" fill="#163e35"/>
|
||||
<text x="540" y="400" text-anchor="middle" fill="#fff" font-size="25" font-weight="700">One shared storage cluster</text>
|
||||
<g fill="#fff" font-size="20" font-weight="700" text-anchor="middle">
|
||||
<text x="213" y="445">Masters</text>
|
||||
<text x="540" y="445">Filers</text>
|
||||
<text x="867" y="445">Volume servers</text>
|
||||
</g>
|
||||
<path d="M376 425v51 M704 425v51" stroke="#497266"/>
|
||||
<g fill="#cfe4dc" font-size="17" text-anchor="middle">
|
||||
<text x="213" y="473">Coordination & placement</text>
|
||||
<text x="540" y="473">Namespaces & metadata</text>
|
||||
<text x="867" y="473">Replicated or erasure-coded blobs</text>
|
||||
</g>
|
||||
<text x="540" y="511" text-anchor="middle" fill="#cfe4dc" font-size="17">Add volume servers to grow capacity</text>
|
||||
|
||||
<path d="M284 536v23 M796 536v23" stroke="#75928e" stroke-width="2" stroke-dasharray="5 5"/>
|
||||
<rect x="40" y="560" width="488" height="58" rx="12" fill="#fff" stroke="#cbded8"/>
|
||||
<rect x="552" y="560" width="488" height="58" rx="12" fill="#fff" stroke="#cbded8"/>
|
||||
<text x="284" y="596" text-anchor="middle" fill="#305c50" font-size="19">Cloud caching & tiering</text>
|
||||
<text x="796" y="596" text-anchor="middle" fill="#305c50" font-size="19">Cross-cluster replication</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.3 KiB |
@@ -45,6 +45,8 @@ Rule of thumb: start with 3 masters, then grow volume servers with data.
|
||||
- Metadata store options: PostgreSQL, MySQL, Redis, Cassandra, TiKV, etc.
|
||||
- Run **3 filers** for HA
|
||||
- Filers are stateless relative to each other — state lives in the DB
|
||||
- No quorum among filers: 2 already survive one failure; the third keeps a spare while one is down for upgrades
|
||||
- Give clients every filer address (e.g. `-filer=f1:8888,f2:8888,f3:8888`) or a load balancer that forwards both the HTTP and gRPC ports (8888 and 18888)
|
||||
|
||||
**S3 Servers**
|
||||
|
||||
@@ -77,7 +79,7 @@ Keeps housekeeping off the hot path.
|
||||
|----------------|----------------------|-----------------------------------|
|
||||
| Master | 3 | Raft quorum, topology, volume map |
|
||||
| Volume Server | N (scale out) | Stores data needles |
|
||||
| Filer | 3 | Metadata gateway |
|
||||
| Filer | 3 (2 minimum) | Metadata gateway, no quorum |
|
||||
| Metadata DB | HA cluster | Persists filer metadata |
|
||||
| S3 Server | N (by throughput) | S3 API frontend |
|
||||
| Admin | 1 | Background job coordinator |
|
||||
|
||||
+1055
-1048
File diff suppressed because it is too large.
Load diff
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
@@ -286,6 +286,7 @@ message WriteCondition {
|
||||
IF_EXTENDED_TIME_ELAPSED = 8; // fail if present and extended[ext_key] (unix seconds) is in the future
|
||||
IF_CHUNKS_EQUAL = 9; // fail unless the stored chunk fid multiset equals fids (absent entry = no chunks)
|
||||
IF_ENTRY_EQUAL = 10; // fail unless the stored entry equals expected_entry
|
||||
IF_OBJECT_EXISTS = 11; // fail if absent or a plain directory, one holding no object of its own (If-Match: * on a null version)
|
||||
}
|
||||
// Clause is one primitive comparison. IF_ETAG_MATCH holds when the current
|
||||
// entry's ETag equals any value in etags; IF_ETAG_NOT_MATCH holds when it
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Generated
+17
@@ -6684,6 +6684,19 @@ dependencies = [
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tonic-health"
|
||||
version = "0.14.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcfab99db777fba2802f0dfa861d1628d1ae916fb199d29819941f139ae85082"
|
||||
dependencies = [
|
||||
"prost",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tonic",
|
||||
"tonic-prost",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tonic-prost"
|
||||
version = "0.14.6"
|
||||
@@ -7217,6 +7230,7 @@ dependencies = [
|
||||
"arrow-cast",
|
||||
"arrow-schema",
|
||||
"async-trait",
|
||||
"axum",
|
||||
"bytes",
|
||||
"clap",
|
||||
"futures",
|
||||
@@ -7225,6 +7239,7 @@ dependencies = [
|
||||
"lance-linalg",
|
||||
"moka",
|
||||
"object_store",
|
||||
"prometheus",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"protoc-bin-vendored",
|
||||
@@ -7236,10 +7251,12 @@ dependencies = [
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tonic",
|
||||
"tonic-health",
|
||||
"tonic-prost",
|
||||
"tonic-prost-build",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
"weed-lance-worker",
|
||||
"weed-vector-core",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# SeaweedFS vector engine
|
||||
|
||||
`weed-vector` serves the S3 Vectors data plane through the S3 gateway. Indexes use Lance tables on the cluster's filers and volume servers. Go and Rust volume servers use the same engine and API.
|
||||
|
||||
With a local `weed mini` cluster running:
|
||||
|
||||
```sh
|
||||
weed-vector --masters=localhost:9333 --metrics-port=9329
|
||||
```
|
||||
|
||||
Point an AWS S3 Vectors client at the S3 endpoint, normally `http://localhost:8333`. The engine registers with the masters automatically. `--listen` defaults to `127.0.0.1:8090`; use an address reachable from the gateway when running on another host or in a container.
|
||||
|
||||
| Setting | Default | Purpose |
|
||||
| --- | --- | --- |
|
||||
| `--masters` | Required | Comma-separated master addresses |
|
||||
| `--listen` | `127.0.0.1:8090` | gRPC listener and registered address |
|
||||
| `--filer-group` | Empty | Filer group used for table storage |
|
||||
| `--read-cache-mb` | `512` | Immutable data/index read cache; zero disables it |
|
||||
| `--nprobes` | Automatic | ANN partitions searched per query |
|
||||
| `--metrics-port` | `0` | HTTP metrics and health listener; zero disables it |
|
||||
| `--metrics-ip` | `127.0.0.1` | HTTP listener address |
|
||||
| `--security-toml` | Discovered | Cluster certificates, signing keys and encryption keys |
|
||||
|
||||
The HTTP listener provides `/health`, `/ready`, and `/metrics`. Readiness requires an active registration with the master. The gRPC listener also implements the standard health service for `vector_pb.VectorService` and the whole server. These health statuses follow master registration.
|
||||
|
||||
Metrics use the `SeaweedFS_vector_` prefix:
|
||||
|
||||
- `connected`: active master registration.
|
||||
- `request_total{type,code}`, `request_seconds{type}`, and `in_flight_requests{type}`: engine requests and their gRPC outcomes.
|
||||
- `query_results_total`: vectors returned by queries.
|
||||
- `cache_requests_total{result}`, `cache_bytes`, and `cache_entries`: immutable read cache activity and occupancy.
|
||||
- `storage_read_bytes_total` and `storage_read_seconds`: storage fetches for cacheable immutable reads.
|
||||
|
||||
The S3 gateway separately publishes `SeaweedFS_s3_` request metrics with `type="s3vectors.<Operation>"`. Scrape both processes to distinguish gateway latency from engine work. Metrics and HTTP probes are unauthenticated; bind them to an internal address or restrict their network access.
|
||||
|
||||
For mutual TLS, configure `[grpc.vector]` for the engine's server certificate, `[grpc.client]` for its master/filer connections, and the cluster CA. HTTPS volume reads also use `[https.client]`. The engine follows the same signing and encryption configuration as the other cluster clients.
|
||||
|
||||
Run the Lance maintenance worker against the same masters and Lance namespace to build and update ANN indexes. Queries can scan data that has not been indexed yet. See the [maintenance worker documentation](../seaweed-worker/README.md) and [Helm chart](../k8s/charts/seaweedfs/README.md) for deployment settings.
|
||||
|
||||
The integration suite at `test/s3vectors` runs the same API and observability checks against both Go and Rust volume servers, including mutual TLS, signed volume reads, and encrypted volume data.
|
||||
@@ -170,7 +170,7 @@ async fn open_dataset(
|
||||
storage_options: Default::default(),
|
||||
managed_versioning: false,
|
||||
};
|
||||
return dataset::open_at(&description, storage.wrapper(id).await?).await;
|
||||
return dataset::open_at(&description, storage.wrapper(id).await?, None).await;
|
||||
}
|
||||
let table = dataset::open(client, &parse_id(id), storage).await?;
|
||||
Ok(table.dataset)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//! and version tags act as the lease maintenance must respect.
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::{LazyLock, Mutex};
|
||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
use std::sync::{Arc, LazyLock, Mutex, Weak};
|
||||
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
|
||||
|
||||
use anyhow::Result;
|
||||
use lance::Dataset;
|
||||
@@ -21,6 +21,11 @@ const FOREIGN_TTL: Duration = Duration::from_secs(24 * 3600);
|
||||
/// Expired-lease scans run at most once per interval per dataset, not per
|
||||
/// request.
|
||||
const REAP_INTERVAL: Duration = Duration::from_secs(60);
|
||||
/// How long a shared lease stays after the last read that took it.
|
||||
const SHARED_LINGER: Duration = Duration::from_secs(10);
|
||||
/// A shared lease is handed out for this long after it was taken, then
|
||||
/// replaced, so a busy version's tag never ages into a reaper's TTL.
|
||||
const SHARED_FOR: Duration = Duration::from_secs(300);
|
||||
/// A process-unique owner id embedded in lease tags so a reaper only applies
|
||||
/// the short TTL to its own leases.
|
||||
static INSTANCE: LazyLock<String> = LazyLock::new(|| Uuid::new_v4().simple().to_string());
|
||||
@@ -138,6 +143,106 @@ fn untrack(tag: &str) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Leases that reads of one version share: the first read tags the version,
|
||||
/// reads that follow reuse the tag, and the tag goes once no read has taken it
|
||||
/// for [`SHARED_LINGER`]. Spares a tag write and delete per read.
|
||||
pub struct SharedLeases {
|
||||
/// By location, version, manifest ETag and commit time: a table dropped
|
||||
/// and created again at its location reuses version numbers, not
|
||||
/// manifests. A rename commit leaves no ETag.
|
||||
held: Mutex<Held>,
|
||||
linger: Duration,
|
||||
share_for: Duration,
|
||||
}
|
||||
|
||||
type LeaseKey = (String, u64, Option<String>, u128);
|
||||
|
||||
#[derive(Default)]
|
||||
struct Held {
|
||||
slots: HashMap<LeaseKey, Slot>,
|
||||
/// Slots are pruned once they reach this many, so a lookup does not
|
||||
/// scan them all.
|
||||
prune_at: usize,
|
||||
}
|
||||
/// Reads of a version that find no lease wait here for the first to take it.
|
||||
type Slot = Arc<tokio::sync::Mutex<Weak<SharedLease>>>;
|
||||
|
||||
impl Default for SharedLeases {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
held: Mutex::default(),
|
||||
linger: SHARED_LINGER,
|
||||
share_for: SHARED_FOR,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A lease held for as long as any read, or the linger after the last one,
|
||||
/// keeps it.
|
||||
pub struct SharedLease {
|
||||
_lease: Lease,
|
||||
taken: Instant,
|
||||
}
|
||||
|
||||
impl SharedLeases {
|
||||
/// [`try_pin`], reusing a lease another read of this version holds.
|
||||
pub async fn try_pin(&self, dataset: &Dataset) -> Result<Option<Arc<SharedLease>>> {
|
||||
let key = (
|
||||
dataset.uri().to_string(),
|
||||
dataset.version().version,
|
||||
dataset.manifest_location().e_tag.clone(),
|
||||
dataset.manifest().timestamp_nanos,
|
||||
);
|
||||
let slot = match self.held.lock() {
|
||||
Ok(mut held) => {
|
||||
if held.slots.len() >= held.prune_at {
|
||||
// A slot another read has taken but not yet locked stays.
|
||||
held.slots.retain(|_, slot| {
|
||||
Arc::strong_count(slot) > 1
|
||||
|| slot
|
||||
.try_lock()
|
||||
.map_or(true, |lease| lease.strong_count() > 0)
|
||||
});
|
||||
held.prune_at = (2 * held.slots.len()).max(64);
|
||||
// A burst's allocation would otherwise make every later
|
||||
// prune scan it.
|
||||
let capacity = held.prune_at;
|
||||
held.slots.shrink_to(capacity);
|
||||
}
|
||||
held.slots.entry(key).or_default().clone()
|
||||
}
|
||||
Err(_) => Slot::default(),
|
||||
};
|
||||
let mut slot = slot.lock().await;
|
||||
let lease = match slot
|
||||
.upgrade()
|
||||
.filter(|lease| lease.taken.elapsed() < self.share_for)
|
||||
{
|
||||
Some(lease) => lease,
|
||||
None => {
|
||||
let Some(lease) = try_pin(dataset).await? else {
|
||||
return Ok(None);
|
||||
};
|
||||
let lease = Arc::new(SharedLease {
|
||||
_lease: lease,
|
||||
taken: Instant::now(),
|
||||
});
|
||||
*slot = Arc::downgrade(&lease);
|
||||
lease
|
||||
}
|
||||
};
|
||||
drop(slot);
|
||||
if let Ok(handle) = tokio::runtime::Handle::try_current() {
|
||||
let (lingering, linger) = (lease.clone(), self.linger);
|
||||
handle.spawn(async move {
|
||||
tokio::time::sleep(linger).await;
|
||||
drop(lingering);
|
||||
});
|
||||
}
|
||||
Ok(Some(lease))
|
||||
}
|
||||
}
|
||||
|
||||
/// Drop lease tags whose owner never released them, so an abandoned lease
|
||||
/// cannot keep a version out of cleanup forever.
|
||||
async fn reap_expired(dataset: &Dataset, now: u128) {
|
||||
@@ -324,6 +429,131 @@ mod tests {
|
||||
b.release().await.unwrap();
|
||||
}
|
||||
|
||||
/// Reads of one version share a tag, another version gets its own, and
|
||||
/// the tags go once the linger after the last read has passed.
|
||||
#[tokio::test]
|
||||
async fn reads_of_a_version_share_one_lease() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let mut dataset =
|
||||
testing::write_dataset(&dir, &testing::vectors(4, 4), &["a", "b", "c", "d"]).await;
|
||||
let leases = SharedLeases {
|
||||
linger: Duration::from_millis(50),
|
||||
..Default::default()
|
||||
};
|
||||
let a = leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
let b = leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
assert!(Arc::ptr_eq(&a, &b));
|
||||
assert_eq!(dataset.tags().list().await.unwrap().len(), 1);
|
||||
|
||||
testing::append_dataset(&mut dataset, &testing::vectors(1, 4), &["e"]).await;
|
||||
let c = leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
assert!(!Arc::ptr_eq(&a, &c));
|
||||
assert_eq!(dataset.tags().list().await.unwrap().len(), 2);
|
||||
|
||||
drop((a, b, c));
|
||||
tokio::time::sleep(leases.linger).await;
|
||||
let mut left = usize::MAX;
|
||||
for _ in 0..1000 {
|
||||
// A listing that meets a tag as it is deleted fails; try again.
|
||||
if let Ok(tags) = dataset.tags().list().await {
|
||||
left = tags.len();
|
||||
}
|
||||
if left == 0 {
|
||||
break;
|
||||
}
|
||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||
}
|
||||
assert_eq!(left, 0);
|
||||
}
|
||||
|
||||
/// Reads that arrive together, before any lease exists, share the one the
|
||||
/// first takes.
|
||||
#[tokio::test]
|
||||
async fn concurrent_reads_take_one_lease() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset =
|
||||
testing::write_dataset(&dir, &testing::vectors(4, 4), &["a", "b", "c", "d"]).await;
|
||||
let leases = SharedLeases::default();
|
||||
let pins: Vec<_> = futures::future::join_all((0..8).map(|_| leases.try_pin(&dataset)))
|
||||
.await
|
||||
.into_iter()
|
||||
.map(|lease| lease.unwrap().unwrap())
|
||||
.collect();
|
||||
assert!(pins.iter().all(|lease| Arc::ptr_eq(lease, &pins[0])));
|
||||
assert_eq!(dataset.tags().list().await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
/// A table dropped and written again at its location gets its own lease
|
||||
/// for a version number the old table had.
|
||||
#[tokio::test]
|
||||
async fn a_recreated_table_takes_its_own_lease() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let rows = testing::vectors(4, 4);
|
||||
let old = testing::write_dataset(&dir, &rows, &["a", "b", "c", "d"]).await;
|
||||
let leases = SharedLeases::default();
|
||||
let first = leases.try_pin(&old).await.unwrap().unwrap();
|
||||
std::fs::remove_dir_all(dir.path()).unwrap();
|
||||
let new = testing::write_dataset(&dir, &rows, &["e", "f", "g", "h"]).await;
|
||||
assert_eq!(new.version().version, old.version().version);
|
||||
let second = leases.try_pin(&new).await.unwrap().unwrap();
|
||||
assert!(!Arc::ptr_eq(&first, &second));
|
||||
assert_eq!(new.tags().list().await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
/// Slots of released leases are pruned as new versions come in.
|
||||
#[tokio::test]
|
||||
async fn released_lease_slots_are_pruned() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let mut dataset = testing::write_dataset(&dir, &testing::vectors(1, 4), &["a"]).await;
|
||||
let leases = SharedLeases {
|
||||
linger: Duration::ZERO,
|
||||
..Default::default()
|
||||
};
|
||||
for _ in 0..200 {
|
||||
drop(leases.try_pin(&dataset).await.unwrap());
|
||||
tokio::task::yield_now().await;
|
||||
testing::append_dataset(&mut dataset, &testing::vectors(1, 4), &["b"]).await;
|
||||
}
|
||||
assert!(leases.held.lock().unwrap().slots.len() <= 128);
|
||||
}
|
||||
|
||||
/// A slot a read has taken but not yet locked survives a prune, so that
|
||||
/// read and the next share the lease.
|
||||
#[tokio::test]
|
||||
async fn a_taken_slot_survives_a_prune() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset = testing::write_dataset(&dir, &testing::vectors(1, 4), &["a"]).await;
|
||||
let leases = SharedLeases::default();
|
||||
let key: LeaseKey = ("elsewhere".into(), 1, None, 0);
|
||||
let taken = {
|
||||
let mut held = leases.held.lock().unwrap();
|
||||
held.prune_at = 0;
|
||||
held.slots.entry(key.clone()).or_default().clone()
|
||||
};
|
||||
leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
assert!(Arc::ptr_eq(
|
||||
&leases.held.lock().unwrap().slots[&key],
|
||||
&taken
|
||||
));
|
||||
}
|
||||
|
||||
/// A shared lease is not handed out past SHARED_FOR, so a busy version
|
||||
/// moves to a fresh tag.
|
||||
#[tokio::test]
|
||||
async fn a_shared_lease_is_replaced_when_old() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset =
|
||||
testing::write_dataset(&dir, &testing::vectors(4, 4), &["a", "b", "c", "d"]).await;
|
||||
let leases = SharedLeases {
|
||||
share_for: Duration::from_millis(50),
|
||||
..Default::default()
|
||||
};
|
||||
let a = leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
tokio::time::sleep(leases.share_for).await;
|
||||
let b = leases.try_pin(&dataset).await.unwrap().unwrap();
|
||||
assert!(!Arc::ptr_eq(&a, &b));
|
||||
}
|
||||
|
||||
/// A stale lease tag left behind is reaped by the next pin; a stale-named
|
||||
/// tag this process still holds is not.
|
||||
#[tokio::test]
|
||||
|
||||
@@ -13,6 +13,9 @@ name = "weed-vector"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
axum = "0.8"
|
||||
prometheus = { version = "0.13", default-features = false }
|
||||
tonic-health = "0.14"
|
||||
weed-vector-core = { path = "../core" }
|
||||
weed-lance-worker = { path = "../../../seaweed-worker/crates/lance" }
|
||||
sw-client = { path = "../../../seaweed-worker/crates/sw-client" }
|
||||
@@ -33,6 +36,7 @@ bytes = "1"
|
||||
clap = { version = "4", features = ["derive", "env"] }
|
||||
futures = "0.3"
|
||||
moka = { version = "0.12", features = ["sync"] }
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
object_store = { version = "0.13", features = ["aws"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//! The VectorService gRPC server the S3 gateway talks to.
|
||||
|
||||
pub mod metrics;
|
||||
pub mod observed;
|
||||
pub mod read_cache;
|
||||
pub mod service;
|
||||
|
||||
|
||||
@@ -5,12 +5,16 @@ use clap::Parser;
|
||||
use tokio_stream::wrappers::TcpListenerStream;
|
||||
use tonic::transport::Server;
|
||||
use weed_lance_worker::cluster::Cluster;
|
||||
use weed_vector_server::master_client;
|
||||
use weed_vector_server::pb::vector::vector_service_server::VectorServiceServer;
|
||||
use weed_vector_server::read_cache::ReadCache;
|
||||
use weed_vector_server::security::Security;
|
||||
use weed_vector_server::service::VectorServer;
|
||||
use weed_vector_server::tls::{self, ServerTls};
|
||||
use weed_vector_server::{
|
||||
master_client,
|
||||
metrics::{self, Metrics},
|
||||
observed::ObservedService,
|
||||
};
|
||||
|
||||
/// The VectorService the S3 gateway fans vector calls out to.
|
||||
#[derive(Parser)]
|
||||
@@ -18,6 +22,9 @@ struct Args {
|
||||
/// gRPC listen address.
|
||||
#[arg(long, env = "WEED_VECTOR_LISTEN", default_value = "127.0.0.1:8090")]
|
||||
listen: String,
|
||||
/// Address to register when it differs from the listen address.
|
||||
#[arg(long, env = "WEED_VECTOR_ADVERTISE")]
|
||||
advertise: Option<String>,
|
||||
/// Comma-separated master addresses. The engine registers with them, so
|
||||
/// the gateway finds it, and asks them for the filers it keeps tables
|
||||
/// through.
|
||||
@@ -34,6 +41,13 @@ struct Args {
|
||||
/// Memory for caching reads of write-once table files, in MiB; 0 disables.
|
||||
#[arg(long, env = "WEED_VECTOR_READ_CACHE_MB", default_value_t = 512)]
|
||||
read_cache_mb: u64,
|
||||
/// Memory for indexes loaded by queries, kept for the next query, in MiB.
|
||||
#[arg(long, env = "WEED_VECTOR_INDEX_CACHE_MB", default_value_t = 1024)]
|
||||
index_cache_mb: usize,
|
||||
/// Memory for table metadata (manifests, file footers) kept across
|
||||
/// queries, in MiB.
|
||||
#[arg(long, env = "WEED_VECTOR_METADATA_CACHE_MB", default_value_t = 256)]
|
||||
metadata_cache_mb: usize,
|
||||
/// Partitions each query probes in a table's vector index. Default: a
|
||||
/// tenth of the index's partitions, at least 8; more under a filter.
|
||||
#[arg(long, env = "WEED_VECTOR_NPROBES")]
|
||||
@@ -45,6 +59,21 @@ struct Args {
|
||||
/// processes find in -config_dir, ., ~/.seaweedfs and /etc/seaweedfs.
|
||||
#[arg(long, env = "WEED_VECTOR_SECURITY_TOML")]
|
||||
security_toml: Option<PathBuf>,
|
||||
#[arg(
|
||||
long,
|
||||
alias = "metricsPort",
|
||||
env = "WEED_VECTOR_METRICS_PORT",
|
||||
default_value_t = 0
|
||||
)]
|
||||
metrics_port: u16,
|
||||
#[arg(
|
||||
long,
|
||||
alias = "metricsIp",
|
||||
env = "WEED_VECTOR_METRICS_IP",
|
||||
default_value = "127.0.0.1"
|
||||
)]
|
||||
metrics_ip: String,
|
||||
|
||||
/// The directory weed's -config_dir names, searched for security.toml
|
||||
/// first.
|
||||
#[arg(long, alias = "config_dir", env = "WEED_VECTOR_CONFIG_DIR")]
|
||||
@@ -78,7 +107,13 @@ fn normalize_args(args: Vec<String>) -> Vec<String> {
|
||||
|
||||
/// A wildcard listen address is not reachable for peers; derive the outbound
|
||||
/// IP toward the first master instead — the address the master sees anyway.
|
||||
fn advertised_addr(listen: &str, masters: &[String]) -> String {
|
||||
fn advertised_addr(listen: &str, masters: &[String], advertise: Option<&str>) -> String {
|
||||
if let Some(address) = advertise
|
||||
.map(str::trim)
|
||||
.filter(|address| !address.is_empty())
|
||||
{
|
||||
return address.to_string();
|
||||
}
|
||||
let Some((host, _)) = listen.rsplit_once(':') else {
|
||||
return listen.to_string();
|
||||
};
|
||||
@@ -128,11 +163,32 @@ async fn main() -> Result<()> {
|
||||
.with_context(|| format!("listen on {}", args.listen))?;
|
||||
let cluster = Cluster::new(&args.masters, &args.filer_group, &security)?;
|
||||
let reads = cluster.storage(&security).await?;
|
||||
let (health, health_service) = tonic_health::server::health_reporter();
|
||||
let metrics = Metrics::new()?.with_health(health);
|
||||
metrics.set_connected(false).await;
|
||||
let cache = (args.read_cache_mb > 0)
|
||||
.then(|| ReadCache::new(args.read_cache_mb << 20).with_metrics(metrics.clone()));
|
||||
let mut service = VectorServer::new()
|
||||
.with_nprobes(args.nprobes.map(std::num::NonZeroUsize::get))
|
||||
.with_lance_caches(args.index_cache_mb << 20, args.metadata_cache_mb << 20)
|
||||
.with_storage(reads);
|
||||
if args.read_cache_mb > 0 {
|
||||
service = service.with_read_cache(ReadCache::new(args.read_cache_mb << 20));
|
||||
if let Some(cache) = &cache {
|
||||
service = service.with_read_cache(cache.clone());
|
||||
}
|
||||
if args.metrics_port > 0 {
|
||||
let ip = args
|
||||
.metrics_ip
|
||||
.trim_start_matches('[')
|
||||
.trim_end_matches(']')
|
||||
.parse::<std::net::IpAddr>()?;
|
||||
let listener =
|
||||
tokio::net::TcpListener::bind(std::net::SocketAddr::new(ip, args.metrics_port)).await?;
|
||||
let metrics = metrics.clone();
|
||||
tokio::spawn(async move {
|
||||
if let Err(error) = metrics::serve_listener(metrics, listener, cache).await {
|
||||
tracing::error!(%error, "vector metrics server stopped");
|
||||
}
|
||||
});
|
||||
}
|
||||
tracing::info!(
|
||||
listen = %args.listen,
|
||||
@@ -148,19 +204,26 @@ async fn main() -> Result<()> {
|
||||
);
|
||||
// Registered only now, with storage connected and the listener bound,
|
||||
// so the gateway never finds an engine that cannot serve yet.
|
||||
let advertise = advertised_addr(&args.listen, &cluster.masters);
|
||||
let advertise = advertised_addr(&args.listen, &cluster.masters, args.advertise.as_deref());
|
||||
tokio::spawn(master_client::keep_connected(
|
||||
cluster.masters.clone(),
|
||||
advertise,
|
||||
args.filer_group.clone(),
|
||||
args.metrics_port,
|
||||
cluster.master_tls.clone(),
|
||||
metrics.clone(),
|
||||
));
|
||||
let router = Server::builder()
|
||||
.add_service(health_service)
|
||||
// Match the gateway's 1 GiB cap — put batches over the tonic 4 MiB
|
||||
// default otherwise get rejected before they reach the handler.
|
||||
.add_service(
|
||||
VectorServiceServer::new(service)
|
||||
.max_decoding_message_size(1 << 30)
|
||||
.max_encoding_message_size(1 << 30),
|
||||
VectorServiceServer::new(ObservedService {
|
||||
inner: service,
|
||||
metrics,
|
||||
})
|
||||
.max_decoding_message_size(1 << 30)
|
||||
.max_encoding_message_size(1 << 30),
|
||||
);
|
||||
match server_tls {
|
||||
Some(tls) => {
|
||||
@@ -180,6 +243,20 @@ async fn main() -> Result<()> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn an_empty_advertise_uses_the_listen_address() {
|
||||
for value in [None, Some(""), Some(" ")] {
|
||||
assert_eq!(
|
||||
advertised_addr("127.0.0.1:8090", &[], value),
|
||||
"127.0.0.1:8090"
|
||||
);
|
||||
}
|
||||
assert_eq!(
|
||||
advertised_addr("127.0.0.1:8090", &[], Some("vector.example:8090")),
|
||||
"vector.example:8090"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nprobes_must_be_positive() {
|
||||
let parse = |nprobes: &str| {
|
||||
|
||||
@@ -8,20 +8,22 @@ use std::time::Duration;
|
||||
use anyhow::{Context, Result};
|
||||
use tokio::time::sleep;
|
||||
|
||||
use crate::master_pb::{KeepConnectedRequest, seaweed_client::SeaweedClient};
|
||||
use crate::master_pb::{
|
||||
KeepConnectedRequest, ListClusterNodesRequest, seaweed_client::SeaweedClient,
|
||||
};
|
||||
use crate::security::GrpcTls;
|
||||
pub use weed_lance_worker::cluster::{CONNECT_TIMEOUT, connect, grpc_addr};
|
||||
|
||||
fn registration(client_addr: &str) -> KeepConnectedRequest {
|
||||
fn registration(client_addr: &str, filer_group: &str, metrics_port: u16) -> KeepConnectedRequest {
|
||||
KeepConnectedRequest {
|
||||
client_type: "vector".into(),
|
||||
client_address: client_addr.into(),
|
||||
version: env!("CARGO_PKG_VERSION").into(),
|
||||
filer_group: String::new(),
|
||||
filer_group: filer_group.into(),
|
||||
data_center: String::new(),
|
||||
rack: String::new(),
|
||||
leave_lock_ring: false,
|
||||
..Default::default()
|
||||
metrics_port: metrics_port.into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,12 +41,22 @@ fn http_addr(master: &str) -> String {
|
||||
|
||||
/// Retry forever: try each master until a stream opens, hold it until it
|
||||
/// errors, then rediscover — same shape as wdclient.KeepConnectedToMaster.
|
||||
pub async fn keep_connected(masters: Vec<String>, client_addr: String, tls: Option<GrpcTls>) {
|
||||
let client_addr = client_addr.as_str();
|
||||
pub async fn keep_connected(
|
||||
masters: Vec<String>,
|
||||
client_addr: String,
|
||||
filer_group: String,
|
||||
metrics_port: u16,
|
||||
tls: Option<GrpcTls>,
|
||||
metrics: crate::metrics::Metrics,
|
||||
) {
|
||||
let registration = ®istration(&client_addr, &filer_group, metrics_port);
|
||||
let tls = tls.as_ref();
|
||||
let metrics = &metrics;
|
||||
loop {
|
||||
try_all_masters(&masters, |master| async move {
|
||||
stream_to(&master, client_addr, tls).await
|
||||
let result = stream_to(&master, registration, tls, Some(&metrics)).await;
|
||||
metrics.set_connected(false).await;
|
||||
result
|
||||
})
|
||||
.await;
|
||||
sleep(Duration::from_secs(3)).await;
|
||||
@@ -82,15 +94,16 @@ where
|
||||
|
||||
async fn stream_to(
|
||||
master: &str,
|
||||
client_addr: &str,
|
||||
registration: &KeepConnectedRequest,
|
||||
tls: Option<&GrpcTls>,
|
||||
metrics: Option<&crate::metrics::Metrics>,
|
||||
) -> Result<Option<String>> {
|
||||
let channel = connect(master, tls).await?;
|
||||
// A master answers at once, a follower with its leader hint.
|
||||
let answer_by = tokio::time::Instant::now() + CONNECT_TIMEOUT;
|
||||
let mut client = SeaweedClient::new(channel);
|
||||
let (tx, rx) = tokio::sync::mpsc::channel(8);
|
||||
tx.send(registration(client_addr)).await?;
|
||||
tx.send(registration.clone()).await?;
|
||||
let mut stream = tokio::time::timeout_at(
|
||||
answer_by,
|
||||
client.keep_connected(tokio_stream::wrappers::ReceiverStream::new(rx)),
|
||||
@@ -99,6 +112,8 @@ async fn stream_to(
|
||||
.context("master did not answer keep-connected")??
|
||||
.into_inner();
|
||||
let mut answered = false;
|
||||
let interval = Duration::from_secs(5);
|
||||
let mut heartbeat = tokio::time::interval_at(tokio::time::Instant::now() + interval, interval);
|
||||
// The master keeps the node live while the stream is open; resend the
|
||||
// registration periodically so a reconnect never leaves a stale entry.
|
||||
loop {
|
||||
@@ -117,23 +132,72 @@ async fn stream_to(
|
||||
return Ok(Some(loc.leader));
|
||||
}
|
||||
}
|
||||
if let Some(metrics) = metrics { metrics.set_connected(true).await; }
|
||||
}
|
||||
None => anyhow::bail!("master closed the keep-connected stream"),
|
||||
},
|
||||
_ = tokio::time::sleep_until(answer_by), if !answered => {
|
||||
anyhow::bail!("master did not answer keep-connected");
|
||||
}
|
||||
_ = sleep(Duration::from_secs(5)) => {
|
||||
tx.send(registration(client_addr)).await?;
|
||||
_ = heartbeat.tick() => {
|
||||
tokio::time::timeout(CONNECT_TIMEOUT, tx.send(registration.clone())).await
|
||||
.context("registration send stalled")??;
|
||||
probe_registration(&mut client).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn probe_registration(client: &mut SeaweedClient<tonic::transport::Channel>) -> Result<()> {
|
||||
tokio::time::timeout(
|
||||
CONNECT_TIMEOUT,
|
||||
client.list_cluster_nodes(ListClusterNodesRequest {
|
||||
client_type: "vector".into(),
|
||||
..Default::default()
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.context("registration heartbeat stalled")??;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn registration_preserves_filer_group() {
|
||||
assert_eq!(
|
||||
registration("vector:8090", "tenant-a", 0).filer_group,
|
||||
"tenant-a"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn registration_advertises_metrics_port() {
|
||||
assert_eq!(registration("vector:8090", "", 9327).metrics_port, 9327);
|
||||
assert_eq!(registration("vector:8090", "", 0).metrics_port, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn stalled_registration_heartbeat_is_bounded() {
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let address = listener.local_addr().unwrap();
|
||||
let hold = tokio::spawn(async move {
|
||||
let (_connection, _) = listener.accept().await.unwrap();
|
||||
std::future::pending::<()>().await;
|
||||
});
|
||||
let channel = tonic::transport::Endpoint::from_shared(format!("http://{address}"))
|
||||
.unwrap()
|
||||
.connect_lazy();
|
||||
let mut client = SeaweedClient::new(channel);
|
||||
let result = tokio::time::timeout(CONNECT_TIMEOUT * 3, probe_registration(&mut client))
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(format!("{:#}", result.unwrap_err()).contains("registration heartbeat stalled"));
|
||||
hold.abort();
|
||||
}
|
||||
|
||||
/// Runs one pass against scripted masters and returns the dial order.
|
||||
async fn pass(masters: &[&str], answer: fn(&str) -> Result<Option<String>>) -> Vec<String> {
|
||||
let masters: Vec<String> = masters.iter().map(|m| m.to_string()).collect();
|
||||
@@ -183,7 +247,8 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn dial_to_a_black_holed_master_is_bounded() {
|
||||
// TEST-NET-1 (RFC 5737) is reserved, so nothing answers the SYN.
|
||||
let dial = stream_to("192.0.2.1:9333", "127.0.0.1:8080", None);
|
||||
let registration = registration("127.0.0.1:8080", "", 0);
|
||||
let dial = stream_to("192.0.2.1:9333", ®istration, None, None);
|
||||
let result = tokio::time::timeout(CONNECT_TIMEOUT * 3, dial).await;
|
||||
assert!(matches!(result, Ok(Err(_))), "dial was not bounded");
|
||||
}
|
||||
@@ -197,7 +262,8 @@ mod tests {
|
||||
let _ = tokio::io::copy(&mut conn, &mut tokio::io::sink()).await;
|
||||
});
|
||||
let master = format!("127.0.0.1:9333.{port}");
|
||||
let open = stream_to(&master, "127.0.0.1:8080", None);
|
||||
let registration = registration("127.0.0.1:8080", "", 0);
|
||||
let open = stream_to(&master, ®istration, None, None);
|
||||
match tokio::time::timeout(CONNECT_TIMEOUT * 3, open).await {
|
||||
Ok(Err(e)) => assert!(format!("{e:#}").contains("did not answer"), "{e:#}"),
|
||||
other => panic!("open was not bounded: {other:?}"),
|
||||
@@ -232,7 +298,8 @@ mod tests {
|
||||
});
|
||||
let master = format!("127.0.0.1:9333.{port}");
|
||||
let tls = credentials();
|
||||
let open = stream_to(&master, "127.0.0.1:8080", Some(&tls));
|
||||
let registration = registration("127.0.0.1:8080", "", 0);
|
||||
let open = stream_to(&master, ®istration, Some(&tls), None);
|
||||
match tokio::time::timeout(CONNECT_TIMEOUT * 3, open).await {
|
||||
Ok(Err(e)) => assert!(format!("{e:#}").contains("did not complete"), "{e:#}"),
|
||||
other => panic!("handshake was not bounded: {other:?}"),
|
||||
@@ -258,16 +325,20 @@ mod tests {
|
||||
let mut tls = credentials();
|
||||
tls.ca_path = fifo.display().to_string();
|
||||
let master = format!("127.0.0.1:9333.{port}");
|
||||
let open = stream_to(&master, "127.0.0.1:8080", Some(&tls));
|
||||
let registration = registration("127.0.0.1:8080", "", 0);
|
||||
let open = stream_to(&master, ®istration, Some(&tls), None);
|
||||
let result = tokio::time::timeout(CONNECT_TIMEOUT * 3, open).await;
|
||||
// A read+write open of a FIFO does not block, and it lets the
|
||||
// blocked read finish so the runtime can shut down.
|
||||
drop(
|
||||
std::fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.open(&fifo),
|
||||
);
|
||||
use std::io::Write;
|
||||
let mut cleanup = std::fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.open(&fifo)
|
||||
.unwrap();
|
||||
let replacement = dir.path().join("ca.replacement");
|
||||
std::fs::write(&replacement, b"invalid CA").unwrap();
|
||||
std::fs::rename(&replacement, &fifo).unwrap();
|
||||
cleanup.write_all(b"invalid CA").unwrap();
|
||||
drop(cleanup);
|
||||
match result {
|
||||
Ok(Err(e)) => assert!(format!("{e:#}").contains("did not complete"), "{e:#}"),
|
||||
other => panic!("credential read was not bounded: {other:?}"),
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use anyhow::Result;
|
||||
use axum::{Router, http::StatusCode, routing::get};
|
||||
use prometheus::{
|
||||
Encoder, Histogram, HistogramOpts, HistogramVec, IntCounter, IntCounterVec, IntGauge,
|
||||
IntGaugeVec, Opts, Registry, TextEncoder,
|
||||
};
|
||||
use tonic_health::{ServingStatus, server::HealthReporter};
|
||||
|
||||
use crate::read_cache::ReadCache;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Metrics {
|
||||
pub registry: Registry,
|
||||
pub connected: IntGauge,
|
||||
pub requests: IntCounterVec,
|
||||
pub request_seconds: HistogramVec,
|
||||
pub in_flight: IntGaugeVec,
|
||||
pub query_results: IntCounter,
|
||||
pub cache_requests: IntCounterVec,
|
||||
pub storage_bytes: IntCounter,
|
||||
pub storage_read_seconds: Histogram,
|
||||
cache_bytes: IntGauge,
|
||||
cache_entries: IntGauge,
|
||||
health: Option<HealthReporter>,
|
||||
}
|
||||
|
||||
impl Metrics {
|
||||
pub fn new() -> Result<Self> {
|
||||
let registry = Registry::new();
|
||||
let opts = |name: &str, help: &str| {
|
||||
Opts::new(name, help)
|
||||
.namespace("SeaweedFS")
|
||||
.subsystem("vector")
|
||||
};
|
||||
let buckets = prometheus::exponential_buckets(0.0001, 2.0, 24)?;
|
||||
let histogram =
|
||||
|name: &str, help: &str| HistogramOpts::from(opts(name, help)).buckets(buckets.clone());
|
||||
let connected = IntGauge::with_opts(opts(
|
||||
"connected",
|
||||
"Whether the engine is registered with the master.",
|
||||
))?;
|
||||
let requests = IntCounterVec::new(
|
||||
opts(
|
||||
"request_total",
|
||||
"Vector engine requests by operation and gRPC status.",
|
||||
),
|
||||
&["type", "code"],
|
||||
)?;
|
||||
let request_seconds = HistogramVec::new(
|
||||
histogram("request_seconds", "Vector engine request duration."),
|
||||
&["type"],
|
||||
)?;
|
||||
let in_flight = IntGaugeVec::new(
|
||||
opts("in_flight_requests", "Vector engine requests in progress."),
|
||||
&["type"],
|
||||
)?;
|
||||
let query_results =
|
||||
IntCounter::with_opts(opts("query_results_total", "Vectors returned by queries."))?;
|
||||
let cache_requests = IntCounterVec::new(
|
||||
opts("cache_requests_total", "Immutable reads by cache outcome."),
|
||||
&["result"],
|
||||
)?;
|
||||
let storage_bytes = IntCounter::with_opts(opts(
|
||||
"storage_read_bytes_total",
|
||||
"Bytes fetched for immutable cache reads.",
|
||||
))?;
|
||||
let storage_read_seconds = Histogram::with_opts(histogram(
|
||||
"storage_read_seconds",
|
||||
"Immutable storage fetch duration.",
|
||||
))?;
|
||||
let cache_bytes =
|
||||
IntGauge::with_opts(opts("cache_bytes", "Current cache weight in bytes."))?;
|
||||
let cache_entries = IntGauge::with_opts(opts("cache_entries", "Current cache entries."))?;
|
||||
for collector in [
|
||||
Box::new(connected.clone()) as Box<dyn prometheus::core::Collector>,
|
||||
Box::new(requests.clone()),
|
||||
Box::new(request_seconds.clone()),
|
||||
Box::new(in_flight.clone()),
|
||||
Box::new(query_results.clone()),
|
||||
Box::new(cache_requests.clone()),
|
||||
Box::new(storage_bytes.clone()),
|
||||
Box::new(storage_read_seconds.clone()),
|
||||
Box::new(cache_bytes.clone()),
|
||||
Box::new(cache_entries.clone()),
|
||||
] {
|
||||
registry.register(collector)?;
|
||||
}
|
||||
Ok(Self {
|
||||
registry,
|
||||
connected,
|
||||
requests,
|
||||
request_seconds,
|
||||
in_flight,
|
||||
query_results,
|
||||
cache_requests,
|
||||
storage_bytes,
|
||||
storage_read_seconds,
|
||||
cache_bytes,
|
||||
cache_entries,
|
||||
health: None,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn with_health(mut self, health: HealthReporter) -> Self {
|
||||
self.health = Some(health);
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn set_connected(&self, connected: bool) {
|
||||
self.connected.set(i64::from(connected));
|
||||
if let Some(health) = self.health.clone() {
|
||||
let status = if connected {
|
||||
ServingStatus::Serving
|
||||
} else {
|
||||
ServingStatus::NotServing
|
||||
};
|
||||
health.set_service_status("", status).await;
|
||||
health
|
||||
.set_service_status("vector_pb.VectorService", status)
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start(&self, operation: &str) -> InFlight {
|
||||
let gauge = self.in_flight.with_label_values(&[operation]);
|
||||
gauge.inc();
|
||||
InFlight {
|
||||
gauge,
|
||||
requests: self.requests.clone(),
|
||||
operation: operation.into(),
|
||||
completed: false,
|
||||
_timer: self
|
||||
.request_seconds
|
||||
.with_label_values(&[operation])
|
||||
.start_timer(),
|
||||
}
|
||||
}
|
||||
|
||||
fn gather(&self, cache: Option<&ReadCache>) -> Result<String> {
|
||||
if let Some(cache) = cache {
|
||||
let (entries, bytes) = cache.size();
|
||||
self.cache_entries.set(entries as i64);
|
||||
self.cache_bytes.set(bytes as i64);
|
||||
}
|
||||
let mut buffer = Vec::new();
|
||||
TextEncoder::new().encode(&self.registry.gather(), &mut buffer)?;
|
||||
Ok(String::from_utf8(buffer)?)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct InFlight {
|
||||
gauge: IntGauge,
|
||||
requests: IntCounterVec,
|
||||
operation: String,
|
||||
completed: bool,
|
||||
_timer: prometheus::HistogramTimer,
|
||||
}
|
||||
|
||||
impl InFlight {
|
||||
pub fn complete(&mut self, error: Option<tonic::Code>) {
|
||||
let code = error
|
||||
.map(|c| format!("{c:?}"))
|
||||
.unwrap_or_else(|| "OK".into());
|
||||
self.requests
|
||||
.with_label_values(&[&self.operation, &code])
|
||||
.inc();
|
||||
self.completed = true;
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for InFlight {
|
||||
fn drop(&mut self) {
|
||||
self.gauge.dec();
|
||||
if !self.completed {
|
||||
self.requests
|
||||
.with_label_values(&[&self.operation, "Cancelled"])
|
||||
.inc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn serve(metrics: Metrics, address: SocketAddr, cache: Option<ReadCache>) -> Result<()> {
|
||||
let listener = tokio::net::TcpListener::bind(address).await?;
|
||||
serve_listener(metrics, listener, cache).await
|
||||
}
|
||||
|
||||
pub async fn serve_listener(
|
||||
metrics: Metrics,
|
||||
listener: tokio::net::TcpListener,
|
||||
cache: Option<ReadCache>,
|
||||
) -> Result<()> {
|
||||
let readiness = metrics.clone();
|
||||
let app = Router::new()
|
||||
.route("/health", get(|| async { StatusCode::OK }))
|
||||
.route(
|
||||
"/ready",
|
||||
get(move || {
|
||||
let metrics = readiness.clone();
|
||||
async move {
|
||||
if metrics.connected.get() == 1 {
|
||||
StatusCode::OK
|
||||
} else {
|
||||
StatusCode::SERVICE_UNAVAILABLE
|
||||
}
|
||||
}
|
||||
}),
|
||||
)
|
||||
.route(
|
||||
"/metrics",
|
||||
get(move || {
|
||||
let metrics = metrics.clone();
|
||||
let cache = cache.clone();
|
||||
async move {
|
||||
metrics
|
||||
.gather(cache.as_ref())
|
||||
.map(|body| ([("content-type", "text/plain; version=0.0.4")], body))
|
||||
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)
|
||||
}
|
||||
}),
|
||||
);
|
||||
axum::serve(listener, app).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn endpoints_follow_registration_and_publish_metrics() {
|
||||
let metrics = Metrics::new().unwrap();
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let endpoint = format!("http://{}", listener.local_addr().unwrap());
|
||||
let task = tokio::spawn(serve_listener(metrics.clone(), listener, None));
|
||||
let client = reqwest::Client::new();
|
||||
assert_eq!(
|
||||
client
|
||||
.get(format!("{endpoint}/health"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.status(),
|
||||
200
|
||||
);
|
||||
assert_eq!(
|
||||
client
|
||||
.get(format!("{endpoint}/ready"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.status(),
|
||||
503
|
||||
);
|
||||
metrics.set_connected(true).await;
|
||||
assert_eq!(
|
||||
client
|
||||
.get(format!("{endpoint}/ready"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.status(),
|
||||
200
|
||||
);
|
||||
let in_flight = metrics.start("QueryVectors");
|
||||
let body = client
|
||||
.get(format!("{endpoint}/metrics"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(body.contains("SeaweedFS_vector_connected 1"));
|
||||
assert!(body.contains("SeaweedFS_vector_in_flight_requests{type=\"QueryVectors\"} 1"));
|
||||
drop(in_flight);
|
||||
assert_eq!(
|
||||
metrics.in_flight.with_label_values(&["QueryVectors"]).get(),
|
||||
0
|
||||
);
|
||||
metrics.set_connected(false).await;
|
||||
assert_eq!(
|
||||
client
|
||||
.get(format!("{endpoint}/ready"))
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.status(),
|
||||
503
|
||||
);
|
||||
task.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn grpc_health_follows_registration() {
|
||||
use tonic_health::pb::{HealthCheckRequest, health_client::HealthClient};
|
||||
let (reporter, service) = tonic_health::server::health_reporter();
|
||||
let metrics = Metrics::new().unwrap().with_health(reporter);
|
||||
metrics.set_connected(false).await;
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let endpoint = format!("http://{}", listener.local_addr().unwrap());
|
||||
let task = tokio::spawn(
|
||||
tonic::transport::Server::builder()
|
||||
.add_service(service)
|
||||
.serve_with_incoming(tokio_stream::wrappers::TcpListenerStream::new(listener)),
|
||||
);
|
||||
let channel = tonic::transport::Endpoint::from_shared(endpoint)
|
||||
.unwrap()
|
||||
.connect()
|
||||
.await
|
||||
.unwrap();
|
||||
let mut client = HealthClient::new(channel);
|
||||
let request = || HealthCheckRequest {
|
||||
service: "vector_pb.VectorService".into(),
|
||||
};
|
||||
assert_eq!(
|
||||
client.check(request()).await.unwrap().into_inner().status,
|
||||
2
|
||||
);
|
||||
metrics.set_connected(true).await;
|
||||
assert_eq!(
|
||||
client.check(request()).await.unwrap().into_inner().status,
|
||||
1
|
||||
);
|
||||
metrics.set_connected(false).await;
|
||||
assert_eq!(
|
||||
client.check(request()).await.unwrap().into_inner().status,
|
||||
2
|
||||
);
|
||||
task.abort();
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Metrics {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Metrics")
|
||||
.field("connected", &self.connected.get())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
use crate::metrics::Metrics;
|
||||
use crate::pb::vector::{self as pb, vector_service_server::VectorService};
|
||||
use crate::service::VectorServer;
|
||||
use tonic::{Request, Response, Status};
|
||||
|
||||
pub struct ObservedService {
|
||||
pub inner: VectorServer,
|
||||
pub metrics: Metrics,
|
||||
}
|
||||
|
||||
#[tonic::async_trait]
|
||||
impl VectorService for ObservedService {
|
||||
async fn create_index(
|
||||
&self,
|
||||
request: Request<pb::CreateIndexRequest>,
|
||||
) -> Result<Response<pb::CreateIndexResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("CreateIndex");
|
||||
let result = self.inner.create_index(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn drop_index(
|
||||
&self,
|
||||
request: Request<pb::DropIndexRequest>,
|
||||
) -> Result<Response<pb::DropIndexResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("DropIndex");
|
||||
let result = self.inner.drop_index(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn put_vectors(
|
||||
&self,
|
||||
request: Request<pb::PutVectorsRequest>,
|
||||
) -> Result<Response<pb::PutVectorsResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("PutVectors");
|
||||
let result = self.inner.put_vectors(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn get_vectors(
|
||||
&self,
|
||||
request: Request<pb::GetVectorsRequest>,
|
||||
) -> Result<Response<pb::GetVectorsResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("GetVectors");
|
||||
let result = self.inner.get_vectors(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn delete_vectors(
|
||||
&self,
|
||||
request: Request<pb::DeleteVectorsRequest>,
|
||||
) -> Result<Response<pb::DeleteVectorsResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("DeleteVectors");
|
||||
let result = self.inner.delete_vectors(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn list_vectors(
|
||||
&self,
|
||||
request: Request<pb::ListVectorsRequest>,
|
||||
) -> Result<Response<pb::ListVectorsResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("ListVectors");
|
||||
let result = self.inner.list_vectors(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
result
|
||||
}
|
||||
async fn query_vectors(
|
||||
&self,
|
||||
request: Request<pb::QueryVectorsRequest>,
|
||||
) -> Result<Response<pb::QueryVectorsResponse>, Status> {
|
||||
let mut in_flight = self.metrics.start("QueryVectors");
|
||||
let result = self.inner.query_vectors(request).await;
|
||||
in_flight.complete(result.as_ref().err().map(|e| e.code()));
|
||||
if let Ok(response) = &result {
|
||||
self.metrics
|
||||
.query_results
|
||||
.inc_by(response.get_ref().vectors.len() as u64);
|
||||
}
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn failures_are_counted_and_release_in_flight_requests() {
|
||||
let service = ObservedService {
|
||||
inner: VectorServer::new(),
|
||||
metrics: Metrics::new().unwrap(),
|
||||
};
|
||||
let response = service
|
||||
.query_vectors(Request::new(pb::QueryVectorsRequest::default()))
|
||||
.await;
|
||||
let code = format!("{:?}", response.unwrap_err().code());
|
||||
assert_eq!(
|
||||
service
|
||||
.metrics
|
||||
.requests
|
||||
.with_label_values(&["QueryVectors", &code])
|
||||
.get(),
|
||||
1
|
||||
);
|
||||
assert_eq!(
|
||||
service
|
||||
.metrics
|
||||
.in_flight
|
||||
.with_label_values(&["QueryVectors"])
|
||||
.get(),
|
||||
0
|
||||
);
|
||||
assert_eq!(
|
||||
service
|
||||
.metrics
|
||||
.request_seconds
|
||||
.with_label_values(&["QueryVectors"])
|
||||
.get_sample_count(),
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use std::fmt;
|
||||
use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::metrics::Metrics;
|
||||
use bytes::Bytes;
|
||||
use futures::StreamExt;
|
||||
use futures::stream::BoxStream;
|
||||
@@ -42,6 +43,7 @@ pub struct ReadCache {
|
||||
/// Keeps entries apart from those of another [`Self::scoped`] view, for
|
||||
/// stores that share a prefix but not their bytes.
|
||||
scope: Arc<str>,
|
||||
metrics: Option<Metrics>,
|
||||
}
|
||||
|
||||
impl ReadCache {
|
||||
@@ -54,14 +56,26 @@ impl ReadCache {
|
||||
})
|
||||
.build(),
|
||||
scope: "".into(),
|
||||
metrics: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_metrics(mut self, metrics: Metrics) -> Self {
|
||||
self.metrics = Some(metrics);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn size(&self) -> (u64, u64) {
|
||||
self.cache.run_pending_tasks();
|
||||
(self.cache.entry_count(), self.cache.weighted_size())
|
||||
}
|
||||
|
||||
/// The same cache, keyed apart under `scope`.
|
||||
pub fn scoped(&self, scope: &str) -> Self {
|
||||
Self {
|
||||
cache: self.cache.clone(),
|
||||
scope: scope.into(),
|
||||
metrics: self.metrics.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,6 +95,7 @@ impl WrappingObjectStore for ReadCache {
|
||||
inner: original,
|
||||
store: format!("{}|{store_prefix}", self.scope).into(),
|
||||
cache: self.cache.clone(),
|
||||
metrics: self.metrics.clone(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -136,6 +151,7 @@ struct CachedStore {
|
||||
inner: Arc<dyn ObjectStore>,
|
||||
store: Arc<str>,
|
||||
cache: moka::sync::Cache<Key, Entry>,
|
||||
metrics: Option<Metrics>,
|
||||
}
|
||||
|
||||
impl CachedStore {
|
||||
@@ -184,14 +200,47 @@ impl ObjectStore for CachedStore {
|
||||
object: Some(object),
|
||||
}) = self.cache.get(&key)
|
||||
{
|
||||
if let Some(metrics) = &self.metrics {
|
||||
metrics.cache_requests.with_label_values(&["hit"]).inc();
|
||||
}
|
||||
return Ok(whole(bytes, &object));
|
||||
}
|
||||
if let Some(metrics) = &self.metrics {
|
||||
metrics.cache_requests.with_label_values(&["miss"]).inc();
|
||||
}
|
||||
let _timer = self
|
||||
.metrics
|
||||
.as_ref()
|
||||
.map(|m| m.storage_read_seconds.start_timer());
|
||||
let result = self.inner.get_opts(location, options).await?;
|
||||
if result.meta.size > MAX_WHOLE_OBJECT {
|
||||
return Ok(result);
|
||||
let meta = result.meta.clone();
|
||||
let range = result.range.clone();
|
||||
let attributes = result.attributes.clone();
|
||||
let metrics = self.metrics.clone();
|
||||
let timer = _timer;
|
||||
let stream = result
|
||||
.into_stream()
|
||||
.map(move |chunk| {
|
||||
let _timer = &timer;
|
||||
if let (Some(metrics), Ok(bytes)) = (&metrics, &chunk) {
|
||||
metrics.storage_bytes.inc_by(bytes.len() as u64);
|
||||
}
|
||||
chunk
|
||||
})
|
||||
.boxed();
|
||||
return Ok(GetResult {
|
||||
payload: GetResultPayload::Stream(stream),
|
||||
meta,
|
||||
range,
|
||||
attributes,
|
||||
});
|
||||
}
|
||||
let object = Arc::new((result.meta.clone(), result.attributes.clone()));
|
||||
let bytes = owned(result.bytes().await?);
|
||||
if let Some(metrics) = &self.metrics {
|
||||
metrics.storage_bytes.inc_by(bytes.len() as u64);
|
||||
}
|
||||
self.cache.insert(
|
||||
key,
|
||||
Entry {
|
||||
@@ -220,7 +269,21 @@ impl ObjectStore for CachedStore {
|
||||
.filter(|(_, hit)| hit.is_none())
|
||||
.map(|(range, _)| range.clone())
|
||||
.collect();
|
||||
if let Some(metrics) = &self.metrics {
|
||||
metrics
|
||||
.cache_requests
|
||||
.with_label_values(&["miss"])
|
||||
.inc_by(missing.len() as u64);
|
||||
metrics
|
||||
.cache_requests
|
||||
.with_label_values(&["hit"])
|
||||
.inc_by((ranges.len() - missing.len()) as u64);
|
||||
}
|
||||
if !missing.is_empty() {
|
||||
let _timer = self
|
||||
.metrics
|
||||
.as_ref()
|
||||
.map(|m| m.storage_read_seconds.start_timer());
|
||||
let mut fetched = self.inner.get_ranges(location, &missing).await?.into_iter();
|
||||
for (range, slot) in ranges.iter().zip(out.iter_mut()) {
|
||||
if slot.is_some() {
|
||||
@@ -230,6 +293,9 @@ impl ObjectStore for CachedStore {
|
||||
break;
|
||||
};
|
||||
let bytes = owned(bytes);
|
||||
if let Some(metrics) = &self.metrics {
|
||||
metrics.storage_bytes.inc_by(bytes.len() as u64);
|
||||
}
|
||||
self.cache.insert(
|
||||
self.key(location, Some(range.clone())),
|
||||
Entry {
|
||||
@@ -287,7 +353,7 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::pb::vector as pb;
|
||||
use crate::pb::vector::vector_service_server::VectorService;
|
||||
use crate::service::VectorServer;
|
||||
use crate::service::{VectorServer, schema_for, table_id};
|
||||
use object_store::ObjectStoreExt;
|
||||
use object_store::memory::InMemory;
|
||||
use tonic::Request;
|
||||
@@ -491,6 +557,16 @@ mod tests {
|
||||
};
|
||||
|
||||
create(&server, &table, 4).await;
|
||||
create(&server, &table, 4).await;
|
||||
let mismatch = server
|
||||
.create_index(Request::new(pb::CreateIndexRequest {
|
||||
table: Some(table.clone()),
|
||||
dimension: 3,
|
||||
..Default::default()
|
||||
}))
|
||||
.await
|
||||
.unwrap_err();
|
||||
assert_eq!(mismatch.code(), tonic::Code::AlreadyExists);
|
||||
put(
|
||||
&server,
|
||||
&table,
|
||||
@@ -540,6 +616,117 @@ mod tests {
|
||||
assert_eq!(query(&server, &table, vec![1.0, 0.0]).await, ["z"]);
|
||||
}
|
||||
|
||||
/// A query loads the index once; the next one finds it in the session
|
||||
/// every read shares.
|
||||
#[tokio::test]
|
||||
async fn queries_reuse_the_loaded_index() {
|
||||
let bucket = format!("session-{}", uuid_like());
|
||||
let location = format!("shared-memory://{bucket}/vector/x");
|
||||
let server = VectorServer::new().with_schemes(&["shared-memory"]);
|
||||
let table = pb::Table {
|
||||
id: vec![bucket, "vector".into(), "x".into()],
|
||||
location: location.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
create(&server, &table, 2).await;
|
||||
put(
|
||||
&server,
|
||||
&table,
|
||||
(0..300)
|
||||
.map(|i| vector(&format!("k{i}"), vec![i as f32, 1.0]))
|
||||
.collect(),
|
||||
)
|
||||
.await;
|
||||
let mut dataset = lance::Dataset::open(&location).await.unwrap();
|
||||
weed_lance_worker::vector_index::build(&mut dataset, "vector", "idx", 2, false)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(query(&server, &table, vec![5.0, 1.0]).await[0], "k5");
|
||||
let session = server.reads.lock().unwrap().session.clone();
|
||||
let loaded = session.index_cache_stats().await;
|
||||
assert!(session.approx_num_items() > 0);
|
||||
assert_eq!(query(&server, &table, vec![7.0, 1.0]).await[0], "k7");
|
||||
let again = session.index_cache_stats().await;
|
||||
assert!(server.handles.contains_key(&(location, false)));
|
||||
assert!(again.hits > loaded.hits, "{loaded:?} then {again:?}");
|
||||
assert_eq!(again.misses, loaded.misses, "{loaded:?} then {again:?}");
|
||||
}
|
||||
|
||||
/// An index dropped and created again at the same location reaches the
|
||||
/// version numbers of the old one; the shared session must not answer
|
||||
/// for them with the old index.
|
||||
#[tokio::test]
|
||||
async fn a_recreated_table_does_not_see_the_old_index() {
|
||||
recreate_after(false).await;
|
||||
recreate_after(true).await;
|
||||
}
|
||||
|
||||
/// `unmarked`: the first table is written without a table id, as indexes
|
||||
/// created before ids were are.
|
||||
async fn recreate_after(unmarked: bool) {
|
||||
let bucket = format!("recreate-{}", uuid_like());
|
||||
let location = format!("shared-memory://{bucket}/vector/x");
|
||||
let server = VectorServer::new().with_schemes(&["shared-memory"]);
|
||||
let table = pb::Table {
|
||||
id: vec![bucket, "vector".into(), "x".into()],
|
||||
location: location.clone(),
|
||||
..Default::default()
|
||||
};
|
||||
let rows = |offset: usize| {
|
||||
(0..300)
|
||||
.map(|i| vector(&format!("k{}", i + offset), vec![(i + offset) as f32, 1.0]))
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
if unmarked {
|
||||
let schema = schema_for(2, pb::DistanceMetric::L2, &[]);
|
||||
let empty = arrow_array::RecordBatch::new_empty(schema.clone());
|
||||
let reader = arrow_array::RecordBatchIterator::new(vec![Ok(empty)], schema);
|
||||
lance::Dataset::write(reader, &location, None)
|
||||
.await
|
||||
.unwrap();
|
||||
} else {
|
||||
create(&server, &table, 2).await;
|
||||
}
|
||||
put(&server, &table, rows(0)).await;
|
||||
let mut dataset = lance::Dataset::open(&location).await.unwrap();
|
||||
assert_eq!(table_id(&dataset).is_empty(), unmarked);
|
||||
weed_lance_worker::vector_index::build(&mut dataset, "vector", "idx", 2, false)
|
||||
.await
|
||||
.unwrap();
|
||||
let indexed = dataset.version().version;
|
||||
assert_eq!(query(&server, &table, vec![5.0, 1.0]).await[0], "k5");
|
||||
let other = pb::Table {
|
||||
id: vec![table.id[0].clone(), "vector".into(), "y".into()],
|
||||
location: location.replace("/vector/x", "/vector/y"),
|
||||
..Default::default()
|
||||
};
|
||||
create(&server, &other, 2).await;
|
||||
put(&server, &other, rows(0)).await;
|
||||
assert_eq!(query(&server, &other, vec![5.0, 1.0]).await[0], "k5");
|
||||
|
||||
let (store, path) = lance::io::ObjectStore::from_uri(&location).await.unwrap();
|
||||
store.remove_dir_all(path).await.unwrap();
|
||||
create(&server, &table, 2).await;
|
||||
let mut offset = 1000;
|
||||
while lance::Dataset::open(&location)
|
||||
.await
|
||||
.unwrap()
|
||||
.version()
|
||||
.version
|
||||
< indexed
|
||||
{
|
||||
put(&server, &table, rows(offset)).await;
|
||||
offset += 1000;
|
||||
}
|
||||
assert_eq!(query(&server, &table, vec![1005.0, 1.0]).await[0], "k1005");
|
||||
server.handles.run_pending_tasks();
|
||||
let session = server.reads.lock().unwrap().session.clone();
|
||||
for (_, (_, dataset)) in server.handles.iter() {
|
||||
assert!(Arc::ptr_eq(&dataset.session(), &session));
|
||||
}
|
||||
}
|
||||
|
||||
fn uuid_like() -> String {
|
||||
format!(
|
||||
"{:x}",
|
||||
|
||||
@@ -9,16 +9,18 @@ use lance::dataset::ProjectionRequest;
|
||||
use lance::dataset::WriteParams;
|
||||
use lance::dataset::{MergeInsertBuilder, WhenMatched, WhenNotMatched};
|
||||
use lance::io::WrappingObjectStore;
|
||||
use lance::session::Session;
|
||||
use lance::table::format::Fragment;
|
||||
use prost_types::{ListValue, Struct, Value, value::Kind};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use tonic::{Request, Response, Status};
|
||||
use weed_lance_worker::catalog::TableDescription;
|
||||
use weed_lance_worker::dataset;
|
||||
use weed_lance_worker::direct_read::{DirectReads, Wrappers};
|
||||
use weed_lance_worker::jobs::vector_index::is_vector_table;
|
||||
use weed_vector_core::index;
|
||||
use weed_vector_core::maintenance::SharedLeases;
|
||||
use weed_vector_core::query::{self, Query};
|
||||
use weed_vector_core::table::VectorTable;
|
||||
|
||||
@@ -55,7 +57,9 @@ const KEY_COLUMN: &str = "key";
|
||||
const METADATA_COLUMN: &str = "metadata";
|
||||
const VECTOR_COLUMN: &str = "vector";
|
||||
const ROW_ID_COLUMN: &str = "_rowid";
|
||||
fn schema_for(
|
||||
const DEFAULT_INDEX_CACHE_BYTES: usize = 1 << 30;
|
||||
const DEFAULT_METADATA_CACHE_BYTES: usize = 256 << 20;
|
||||
pub(crate) fn schema_for(
|
||||
dimension: usize,
|
||||
metric: pb::DistanceMetric,
|
||||
non_filterable: &[String],
|
||||
@@ -95,6 +99,44 @@ fn schema_for(
|
||||
]))
|
||||
}
|
||||
|
||||
fn matches_index_schema(
|
||||
dataset: &Dataset,
|
||||
dimension: usize,
|
||||
metric: pb::DistanceMetric,
|
||||
non_filterable: &[String],
|
||||
) -> bool {
|
||||
let Ok(layout) = VectorTable::resolve(dataset, Some(VECTOR_COLUMN), Some(KEY_COLUMN)) else {
|
||||
return false;
|
||||
};
|
||||
let schema = Schema::from(dataset.schema());
|
||||
let Ok(vector) = schema.field_with_name(VECTOR_COLUMN) else {
|
||||
return false;
|
||||
};
|
||||
let Ok(metadata) = schema.field_with_name(METADATA_COLUMN) else {
|
||||
return false;
|
||||
};
|
||||
let stored_keys = metadata
|
||||
.metadata()
|
||||
.get("non_filterable_metadata_keys")
|
||||
.map(|keys| serde_json::from_str::<Vec<String>>(keys))
|
||||
.transpose();
|
||||
let Ok(stored_keys) = stored_keys else {
|
||||
return false;
|
||||
};
|
||||
let mut stored_keys = stored_keys.unwrap_or_default();
|
||||
let mut requested_keys = non_filterable.to_vec();
|
||||
stored_keys.sort();
|
||||
requested_keys.sort();
|
||||
layout.dimension == dimension
|
||||
&& vector.metadata().get("distance_metric").map(String::as_str)
|
||||
== Some(metric.as_str_name())
|
||||
&& stored_keys == requested_keys
|
||||
&& metadata
|
||||
.metadata()
|
||||
.get("ARROW:extension:name")
|
||||
.is_some_and(|name| name == "lance.json")
|
||||
}
|
||||
|
||||
fn batch_of(vectors: &[pb::Vector], dimension: usize, schema: Arc<Schema>) -> Result<RecordBatch> {
|
||||
let mut seen = std::collections::HashSet::new();
|
||||
for vector in vectors {
|
||||
@@ -406,9 +448,85 @@ fn resolved(table: &pb::Table, schemes: &[&str]) -> Option<TableDescription> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Marks the table an index was created as, in its schema metadata, which
|
||||
/// every later version keeps.
|
||||
const TABLE_ID_KEY: &str = "weed_vector_table_id";
|
||||
|
||||
/// The table a dataset was created as; empty for one created before tables
|
||||
/// were marked.
|
||||
pub(crate) fn table_id(dataset: &Dataset) -> &str {
|
||||
dataset
|
||||
.schema()
|
||||
.metadata
|
||||
.get(TABLE_ID_KEY)
|
||||
.map_or("", String::as_str)
|
||||
}
|
||||
|
||||
/// The session reads share, and the table each location held when this
|
||||
/// session first read it. Lance keys some of its caches by location and
|
||||
/// version alone, and an index dropped and created again at its location
|
||||
/// numbers its versions from 1 again, so a session that sees a location hold
|
||||
/// another table starts over.
|
||||
pub(crate) struct Reads {
|
||||
pub(crate) session: Arc<Session>,
|
||||
generation: u64,
|
||||
tables: HashMap<String, String>,
|
||||
}
|
||||
|
||||
/// Opened tables kept for the next read of them.
|
||||
const MAX_HANDLES: u64 = 1024;
|
||||
|
||||
fn handle_key(table: &pb::Table) -> (String, bool) {
|
||||
(table.location.clone(), table.sse_s3)
|
||||
}
|
||||
|
||||
/// Locations a session remembers before it starts over.
|
||||
const MAX_READ_TABLES: usize = 100_000;
|
||||
|
||||
impl Reads {
|
||||
fn new(index_bytes: usize, metadata_bytes: usize) -> Self {
|
||||
Self {
|
||||
session: Arc::new(Session::new(
|
||||
index_bytes,
|
||||
metadata_bytes,
|
||||
Default::default(),
|
||||
)),
|
||||
generation: 0,
|
||||
tables: HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether a dataset of `table_id` at `location`, opened in this session,
|
||||
/// may be read. Otherwise the session was replaced and the caller opens
|
||||
/// the table again.
|
||||
fn admit(&mut self, location: &str, table_id: &str, (index, metadata): (usize, usize)) -> bool {
|
||||
match self.tables.get(location) {
|
||||
Some(seen) if seen == table_id => return true,
|
||||
None if self.tables.len() < MAX_READ_TABLES => {
|
||||
self.tables
|
||||
.insert(location.to_string(), table_id.to_string());
|
||||
return true;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
let generation = self.generation + 1;
|
||||
*self = Self::new(index, metadata);
|
||||
self.generation = generation;
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub struct VectorServer {
|
||||
storage: Option<DirectReads>,
|
||||
read_cache: Option<ReadCache>,
|
||||
/// Lance's index and metadata caches, shared by every request that only
|
||||
/// reads. Writes open in a session of their own.
|
||||
pub(crate) reads: Mutex<Reads>,
|
||||
/// A table opened by an earlier read, by location and encryption, with
|
||||
/// the generation of the session it was opened in.
|
||||
pub(crate) handles: moka::sync::Cache<(String, bool), (u64, Dataset)>,
|
||||
lance_cache_bytes: (usize, usize),
|
||||
leases: SharedLeases,
|
||||
nprobes: Option<usize>,
|
||||
/// URI schemes a table's location may have.
|
||||
schemes: &'static [&'static str],
|
||||
@@ -425,6 +543,13 @@ impl VectorServer {
|
||||
Self {
|
||||
storage: None,
|
||||
read_cache: None,
|
||||
reads: Mutex::new(Reads::new(
|
||||
DEFAULT_INDEX_CACHE_BYTES,
|
||||
DEFAULT_METADATA_CACHE_BYTES,
|
||||
)),
|
||||
lance_cache_bytes: (DEFAULT_INDEX_CACHE_BYTES, DEFAULT_METADATA_CACHE_BYTES),
|
||||
handles: moka::sync::Cache::new(MAX_HANDLES),
|
||||
leases: SharedLeases::default(),
|
||||
nprobes: None,
|
||||
schemes: &["s3"],
|
||||
}
|
||||
@@ -450,6 +575,13 @@ impl VectorServer {
|
||||
self
|
||||
}
|
||||
|
||||
/// Bytes of loaded indexes and of table metadata kept across reads.
|
||||
pub fn with_lance_caches(mut self, index_bytes: usize, metadata_bytes: usize) -> Self {
|
||||
self.reads = Mutex::new(Reads::new(index_bytes, metadata_bytes));
|
||||
self.lance_cache_bytes = (index_bytes, metadata_bytes);
|
||||
self
|
||||
}
|
||||
|
||||
/// Serve repeated reads of write-once table files from `cache`.
|
||||
pub fn with_read_cache(mut self, cache: ReadCache) -> Self {
|
||||
self.read_cache = Some(cache);
|
||||
@@ -491,9 +623,72 @@ impl VectorServer {
|
||||
}
|
||||
|
||||
async fn open(&self, table: &pb::Table) -> Result<Dataset, Status> {
|
||||
self.open_in(table, None).await
|
||||
}
|
||||
|
||||
/// [`Self::open`] in the shared session, for a request that only reads.
|
||||
async fn open_to_read(&self, table: &pb::Table) -> Result<Dataset, Status> {
|
||||
loop {
|
||||
let (session, generation) = {
|
||||
let reads = self.reads.lock().unwrap();
|
||||
(reads.session.clone(), reads.generation)
|
||||
};
|
||||
let dataset = match self.handle(table, generation).await? {
|
||||
Some(dataset) => dataset,
|
||||
None => {
|
||||
let dataset = self.open_in(table, Some(session)).await?;
|
||||
// Under the lock, so no handle of a replaced session
|
||||
// lands after the replacement cleared them.
|
||||
let reads = self.reads.lock().unwrap();
|
||||
if table.version == 0 && reads.generation == generation {
|
||||
self.handles
|
||||
.insert(handle_key(table), (generation, dataset.clone()));
|
||||
}
|
||||
dataset
|
||||
}
|
||||
};
|
||||
let mut reads = self.reads.lock().unwrap();
|
||||
if reads.generation != generation {
|
||||
continue;
|
||||
}
|
||||
if reads.admit(&table.location, table_id(&dataset), self.lance_cache_bytes) {
|
||||
return Ok(dataset);
|
||||
}
|
||||
// The handles hold the replaced session and its caches.
|
||||
self.handles.invalidate_all();
|
||||
}
|
||||
}
|
||||
|
||||
/// The table from the handle an earlier read of it left in this session,
|
||||
/// moved to the version asked for: the latest costs a listing of its
|
||||
/// versions, not a new store and manifest read.
|
||||
async fn handle(&self, table: &pb::Table, generation: u64) -> Result<Option<Dataset>, Status> {
|
||||
self.describe(table)?;
|
||||
let key = handle_key(table);
|
||||
let Some((at, mut dataset)) = self.handles.get(&key) else {
|
||||
return Ok(None);
|
||||
};
|
||||
if at != generation {
|
||||
return Ok(None);
|
||||
}
|
||||
let moved = match table.version {
|
||||
0 => dataset.checkout_latest().await.map(|()| dataset),
|
||||
version => dataset.checkout_version(version).await,
|
||||
};
|
||||
moved.map(Some).map_err(|err| {
|
||||
self.handles.invalidate(&key);
|
||||
open_status(err.into())
|
||||
})
|
||||
}
|
||||
|
||||
async fn open_in(
|
||||
&self,
|
||||
table: &pb::Table,
|
||||
session: Option<Arc<Session>>,
|
||||
) -> Result<Dataset, Status> {
|
||||
let description = self.describe(table)?;
|
||||
let wrapper = self.wrapper(table);
|
||||
let mut dataset = dataset::open_at(&description, wrapper)
|
||||
let mut dataset = dataset::open_at(&description, wrapper, session)
|
||||
.await
|
||||
.map_err(open_status)?;
|
||||
if table.version != 0 {
|
||||
@@ -526,6 +721,13 @@ impl VectorService for VectorServer {
|
||||
// The gateway has already created the table through the catalog.
|
||||
let description = self.describe(&table)?;
|
||||
let schema = schema_for(dimension, metric, &req.non_filterable_metadata_keys);
|
||||
let schema = Arc::new(Schema::new_with_metadata(
|
||||
schema.fields().clone(),
|
||||
HashMap::from([(
|
||||
TABLE_ID_KEY.to_string(),
|
||||
uuid::Uuid::new_v4().simple().to_string(),
|
||||
)]),
|
||||
));
|
||||
let empty = RecordBatch::new_empty(schema.clone());
|
||||
let reader = arrow_array::RecordBatchIterator::new(vec![Ok(empty)].into_iter(), schema);
|
||||
let dataset = Dataset::write(
|
||||
@@ -536,8 +738,28 @@ impl VectorService for VectorServer {
|
||||
..Default::default()
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
.await;
|
||||
let dataset = match dataset {
|
||||
Ok(dataset) => dataset,
|
||||
Err(error) => match self.open(&table).await {
|
||||
Ok(existing)
|
||||
if matches_index_schema(
|
||||
&existing,
|
||||
dimension,
|
||||
metric,
|
||||
&req.non_filterable_metadata_keys,
|
||||
) =>
|
||||
{
|
||||
existing
|
||||
}
|
||||
Ok(_) => {
|
||||
return Err(Status::already_exists(
|
||||
"index exists with a different schema",
|
||||
));
|
||||
}
|
||||
Err(_) => return Err(internal(error)),
|
||||
},
|
||||
};
|
||||
Ok(Response::new(pb::CreateIndexResponse {
|
||||
version: dataset.version().version,
|
||||
}))
|
||||
@@ -622,12 +844,10 @@ impl VectorService for VectorServer {
|
||||
let table = req
|
||||
.table
|
||||
.ok_or_else(|| Status::invalid_argument("missing table"))?;
|
||||
let dataset = self.open(&table).await?;
|
||||
let dataset = self.open_to_read(&table).await?;
|
||||
// Lease the resolved version so maintenance cannot reclaim its files
|
||||
// while this query runs against it.
|
||||
let _lease = weed_vector_core::maintenance::try_pin(&dataset)
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
let _lease = self.leases.try_pin(&dataset).await.map_err(internal)?;
|
||||
let resolved = VectorTable::resolve(&dataset, None, Some(KEY_COLUMN)).map_err(invalid)?;
|
||||
let columns = projection(req.return_data, req.return_metadata);
|
||||
let batches = query::get(&dataset, &resolved, &req.keys, Some(&columns))
|
||||
@@ -672,7 +892,7 @@ impl VectorService for VectorServer {
|
||||
"segment_index must be below segment_count, which is at most {MAX_SEGMENTS}"
|
||||
)));
|
||||
}
|
||||
let dataset = self.open(&table).await?;
|
||||
let dataset = self.open_to_read(&table).await?;
|
||||
let offset: u64 = if req.next_token.is_empty() {
|
||||
0
|
||||
} else {
|
||||
@@ -692,9 +912,7 @@ impl VectorService for VectorServer {
|
||||
// Data and metadata come from a second read of this version, so
|
||||
// lease it as get_vectors does.
|
||||
let _lease = if columns.len() > 1 {
|
||||
weed_vector_core::maintenance::try_pin(&dataset)
|
||||
.await
|
||||
.map_err(internal)?
|
||||
self.leases.try_pin(&dataset).await.map_err(internal)?
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@@ -739,12 +957,10 @@ impl VectorService for VectorServer {
|
||||
let table = req
|
||||
.table
|
||||
.ok_or_else(|| Status::invalid_argument("missing table"))?;
|
||||
let dataset = self.open(&table).await?;
|
||||
let dataset = self.open_to_read(&table).await?;
|
||||
// Lease the resolved version so maintenance cannot reclaim its files
|
||||
// while this query runs against it.
|
||||
let _lease = weed_vector_core::maintenance::try_pin(&dataset)
|
||||
.await
|
||||
.map_err(internal)?;
|
||||
let _lease = self.leases.try_pin(&dataset).await.map_err(internal)?;
|
||||
let resolved = VectorTable::resolve(&dataset, None, Some(KEY_COLUMN)).map_err(invalid)?;
|
||||
if req.query_vector.len() != resolved.dimension {
|
||||
return Err(Status::invalid_argument(format!(
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use bytes::Bytes;
|
||||
use lance::io::WrappingObjectStore;
|
||||
use object_store::{ObjectStoreExt, memory::InMemory, path::Path};
|
||||
use weed_vector_server::{metrics::Metrics, read_cache::ReadCache};
|
||||
|
||||
#[tokio::test]
|
||||
async fn immutable_reads_report_hits_misses_bytes_and_weight() {
|
||||
let metrics = Metrics::new().unwrap();
|
||||
let cache = ReadCache::new(1024).with_metrics(metrics.clone());
|
||||
let store = cache.wrap("memory", Arc::new(InMemory::new()));
|
||||
let path = Path::from("data/example.lance");
|
||||
store
|
||||
.put(&path, Bytes::from_static(b"abc").into())
|
||||
.await
|
||||
.unwrap();
|
||||
for _ in 0..2 {
|
||||
assert_eq!(
|
||||
store.get(&path).await.unwrap().bytes().await.unwrap(),
|
||||
"abc"
|
||||
);
|
||||
}
|
||||
assert_eq!(metrics.cache_requests.with_label_values(&["miss"]).get(), 1);
|
||||
assert_eq!(metrics.cache_requests.with_label_values(&["hit"]).get(), 1);
|
||||
assert_eq!(metrics.storage_bytes.get(), 3);
|
||||
assert_eq!(metrics.storage_read_seconds.get_sample_count(), 1);
|
||||
let (entries, weight) = cache.size();
|
||||
assert_eq!(entries, 1);
|
||||
assert!(weight >= 3);
|
||||
let metrics_endpoint = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let endpoint = format!("http://{}/metrics", metrics_endpoint.local_addr().unwrap());
|
||||
let task = tokio::spawn(weed_vector_server::metrics::serve_listener(
|
||||
metrics,
|
||||
metrics_endpoint,
|
||||
Some(cache),
|
||||
));
|
||||
let body = reqwest::get(endpoint).await.unwrap().text().await.unwrap();
|
||||
assert!(body.contains("SeaweedFS_vector_cache_entries 1"));
|
||||
assert!(body.contains("SeaweedFS_vector_cache_bytes "));
|
||||
task.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn cancelled_requests_are_counted_once() {
|
||||
let metrics = Metrics::new().unwrap();
|
||||
let guard = metrics.start("QueryVectors");
|
||||
let task = tokio::spawn(async move {
|
||||
let _guard = guard;
|
||||
std::future::pending::<()>().await;
|
||||
});
|
||||
task.abort();
|
||||
let _ = task.await;
|
||||
assert_eq!(
|
||||
metrics.in_flight.with_label_values(&["QueryVectors"]).get(),
|
||||
0
|
||||
);
|
||||
assert_eq!(
|
||||
metrics
|
||||
.requests
|
||||
.with_label_values(&["QueryVectors", "Cancelled"])
|
||||
.get(),
|
||||
1
|
||||
);
|
||||
assert_eq!(
|
||||
metrics
|
||||
.request_seconds
|
||||
.with_label_values(&["QueryVectors"])
|
||||
.get_sample_count(),
|
||||
1
|
||||
);
|
||||
{
|
||||
let mut guard = metrics.start("QueryVectors");
|
||||
guard.complete(None);
|
||||
}
|
||||
assert_eq!(
|
||||
metrics
|
||||
.requests
|
||||
.with_label_values(&["QueryVectors", "OK"])
|
||||
.get(),
|
||||
1
|
||||
);
|
||||
assert_eq!(
|
||||
metrics
|
||||
.requests
|
||||
.with_label_values(&["QueryVectors", "Cancelled"])
|
||||
.get(),
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn large_immutable_reads_report_bytes_without_caching() {
|
||||
let metrics = Metrics::new().unwrap();
|
||||
let cache = ReadCache::new(16 * 1024 * 1024).with_metrics(metrics.clone());
|
||||
let store = cache.wrap("memory", Arc::new(InMemory::new()));
|
||||
let path = Path::from("data/large.lance");
|
||||
let size = 5 * 1024 * 1024;
|
||||
store
|
||||
.put(&path, Bytes::from(vec![0; size]).into())
|
||||
.await
|
||||
.unwrap();
|
||||
let result = store.get(&path).await.unwrap();
|
||||
assert_eq!(metrics.storage_bytes.get(), 0);
|
||||
assert_eq!(metrics.storage_read_seconds.get_sample_count(), 0);
|
||||
assert_eq!(result.bytes().await.unwrap().len(), size);
|
||||
assert_eq!(metrics.storage_bytes.get(), size as u64);
|
||||
assert_eq!(metrics.cache_requests.with_label_values(&["miss"]).get(), 1);
|
||||
assert_eq!(metrics.storage_read_seconds.get_sample_count(), 1);
|
||||
assert_eq!(cache.size(), (0, 0));
|
||||
}
|
||||
@@ -230,6 +230,10 @@ message KeepConnectedRequest {
|
||||
// A draining filer leaves the lock ring but stays a cluster member, so peers
|
||||
// keep following its metadata until the stream closes.
|
||||
bool leave_lock_ring = 8;
|
||||
// Port of this node's Prometheus /metrics listener (-metricsPort), or 0 when
|
||||
// it is not enabled. Advertised so the admin server can scrape it without
|
||||
// exposing metrics on the client-facing service port.
|
||||
uint32 metrics_port = 9;
|
||||
}
|
||||
|
||||
message VolumeLocation {
|
||||
|
||||
@@ -138,7 +138,8 @@ pub struct Cli {
|
||||
#[arg(long = "concurrentUploadLimitMB", default_value_t = 0)]
|
||||
pub concurrent_upload_limit_mb: u32,
|
||||
|
||||
/// Limit total concurrent download size in MB, 0 means unlimited.
|
||||
/// Limit total concurrent download size in MB, 0 means unlimited; reads over
|
||||
/// the limit are sent to a replica unless readMode is local.
|
||||
#[arg(long = "concurrentDownloadLimitMB", default_value_t = 0)]
|
||||
pub concurrent_download_limit_mb: u32,
|
||||
|
||||
@@ -1175,7 +1176,7 @@ fn parse_security_config_with_env(path: &str, env: EnvLookup<'_>) -> SecurityCon
|
||||
|
||||
if let Some((key, value)) = trimmed.split_once('=') {
|
||||
let key = key.trim();
|
||||
let value = value.trim().trim_matches('"');
|
||||
let value: &str = &toml_value_text(value);
|
||||
match section {
|
||||
Section::JwtSigningRead => match key {
|
||||
"key" => cfg.jwt_read_signing_key = value.as_bytes().to_vec(),
|
||||
@@ -1265,6 +1266,20 @@ fn parse_security_config_with_env(path: &str, env: EnvLookup<'_>) -> SecurityCon
|
||||
cfg
|
||||
}
|
||||
|
||||
/// Reads the right-hand side of `key = value` the way TOML (and so Go) does:
|
||||
/// escapes decoded, literal strings kept as written, a trailing comment
|
||||
/// dropped. Text TOML rejects keeps the plain quote trimming.
|
||||
fn toml_value_text(raw: &str) -> String {
|
||||
match format!("v = {raw}").parse::<toml::Table>() {
|
||||
Ok(mut table) => match table.remove("v") {
|
||||
Some(toml::Value::String(text)) => text,
|
||||
Some(other) => other.to_string(),
|
||||
None => String::new(),
|
||||
},
|
||||
Err(_) => raw.trim().trim_matches('"').to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_security_config_path(path: &str, env: EnvLookup<'_>) -> Option<PathBuf> {
|
||||
if !path.is_empty() {
|
||||
return Some(PathBuf::from(path));
|
||||
@@ -1868,6 +1883,34 @@ ui = true
|
||||
assert!(cfg.access_ui);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_security_config_reads_toml_strings() {
|
||||
for (encoded, expected) in [
|
||||
(r#""plain""#, "plain"),
|
||||
(r#""key\n""#, "key\n"),
|
||||
(r#""quote\"slash\\tab\t""#, "quote\"slash\\tab\t"),
|
||||
(r#""key""#, "key"),
|
||||
("'literal\\key'", "literal\\key"),
|
||||
(r#""key" # comment"#, "key"),
|
||||
(r#""YWJj==""#, "YWJj=="),
|
||||
("unquoted", "unquoted"),
|
||||
] {
|
||||
let tmp = tempfile::NamedTempFile::new().unwrap();
|
||||
std::fs::write(
|
||||
tmp.path(),
|
||||
format!(
|
||||
"[jwt.signing]\nkey = {encoded}\n\n[jwt.signing.read]\nkey = {encoded}\n\
|
||||
expires_after_seconds = 30 # seconds\n"
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
let cfg = parse_security_config_with_env(tmp.path().to_str().unwrap(), &|_| None);
|
||||
assert_eq!(cfg.jwt_signing_key, expected.as_bytes(), "{encoded}");
|
||||
assert_eq!(cfg.jwt_read_signing_key, expected.as_bytes(), "{encoded}");
|
||||
assert_eq!(cfg.jwt_read_signing_expires, 30, "{encoded}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_security_config_discovers_current_directory_default() {
|
||||
let _guard = process_state_lock();
|
||||
|
||||
@@ -450,6 +450,7 @@ async fn run(
|
||||
|
||||
{
|
||||
let mut store = state.store.write().unwrap();
|
||||
store.store_dirs = config.folders.clone();
|
||||
for (i, dir) in config.folders.iter().enumerate() {
|
||||
let idx_dir = if config.idx_folder.is_empty() {
|
||||
dir.as_str()
|
||||
|
||||
@@ -5052,13 +5052,18 @@ impl VolumeServer for VolumeGrpcService {
|
||||
// for and referenced by nothing. Go does not gate here either:
|
||||
// its progress callback only runs during the transfer.
|
||||
// Update volume info with remote file reference, unless the
|
||||
// volume was compacted, replaced or removed mid-upload: the
|
||||
// object would not match what now holds this id.
|
||||
// volume was compacted, replaced, removed or written to
|
||||
// mid-upload: the object would not match what now holds this
|
||||
// id. One write lease spans the checks, the .vif save and the
|
||||
// backend swap, so no write or commit lands in between.
|
||||
let abort = {
|
||||
let store = state.store.read().unwrap();
|
||||
let abort = match store.find_volume(vid) {
|
||||
let vol = store.find_volume(vid).map(|(_, v)| v);
|
||||
let _sync_guard = vol.as_ref().map(|v| v.data_file_sync_lock().lock().unwrap());
|
||||
let _lease = vol.as_ref().map(|v| v.instance().write_lock());
|
||||
let abort = match &vol {
|
||||
None => Some(Status::not_found(format!("volume {} not found", vid))),
|
||||
Some((_, v))
|
||||
Some(v)
|
||||
if !v.is_instance(&instance)
|
||||
|| v.super_block().compaction_revision != compaction_revision =>
|
||||
{
|
||||
@@ -5067,12 +5072,22 @@ impl VolumeServer for VolumeGrpcService {
|
||||
vid
|
||||
)))
|
||||
}
|
||||
Some(_) => None,
|
||||
Some(v) => match v.dat_file_size() {
|
||||
Ok(dat_size) if dat_size == size => None,
|
||||
Ok(dat_size) => Some(Status::failed_precondition(format!(
|
||||
"volume {} data file is {} bytes, the copy holds {}: written during the copy",
|
||||
vid, dat_size, size
|
||||
))),
|
||||
Err(e) => Some(Status::internal(format!(
|
||||
"stat volume {} data file: {}",
|
||||
vid, e
|
||||
))),
|
||||
},
|
||||
};
|
||||
if abort.is_none()
|
||||
&& let Some((_, vol)) = store.find_volume(vid)
|
||||
&& let Some(vol) = &vol
|
||||
{
|
||||
vol.update_remote_files(|files| {
|
||||
vol.update_remote_files_held(|files| {
|
||||
files.push(volume_server_pb::RemoteFile {
|
||||
backend_type: backend_type.clone(),
|
||||
backend_id: backend_id.clone(),
|
||||
@@ -5100,7 +5115,7 @@ impl VolumeServer for VolumeGrpcService {
|
||||
// Switch the data backend from the local .dat to the remote
|
||||
// object so reads keep working after upload (matches Go's
|
||||
// LoadRemoteFile).
|
||||
if let Err(e) = vol.load_remote_dat_file() {
|
||||
if let Err(e) = vol.load_remote_dat_file_held() {
|
||||
return Err(Status::internal(format!(
|
||||
"volume {} failed to load remote file: {}",
|
||||
vid, e
|
||||
@@ -8068,7 +8083,7 @@ fn run_vacuum_compact(
|
||||
.begin_compact_volume(vid, preallocate);
|
||||
let result = match job {
|
||||
Ok(Some(job)) => job.run(progress),
|
||||
Ok(None) => Ok(()), // already compacting
|
||||
Ok(None) => Err(crate::storage::volume::compacting_error(vid)),
|
||||
Err(e) => Err(e),
|
||||
};
|
||||
|
||||
@@ -9691,6 +9706,68 @@ mod tests {
|
||||
let _ = s3.shutdown.send(());
|
||||
}
|
||||
|
||||
// A write acknowledged while the upload runs is not in the object; the
|
||||
// volume must keep serving the local .dat that holds it.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
|
||||
async fn test_tier_move_to_remote_aborts_when_written_mid_upload() {
|
||||
let (service, tmp) = make_local_service_with_volume("", None);
|
||||
seed_compactable_volume(&service);
|
||||
let mut s3 = spawn_multipart_s3_server();
|
||||
register_tier_backend("s3.tier_up_written", s3.endpoint.clone());
|
||||
|
||||
let stream = start_parked_tier_move(&service, &mut s3, "s3.tier_up_written", false).await;
|
||||
let data = b"needle-3".to_vec();
|
||||
let mut n = Needle {
|
||||
id: NeedleId(3),
|
||||
cookie: Cookie(3),
|
||||
data_size: data.len() as u32,
|
||||
data: data.clone(),
|
||||
..Needle::default()
|
||||
};
|
||||
service
|
||||
.state
|
||||
.store
|
||||
.read()
|
||||
.unwrap()
|
||||
.write_volume_needle(VolumeId(1), &mut n, true)
|
||||
.expect("the write lands while the upload is parked");
|
||||
s3.release.add_permits(1);
|
||||
|
||||
let terminal = tier_move_error(stream).await;
|
||||
global_s3_tier_registry()
|
||||
.write()
|
||||
.unwrap()
|
||||
.remove("s3.tier_up_written");
|
||||
let err = terminal.expect("the tier move must fail once the volume was written");
|
||||
assert_eq!(err.code(), tonic::Code::FailedPrecondition, "{err:?}");
|
||||
assert_eq!(
|
||||
s3.delete_count.load(std::sync::atomic::Ordering::SeqCst),
|
||||
1,
|
||||
"the stale object must be deleted"
|
||||
);
|
||||
{
|
||||
let store = service.state.store.read().unwrap();
|
||||
let (_, vol) = store.find_volume(VolumeId(1)).unwrap();
|
||||
assert!(!vol.has_remote_file());
|
||||
assert!(vol.volume_info().files.is_empty());
|
||||
}
|
||||
assert!(tmp.path().join("1.dat").exists());
|
||||
let mut n = Needle {
|
||||
id: NeedleId(3),
|
||||
cookie: Cookie(3),
|
||||
..Needle::default()
|
||||
};
|
||||
service
|
||||
.state
|
||||
.store
|
||||
.read()
|
||||
.unwrap()
|
||||
.read_volume_needle(VolumeId(1), &mut n)
|
||||
.expect("the acknowledged write must stay readable");
|
||||
assert_eq!(n.data, data);
|
||||
let _ = s3.shutdown.send(());
|
||||
}
|
||||
|
||||
// Go fails here too: unmounting closes the descriptor its copy reads.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
|
||||
async fn test_tier_move_to_remote_fails_when_volume_is_unmounted_mid_upload() {
|
||||
|
||||
@@ -913,7 +913,6 @@ async fn proxy_or_redirect_to_target(
|
||||
state: &VolumeServerState,
|
||||
info: ProxyRequestInfo,
|
||||
vid: VolumeId,
|
||||
allow_local_redirect: bool,
|
||||
) -> Response {
|
||||
// Look up volume locations from master
|
||||
let locations = match lookup_volume(
|
||||
@@ -961,10 +960,7 @@ async fn proxy_or_redirect_to_target(
|
||||
match state.read_mode {
|
||||
ReadMode::Proxy => proxy_request(state, &info, target).await,
|
||||
ReadMode::Redirect => redirect_request(&info, target, &state.outgoing_http_scheme),
|
||||
ReadMode::Local if allow_local_redirect => {
|
||||
redirect_request(&info, target, &state.outgoing_http_scheme)
|
||||
}
|
||||
ReadMode::Local => unreachable!(),
|
||||
ReadMode::Local => StatusCode::NOT_FOUND.into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1431,7 +1427,7 @@ async fn proxy_missing_volume(
|
||||
None => return StatusCode::NOT_FOUND.into_response(),
|
||||
};
|
||||
|
||||
proxy_or_redirect_to_target(state, info, vid, false).await
|
||||
proxy_or_redirect_to_target(state, info, vid).await
|
||||
}
|
||||
|
||||
/// Go's `proxied` query param check (loop prevention).
|
||||
@@ -1464,8 +1460,10 @@ async fn check_download_limit(
|
||||
|
||||
// Go tries proxy to replica once before the wait loop
|
||||
// (checkDownloadLimit); it does not retry on each wakeup.
|
||||
let should_try_replica =
|
||||
!is_proxied_query(&query_string) && !state.current_master().await.is_empty() && {
|
||||
let should_try_replica = state.read_mode != ReadMode::Local
|
||||
&& !is_proxied_query(&query_string)
|
||||
&& !state.current_master().await.is_empty()
|
||||
&& {
|
||||
let store = state.store.read().unwrap();
|
||||
store
|
||||
.find_volume(vid)
|
||||
@@ -1475,25 +1473,24 @@ async fn check_download_limit(
|
||||
&& let Some(info) =
|
||||
build_proxy_request_info(path, request_headers, &query_string, method)
|
||||
{
|
||||
return ControlFlow::Break(proxy_or_redirect_to_target(state, info, vid, true).await);
|
||||
return ControlFlow::Break(proxy_or_redirect_to_target(state, info, vid).await);
|
||||
}
|
||||
|
||||
// Blocking wait loop (Go's waitForDownloadSlot)
|
||||
loop {
|
||||
if tokio::time::timeout_at(deadline, state.download_notify.notified())
|
||||
.await
|
||||
.is_err()
|
||||
let notified = state.download_notify.notified();
|
||||
if state.inflight_download_bytes.load(Ordering::Relaxed)
|
||||
<= state.concurrent_download_limit
|
||||
{
|
||||
break;
|
||||
}
|
||||
if tokio::time::timeout_at(deadline, notified).await.is_err() {
|
||||
return ControlFlow::Break(json_error_with_query(
|
||||
StatusCode::TOO_MANY_REQUESTS,
|
||||
"download limit exceeded",
|
||||
uri.query(),
|
||||
));
|
||||
}
|
||||
let current = state.inflight_download_bytes.load(Ordering::Relaxed);
|
||||
if current <= state.concurrent_download_limit {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ControlFlow::Continue(true)
|
||||
@@ -6362,6 +6359,88 @@ mod tests {
|
||||
test_state_with_store(store)
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_limit_local_read_mode_waits_instead_of_proxying() {
|
||||
use crate::storage::super_block::ReplicaPlacement;
|
||||
|
||||
let tmp = tempfile::TempDir::new().unwrap();
|
||||
let mut state = volume_test_state(&tmp);
|
||||
{
|
||||
let s = Arc::get_mut(&mut state).unwrap();
|
||||
s.read_mode = ReadMode::Local;
|
||||
s.concurrent_download_limit = 1;
|
||||
s.inflight_download_data_timeout = std::time::Duration::from_millis(50);
|
||||
}
|
||||
*state.current_master_url.write().await = "127.0.0.1:1".to_string();
|
||||
state.inflight_download_bytes.store(2, Ordering::Relaxed);
|
||||
state
|
||||
.store
|
||||
.read()
|
||||
.unwrap()
|
||||
.find_volume(VolumeId(1))
|
||||
.unwrap()
|
||||
.1
|
||||
.set_replica_placement(ReplicaPlacement::from_string("001").unwrap())
|
||||
.unwrap();
|
||||
|
||||
let path = "/1,0123456789abcdef";
|
||||
let uri: axum::http::Uri = path.parse().unwrap();
|
||||
let flow = check_download_limit(
|
||||
&state,
|
||||
&uri,
|
||||
&HeaderMap::new(),
|
||||
path,
|
||||
VolumeId(1),
|
||||
&Method::GET,
|
||||
)
|
||||
.await;
|
||||
match flow {
|
||||
ControlFlow::Break(resp) => assert_eq!(resp.status(), StatusCode::TOO_MANY_REQUESTS),
|
||||
ControlFlow::Continue(_) => panic!("read over the download limit must not proceed"),
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_limit_wait_sees_release_before_waiting() {
|
||||
let mut state = streaming_test_state();
|
||||
{
|
||||
let s = Arc::get_mut(&mut state).unwrap();
|
||||
s.read_mode = ReadMode::Proxy;
|
||||
s.concurrent_download_limit = 1;
|
||||
s.inflight_download_data_timeout = std::time::Duration::from_secs(5);
|
||||
}
|
||||
*state.current_master_url.write().await = "127.0.0.1:1".to_string();
|
||||
state.inflight_download_bytes.store(2, Ordering::Relaxed);
|
||||
|
||||
let master_guard = state.current_master_url.write().await;
|
||||
let waiter = tokio::spawn({
|
||||
let state = state.clone();
|
||||
async move {
|
||||
let path = "/1,0123456789abcdef";
|
||||
let uri: axum::http::Uri = path.parse().unwrap();
|
||||
check_download_limit(
|
||||
&state,
|
||||
&uri,
|
||||
&HeaderMap::new(),
|
||||
path,
|
||||
VolumeId(1),
|
||||
&Method::GET,
|
||||
)
|
||||
.await
|
||||
}
|
||||
});
|
||||
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
|
||||
state.inflight_download_bytes.store(0, Ordering::Relaxed);
|
||||
state.download_notify.notify_waiters();
|
||||
drop(master_guard);
|
||||
|
||||
let flow = tokio::time::timeout(std::time::Duration::from_secs(2), waiter)
|
||||
.await
|
||||
.expect("waiter missed the released download slot")
|
||||
.unwrap();
|
||||
assert!(matches!(flow, ControlFlow::Continue(true)));
|
||||
}
|
||||
|
||||
/// Write a needle to volume 1 and return its URL path.
|
||||
fn put_test_needle(state: &VolumeServerState, id: u64, data: &[u8]) -> String {
|
||||
put_test_needle_with(state, id, data, |_| {})
|
||||
|
||||
@@ -376,9 +376,10 @@ fn process_batch(state: Arc<VolumeServerState>, batch: Vec<WriteRequest>) {
|
||||
for (needle, fsync, response_tx, pending) in entries {
|
||||
// A delete reaching a remounted volume cannot cancel a write
|
||||
// queued for the old one.
|
||||
if let (Ok(vol), Some(pending)) = (&vol, &pending)
|
||||
&& !vol.tracks_pending_write(pending)
|
||||
if let (Ok(vol), Some(tracked)) = (&vol, &pending)
|
||||
&& !vol.tracks_pending_write(tracked)
|
||||
{
|
||||
drop(pending);
|
||||
let _ = response_tx.send(Err(VolumeError::NotFound));
|
||||
continue;
|
||||
}
|
||||
@@ -396,6 +397,9 @@ fn process_batch(state: Arc<VolumeServerState>, batch: Vec<WriteRequest>) {
|
||||
})
|
||||
.collect(),
|
||||
};
|
||||
// Untrack before replying, as Go does: a caller that sees its write
|
||||
// finish must not still find it pending.
|
||||
drop(pendings);
|
||||
for (response_tx, result) in senders.into_iter().zip(results) {
|
||||
// Send result back; ignore error if receiver dropped.
|
||||
let _ = response_tx.send(result);
|
||||
|
||||
@@ -58,6 +58,8 @@ pub struct DiskLocation {
|
||||
/// skips a claimed vid outright and claims any other through its load,
|
||||
/// so a VolumeCopy's .note sweep cannot unlink files it still writes.
|
||||
pub(crate) load_guard: Option<Arc<Mutex<HashSet<VolumeId>>>>,
|
||||
/// The data directory of every disk on this server.
|
||||
pub(crate) store_dirs: Vec<String>,
|
||||
}
|
||||
|
||||
/// Keeps `vid` in the copy-claim set through one scan load so a VolumeCopy
|
||||
@@ -123,6 +125,7 @@ impl DiskLocation {
|
||||
disk_free_bytes: AtomicU64::new(0),
|
||||
min_free_space,
|
||||
load_guard: None,
|
||||
store_dirs: Vec::new(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -486,8 +489,20 @@ impl DiskLocation {
|
||||
|
||||
// Custom ratio comes from the volume's own .vif; the server holds no
|
||||
// cluster EC config in memory.
|
||||
let data_shards =
|
||||
ec_data_shards_from_vif(&self.directory, &self.idx_directory, collection, vid);
|
||||
let data_shards = ec_data_shards_from_vif(
|
||||
&self.directory,
|
||||
&self.idx_directory,
|
||||
&self.store_dirs,
|
||||
collection,
|
||||
vid,
|
||||
);
|
||||
if data_shards == 0 {
|
||||
warn!(
|
||||
volume_id = vid.0,
|
||||
"sibling .vif files disagree on the encode; keeping EC shards"
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
// On-disk .dat: an empty <= superblock one is a stub; a transient stat
|
||||
// error keeps the shards rather than deleting.
|
||||
@@ -1020,7 +1035,9 @@ impl DiskLocation {
|
||||
// propagate the error to the caller.
|
||||
let created = !self.ec_volumes.contains_key(&vid);
|
||||
if created {
|
||||
let ec_vol = EcVolume::new(&dir, idx_dir, collection, vid).map_err(VolumeError::Io)?;
|
||||
let ec_vol =
|
||||
EcVolume::new_with_vif_dirs(&dir, idx_dir, &self.store_dirs, collection, vid)
|
||||
.map_err(VolumeError::Io)?;
|
||||
self.ec_volumes.insert(vid, ec_vol);
|
||||
}
|
||||
let ec_vol = self.ec_volumes.get_mut(&vid).expect("just inserted above");
|
||||
@@ -1441,6 +1458,7 @@ fn rm_if_present(path: String) -> io::Result<()> {
|
||||
fn ec_data_shards_from_vif(
|
||||
directory: &str,
|
||||
idx_directory: &str,
|
||||
store_dirs: &[String],
|
||||
collection: &str,
|
||||
vid: VolumeId,
|
||||
) -> usize {
|
||||
@@ -1459,6 +1477,23 @@ fn ec_data_shards_from_vif(
|
||||
break;
|
||||
}
|
||||
}
|
||||
match crate::storage::erasure_coding::ec_volume::sibling_ec_config_vif(
|
||||
directory,
|
||||
idx_directory,
|
||||
store_dirs,
|
||||
collection,
|
||||
vid,
|
||||
) {
|
||||
Err(()) => return 0,
|
||||
Ok(Some(vi)) => {
|
||||
if let Some(ds) = vi.ec_shard_config.map(|c| c.data_shards as usize)
|
||||
&& ds > 0
|
||||
{
|
||||
return ds;
|
||||
}
|
||||
}
|
||||
Ok(None) => {}
|
||||
}
|
||||
DATA_SHARDS_COUNT
|
||||
}
|
||||
|
||||
@@ -1542,7 +1577,7 @@ pub(crate) fn vif_references_remote_file(vif_path: &str) -> bool {
|
||||
/// True when a `.vif` records an EC shard config, i.e. the volume was
|
||||
/// erasure-coded. Such a volume keeps no local `.dat`, so an empty `.dat`
|
||||
/// alongside it is a leftover stub safe to remove.
|
||||
fn vif_is_ec_volume(vif_path: &str) -> bool {
|
||||
pub(crate) fn vif_is_ec_volume(vif_path: &str) -> bool {
|
||||
fs::read_to_string(vif_path)
|
||||
.ok()
|
||||
.and_then(|s| serde_json::from_str::<VifVolumeInfo>(&s).ok())
|
||||
|
||||
@@ -272,6 +272,96 @@ fn locate_vif_path(dir: &str, dir_idx: &str, collection: &str, volume_id: Volume
|
||||
data_vif
|
||||
}
|
||||
|
||||
/// [`locate_vif_path`], except that a data-dir `.vif` recording no EC config
|
||||
/// yields to the idx dir's when that one records it: a source volume's own
|
||||
/// `.vif` stays on a disk that later receives shards of the same volume id,
|
||||
/// while the encode's `.vif` lands with the index on a sibling.
|
||||
fn resolve_vif_path(dir: &str, dir_idx: &str, collection: &str, volume_id: VolumeId) -> String {
|
||||
let path = locate_vif_path(dir, dir_idx, collection, volume_id);
|
||||
let data_vif = format!(
|
||||
"{}.vif",
|
||||
crate::storage::volume::volume_file_name(dir, collection, volume_id),
|
||||
);
|
||||
if dir_idx == dir || path != data_vif {
|
||||
return path;
|
||||
}
|
||||
let idx_vif = format!(
|
||||
"{}.vif",
|
||||
crate::storage::volume::volume_file_name(dir_idx, collection, volume_id),
|
||||
);
|
||||
prefer_ec_config_vif(path, idx_vif)
|
||||
}
|
||||
|
||||
fn read_vif_file(path: &str) -> Result<Option<crate::storage::volume::VifVolumeInfo>, ()> {
|
||||
match std::fs::read_to_string(path) {
|
||||
Ok(content) if content.trim().is_empty() => Ok(None),
|
||||
Ok(content) => serde_json::from_str(&content).map(Some).map_err(|_| ()),
|
||||
Err(e) if e.kind() == io::ErrorKind::NotFound => Ok(None),
|
||||
Err(_) => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns `alt` when `local` records no EC config but `alt` does.
|
||||
fn prefer_ec_config_vif(local: String, alt: String) -> String {
|
||||
match read_vif_file(&local) {
|
||||
Ok(Some(info)) if info.ec_shard_config.is_some() => return local,
|
||||
Err(()) => return local,
|
||||
_ => {}
|
||||
}
|
||||
match read_vif_file(&alt) {
|
||||
Ok(Some(info)) if info.ec_shard_config.is_some() => alt,
|
||||
_ => local,
|
||||
}
|
||||
}
|
||||
|
||||
/// The `.vif` a disk mounting against a shared `-dir.idx` takes from a sibling
|
||||
/// data dir in `vif_dirs`: its own records no EC config, the index is not its
|
||||
/// own, and every sibling `.vif` recording an EC config names the same run.
|
||||
/// `Err` when a sibling `.vif` cannot be read or the siblings name different runs.
|
||||
pub(crate) fn sibling_ec_config_vif(
|
||||
dir: &str,
|
||||
dir_idx: &str,
|
||||
vif_dirs: &[String],
|
||||
collection: &str,
|
||||
volume_id: VolumeId,
|
||||
) -> Result<Option<crate::storage::volume::VifVolumeInfo>, ()> {
|
||||
let data_base = crate::storage::volume::volume_file_name(dir, collection, volume_id);
|
||||
let data_vif = format!("{}.vif", data_base);
|
||||
if dir_idx == dir
|
||||
|| vif_dirs.iter().any(|d| d == dir_idx)
|
||||
|| matches!(ecx_file_size(&format!("{}.ecx", data_base)), Some(n) if n > 0)
|
||||
|| resolve_vif_path(dir, dir_idx, collection, volume_id) != data_vif
|
||||
{
|
||||
return Ok(None);
|
||||
}
|
||||
match read_vif_file(&data_vif) {
|
||||
Ok(Some(info)) if info.ec_shard_config.is_some() => return Ok(None),
|
||||
Err(()) => return Ok(None),
|
||||
_ => {}
|
||||
}
|
||||
let mut found: Option<crate::storage::volume::VifVolumeInfo> = None;
|
||||
for other in vif_dirs.iter().filter(|d| d.as_str() != dir) {
|
||||
let path = format!(
|
||||
"{}.vif",
|
||||
crate::storage::volume::volume_file_name(other, collection, volume_id)
|
||||
);
|
||||
let info = match read_vif_file(&path) {
|
||||
Ok(Some(info)) if info.ec_shard_config.is_some() => info,
|
||||
Ok(_) => continue,
|
||||
Err(()) => return Err(()),
|
||||
};
|
||||
let run = |v: &crate::storage::volume::VifVolumeInfo| {
|
||||
v.ec_shard_config.as_ref().map(|c| c.encode_ts_ns)
|
||||
};
|
||||
match &found {
|
||||
None => found = Some(info),
|
||||
Some(f) if run(f) != run(&info) => return Err(()),
|
||||
Some(_) => {}
|
||||
}
|
||||
}
|
||||
Ok(found)
|
||||
}
|
||||
|
||||
/// Load the volume's `.vif` (data dir first, then idx dir, then the active
|
||||
/// generation's versioned sidecar — see [`locate_vif_path`]). Absent
|
||||
/// everywhere is legal — legacy volumes predate the sidecar — and returns
|
||||
@@ -286,7 +376,7 @@ pub fn load_vif_info(
|
||||
collection: &str,
|
||||
volume_id: VolumeId,
|
||||
) -> io::Result<Option<crate::storage::volume::VifVolumeInfo>> {
|
||||
let vif_path = locate_vif_path(dir, dir_idx, collection, volume_id);
|
||||
let vif_path = resolve_vif_path(dir, dir_idx, collection, volume_id);
|
||||
match std::fs::read_to_string(&vif_path) {
|
||||
Ok(content) if content.trim().is_empty() => Ok(None),
|
||||
Ok(content) => serde_json::from_str(&content).map(Some).map_err(|e| {
|
||||
@@ -336,15 +426,16 @@ pub fn load_vif_info_across_dirs(
|
||||
// pointed callers at the wrong disk whenever the vif lived with the
|
||||
// index — and a caller resolving the rest of the volume's metadata
|
||||
// against that answer would look in a directory holding none of it.
|
||||
let data_vif = format!(
|
||||
let idx_vif = format!(
|
||||
"{}.vif",
|
||||
crate::storage::volume::volume_file_name(dir, collection, volume_id)
|
||||
crate::storage::volume::volume_file_name(dir_idx, collection, volume_id)
|
||||
);
|
||||
let found_in = if std::path::Path::new(&data_vif).exists() {
|
||||
dir.to_string()
|
||||
} else {
|
||||
dir_idx.to_string()
|
||||
};
|
||||
let found_in =
|
||||
if dir_idx != dir && resolve_vif_path(dir, dir_idx, collection, volume_id) == idx_vif {
|
||||
dir_idx.to_string()
|
||||
} else {
|
||||
dir.to_string()
|
||||
};
|
||||
return Ok(Some((vif, found_in)));
|
||||
}
|
||||
for other in other_dirs {
|
||||
@@ -569,7 +660,25 @@ impl EcVolume {
|
||||
collection: &str,
|
||||
volume_id: VolumeId,
|
||||
) -> io::Result<Self> {
|
||||
Self::open_with(dir, dir_idx, collection, volume_id, EcjFsOps::REAL)
|
||||
Self::open_with(dir, dir_idx, collection, volume_id, EcjFsOps::REAL, &[])
|
||||
}
|
||||
|
||||
/// [`Self::new`] for a disk whose server's data directories are `vif_dirs`.
|
||||
pub fn new_with_vif_dirs(
|
||||
dir: &str,
|
||||
dir_idx: &str,
|
||||
vif_dirs: &[String],
|
||||
collection: &str,
|
||||
volume_id: VolumeId,
|
||||
) -> io::Result<Self> {
|
||||
Self::open_with(
|
||||
dir,
|
||||
dir_idx,
|
||||
collection,
|
||||
volume_id,
|
||||
EcjFsOps::REAL,
|
||||
vif_dirs,
|
||||
)
|
||||
}
|
||||
|
||||
/// [`Self::new`] with the journal-compaction filesystem steps supplied, so
|
||||
@@ -580,10 +689,15 @@ impl EcVolume {
|
||||
collection: &str,
|
||||
volume_id: VolumeId,
|
||||
ecj_ops: EcjFsOps,
|
||||
vif_dirs: &[String],
|
||||
) -> io::Result<Self> {
|
||||
// One load of the volume's `.vif`, used for both the shard config and
|
||||
// the version / dat-size fields below.
|
||||
let vif = load_vif_info(dir, dir_idx, collection, volume_id)?;
|
||||
let vif = sibling_ec_config_vif(dir, dir_idx, vif_dirs, collection, volume_id)
|
||||
.ok()
|
||||
.flatten()
|
||||
.or(vif);
|
||||
// Both directories: a split -dir/-dir.idx layout keeps the .ecsum with
|
||||
// the INDEX, and it is the only layout record a volume whose vif is
|
||||
// absent or config-free still has.
|
||||
@@ -3580,7 +3694,7 @@ mod tests {
|
||||
);
|
||||
let before = std::fs::read(&ecj_path).unwrap();
|
||||
(
|
||||
EcVolume::open_with(dir, dir, "", vid, ops),
|
||||
EcVolume::open_with(dir, dir, "", vid, ops, &[]),
|
||||
ecj_path,
|
||||
before,
|
||||
)
|
||||
@@ -3801,7 +3915,7 @@ mod tests {
|
||||
read_at: rewrite_after_last_read,
|
||||
..EcjFsOps::REAL
|
||||
};
|
||||
let vol = EcVolume::open_with(dir, dir, "", vid, ops).unwrap();
|
||||
let vol = EcVolume::open_with(dir, dir, "", vid, ops, &[]).unwrap();
|
||||
assert!(
|
||||
IN_PLACE_REWRITE.with(|r| r.borrow().is_none()),
|
||||
"the rewrite never ran"
|
||||
@@ -4108,6 +4222,143 @@ mod tests {
|
||||
assert_eq!(vol.block_size, 0, "legacy layout for a pre-record volume");
|
||||
}
|
||||
|
||||
/// Shards placed on the disk that still holds the source volume's `.vif`
|
||||
/// mount against an index on a sibling disk; the encode identity and
|
||||
/// layout come from the sibling's `.vif`, not the source's config-free one.
|
||||
#[test]
|
||||
fn test_ec_volume_prefers_idx_vif_over_config_free_data_vif() {
|
||||
let data_tmp = TempDir::new().unwrap();
|
||||
let idx_tmp = TempDir::new().unwrap();
|
||||
let dir = data_tmp.path().to_str().unwrap();
|
||||
let dir_idx = idx_tmp.path().to_str().unwrap();
|
||||
write_ecx_file(dir_idx, "pics", VolumeId(1), &[]);
|
||||
let data_base = crate::storage::volume::volume_file_name(dir, "pics", VolumeId(1));
|
||||
std::fs::write(
|
||||
format!("{}.vif", data_base),
|
||||
r#"{"version":3,"readOnly":true}"#,
|
||||
)
|
||||
.unwrap();
|
||||
let vif = crate::storage::volume::VifVolumeInfo {
|
||||
version: 3,
|
||||
dat_file_size: 4096,
|
||||
ec_shard_config: Some(crate::storage::volume::VifEcShardConfig {
|
||||
data_shards: 12,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: 1_700_000_000_123_456_789,
|
||||
block_size: 3 * 1024 * 1024,
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
let idx_base = crate::storage::volume::volume_file_name(dir_idx, "pics", VolumeId(1));
|
||||
std::fs::write(
|
||||
format!("{}.vif", idx_base),
|
||||
serde_json::to_string_pretty(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let vol = EcVolume::new(dir, dir_idx, "pics", VolumeId(1)).unwrap();
|
||||
assert_eq!(vol.encode_ts_ns, 1_700_000_000_123_456_789);
|
||||
assert_eq!((vol.data_shards, vol.parity_shards), (12, 4));
|
||||
assert_eq!(vol.block_size, 3 * 1024 * 1024);
|
||||
assert_eq!(vol.dat_file_size, 4096);
|
||||
let (_, found_in) = load_vif_info_across_dirs(dir, dir_idx, &[], "pics", VolumeId(1))
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
assert_eq!(found_in, dir_idx);
|
||||
}
|
||||
|
||||
/// A data-dir `.vif` that records an EC config stays authoritative.
|
||||
#[test]
|
||||
fn test_ec_volume_keeps_data_vif_with_ec_config() {
|
||||
let data_tmp = TempDir::new().unwrap();
|
||||
let idx_tmp = TempDir::new().unwrap();
|
||||
let dir = data_tmp.path().to_str().unwrap();
|
||||
let dir_idx = idx_tmp.path().to_str().unwrap();
|
||||
write_ecx_file(dir_idx, "pics", VolumeId(1), &[]);
|
||||
for (d, ts) in [(dir, 11), (dir_idx, 22)] {
|
||||
let vif = crate::storage::volume::VifVolumeInfo {
|
||||
version: 3,
|
||||
ec_shard_config: Some(crate::storage::volume::VifEcShardConfig {
|
||||
data_shards: 10,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: ts,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
let base = crate::storage::volume::volume_file_name(d, "pics", VolumeId(1));
|
||||
std::fs::write(
|
||||
format!("{}.vif", base),
|
||||
serde_json::to_string_pretty(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let vol = EcVolume::new(dir, dir_idx, "pics", VolumeId(1)).unwrap();
|
||||
assert_eq!(vol.encode_ts_ns, 11);
|
||||
}
|
||||
|
||||
/// With a shared `-dir.idx` the encode's `.vif` sits in the data dir of the
|
||||
/// disk that received the index, so a disk holding a source volume's
|
||||
/// config-free `.vif` takes it from that sibling, but only when the
|
||||
/// siblings agree on one run.
|
||||
#[test]
|
||||
fn test_ec_volume_takes_sibling_vif_with_shared_index() {
|
||||
const RUN_A: i64 = 1_700_000_000_000_000_011;
|
||||
const RUN_B: i64 = 1_700_000_000_000_000_022;
|
||||
let cases: [(&str, &[i64], bool, i64); 4] = [
|
||||
("one sibling", &[RUN_A], false, RUN_A),
|
||||
("siblings agree", &[RUN_A, RUN_A], false, RUN_A),
|
||||
("siblings disagree", &[RUN_A, RUN_B], false, 0),
|
||||
("local index", &[RUN_A], true, 0),
|
||||
];
|
||||
for (name, sibling_ts, local_index, want) in cases {
|
||||
let data_tmp = TempDir::new().unwrap();
|
||||
let idx_tmp = TempDir::new().unwrap();
|
||||
let dir = data_tmp.path().to_str().unwrap();
|
||||
let dir_idx = idx_tmp.path().to_str().unwrap();
|
||||
let entry = [(NeedleId(1), Offset::from_actual_offset(8), Size(10))];
|
||||
write_ecx_file(dir_idx, "c", VolumeId(1), &entry);
|
||||
if local_index {
|
||||
write_ecx_file(dir, "c", VolumeId(1), &entry);
|
||||
}
|
||||
let data_base = crate::storage::volume::volume_file_name(dir, "c", VolumeId(1));
|
||||
std::fs::write(
|
||||
format!("{}.vif", data_base),
|
||||
r#"{"version":3,"readOnly":true}"#,
|
||||
)
|
||||
.unwrap();
|
||||
let mut dirs = vec![dir.to_string()];
|
||||
let mut siblings = Vec::new();
|
||||
for &ts in sibling_ts {
|
||||
let sibling = TempDir::new().unwrap();
|
||||
let sibling_dir = sibling.path().to_str().unwrap().to_string();
|
||||
let vif = crate::storage::volume::VifVolumeInfo {
|
||||
version: 3,
|
||||
dat_file_size: 4096,
|
||||
ec_shard_config: Some(crate::storage::volume::VifEcShardConfig {
|
||||
data_shards: 10,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: ts,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
let base = crate::storage::volume::volume_file_name(&sibling_dir, "c", VolumeId(1));
|
||||
std::fs::write(
|
||||
format!("{}.vif", base),
|
||||
serde_json::to_string(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
dirs.push(sibling_dir);
|
||||
siblings.push(sibling);
|
||||
}
|
||||
|
||||
let vol = EcVolume::new_with_vif_dirs(dir, dir_idx, &dirs, "c", VolumeId(1)).unwrap();
|
||||
assert_eq!(vol.encode_ts_ns, want, "{}", name);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ec_volume_wide_ratio_vif_config() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
|
||||
@@ -122,6 +122,9 @@ pub struct Store {
|
||||
/// The copy-claim set installed on every location by
|
||||
/// set_volume_load_guard, kept here so a later add_location gets it too.
|
||||
load_guard: Option<Arc<Mutex<HashSet<VolumeId>>>>,
|
||||
/// The data directory of every disk this server loads, set before the
|
||||
/// first `add_location` so a disk's EC mounts can see its siblings.
|
||||
pub store_dirs: Vec<String>,
|
||||
}
|
||||
|
||||
impl Store {
|
||||
@@ -148,6 +151,7 @@ impl Store {
|
||||
disk_stats_of: super::disk_location::get_disk_stats,
|
||||
load_guard: None,
|
||||
preallocate_supported: PREALLOCATE_SUPPORTED,
|
||||
store_dirs: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +174,7 @@ impl Store {
|
||||
tags,
|
||||
)?;
|
||||
loc.load_guard = self.load_guard.clone();
|
||||
loc.store_dirs = self.store_dirs.clone();
|
||||
loc.load_existing_volumes(self.needle_map_kind)?;
|
||||
|
||||
// Check for duplicate volume IDs across existing locations
|
||||
@@ -1807,7 +1812,7 @@ impl Store {
|
||||
{
|
||||
match self.begin_compact_volume(vid, preallocate)? {
|
||||
Some(job) => job.run(progress_fn),
|
||||
None => Ok(()),
|
||||
None => Err(crate::storage::volume::compacting_error(vid)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3671,8 +3676,8 @@ mod tests {
|
||||
assert!(store.cleanup_compact_volume(vid).is_err());
|
||||
let (_, v) = store.find_volume(vid).unwrap();
|
||||
assert!(v.relocate_index_to(other.path().to_str().unwrap()).is_err());
|
||||
// Go parity: a commit that finds the volume compacting is a no-op.
|
||||
store.commit_compact_volume(vid).unwrap();
|
||||
assert!(store.commit_compact_volume(vid).is_err());
|
||||
assert!(store.compact_volume(vid, 0, 0, |_| true).is_err());
|
||||
|
||||
let (_, v) = store.find_volume(vid).expect("still mounted");
|
||||
assert!(v.is_compacting());
|
||||
|
||||
@@ -8,7 +8,9 @@ use std::path::Path;
|
||||
|
||||
use tracing::{info, warn};
|
||||
|
||||
use crate::storage::disk_location::{DiskLocation, parse_collection_volume_id_pub};
|
||||
use crate::storage::disk_location::{
|
||||
DiskLocation, parse_collection_volume_id_pub, vif_is_ec_volume,
|
||||
};
|
||||
use crate::storage::store::Store;
|
||||
use crate::storage::types::VolumeId;
|
||||
|
||||
@@ -207,6 +209,33 @@ fn mirror_sidecars_for_volume(
|
||||
collection: &str,
|
||||
vid: VolumeId,
|
||||
) -> io::Result<usize> {
|
||||
// A local .vif with no EC config (a source volume's own) would shadow the
|
||||
// owner's once the index is copied next to it; keep mounting across disks.
|
||||
let dst_vif = sidecar_dest_path(dst_data_dir, dst_idx_dir, collection, vid, ".vif");
|
||||
if path_is_regular_file(&dst_vif)
|
||||
&& !vif_is_ec_volume(&dst_vif)
|
||||
&& (vif_is_ec_volume(&sidecar_dest_path(
|
||||
src_data_dir,
|
||||
src_idx_dir,
|
||||
collection,
|
||||
vid,
|
||||
".vif",
|
||||
)) || vif_is_ec_volume(&sidecar_dest_path(
|
||||
src_idx_dir,
|
||||
src_data_dir,
|
||||
collection,
|
||||
vid,
|
||||
".vif",
|
||||
)))
|
||||
{
|
||||
info!(
|
||||
volume_id = vid.0,
|
||||
collection = %collection,
|
||||
vif = %dst_vif,
|
||||
"local .vif records no EC config; not mirroring EC sidecars",
|
||||
);
|
||||
return Ok(0);
|
||||
}
|
||||
let mut copied = 0usize;
|
||||
for ext in EC_MIRRORED_SIDECARS {
|
||||
let dst = sidecar_dest_path(dst_data_dir, dst_idx_dir, collection, vid, ext);
|
||||
@@ -391,6 +420,222 @@ mod tests {
|
||||
assert_eq!(ecj_dst, ecj, ".ecj mirrored bytes differ from source");
|
||||
}
|
||||
|
||||
/// Shards on a disk that still holds the source volume's config-free
|
||||
/// `.vif` must mount with the owner's encode identity: mirroring the index
|
||||
/// next to that `.vif` would make the disk mount through it.
|
||||
#[test]
|
||||
fn mirror_skips_disk_with_config_free_vif() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let dir0 = tmp.path().join("data0");
|
||||
let dir1 = tmp.path().join("data1");
|
||||
fs::create_dir_all(&dir0).unwrap();
|
||||
fs::create_dir_all(&dir1).unwrap();
|
||||
|
||||
let collection = "c";
|
||||
let vid = 4122u32;
|
||||
plant_shard(&dir0, collection, vid, 2);
|
||||
plant_shard(&dir1, collection, vid, 0);
|
||||
fs::write(
|
||||
dir0.join(format!("{}_{}.vif", collection, vid)),
|
||||
r#"{"version":3,"readOnly":true}"#,
|
||||
)
|
||||
.unwrap();
|
||||
plant_ecx(&dir1, collection, vid, &[0xA1u8; 20]);
|
||||
let vif = VifVolumeInfo {
|
||||
version: 3,
|
||||
ec_shard_config: Some(VifEcShardConfig {
|
||||
data_shards: 10,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: 1_700_000_000_000_000_042,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
fs::write(
|
||||
dir1.join(format!("{}_{}.vif", collection, vid)),
|
||||
serde_json::to_string(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut store = Store::new(NeedleMapKind::InMemory);
|
||||
add_loc(&mut store, &dir0);
|
||||
add_loc(&mut store, &dir1);
|
||||
|
||||
assert!(
|
||||
!dir0.join(format!("{}_{}.ecx", collection, vid)).exists(),
|
||||
".ecx mirrored next to the config-free .vif"
|
||||
);
|
||||
let ec_vol = store.locations[0]
|
||||
.find_ec_volume(VolumeId(vid))
|
||||
.expect("dir0 ec volume mounted");
|
||||
assert_eq!(ec_vol.encode_ts_ns, 1_700_000_000_000_000_042);
|
||||
}
|
||||
|
||||
/// With a shared `-dir.idx` every disk sees the `.ecx`, and only the disk
|
||||
/// that received it holds the encode's `.vif`. A disk loaded first that
|
||||
/// still holds the source volume's config-free `.vif` must take that
|
||||
/// identity from its sibling.
|
||||
#[test]
|
||||
fn shared_index_disk_takes_sibling_vif_on_startup() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let dir0 = tmp.path().join("data0");
|
||||
let dir1 = tmp.path().join("data1");
|
||||
let idx = tmp.path().join("idx");
|
||||
for d in [&dir0, &dir1, &idx] {
|
||||
fs::create_dir_all(d).unwrap();
|
||||
}
|
||||
|
||||
let collection = "c";
|
||||
let vid = 4123u32;
|
||||
plant_shard(&dir0, collection, vid, 2);
|
||||
plant_shard(&dir1, collection, vid, 0);
|
||||
fs::write(
|
||||
dir0.join(format!("{}_{}.vif", collection, vid)),
|
||||
r#"{"version":3,"readOnly":true}"#,
|
||||
)
|
||||
.unwrap();
|
||||
plant_ecx(&idx, collection, vid, &[0xA1u8; 20]);
|
||||
let vif = VifVolumeInfo {
|
||||
version: 3,
|
||||
ec_shard_config: Some(VifEcShardConfig {
|
||||
data_shards: 10,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: 1_700_000_000_000_000_043,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
fs::write(
|
||||
dir1.join(format!("{}_{}.vif", collection, vid)),
|
||||
serde_json::to_string(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let mut store = Store::new(NeedleMapKind::InMemory);
|
||||
store.store_dirs = vec![
|
||||
dir0.to_str().unwrap().to_string(),
|
||||
dir1.to_str().unwrap().to_string(),
|
||||
];
|
||||
for dir in [&dir0, &dir1] {
|
||||
store
|
||||
.add_location(
|
||||
dir.to_str().unwrap(),
|
||||
idx.to_str().unwrap(),
|
||||
100,
|
||||
DiskType::HardDrive,
|
||||
MinFreeSpace::Percent(0.0),
|
||||
Vec::new(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
for loc in &store.locations {
|
||||
let ec_vol = loc
|
||||
.find_ec_volume(VolumeId(vid))
|
||||
.unwrap_or_else(|| panic!("{} ec volume mounted", loc.directory));
|
||||
assert_eq!(
|
||||
ec_vol.encode_ts_ns, 1_700_000_000_000_000_043,
|
||||
"{}",
|
||||
loc.directory
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Starts a store whose first disk still holds the source `.dat`, its
|
||||
/// config-free `.vif` and one 12+4 shard, with the `.ecx` in a shared
|
||||
/// index dir and one sibling encode `.vif` per entry of `sibling_runs`.
|
||||
/// Asserts the source `.dat`, the shard and the `.ecx` survive startup.
|
||||
fn start_with_sibling_encode_vifs(sibling_runs: &[i64]) -> Store {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let dirs: Vec<_> = (0..=sibling_runs.len())
|
||||
.map(|i| tmp.path().join(format!("data{}", i)))
|
||||
.collect();
|
||||
let idx = tmp.path().join("idx");
|
||||
for d in dirs.iter().chain([&idx]) {
|
||||
fs::create_dir_all(d).unwrap();
|
||||
}
|
||||
|
||||
let collection = "c";
|
||||
let vid = 4124u32;
|
||||
let base0 = dirs[0].join(format!("{}_{}", collection, vid));
|
||||
let dat = format!("{}.dat", base0.display());
|
||||
let shard = format!("{}.ec02", base0.display());
|
||||
fs::File::create(&dat)
|
||||
.unwrap()
|
||||
.set_len(11 * 1024 * 1024)
|
||||
.unwrap();
|
||||
fs::File::create(&shard)
|
||||
.unwrap()
|
||||
.set_len(1024 * 1024)
|
||||
.unwrap();
|
||||
fs::write(
|
||||
format!("{}.vif", base0.display()),
|
||||
r#"{"version":3,"readOnly":true}"#,
|
||||
)
|
||||
.unwrap();
|
||||
plant_ecx(&idx, collection, vid, &[0xA1u8; 20]);
|
||||
for (dir, run) in dirs[1..].iter().zip(sibling_runs) {
|
||||
let vif = VifVolumeInfo {
|
||||
version: 3,
|
||||
ec_shard_config: Some(VifEcShardConfig {
|
||||
data_shards: 12,
|
||||
parity_shards: 4,
|
||||
encode_ts_ns: *run,
|
||||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
};
|
||||
fs::write(
|
||||
dir.join(format!("{}_{}.vif", collection, vid)),
|
||||
serde_json::to_string(&vif).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let mut store = Store::new(NeedleMapKind::InMemory);
|
||||
store.store_dirs = dirs
|
||||
.iter()
|
||||
.map(|d| d.to_str().unwrap().to_string())
|
||||
.collect();
|
||||
for dir in &dirs {
|
||||
store
|
||||
.add_location(
|
||||
dir.to_str().unwrap(),
|
||||
idx.to_str().unwrap(),
|
||||
100,
|
||||
DiskType::HardDrive,
|
||||
MinFreeSpace::Percent(0.0),
|
||||
Vec::new(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let ecx = idx.join(format!("{}_{}.ecx", collection, vid));
|
||||
for path in [dat.as_str(), shard.as_str(), ecx.to_str().unwrap()] {
|
||||
assert!(Path::new(path).exists(), "{} removed at startup", path);
|
||||
}
|
||||
store
|
||||
}
|
||||
|
||||
/// A disk still holding the source `.dat` sizes its shards by the
|
||||
/// sibling's encode `.vif` before the startup check decides whether they
|
||||
/// are leftovers of an interrupted encode.
|
||||
#[test]
|
||||
fn shared_index_startup_validation_uses_sibling_vif_ratio() {
|
||||
let store = start_with_sibling_encode_vifs(&[1_700_000_000_000_000_044]);
|
||||
let ec_vol = store.locations[0]
|
||||
.find_ec_volume(VolumeId(4124))
|
||||
.expect("dir0 ec volume mounted");
|
||||
assert!(ec_vol.has_shard(2), "shard 2 not mounted on dir0");
|
||||
}
|
||||
|
||||
/// Sibling `.vif` files naming different encode runs leave the ratio
|
||||
/// unknown, so the startup check keeps the shards.
|
||||
#[test]
|
||||
fn shared_index_startup_validation_keeps_shards_on_disagreeing_siblings() {
|
||||
start_with_sibling_encode_vifs(&[1_700_000_000_000_000_044, 1_700_000_000_000_000_045]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mirror_preserves_existing_destination_sidecars() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
|
||||
@@ -1242,6 +1242,10 @@ const RANGE_CHECK_BLOCKS: u64 = 64;
|
||||
const MIN_RANGE_CHECK_BLOCK_SIZE: u64 = 64 * 1024;
|
||||
const MAX_RANGE_CHECK_BLOCK_SIZE: u64 = 1024 * 1024;
|
||||
|
||||
pub(crate) fn compacting_error(id: VolumeId) -> VolumeError {
|
||||
VolumeError::Io(io::Error::other(format!("volume {} is compacting", id)))
|
||||
}
|
||||
|
||||
/// Keeps a needle to 64 blocks, each 64 KiB to 1 MiB, as Go's
|
||||
/// rangeCheckBlockSize.
|
||||
pub(crate) fn range_check_block_size(data_size: u64) -> u64 {
|
||||
@@ -1913,10 +1917,7 @@ impl Volume {
|
||||
}
|
||||
|
||||
pub(crate) fn compacting_error(&self) -> VolumeError {
|
||||
VolumeError::Io(io::Error::other(format!(
|
||||
"volume {} is compacting",
|
||||
self.id
|
||||
)))
|
||||
compacting_error(self.id)
|
||||
}
|
||||
|
||||
// ---- File naming (matching Go) ----
|
||||
@@ -2497,9 +2498,15 @@ impl Volume {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn load_remote_dat_file(&self) -> Result<(), VolumeError> {
|
||||
let _sync_guard = self.data_file_sync_lock.lock().unwrap();
|
||||
let _guard = self.data_file_access_control.write_lock();
|
||||
self.load_remote_dat_file_held()
|
||||
}
|
||||
|
||||
/// `load_remote_dat_file` for callers already holding the write lease.
|
||||
pub(crate) fn load_remote_dat_file_held(&self) -> Result<(), VolumeError> {
|
||||
let mut io = self.io.write().unwrap();
|
||||
self.load_remote_dat_file_io(&mut io)
|
||||
}
|
||||
@@ -5843,7 +5850,7 @@ impl Volume {
|
||||
{
|
||||
match self.begin_compact_by_index()? {
|
||||
Some(job) => job.run(progress_fn),
|
||||
None => Ok(()), // already compacting
|
||||
None => Err(self.compacting_error()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5948,7 +5955,7 @@ impl Volume {
|
||||
return Err(VolumeError::NotFound);
|
||||
}
|
||||
let Some(_claim) = CompactionClaim::try_claim(&self.is_compacting) else {
|
||||
return Ok(()); // already compacting, silently skip (matches Go)
|
||||
return Err(self.compacting_error());
|
||||
};
|
||||
// The reload would read the remote object through the compacted .idx.
|
||||
if self.has_remote_file() {
|
||||
@@ -5963,6 +5970,8 @@ impl Volume {
|
||||
}
|
||||
|
||||
fn do_commit_compact(&self) -> Result<(), VolumeError> {
|
||||
// A duplicate commit must fail before it closes the live files.
|
||||
self.check_compact_files()?;
|
||||
if let Err(e) = self.makeup_diff() {
|
||||
warn!("makeup_diff failed: {}", e);
|
||||
// Match Go: clean up .cpd/.cpx on makeup_diff failure
|
||||
@@ -6038,8 +6047,13 @@ impl Volume {
|
||||
/// requires BOTH .cpd/.cpx to be present, so a stale or duplicate commit
|
||||
/// returns an error without deleting the live .dat/.idx.
|
||||
fn apply_compact_swap(&self) -> Result<(), VolumeError> {
|
||||
// Normal commit: both temp files must be present, or a stale/duplicate
|
||||
// commit could clobber the live .dat/.idx.
|
||||
self.check_compact_files()?;
|
||||
self.finish_compact_swap()
|
||||
}
|
||||
|
||||
/// Both temp files of a normal commit must be present, or a stale or
|
||||
/// duplicate commit could clobber the live .dat/.idx.
|
||||
fn check_compact_files(&self) -> Result<(), VolumeError> {
|
||||
if !Path::new(&self.file_name(".cpd")).exists()
|
||||
|| !Path::new(&self.file_name(".cpx")).exists()
|
||||
{
|
||||
@@ -6048,7 +6062,7 @@ impl Volume {
|
||||
"compact files (.cpd/.cpx) not found",
|
||||
)));
|
||||
}
|
||||
self.finish_compact_swap()
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Renames whichever compaction temp file is still present (.cpd->.dat,
|
||||
@@ -6148,10 +6162,11 @@ impl Volume {
|
||||
|
||||
/// Clean up leftover compaction files (.cpd, .cpx).
|
||||
pub fn cleanup_compact(&self) -> Result<(), VolumeError> {
|
||||
// An in-flight copy is still writing .cpd/.cpx.
|
||||
if self.is_compacting() {
|
||||
// An in-flight copy is still writing .cpd/.cpx; claim the volume so
|
||||
// none starts while the files are removed.
|
||||
let Some(_claim) = CompactionClaim::try_claim(&self.is_compacting) else {
|
||||
return Err(self.compacting_error());
|
||||
}
|
||||
};
|
||||
// Refuse to unlink .cpd/.cpx while a .cpc marker exists: those temp files
|
||||
// are the only inputs reconcile can roll forward to, so removing them
|
||||
// mid-commit would strand a decided swap.
|
||||
@@ -12929,4 +12944,35 @@ mod tests {
|
||||
"live .dat unchanged"
|
||||
);
|
||||
}
|
||||
|
||||
/// A commit that finds no .cpd/.cpx (another vacuum already committed
|
||||
/// them) must leave the volume loaded and writable.
|
||||
#[test]
|
||||
fn test_commit_compact_without_temp_files_keeps_volume_loaded() {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
let dir = tmp.path().to_str().unwrap();
|
||||
let v = make_test_volume(dir);
|
||||
let needle = |i: u64| Needle {
|
||||
id: NeedleId(i),
|
||||
cookie: Cookie(i as u32),
|
||||
data: format!("data-{}", i).into_bytes(),
|
||||
data_size: format!("data-{}", i).len() as u32,
|
||||
..Needle::default()
|
||||
};
|
||||
for i in 1..=3u64 {
|
||||
v.write_needle(&mut needle(i), true, false).unwrap();
|
||||
}
|
||||
v.compact_by_index(0, 0, |_| true).unwrap();
|
||||
v.commit_compact().unwrap();
|
||||
|
||||
assert!(v.commit_compact().is_err());
|
||||
assert!(!Path::new(&v.file_name(".cpc")).exists());
|
||||
v.write_needle(&mut needle(4), true, false).unwrap();
|
||||
let mut n1 = Needle {
|
||||
id: NeedleId(1),
|
||||
..Needle::default()
|
||||
};
|
||||
v.read_needle(&mut n1).unwrap();
|
||||
assert_eq!(n1.data, b"data-1");
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ use lance::io::{
|
||||
ObjectStore, ObjectStoreParams, ObjectStoreRegistry, StorageOptionsAccessor,
|
||||
WrappingObjectStore,
|
||||
};
|
||||
use lance::session::Session;
|
||||
|
||||
use crate::catalog::{NamespaceClient, TableDescription};
|
||||
use crate::direct_read::DirectReads;
|
||||
@@ -74,7 +75,7 @@ pub fn unsigned_options() -> HashMap<String, String> {
|
||||
pub async fn open(client: &NamespaceClient, id: &[String], storage: &Storage) -> Result<OpenTable> {
|
||||
let description = client.describe_table(id).await?;
|
||||
let wrapper = storage.wrapper(&description.location).await?;
|
||||
let dataset = open_at(&description, wrapper).await?;
|
||||
let dataset = open_at(&description, wrapper, None).await?;
|
||||
Ok(OpenTable {
|
||||
id: id.to_vec(),
|
||||
location: description.location,
|
||||
@@ -82,13 +83,19 @@ pub async fn open(client: &NamespaceClient, id: &[String], storage: &Storage) ->
|
||||
})
|
||||
}
|
||||
|
||||
/// Open a table the caller has already resolved, with the store wrapped.
|
||||
/// Open a table the caller has already resolved, with the store wrapped, in
|
||||
/// `session` when given, otherwise in a session of its own.
|
||||
pub async fn open_at(
|
||||
description: &TableDescription,
|
||||
wrapper: Option<Arc<dyn WrappingObjectStore>>,
|
||||
session: Option<Arc<Session>>,
|
||||
) -> Result<Dataset> {
|
||||
DatasetBuilder::from_uri(&description.location)
|
||||
.with_store_params(store_params(wrapper))
|
||||
let mut builder =
|
||||
DatasetBuilder::from_uri(&description.location).with_store_params(store_params(wrapper));
|
||||
if let Some(session) = session {
|
||||
builder = builder.with_session(session);
|
||||
}
|
||||
builder
|
||||
.load()
|
||||
.await
|
||||
.with_context(|| format!("open lance dataset at {}", description.location))
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
import io
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tarfile
|
||||
import tempfile
|
||||
import unittest
|
||||
import zipfile
|
||||
|
||||
SOURCE = (Path(__file__).resolve().parents[2] / 'install.sh').read_text().rsplit('\nmain\n', 1)[0]
|
||||
BASH = os.environ.get('BASH_BINARY', 'bash')
|
||||
|
||||
|
||||
class VectorInstallerTest(unittest.TestCase):
|
||||
def shell(self, code, **env):
|
||||
result = subprocess.run([BASH, '-s'], input=(SOURCE + '\n' + code + '\n').encode('utf-8'),
|
||||
env=dict(os.environ, **env), capture_output=True)
|
||||
result.stdout = result.stdout.decode('utf-8', errors='replace')
|
||||
result.stderr = result.stderr.decode('utf-8', errors='replace')
|
||||
return result
|
||||
|
||||
def test_platforms_and_asset_names(self):
|
||||
for system, arch, supported, suffix in [
|
||||
('linux', 'amd64', True, 'tar.gz'), ('linux', 'arm64', True, 'tar.gz'),
|
||||
('darwin', 'amd64', True, 'tar.gz'), ('darwin', 'arm64', True, 'tar.gz'),
|
||||
('windows', 'amd64', True, 'zip'), ('windows', 'arm64', False, 'zip'),
|
||||
('freebsd', 'amd64', False, 'tar.gz'),
|
||||
]:
|
||||
with self.subTest(system=system, arch=arch):
|
||||
result = self.shell('vector_platform_supported "$SYSTEM" "$ARCH"; result=$?; '
|
||||
'vector_asset_name "$SYSTEM" "$ARCH"; exit "$result"', SYSTEM=system, ARCH=arch)
|
||||
if supported:
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout.strip(), f'weed-vector_{system}_{arch}.{suffix}')
|
||||
else:
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
|
||||
def test_installs_archive_binary(self):
|
||||
for system in ['linux', 'darwin', 'windows']:
|
||||
with self.subTest(system=system), tempfile.TemporaryDirectory() as directory:
|
||||
directory = Path(directory)
|
||||
name = 'weed-vector.exe' if system == 'windows' else 'weed-vector'
|
||||
contents = b'vector engine fixture'
|
||||
archive = directory / ('vector.zip' if system == 'windows' else 'vector.tar.gz')
|
||||
if system == 'windows':
|
||||
with zipfile.ZipFile(archive, 'w') as output:
|
||||
output.writestr(name, contents)
|
||||
else:
|
||||
with tarfile.open(archive, 'w:gz') as output:
|
||||
info = tarfile.TarInfo(name)
|
||||
info.size = len(contents)
|
||||
info.mode = 0o755
|
||||
output.addfile(info, io.BytesIO(contents))
|
||||
dest = directory / 'bin'
|
||||
result = self.shell('download() { cp "$ARCHIVE" "$2"; }; VERSION=test; '
|
||||
'INSTALL_DIR="$DEST"; install_component vector "$SYSTEM" amd64',
|
||||
ARCHIVE=archive.as_posix(), DEST=dest.as_posix(), SYSTEM=system)
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertEqual((dest / name).read_bytes(), contents)
|
||||
|
||||
|
||||
class EnterpriseInstallerTest(unittest.TestCase):
|
||||
shell = VectorInstallerTest.shell
|
||||
|
||||
def enterprise(self, code, **env):
|
||||
return self.shell('ENTERPRISE=true; REPO=seaweedfs/artifactory; EDITION=-enterprise; ' + code, **env)
|
||||
|
||||
def test_asset_names(self):
|
||||
result = self.enterprise('go_asset_name linux amd64; go_asset_name windows amd64; '
|
||||
'rust_asset_name linux arm64; worker_asset_name linux amd64; '
|
||||
'vector_asset_name linux arm64; LARGE_DISK=true; '
|
||||
'go_asset_name darwin arm64; rust_asset_name linux amd64')
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout.split(), [
|
||||
'weed-enterprise-linux_amd64.tar.gz', 'weed-enterprise-windows_amd64.zip',
|
||||
'weed-volume-enterprise_linux_arm64.tar.gz', 'weed-worker-enterprise_linux_amd64.tar.gz',
|
||||
'weed-vector-enterprise_linux_arm64.tar.gz', 'weed-enterprise-darwin_arm64_large_disk.tar.gz',
|
||||
'weed-volume-enterprise_large_disk_linux_amd64.tar.gz',
|
||||
])
|
||||
|
||||
def test_open_source_go_asset_names(self):
|
||||
result = self.shell('go_asset_name linux amd64; go_asset_name windows amd64; '
|
||||
'LARGE_DISK=true; go_asset_name windows amd64')
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout.split(), [
|
||||
'linux_amd64.tar.gz', 'windows_amd64.zip', 'windows_amd64_large_disk.zip',
|
||||
])
|
||||
|
||||
def test_windows_weed_keeps_exe(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
directory = Path(directory)
|
||||
archive = directory / 'weed.zip'
|
||||
with zipfile.ZipFile(archive, 'w') as output:
|
||||
output.writestr('weed.exe', b'weed fixture')
|
||||
dest = directory / 'bin'
|
||||
result = self.shell('download() { cp "$ARCHIVE" "$2"; }; VERSION=test; '
|
||||
'INSTALL_DIR="$DEST"; install_component weed windows amd64',
|
||||
ARCHIVE=archive.as_posix(), DEST=dest.as_posix())
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
self.assertEqual((dest / 'weed.exe').read_bytes(), b'weed fixture')
|
||||
|
||||
def test_rust_binaries_linux_only(self):
|
||||
for system, arch, supported in [
|
||||
('linux', 'amd64', True), ('linux', 'arm64', True),
|
||||
('darwin', 'arm64', False), ('windows', 'amd64', False),
|
||||
]:
|
||||
with self.subTest(system=system, arch=arch):
|
||||
for check in ['vector_platform_supported', 'rust_volume_platform_supported']:
|
||||
result = self.enterprise(f'{check} "$SYSTEM" "$ARCH"', SYSTEM=system, ARCH=arch)
|
||||
self.assertEqual(result.returncode == 0, supported, check)
|
||||
|
||||
def test_latest_version_skips_other_releases(self):
|
||||
tags = ['vfs-0.2.5', 'kvcache-filer-native-v0.1.0-preview.1', '4.54-rc1', '4.53', '4.52']
|
||||
listing = ''.join(f' "tag_name": "{tag}",\\n' for tag in tags)
|
||||
result = self.enterprise(f"curl() {{ printf '{listing}'; }}; get_latest_version")
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(result.stdout.strip(), '4.53')
|
||||
@@ -104,7 +104,9 @@ for i in $(seq 1 60); do
|
||||
if mountpoint -q "${MOUNT_DIR}"; then
|
||||
break
|
||||
fi
|
||||
if ! kill -0 "${mount_pid}" 2>/dev/null; then
|
||||
# Not kill -0: sudo briefly runs with a root real uid while starting, so
|
||||
# signalling it fails with EPERM even though it is alive.
|
||||
if ! ps -p "${mount_pid}" >/dev/null; then
|
||||
echo "weed mount exited early; log tail:" >&2
|
||||
tail -n 100 "${LOG_DIR}/mount.log" >&2 || true
|
||||
exit 1
|
||||
|
||||
@@ -239,7 +239,7 @@ The tests are automatically run in GitHub Actions on every push/PR that affects
|
||||
**Workflow**: `.github/workflows/s3-parquet-tests.yml`
|
||||
|
||||
**Test Matrix**:
|
||||
- Python versions: 3.9, 3.11, 3.12
|
||||
- Python versions: 3.10, 3.11, 3.12
|
||||
- PyArrow integration tests (s3fs): 20 test combinations
|
||||
- PyArrow native S3 tests: 6 test scenarios ✅
|
||||
- Cross-filesystem compatibility tests: 12 test scenarios ✅ **NEW**
|
||||
|
||||
@@ -44,12 +44,22 @@ func vacuumVolumes(t *testing.T) {
|
||||
require.NotEmpty(t, defaultConfig.MasterEndpoint, "vacuum needs a master endpoint; set MASTER_ENDPOINT")
|
||||
endpoint := strings.TrimRight(defaultConfig.MasterEndpoint, "/") + "/vol/vacuum?garbageThreshold=0.001"
|
||||
httpClient := &http.Client{Timeout: 30 * time.Second}
|
||||
resp, err := httpClient.Get(endpoint)
|
||||
require.NoError(t, err, "vacuum request to %s", endpoint)
|
||||
defer resp.Body.Close()
|
||||
_, err = io.Copy(io.Discard, resp.Body)
|
||||
require.NoError(t, err, "reading the vacuum response")
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode, "vacuum request to %s", endpoint)
|
||||
// The master runs one vacuum at a time and answers 409 to a request it
|
||||
// dropped because its automatic vacuum was running. Ask until ours runs.
|
||||
deadline := time.Now().Add(time.Minute)
|
||||
for {
|
||||
resp, err := httpClient.Get(endpoint)
|
||||
require.NoError(t, err, "vacuum request to %s", endpoint)
|
||||
_, err = io.Copy(io.Discard, resp.Body)
|
||||
resp.Body.Close()
|
||||
require.NoError(t, err, "reading the vacuum response")
|
||||
if resp.StatusCode == http.StatusConflict && time.Now().Before(deadline) {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
require.Equal(t, http.StatusOK, resp.StatusCode, "vacuum request to %s", endpoint)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func requireVersionBody(t *testing.T, client *s3.Client, bucketName, objectKey, versionId string, want []byte, msg string) {
|
||||
|
||||
+8
-13
@@ -1,10 +1,7 @@
|
||||
WEED := ./weed
|
||||
VEC := ./weed-vector
|
||||
CLI := ./weed-vector-cli
|
||||
WORKER_MANIFEST := ../../rust/sw-vector-distributed/Cargo.toml
|
||||
ifneq ($(wildcard $(WORKER_MANIFEST)),)
|
||||
WORKER := ./weed-vector-worker
|
||||
endif
|
||||
ENGINE_MANIFEST := ../../rust/sw-vector-distributed/Cargo.toml
|
||||
VOLUME := ./weed-volume
|
||||
LANCE_WORKER := ./weed-worker
|
||||
CARGO_PROFILE ?= release
|
||||
@@ -21,7 +18,11 @@ $(WEED): FORCE
|
||||
go build -o $(WEED) ../../weed
|
||||
|
||||
$(VEC): FORCE
|
||||
ifneq ($(wildcard $(ENGINE_MANIFEST)),)
|
||||
cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../rust/Cargo.toml -p sw-vector-distributed --bin weed-vector
|
||||
else
|
||||
cd ../../seaweed-vector && cargo build --locked --profile $(CARGO_PROFILE) -p weed-vector-server
|
||||
endif
|
||||
cp $(CARGO_OUTPUT)/weed-vector $(VEC)
|
||||
|
||||
$(CLI): FORCE
|
||||
@@ -32,19 +33,13 @@ $(LANCE_WORKER): FORCE
|
||||
cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../seaweed-worker/Cargo.toml -p weed-lance-worker --bin weed-worker
|
||||
cp $(CARGO_OUTPUT)/weed-worker $(LANCE_WORKER)
|
||||
|
||||
ifneq ($(WORKER),)
|
||||
$(WORKER): $(VEC) FORCE
|
||||
cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../rust/Cargo.toml -p sw-vector-distributed --bin weed-vector
|
||||
cp $(CARGO_OUTPUT)/weed-vector $(WORKER)
|
||||
endif
|
||||
|
||||
$(VOLUME): $(VEC) $(WORKER) FORCE
|
||||
$(VOLUME): $(VEC) FORCE
|
||||
cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../seaweed-volume/Cargo.toml --bin weed-volume
|
||||
cp $(CARGO_OUTPUT)/weed-volume $(VOLUME)
|
||||
|
||||
FORCE:
|
||||
|
||||
build: $(WEED) $(VEC) $(WORKER) $(VOLUME)
|
||||
build: $(WEED) $(VEC) $(VOLUME)
|
||||
ifneq ($(VECTOR_WORKER),)
|
||||
build: $(CLI) $(LANCE_WORKER)
|
||||
endif
|
||||
@@ -56,4 +51,4 @@ perf: build $(CLI)
|
||||
./run_perf.sh
|
||||
|
||||
clean:
|
||||
rm -f $(WEED) $(VEC) $(CLI) $(LANCE_WORKER) ./weed-vector-worker $(VOLUME)
|
||||
rm -f $(WEED) $(VEC) $(CLI) $(LANCE_WORKER) $(VOLUME)
|
||||
+30
-21
@@ -123,7 +123,7 @@ def write_tls(directory):
|
||||
"-out", "outsider.pem", "-days", "2", "-extfile", "ext.cnf")
|
||||
cert, key, ca = (f'{key} = {json.dumps(str(directory / name), ensure_ascii=False)}\n' for key, name in (("cert", "cert.pem"), ("key", "key.pem"), ("ca", "ca.pem")))
|
||||
pem = cert + key + ca
|
||||
grpc = "".join(f"[grpc.{component}]\n{cert}{key}\n" for component in ("master", "volume", "filer", "s3"))
|
||||
grpc = "".join(f"[grpc.{component}]\n{cert}{key}\n" for component in ("master", "volume", "filer", "s3", "admin", "worker"))
|
||||
# Clients (the gateway, the engine) accept only servers named localhost;
|
||||
# the engine serves only clients named localhost.
|
||||
grpc += f"[grpc.client]\n{cert}{key}allowed_server_commonNames = \"localhost\"\n"
|
||||
@@ -242,23 +242,22 @@ def run_cluster(param, tmp_path_factory, identities):
|
||||
# VECTOR_WORKER=1 adds the admin server and the Lance maintenance worker,
|
||||
# for the tests that build vector indexes through a plugin job.
|
||||
lance_worker = binary("LANCE_WORKER_BINARY", "weed-worker") if os.environ.get("VECTOR_WORKER") else None
|
||||
worker = binary("VECTOR_WORKER_BINARY", "weed-vector-worker") if mode == "distributed" else None
|
||||
volume_binary = binary("RUST_VOLUME_SERVER_BINARY", "weed-volume") if volume == "rust" else weed
|
||||
processes = {}
|
||||
with contextlib.ExitStack() as stack:
|
||||
with contextlib.ExitStack() as reservations:
|
||||
ports = []
|
||||
for _ in range(14):
|
||||
for _ in range(15):
|
||||
sock = reservations.enter_context(socket.socket())
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
ports.append(sock.getsockname()[1])
|
||||
(master, master_grpc, vol, vol_grpc, filer, filer_grpc, s3, s3_grpc, lance, vector, worker1, worker2,
|
||||
admin, admin_grpc) = ports
|
||||
(master, master_grpc, vol, vol_grpc, filer, filer_grpc, s3, s3_grpc, lance, vector, engine1, engine2,
|
||||
admin, admin_grpc, vector_metrics) = ports
|
||||
master_addr = f"127.0.0.1:{master}.{master_grpc}"
|
||||
filer_addr = f"127.0.0.1:{filer}.{filer_grpc}"
|
||||
|
||||
# VECTOR_READ_JWT=1 makes volume reads need a JWT; every weed process
|
||||
# and the workers sign with the key.
|
||||
# and the engines sign with the key.
|
||||
read_jwt_key = os.environ.get("VECTOR_READ_JWT") and uuid.uuid4().hex
|
||||
# The cluster's filer signing key: the gateway's catalog authenticates
|
||||
# the worker and the CLI by the token they derive from it.
|
||||
@@ -304,10 +303,11 @@ def run_cluster(param, tmp_path_factory, identities):
|
||||
# VECTOR_ENCRYPT_VOLUMES=1 turns on the filer's volume encryption, which
|
||||
# the gateway, the engine and the worker all follow: every chunk they
|
||||
# store is encrypted, and direct reads must undo it.
|
||||
filer_group = os.environ.get("VECTOR_FILER_GROUP", "")
|
||||
encrypt = ["-encryptVolumeData"] if os.environ.get("VECTOR_ENCRYPT_VOLUMES") else []
|
||||
start("filer", [weed, "filer", f"-master={master_addr}", "-ip=127.0.0.1",
|
||||
"-ip.bind=127.0.0.1", f"-port={filer}", f"-port.grpc={filer_grpc}",
|
||||
f"-defaultStoreDir={directory / 'filer'}", *encrypt])
|
||||
f"-defaultStoreDir={directory / 'filer'}", f"-filerGroup={filer_group}", *encrypt])
|
||||
wait_for(lambda: listening(filer_grpc), processes, "filer not ready")
|
||||
endpoint = f"http://127.0.0.1:{s3}"
|
||||
# weed s3 turns AWS_ACCESS_KEY_ID into an admin identity.
|
||||
@@ -325,8 +325,12 @@ def run_cluster(param, tmp_path_factory, identities):
|
||||
# The engine keeps tables on the filers and volume servers itself; it
|
||||
# has no S3 credentials to be given, and encrypts its chunks for the
|
||||
# volume servers as the gateway does.
|
||||
start("vector", [engine, "--masters", master_addr, "--listen", f"127.0.0.1:{vector}"])
|
||||
start("vector", [engine, "--masters", master_addr, "--listen", f"127.0.0.1:{vector}", "--metrics-port", str(vector_metrics), "--filer-group", filer_group])
|
||||
wait_for(lambda: listening(vector), processes, "vector engine not ready")
|
||||
def vector_ready():
|
||||
with urllib.request.urlopen(f"http://127.0.0.1:{vector_metrics}/ready", timeout=1) as response:
|
||||
return response.status == 200
|
||||
wait_for(vector_ready, processes, "vector engine did not register with master")
|
||||
if os.environ.get("VECTOR_TLS"):
|
||||
wait_for(lambda: listening(s3_grpc), processes, "s3 gRPC not ready")
|
||||
for name, port in (("master", master_grpc), ("volume", vol_grpc), ("filer", filer_grpc),
|
||||
@@ -335,41 +339,46 @@ def run_cluster(param, tmp_path_factory, identities):
|
||||
probe_grpc_tls("engine", vector, directory, outsider=True)
|
||||
|
||||
wait_for(
|
||||
lambda: f"Cluster: vector node 127.0.0.1:{vector} added to group ''"
|
||||
lambda: f"Cluster: vector node 127.0.0.1:{vector} added to group '{filer_group}'"
|
||||
in (directory / "master.log").read_text(),
|
||||
processes,
|
||||
"vector engine never registered with the master",
|
||||
)
|
||||
|
||||
if worker:
|
||||
for i, port in enumerate((worker1, worker2)):
|
||||
start(f"worker-{i}", [worker, "--masters", master_addr, "--listen", f"127.0.0.1:{port}"])
|
||||
wait_for(lambda: listening(port), processes, "vector worker not ready")
|
||||
# Distributed mode needs the Enterprise weed-vector, whose engines all
|
||||
# join the masters' placement controller.
|
||||
if mode == "distributed":
|
||||
for i, port in enumerate((engine1, engine2), 1):
|
||||
start(f"vector-{i}", [engine, "--masters", master_addr, "--listen", f"127.0.0.1:{port}",
|
||||
"--filer-group", filer_group, "--state-dir", str(directory / f"vector-{i}"),
|
||||
"--capacity-bytes", str(1 << 30), "--drain-timeout", "5s"])
|
||||
wait_for(lambda: listening(port), processes, f"vector-{i} not ready")
|
||||
wait_for(
|
||||
lambda: all(
|
||||
f"S3 Vectors: discovered search worker 127.0.0.1:{port}"
|
||||
in (directory / "s3.log").read_text()
|
||||
for port in (worker1, worker2)
|
||||
),
|
||||
lambda: all(f"joined at 127.0.0.1:{port}" in (directory / "master.log").read_text()
|
||||
for port in (engine1, engine2)),
|
||||
processes,
|
||||
"gateway did not discover both search workers",
|
||||
"the engines never joined the placement controller",
|
||||
)
|
||||
admin_url = None
|
||||
if lance_worker:
|
||||
(directory / "admin").mkdir()
|
||||
admin_url = f"http://127.0.0.1:{admin}"
|
||||
start("admin", [weed, "admin", "-ip=127.0.0.1", f"-port={admin}", f"-port.grpc={admin_grpc}",
|
||||
start("admin", [weed, "admin", f"-filerGroup={filer_group}", "-ip=127.0.0.1", f"-port={admin}", f"-port.grpc={admin_grpc}",
|
||||
"-port.legacy=0", f"-master={master_addr}", f"-dataDir={directory / 'admin'}"])
|
||||
wait_for(lambda: http_ready(f"{admin_url}/api/plugin/job-types"), processes, "admin not ready")
|
||||
tls_args = []
|
||||
if os.environ.get("VECTOR_TLS"):
|
||||
tls_args = ["--tls-ca", str(directory / "ca.pem"), "--tls-cert", str(directory / "cert.pem"), "--tls-key", str(directory / "key.pem"), "--tls-server-name", "localhost"]
|
||||
start("lance-worker", [lance_worker, "--admin", f"127.0.0.1:{admin}.{admin_grpc}",
|
||||
"--namespace", f"http://127.0.0.1:{lance}", "--id", "vectors-test-worker",
|
||||
"--masters", master_addr])
|
||||
"--masters", master_addr, "--filer-group", filer_group, *tls_args])
|
||||
wait_for(lambda: "lance_vector_index" in
|
||||
[jt["job_type"] for jt in json.load(urllib.request.urlopen(f"{admin_url}/api/plugin/job-types", timeout=2))],
|
||||
processes, "the Lance worker never registered with admin")
|
||||
|
||||
yield {"endpoint": endpoint, "mode": mode, "processes": processes, "directory": directory, "filer": filer,
|
||||
"masters": master_addr, "filer_signing_key": filer_signing_key,
|
||||
"vector_metrics": f"http://127.0.0.1:{vector_metrics}",
|
||||
"catalog": f"http://127.0.0.1:{lance}", "admin": admin_url, "env": process_env()}
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,24 @@
|
||||
"actions": [
|
||||
"Write"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "policy-reader",
|
||||
"credentials": [
|
||||
{
|
||||
"accessKey": "policy-reader",
|
||||
"secretKey": "policy-reader-secret"
|
||||
}
|
||||
],
|
||||
"policyNames": [
|
||||
"vector-policy"
|
||||
]
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
{
|
||||
"name": "vector-policy",
|
||||
"content": "{\"Version\": \"2012-10-17\", \"Statement\": [{\"Effect\": \"Allow\", \"Action\": [\"s3vectors:GetVectors\", \"s3vectors:QueryVectors\"], \"Resource\": \"arn:aws:s3vectors:*:*:bucket/vector-iam/index/docs\"}, {\"Effect\": \"Allow\", \"Action\": \"s3vectors:CreateVectorBucket\", \"Resource\": \"*\"}, {\"Effect\": \"Allow\", \"Action\": \"s3vectors:TagResource\", \"Resource\": \"arn:aws:s3vectors:*:*:bucket/vector-iam-*\"}, {\"Effect\": \"Deny\", \"Action\": \"s3vectors:QueryVectors\", \"Resource\": \"*\", \"Condition\": {\"StringEquals\": {\"aws:ResourceTag/classification\": \"private\"}}}, {\"Effect\": \"Deny\", \"Action\": \"s3vectors:QueryVectors\", \"Resource\": \"*\", \"Condition\": {\"StringEquals\": {\"s3vectors:VectorBucketTag/environment\": \"production\"}}}, {\"Effect\": \"Deny\", \"Action\": \"s3vectors:CreateVectorBucket\", \"Resource\": \"*\", \"Condition\": {\"StringEquals\": {\"aws:RequestTag/classification\": \"forbidden\"}}}, {\"Effect\": \"Deny\", \"Action\": \"s3vectors:CreateVectorBucket\", \"Resource\": \"*\", \"Condition\": {\"ForAnyValue:StringEquals\": {\"aws:TagKeys\": \"forbidden-key\"}}}]}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import urllib.request
|
||||
"""Run the S3 Vectors API against Go/Rust volumes and single/distributed queries."""
|
||||
|
||||
import contextlib
|
||||
@@ -150,7 +151,7 @@ def run_cli(cluster, *args):
|
||||
from pathlib import Path
|
||||
cli = Path(os.environ.get("VECTOR_CLI_BINARY", Path(__file__).resolve().parent / "weed-vector-cli")).resolve()
|
||||
command = [str(cli), "--namespace", cluster["catalog"], "--masters", cluster["masters"],
|
||||
"--filer-signing-key", cluster["filer_signing_key"], *args]
|
||||
"--filer-signing-key", cluster["filer_signing_key"], "--filer-group", os.environ.get("VECTOR_FILER_GROUP", ""), *args]
|
||||
return json.loads(subprocess.run(command, check=True, capture_output=True, text=True,
|
||||
cwd=cluster["directory"], env=cluster["env"]).stdout)
|
||||
|
||||
@@ -711,6 +712,43 @@ def test_vector_index_job(vectors, cluster):
|
||||
assert found >= 180, f"recall after retrain {found}/200"
|
||||
|
||||
|
||||
def test_attached_iam_vector_policies(vectors, cluster):
|
||||
client = boto3.client("s3vectors", endpoint_url=cluster["endpoint"], region_name="us-east-1",
|
||||
aws_access_key_id="policy-reader", aws_secret_access_key="policy-reader-secret",
|
||||
config=vectors.meta.config)
|
||||
bucket = "vector-iam"
|
||||
vectors.create_vector_bucket(vectorBucketName=bucket)
|
||||
target = {"vectorBucketName": bucket, "indexName": "docs"}
|
||||
vectors.create_index(**target, dataType="float32", dimension=3, distanceMetric="cosine")
|
||||
index_arn = vectors.get_index(**target)["index"]["indexArn"]
|
||||
bucket_arn = vectors.get_vector_bucket(vectorBucketName=bucket)["vectorBucket"]["vectorBucketArn"]
|
||||
query = {**target, "queryVector": {"float32": [1, 0, 0]}, "topK": 1}
|
||||
try:
|
||||
assert client.query_vectors(**query)["vectors"] == []
|
||||
assert client.get_vectors(**target, keys=["missing"])["vectors"] == []
|
||||
expect_error("AccessDeniedException", client.put_vectors, **target,
|
||||
vectors=[{"key": "blocked", "data": {"float32": [1, 0, 0]}}])
|
||||
vectors.tag_resource(resourceArn=index_arn, tags={"classification": "private"})
|
||||
expect_error("AccessDeniedException", client.query_vectors, **query)
|
||||
vectors.untag_resource(resourceArn=index_arn, tagKeys=["classification"])
|
||||
assert client.query_vectors(**query)["vectors"] == []
|
||||
vectors.tag_resource(resourceArn=bucket_arn, tags={"environment": "production"})
|
||||
expect_error("AccessDeniedException", client.query_vectors, **query)
|
||||
vectors.untag_resource(resourceArn=bucket_arn, tagKeys=["environment"])
|
||||
assert client.query_vectors(**query)["vectors"] == []
|
||||
vectors.put_vector_bucket_policy(vectorBucketName=bucket, policy=json.dumps({"Version": "2012-10-17", "Statement": [
|
||||
{"Effect": "Deny", "Principal": "*", "Action": "s3vectors:QueryVectors", "Resource": index_arn}]}))
|
||||
expect_error("AccessDeniedException", client.query_vectors, **query)
|
||||
expect_error("AccessDeniedException", client.create_vector_bucket,
|
||||
vectorBucketName="vector-iam-rejected", tags={"classification": "forbidden"})
|
||||
expect_error("AccessDeniedException", client.create_vector_bucket,
|
||||
vectorBucketName="vector-iam-key-denied", tags={"forbidden-key": "value"})
|
||||
finally:
|
||||
vectors.delete_vector_bucket_policy(vectorBucketName=bucket)
|
||||
vectors.delete_index(**target)
|
||||
vectors.delete_vector_bucket(vectorBucketName=bucket)
|
||||
|
||||
|
||||
def test_invalid_credentials(cluster):
|
||||
client = boto3.client("s3vectors", endpoint_url=cluster["endpoint"], aws_access_key_id="unknown",
|
||||
aws_secret_access_key="unknown", region_name="us-east-1")
|
||||
@@ -719,6 +757,18 @@ def test_invalid_credentials(cluster):
|
||||
assert exc.value.response["ResponseMetadata"]["HTTPStatusCode"] == 403
|
||||
|
||||
|
||||
def test_vector_engine_observability(vectors, index, cluster):
|
||||
vectors.query_vectors(**index, queryVector={"float32": [1, 0, 0, 0]}, topK=1)
|
||||
with urllib.request.urlopen(cluster["vector_metrics"] + "/ready", timeout=5) as response:
|
||||
assert response.status == 200
|
||||
with urllib.request.urlopen(cluster["vector_metrics"] + "/metrics", timeout=5) as response:
|
||||
metrics = response.read().decode()
|
||||
assert "SeaweedFS_vector_connected 1" in metrics
|
||||
assert any(line.startswith("SeaweedFS_vector_request_total{") and 'type="QueryVectors"' in line
|
||||
and 'code="OK"' in line for line in metrics.splitlines())
|
||||
assert "SeaweedFS_vector_request_seconds_bucket" in metrics
|
||||
|
||||
|
||||
def test_query_without_writer(vectors, index, cluster):
|
||||
from conftest import stop
|
||||
|
||||
@@ -753,3 +803,5 @@ def test_engine_without_credentials(open_cluster):
|
||||
hits = client.query_vectors(**index, queryVector={"float32": [1, 0]}, topK=1)["vectors"]
|
||||
assert [h["key"] for h in hits] == ["a"]
|
||||
|
||||
|
||||
|
||||
@@ -983,11 +983,21 @@ func TestTusAbortedPatchKeepsStoredChunks(t *testing.T) {
|
||||
require.Equal(t, http.StatusNoContent, patchResp.StatusCode)
|
||||
|
||||
// A vacuum reclaims whatever the filer deleted, so the file survives this
|
||||
// only if the chunks the session kept are still stored.
|
||||
vacuumResp, err := client.Get(fmt.Sprintf("http://127.0.0.1:%s/vol/vacuum?garbageThreshold=0.001", testMasterPort))
|
||||
require.NoError(t, err)
|
||||
vacuumResp.Body.Close()
|
||||
require.Equal(t, http.StatusOK, vacuumResp.StatusCode)
|
||||
// only if the chunks the session kept are still stored. The master answers
|
||||
// 409 to a request it dropped because its automatic vacuum was running, so
|
||||
// ask until ours runs.
|
||||
vacuumDeadline := time.Now().Add(time.Minute)
|
||||
for {
|
||||
vacuumResp, err := client.Get(fmt.Sprintf("http://127.0.0.1:%s/vol/vacuum?garbageThreshold=0.001", testMasterPort))
|
||||
require.NoError(t, err)
|
||||
vacuumResp.Body.Close()
|
||||
if vacuumResp.StatusCode == http.StatusConflict && time.Now().Before(vacuumDeadline) {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
require.Equal(t, http.StatusOK, vacuumResp.StatusCode)
|
||||
break
|
||||
}
|
||||
|
||||
getResp, err := client.Get(cluster.FilerURL() + targetPath)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package volume_server_grpc_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/test/volume_server/framework"
|
||||
"github.com/seaweedfs/seaweedfs/test/volume_server/matrix"
|
||||
"github.com/seaweedfs/seaweedfs/weed/operation/volume_move"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
func moverServerAddress(cluster framework.MultiCluster, index int) pb.ServerAddress {
|
||||
return pb.ServerAddress(cluster.VolumeAdminAddress(index) + "." + strings.Split(cluster.VolumeGRPCAddress(index), ":")[1])
|
||||
}
|
||||
|
||||
func reloadVolume(t *testing.T, client volume_server_pb.VolumeServerClient, volumeID uint32) {
|
||||
t.Helper()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
if _, err := client.VolumeUnmount(ctx, &volume_server_pb.VolumeUnmountRequest{VolumeId: volumeID}); err != nil {
|
||||
t.Fatalf("unmount volume %d: %v", volumeID, err)
|
||||
}
|
||||
if _, err := client.VolumeMount(ctx, &volume_server_pb.VolumeMountRequest{VolumeId: volumeID}); err != nil {
|
||||
t.Fatalf("mount volume %d: %v", volumeID, err)
|
||||
}
|
||||
}
|
||||
|
||||
func uploadStatus(t *testing.T, httpClient *http.Client, volumeURL string, volumeID uint32, key uint64, data string) int {
|
||||
t.Helper()
|
||||
resp := framework.UploadBytes(t, httpClient, volumeURL, framework.NewFileID(volumeID, key, 0x5EED0000+uint32(key)), []byte(data))
|
||||
framework.ReadAllAndClose(t, resp)
|
||||
return resp.StatusCode
|
||||
}
|
||||
|
||||
func TestLiveMoveFreezeSurvivesSourceReload(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
|
||||
cluster := framework.StartMultiVolumeClusterAuto(t, matrix.P1(), 2)
|
||||
sourceConn, sourceClient := framework.DialVolumeServer(t, cluster.VolumeGRPCAddress(0))
|
||||
defer sourceConn.Close()
|
||||
targetConn, targetClient := framework.DialVolumeServer(t, cluster.VolumeGRPCAddress(1))
|
||||
defer targetConn.Close()
|
||||
|
||||
const volumeID = uint32(977)
|
||||
framework.AllocateVolume(t, sourceClient, volumeID, "")
|
||||
httpClient := framework.NewHTTPClient()
|
||||
if code := uploadStatus(t, httpClient, cluster.VolumeAdminURL(0), volumeID, 1, "before-move"); code != http.StatusCreated {
|
||||
t.Fatalf("initial upload: status %d", code)
|
||||
}
|
||||
|
||||
var reloadedSourceWrite, targetWrite int
|
||||
mover := volume_move.NewMover(grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancel()
|
||||
err := mover.LiveMoveVolume(ctx, needle.VolumeId(volumeID), moverServerAddress(cluster, 0), moverServerAddress(cluster, 1), volume_move.VolumeMoveOptions{
|
||||
IdleTimeout: time.Second,
|
||||
Progress: func(percent float64, stage string) {
|
||||
switch percent {
|
||||
case 20:
|
||||
// frozen, not yet copied: a reload must not reopen the source
|
||||
reloadVolume(t, sourceClient, volumeID)
|
||||
reloadedSourceWrite = uploadStatus(t, httpClient, cluster.VolumeAdminURL(0), volumeID, 2, "lost-after-move")
|
||||
case 70:
|
||||
// copied, not yet tailed: the copy must not inherit the freeze
|
||||
targetWrite = uploadStatus(t, httpClient, cluster.VolumeAdminURL(1), volumeID, 3, "on-target")
|
||||
}
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("LiveMoveVolume: %v", err)
|
||||
}
|
||||
if reloadedSourceWrite != http.StatusConflict {
|
||||
t.Fatalf("reloaded source write: status %d, want %d", reloadedSourceWrite, http.StatusConflict)
|
||||
}
|
||||
if targetWrite != http.StatusCreated {
|
||||
t.Fatalf("copied target refused a write before the tail: status %d", targetWrite)
|
||||
}
|
||||
|
||||
// The writable mark on the target is persisted too.
|
||||
reloadVolume(t, targetClient, volumeID)
|
||||
if code := uploadStatus(t, httpClient, cluster.VolumeAdminURL(1), volumeID, 4, "after-reload"); code != http.StatusCreated {
|
||||
t.Fatalf("moved volume refused a write after a reload: status %d", code)
|
||||
}
|
||||
for key, want := range map[uint64]string{1: "before-move", 3: "on-target", 4: "after-reload"} {
|
||||
resp := framework.ReadBytes(t, httpClient, cluster.VolumeAdminURL(1), framework.NewFileID(volumeID, key, 0x5EED0000+uint32(key)))
|
||||
body := framework.ReadAllAndClose(t, resp)
|
||||
if resp.StatusCode != http.StatusOK || string(body) != want {
|
||||
t.Fatalf("read key %d from target: status %d body %q, want %q", key, resp.StatusCode, body, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLiveMoveAbortClearsPersistedFreeze(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
|
||||
cluster := framework.StartMultiVolumeClusterAuto(t, matrix.P1(), 2)
|
||||
sourceConn, sourceClient := framework.DialVolumeServer(t, cluster.VolumeGRPCAddress(0))
|
||||
defer sourceConn.Close()
|
||||
|
||||
const volumeID = uint32(978)
|
||||
framework.AllocateVolume(t, sourceClient, volumeID, "")
|
||||
httpClient := framework.NewHTTPClient()
|
||||
if code := uploadStatus(t, httpClient, cluster.VolumeAdminURL(0), volumeID, 1, "before-move"); code != http.StatusCreated {
|
||||
t.Fatalf("initial upload: status %d", code)
|
||||
}
|
||||
|
||||
mover := volume_move.NewMover(grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancel()
|
||||
err := mover.LiveMoveVolume(ctx, needle.VolumeId(volumeID), moverServerAddress(cluster, 0), moverServerAddress(cluster, 1), volume_move.VolumeMoveOptions{
|
||||
Progress: func(percent float64, stage string) {
|
||||
if percent == 20 {
|
||||
cancel()
|
||||
}
|
||||
},
|
||||
})
|
||||
if err == nil {
|
||||
t.Fatalf("LiveMoveVolume succeeded with a cancelled context")
|
||||
}
|
||||
|
||||
reloadVolume(t, sourceClient, volumeID)
|
||||
if code := uploadStatus(t, httpClient, cluster.VolumeAdminURL(0), volumeID, 2, "after-abort"); code != http.StatusCreated {
|
||||
t.Fatalf("aborted move left the source readonly after a reload: status %d", code)
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/iam"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
// Access key status constants
|
||||
@@ -32,6 +33,7 @@ type AdminData struct {
|
||||
VolumeServers []VolumeServer `json:"volume_servers"`
|
||||
FilerNodes []FilerNode `json:"filer_nodes"`
|
||||
MessageBrokers []MessageBrokerNode `json:"message_brokers"`
|
||||
VectorNodes []VectorNode `json:"vector_nodes"`
|
||||
S3Nodes []S3Node `json:"s3_nodes"`
|
||||
DataCenters []DataCenter `json:"datacenters"`
|
||||
LastUpdated time.Time `json:"last_updated"`
|
||||
@@ -250,6 +252,7 @@ func (s *AdminServer) GetAdminData(username string) (AdminData, error) {
|
||||
FilerNodes: filerNodes,
|
||||
MessageBrokers: messageBrokers,
|
||||
S3Nodes: s3Nodes,
|
||||
VectorNodes: s.getVectorNodesStatus(context.Background()).Engines,
|
||||
DataCenters: topology.DataCenters,
|
||||
LastUpdated: topology.UpdatedAt,
|
||||
TotalEcVolumes: totalEcVolumes,
|
||||
@@ -288,6 +291,17 @@ func (s *AdminServer) ShowOverview(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, topology)
|
||||
}
|
||||
|
||||
// raftMasterHttpAddress returns a raft member's HTTP address. Members are
|
||||
// named after their master address, while the raft address only carries the
|
||||
// gRPC port, which is not always the HTTP port + 10000.
|
||||
func raftMasterHttpAddress(server *master_pb.RaftListClusterServersResponse_ClusterServers) string {
|
||||
httpAddress := pb.ServerAddress(server.Id).ToHttpAddress()
|
||||
if _, port, err := util.ParseHostPort(httpAddress); err == nil && port > 0 && port < 65536 {
|
||||
return httpAddress
|
||||
}
|
||||
return pb.GrpcAddressToServerAddress(server.Address)
|
||||
}
|
||||
|
||||
// getMasterNodesStatus returns the full set of master nodes in the cluster.
|
||||
// It prefers the authoritative raft membership (RaftListClusterServers) and
|
||||
// falls back to the currently-connected master if the raft call fails, so the
|
||||
@@ -311,7 +325,7 @@ func (s *AdminServer) getMasterNodesStatus() []MasterNode {
|
||||
glog.Warningf("skip master with invalid raft address %q: %v", server.Address, splitErr)
|
||||
continue
|
||||
}
|
||||
httpAddress := pb.GrpcAddressToServerAddress(server.Address)
|
||||
httpAddress := raftMasterHttpAddress(server)
|
||||
if httpAddress == "" {
|
||||
glog.Warningf("skip master with invalid raft address %q", server.Address)
|
||||
continue
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
)
|
||||
|
||||
func TestRaftMasterHttpAddress(t *testing.T) {
|
||||
tests := []struct {
|
||||
name, id, address, want string
|
||||
}{
|
||||
{"goraft names members by full address", "127.101.0.1:11111.11112", "127.101.0.1:11112", "127.101.0.1:11111"},
|
||||
{"hashicorp names members by http address", "127.102.0.1:2222", "127.102.0.1:3333", "127.102.0.1:2222"},
|
||||
{"default ports", "10.0.0.1:9333", "10.0.0.1:19333", "10.0.0.1:9333"},
|
||||
{"ipv6", "[::1]:2222.3333", "[::1]:3333", "[::1]:2222"},
|
||||
{"id that is not an address", "master-a", "10.0.0.2:19333", "10.0.0.2:9333"},
|
||||
{"id without a valid port", "10.0.0.3:0", "10.0.0.3:19334", "10.0.0.3:9334"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := raftMasterHttpAddress(&master_pb.RaftListClusterServersResponse_ClusterServers{Id: tt.id, Address: tt.address})
|
||||
if got != tt.want {
|
||||
t.Errorf("raftMasterHttpAddress(%q, %q) = %q, want %q", tt.id, tt.address, got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1371,8 +1371,7 @@ func (s *AdminServer) GetClusterMasters() (*ClusterMastersData, error) {
|
||||
|
||||
// Process each raft server
|
||||
for _, server := range resp.ClusterServers {
|
||||
// Raft stores gRPC addresses, convert to HTTP address
|
||||
httpAddress := pb.GrpcAddressToServerAddress(server.Address)
|
||||
httpAddress := raftMasterHttpAddress(server)
|
||||
if httpAddress == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -28,3 +28,11 @@ func TestListClusterNodesRequestKeepsDefaultFilerGroupEmpty(t *testing.T) {
|
||||
t.Fatalf("FilerGroup = %q, want empty", req.FilerGroup)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVectorDiscoveryUsesRegistrationGroup(t *testing.T) {
|
||||
s := &AdminServer{filerGroup: "tenant-a"}
|
||||
request := s.listClusterNodesRequest(cluster.VectorType)
|
||||
if request.FilerGroup != s.filerGroup {
|
||||
t.Fatalf("vector registration group must match the filer: %+v", request)
|
||||
}
|
||||
}
|
||||
@@ -256,6 +256,17 @@ var pluginConfigSections = []pluginConfigSection{
|
||||
"collection_filter": stringValue,
|
||||
},
|
||||
},
|
||||
{
|
||||
// s3_lifecycle has no worker config form; its knobs are admin values
|
||||
jobType: "s3_lifecycle",
|
||||
prefix: "maintenance.s3_lifecycle",
|
||||
adminKeys: map[string]func(v TomlConfig, key string) *plugin_pb.ConfigValue{
|
||||
"meta_log_retention_days": int64Value,
|
||||
"walker_interval_minutes": int64Value,
|
||||
"cluster_deletes_per_second": int64Value,
|
||||
"cluster_deletes_burst": int64Value,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func doubleValue(v TomlConfig, key string) *plugin_pb.ConfigValue {
|
||||
|
||||
@@ -401,3 +401,56 @@ max_shard_transfers = 0
|
||||
t.Fatalf("max_shard_transfers = %d, want 0", got.GetInt64Value())
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyPluginConfigFromTomlS3Lifecycle(t *testing.T) {
|
||||
s := newPluginServer(t)
|
||||
seed := &plugin_pb.PersistedJobTypeConfig{
|
||||
JobType: "s3_lifecycle",
|
||||
AdminRuntime: &plugin_pb.AdminRuntimeConfig{Enabled: true, RetryLimit: 1},
|
||||
AdminConfigValues: map[string]*plugin_pb.ConfigValue{
|
||||
"meta_log_retention_days": {Kind: &plugin_pb.ConfigValue_Int64Value{Int64Value: 7}},
|
||||
},
|
||||
}
|
||||
if err := s.GetPlugin().SaveJobTypeConfig(seed); err != nil {
|
||||
t.Fatalf("seed: %v", err)
|
||||
}
|
||||
|
||||
v := tomlConfig(t, `
|
||||
[maintenance.s3_lifecycle]
|
||||
meta_log_retention_days = 0
|
||||
walker_interval_minutes = 30
|
||||
cluster_deletes_per_second = 50
|
||||
cluster_deletes_burst = 200
|
||||
retry_limit = 3
|
||||
`)
|
||||
if err := s.ApplyPluginConfigFromToml(v); err != nil {
|
||||
t.Fatalf("apply: %v", err)
|
||||
}
|
||||
|
||||
cfg, err := s.GetPlugin().LoadJobTypeConfig("s3_lifecycle")
|
||||
if err != nil || cfg == nil {
|
||||
t.Fatalf("load: %v %v", cfg, err)
|
||||
}
|
||||
// an explicit 0 must replace the saved value, not read as unset
|
||||
if got, ok := cfg.AdminConfigValues["meta_log_retention_days"].GetKind().(*plugin_pb.ConfigValue_Int64Value); !ok || got.Int64Value != 0 {
|
||||
t.Errorf("meta_log_retention_days = %v, want int64 0", cfg.AdminConfigValues["meta_log_retention_days"])
|
||||
}
|
||||
if got := cfg.AdminConfigValues["walker_interval_minutes"].GetInt64Value(); got != 30 {
|
||||
t.Errorf("walker_interval_minutes = %d, want 30", got)
|
||||
}
|
||||
if got := cfg.AdminConfigValues["cluster_deletes_per_second"].GetInt64Value(); got != 50 {
|
||||
t.Errorf("cluster_deletes_per_second = %d, want 50", got)
|
||||
}
|
||||
if got := cfg.AdminConfigValues["cluster_deletes_burst"].GetInt64Value(); got != 200 {
|
||||
t.Errorf("cluster_deletes_burst = %d, want 200", got)
|
||||
}
|
||||
if cfg.AdminRuntime.RetryLimit != 3 {
|
||||
t.Errorf("retry_limit = %d, want 3", cfg.AdminRuntime.RetryLimit)
|
||||
}
|
||||
if !cfg.AdminRuntime.Enabled {
|
||||
t.Errorf("enabled flipped off by unrelated toml keys")
|
||||
}
|
||||
if cfg.UpdatedBy != "admin.toml" {
|
||||
t.Errorf("updated_by = %q, want admin.toml", cfg.UpdatedBy)
|
||||
}
|
||||
}
|
||||
@@ -105,16 +105,16 @@ func (s *AdminServer) GetDashboardTrends() DashboardTrends {
|
||||
tasks := series(func(s dashSample) float64 { return s.tasks })
|
||||
workers := series(func(s dashSample) float64 { return s.workers })
|
||||
|
||||
// Sparkline colors match the existing cards' border colors.
|
||||
// Sparkline colors follow the data palette.
|
||||
return DashboardTrends{
|
||||
Samples: len(samples),
|
||||
Volumes: sparklineSVG(series(func(s dashSample) float64 { return s.volumes }), "#1cc88a"), // success
|
||||
Chunks: sparklineSVG(series(func(s dashSample) float64 { return s.chunks }), "#36b9cc"), // info
|
||||
DiskUsed: sparklineSVG(series(func(s dashSample) float64 { return s.diskUsed }), "#f6c23e"), // warning
|
||||
EcShards: sparklineSVG(series(func(s dashSample) float64 { return s.ecShards }), "#5a5c69"), // dark
|
||||
Tasks: sparklineSVG(tasks, "#36b9cc"),
|
||||
Volumes: sparklineSVG(series(func(s dashSample) float64 { return s.volumes }), "#5552e0"),
|
||||
Chunks: sparklineSVG(series(func(s dashSample) float64 { return s.chunks }), "#00897a"),
|
||||
DiskUsed: sparklineSVG(series(func(s dashSample) float64 { return s.diskUsed }), "#c2541a"),
|
||||
EcShards: sparklineSVG(series(func(s dashSample) float64 { return s.ecShards }), "#9a45c2"),
|
||||
Tasks: sparklineSVG(tasks, "#8f6d10"),
|
||||
TasksValue: trendCount(last(tasks)),
|
||||
Workers: sparklineSVG(workers, "#4e73df"),
|
||||
Workers: sparklineSVG(workers, "#5552e0"),
|
||||
WorkersValue: trendCount(last(workers)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package dash
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/lance"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3tables"
|
||||
"github.com/seaweedfs/seaweedfs/weed/s3api/s3vectors"
|
||||
@@ -15,6 +17,7 @@ import (
|
||||
type S3VectorsBucketsData struct {
|
||||
Username string `json:"username"`
|
||||
Buckets []S3VectorsBucketSummary `json:"buckets"`
|
||||
Operations VectorOperationsData `json:"operations"`
|
||||
TotalBuckets int `json:"total_buckets"`
|
||||
Truncated bool `json:"truncated,omitempty"`
|
||||
LastUpdated time.Time `json:"last_updated"`
|
||||
@@ -33,6 +36,7 @@ type S3VectorsBucketData struct {
|
||||
Bucket S3VectorsBucketSummary `json:"bucket"`
|
||||
Policy string `json:"policy,omitempty"`
|
||||
Indexes []*s3vectors.Index `json:"indexes"`
|
||||
Operations VectorOperationsData `json:"operations"`
|
||||
TotalIndexes int `json:"total_indexes"`
|
||||
Truncated bool `json:"truncated,omitempty"`
|
||||
LastUpdated time.Time `json:"last_updated"`
|
||||
@@ -46,11 +50,15 @@ func (c s3VectorsFilerClient) WithFilerClient(_ bool, fn func(client filer_pb.Se
|
||||
return c.s.WithFilerClient(fn)
|
||||
}
|
||||
|
||||
// newS3VectorsServer serves the catalog side of S3 Vectors for the admin
|
||||
// console. It has no vector engine, so it never runs an operation that needs
|
||||
// one, such as CreateIndex.
|
||||
func newS3VectorsServer(s *AdminServer) *s3vectors.Server {
|
||||
server := s3vectors.NewServer(s3VectorsFilerClient{s}, nil, nil)
|
||||
client := s3VectorsFilerClient{s}
|
||||
backend := s3vectors.NewVectorDiscovery(s.masterClient.ListCachedMasters, s.grpcDialOption, s.filerGroup)
|
||||
server := s3vectors.NewServer(client, nil, backend)
|
||||
catalog := lance.NewServer(client, nil)
|
||||
server.SetDescribe(func(ctx context.Context, id []string) (string, map[string]string, error) {
|
||||
request := (&http.Request{Method: http.MethodPost, Header: make(http.Header)}).WithContext(ctx)
|
||||
return catalog.DescribeTableInternal(request, id)
|
||||
})
|
||||
server.SetRegion(s3tables.DefaultRegion)
|
||||
server.SetAccountID(s3tables.DefaultAccountID)
|
||||
return server
|
||||
@@ -103,6 +111,7 @@ func (s *AdminServer) GetS3VectorsBucketsData(ctx context.Context) (S3VectorsBuc
|
||||
}
|
||||
req.NextToken = resp.NextToken
|
||||
}
|
||||
data.Operations = s.GetVectorOperationsData(ctx)
|
||||
data.TotalBuckets = len(data.Buckets)
|
||||
data.LastUpdated = time.Now()
|
||||
return data, nil
|
||||
@@ -148,6 +157,7 @@ func (s *AdminServer) GetS3VectorsBucketData(ctx context.Context, bucket string)
|
||||
}
|
||||
req.NextToken = resp.NextToken
|
||||
}
|
||||
data.Operations = s.GetVectorOperationsData(ctx)
|
||||
data.TotalIndexes = len(data.Indexes)
|
||||
return data, nil
|
||||
}
|
||||
@@ -166,14 +176,20 @@ func (s *AdminServer) CreateS3VectorsBucket(w http.ResponseWriter, r *http.Reque
|
||||
return
|
||||
}
|
||||
var req struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name"`
|
||||
EncryptionConfiguration map[string]interface{} `json:"encryptionConfiguration,omitempty"`
|
||||
Tags map[string]string `json:"tags,omitempty"`
|
||||
}
|
||||
if err := decodeJSONBody(newJSONMaxReader(w, r), &req); err != nil {
|
||||
writeJSONError(w, http.StatusBadRequest, "Invalid request: "+err.Error())
|
||||
return
|
||||
}
|
||||
if req.EncryptionConfiguration["sseType"] == "AES256" && !s.vectorEncryptionConfigured(r.Context()) {
|
||||
writeJSONError(w, http.StatusBadRequest, "Cannot verify SSE-S3 support on the S3 gateway; configure s3.public_endpoint and an SSE-S3 key on the gateway and vector engines")
|
||||
return
|
||||
}
|
||||
var resp s3vectors.CreateVectorBucketResponse
|
||||
if err := s.executeS3VectorsOperation(r.Context(), "CreateVectorBucket", &s3vectors.CreateVectorBucketRequest{VectorBucketName: req.Name}, &resp); err != nil {
|
||||
if err := s.executeS3VectorsOperation(r.Context(), "CreateVectorBucket", &s3vectors.CreateVectorBucketRequest{VectorBucketName: req.Name, EncryptionConfiguration: req.EncryptionConfiguration, Tags: req.Tags}, &resp); err != nil {
|
||||
writeS3VectorsError(w, err)
|
||||
return
|
||||
}
|
||||
@@ -252,3 +268,40 @@ func writeS3VectorsError(w http.ResponseWriter, err error) {
|
||||
}
|
||||
writeJSONError(w, status, e.Message)
|
||||
}
|
||||
|
||||
func (s *AdminServer) ExecuteS3VectorsOperationAPI(w http.ResponseWriter, r *http.Request) {
|
||||
if !requireSessionCSRFToken(w, r) {
|
||||
return
|
||||
}
|
||||
var req struct {
|
||||
Operation string `json:"operation"`
|
||||
Request json.RawMessage `json:"request"`
|
||||
}
|
||||
if err := decodeJSONBody(newJSONMaxReader(w, r), &req); err != nil {
|
||||
writeJSONError(w, http.StatusBadRequest, "Invalid request: "+err.Error())
|
||||
return
|
||||
}
|
||||
switch req.Operation {
|
||||
case "CreateIndex", "PutVectorBucketPolicy", "DeleteVectorBucketPolicy", "TagResource", "UntagResource", "ListTagsForResource", "PutVectors", "GetVectors", "ListVectors", "DeleteVectors", "QueryVectors":
|
||||
default:
|
||||
writeJSONError(w, http.StatusBadRequest, "Unsupported vector operation")
|
||||
return
|
||||
}
|
||||
switch req.Operation {
|
||||
case "QueryVectors", "GetVectors", "ListVectors", "ListTagsForResource":
|
||||
default:
|
||||
if role := RoleFromContext(r.Context()); role != "admin" && (role != "" || UsernameFromContext(r.Context()) != "") {
|
||||
writeJSONError(w, http.StatusForbidden, "This operation requires admin access")
|
||||
return
|
||||
}
|
||||
}
|
||||
var resp json.RawMessage
|
||||
if err := s.executeS3VectorsOperation(r.Context(), req.Operation, req.Request, &resp); err != nil {
|
||||
writeS3VectorsError(w, err)
|
||||
return
|
||||
}
|
||||
if len(resp) == 0 {
|
||||
resp = json.RawMessage(`{}`)
|
||||
}
|
||||
writeJSON(w, http.StatusOK, resp)
|
||||
}
|
||||
@@ -22,7 +22,9 @@ func newS3VectorsTestServer(t *testing.T) (*AdminServer, *s3tables.ManagerClient
|
||||
server := s3vectors.NewServer(client, nil, nil)
|
||||
server.SetRegion(s3tables.DefaultRegion)
|
||||
server.SetAccountID(s3tables.DefaultAccountID)
|
||||
return &AdminServer{s3VectorsServer: server}, client
|
||||
gateway := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte(`{"sseS3":true}`)) }))
|
||||
t.Cleanup(gateway.Close)
|
||||
return &AdminServer{s3VectorsServer: server, s3PublicEndpoint: gateway.URL}, client
|
||||
}
|
||||
|
||||
// createS3VectorsIndexRecord writes the catalog record CreateIndex leaves
|
||||
@@ -172,3 +174,79 @@ func TestS3VectorsBucketsStopAtTheListLimit(t *testing.T) {
|
||||
t.Fatalf("listed %d buckets (truncated %v), want the limit %d and truncated", data.TotalBuckets, data.Truncated, s3TablesAdminListLimit)
|
||||
}
|
||||
}
|
||||
|
||||
func TestS3VectorsManagementOperations(t *testing.T) {
|
||||
s, _ := newS3VectorsTestServer(t)
|
||||
w := s3VectorsRequest(t, s.CreateS3VectorsBucket, http.MethodPost, "/api/s3vectors/buckets", `{"name":"managed","encryptionConfiguration":{"sseType":"AES256"},"tags":{"env":"test"}}`)
|
||||
if w.Code != http.StatusCreated {
|
||||
t.Fatal(w.Code, w.Body)
|
||||
}
|
||||
summary, err := s.s3VectorsBucketSummary(t.Context(), "managed")
|
||||
if err != nil || summary.Encryption != "AES256" {
|
||||
t.Fatal(summary, err)
|
||||
}
|
||||
arn := summary.ARN
|
||||
for _, body := range []string{
|
||||
`{"operation":"TagResource","request":{"resourceArn":"` + arn + `","tags":{"team":"search"}}}`,
|
||||
`{"operation":"ListTagsForResource","request":{"resourceArn":"` + arn + `"}}`,
|
||||
`{"operation":"UntagResource","request":{"resourceArn":"` + arn + `","tagKeys":["team"]}}`,
|
||||
`{"operation":"PutVectorBucketPolicy","request":{"vectorBucketName":"managed","policy":"{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3vectors:QueryVectors\",\"Resource\":\"*\"}]}"}}`,
|
||||
`{"operation":"DeleteVectorBucketPolicy","request":{"vectorBucketName":"managed"}}`,
|
||||
} {
|
||||
w := s3VectorsRequest(t, s.ExecuteS3VectorsOperationAPI, http.MethodPost, "/api/s3vectors/operations", body)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("%s: %d %s", body, w.Code, w.Body)
|
||||
}
|
||||
}
|
||||
for _, body := range []string{`{"operation":"Unknown","request":{}}`, `{bad json`} {
|
||||
if w := s3VectorsRequest(t, s.ExecuteS3VectorsOperationAPI, http.MethodPost, "/api/s3vectors/operations", body); w.Code != http.StatusBadRequest {
|
||||
t.Fatal(w.Code, w.Body)
|
||||
}
|
||||
}
|
||||
request := httptest.NewRequest(http.MethodPost, "/api/s3vectors/operations", strings.NewReader(`{}`))
|
||||
request = request.WithContext(WithAuthContext(request.Context(), "admin", "admin", "required-token"))
|
||||
recorder := httptest.NewRecorder()
|
||||
s.ExecuteS3VectorsOperationAPI(recorder, request)
|
||||
if recorder.Code != http.StatusForbidden {
|
||||
t.Fatal("missing CSRF token accepted", recorder.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestS3VectorsEncryptedCreationRequiresKey(t *testing.T) {
|
||||
s, _ := newS3VectorsTestServer(t)
|
||||
s.s3VectorsServer.SetEncryptionChecker(func() bool { return false })
|
||||
w := s3VectorsRequest(t, s.CreateS3VectorsBucket, http.MethodPost, "/api/s3vectors/buckets", `{"name":"sealed","encryptionConfiguration":{"sseType":"AES256"}}`)
|
||||
if w.Code != http.StatusBadRequest {
|
||||
t.Fatalf("encrypted bucket without key: %d %s", w.Code, w.Body)
|
||||
}
|
||||
data, err := s.GetS3VectorsBucketsData(t.Context())
|
||||
if err != nil || len(data.Buckets) != 0 {
|
||||
t.Fatalf("unusable bucket persisted: %+v %v", data, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestS3VectorsReadOnlyOperations(t *testing.T) {
|
||||
s, _ := newS3VectorsTestServer(t)
|
||||
s3VectorsRequest(t, s.CreateS3VectorsBucket, http.MethodPost, "/api/s3vectors/buckets", `{"name":"readable"}`)
|
||||
summary, err := s.s3VectorsBucketSummary(t.Context(), "readable")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, role := range []string{"readonly", ""} {
|
||||
for _, operation := range []string{"ListTagsForResource", "TagResource", "CreateIndex", "DeleteVectors"} {
|
||||
body := fmt.Sprintf(`{"operation":%q,"request":{"resourceArn":%q}}`, operation, summary.ARN)
|
||||
request := httptest.NewRequest(http.MethodPost, "/api/s3vectors/operations", strings.NewReader(body))
|
||||
request = request.WithContext(WithAuthContext(request.Context(), "viewer", role, "token"))
|
||||
request.Header.Set("X-CSRF-Token", "token")
|
||||
w := httptest.NewRecorder()
|
||||
s.ExecuteS3VectorsOperationAPI(w, request)
|
||||
want := http.StatusForbidden
|
||||
if operation == "ListTagsForResource" {
|
||||
want = http.StatusOK
|
||||
}
|
||||
if w.Code != want {
|
||||
t.Fatalf("%s: %d %s", operation, w.Code, w.Body)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/cluster"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
|
||||
)
|
||||
|
||||
func (s *AdminServer) vectorEncryptionConfigured(ctx context.Context) bool {
|
||||
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
endpoints := []string{}
|
||||
if s.s3PublicEndpoint != "" {
|
||||
endpoints = append(endpoints, s.s3PublicEndpoint)
|
||||
} else if s.masterClient != nil {
|
||||
err := s.masterClient.WithClient(ctx, false, func(client master_pb.SeaweedClient) error {
|
||||
response, err := client.ListClusterNodes(ctx, s.listClusterNodesRequest(cluster.S3Type))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, node := range response.ClusterNodes {
|
||||
endpoints = append(endpoints, "http://"+pb.ServerAddress(node.Address).ToHttpAddress())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if len(endpoints) == 0 {
|
||||
return false
|
||||
}
|
||||
for _, endpoint := range endpoints {
|
||||
request, err := http.NewRequestWithContext(ctx, http.MethodGet, strings.TrimRight(endpoint, "/")+"/status?features", nil)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
response, err := util_http.GetGlobalHttpClient().Do(request)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
var features struct {
|
||||
SSES3 bool `json:"sseS3"`
|
||||
}
|
||||
err = json.NewDecoder(io.LimitReader(response.Body, 4096)).Decode(&features)
|
||||
_ = response.Body.Close()
|
||||
if response.StatusCode != http.StatusOK || err != nil || !features.SSES3 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVectorEncryptionChecksRemoteGateway(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
body string
|
||||
want bool
|
||||
}{{`{"sseS3":true}`, true}, {`{"sseS3":false}`, false}, {``, false}} {
|
||||
gateway := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/status" || !r.URL.Query().Has("features") {
|
||||
t.Errorf("wrong probe: %s", r.URL)
|
||||
}
|
||||
_, _ = w.Write([]byte(test.body))
|
||||
}))
|
||||
s := &AdminServer{s3PublicEndpoint: gateway.URL}
|
||||
if got := s.vectorEncryptionConfigured(t.Context()); got != test.want {
|
||||
t.Errorf("body %q: %v", test.body, got)
|
||||
}
|
||||
gateway.Close()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
adminplugin "github.com/seaweedfs/seaweedfs/weed/admin/plugin"
|
||||
"github.com/seaweedfs/seaweedfs/weed/cluster"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/health/grpc_health_v1"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type VectorNode struct {
|
||||
Address string `json:"address"`
|
||||
Version string `json:"version"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type VectorOperationsData struct {
|
||||
Engines []VectorNode `json:"engines"`
|
||||
DiscoveryError string `json:"discovery_error,omitempty"`
|
||||
MaintenanceWorkers int `json:"maintenance_workers"`
|
||||
MaintenanceJobs []adminplugin.TrackedJob `json:"maintenance_jobs"`
|
||||
}
|
||||
|
||||
func (s *AdminServer) getVectorNodesStatus(ctx context.Context) VectorOperationsData {
|
||||
data := VectorOperationsData{Engines: []VectorNode{}}
|
||||
if s.masterClient == nil {
|
||||
data.DiscoveryError = "Master discovery unavailable"
|
||||
return data
|
||||
}
|
||||
var discoveryErr error
|
||||
for _, master := range s.masterClient.ListCachedMasters() {
|
||||
discoveryCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
conn, err := pb.GrpcDial(discoveryCtx, master.ToGrpcAddress(), false, s.grpcDialOption)
|
||||
if err == nil {
|
||||
response, callErr := master_pb.NewSeaweedClient(conn).ListClusterNodes(discoveryCtx, s.listClusterNodesRequest(cluster.VectorType))
|
||||
_ = conn.Close()
|
||||
err = callErr
|
||||
if err == nil {
|
||||
for _, node := range response.ClusterNodes {
|
||||
data.Engines = append(data.Engines, VectorNode{Address: node.Address, Version: node.Version, Status: "Registered"})
|
||||
}
|
||||
}
|
||||
}
|
||||
cancel()
|
||||
if err != nil {
|
||||
discoveryErr = err
|
||||
}
|
||||
if len(data.Engines) > 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if len(data.Engines) == 0 && discoveryErr != nil {
|
||||
data.DiscoveryError = discoveryErr.Error()
|
||||
return data
|
||||
}
|
||||
var checks errgroup.Group
|
||||
checks.SetLimit(8)
|
||||
for i := range data.Engines {
|
||||
checks.Go(func() error {
|
||||
data.Engines[i].Status = vectorNodeStatus(ctx, data.Engines[i].Address, s.grpcDialOption)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
_ = checks.Wait()
|
||||
sort.Slice(data.Engines, func(i, j int) bool { return data.Engines[i].Address < data.Engines[j].Address })
|
||||
return data
|
||||
}
|
||||
|
||||
func vectorNodeStatus(ctx context.Context, address string, dialOption grpc.DialOption) string {
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Second)
|
||||
defer cancel()
|
||||
conn, err := pb.GrpcDial(ctx, address, false, dialOption)
|
||||
if err != nil {
|
||||
return "Unreachable"
|
||||
}
|
||||
defer conn.Close()
|
||||
response, err := grpc_health_v1.NewHealthClient(conn).Check(ctx, &grpc_health_v1.HealthCheckRequest{Service: "vector_pb.VectorService"})
|
||||
if status.Code(err) == codes.Unimplemented || status.Code(err) == codes.NotFound {
|
||||
return "Registered (health unavailable)"
|
||||
}
|
||||
if err != nil {
|
||||
return "Unreachable"
|
||||
}
|
||||
if response.Status == grpc_health_v1.HealthCheckResponse_SERVING {
|
||||
return "Ready"
|
||||
}
|
||||
return "Not ready"
|
||||
}
|
||||
|
||||
func (s *AdminServer) GetVectorOperationsData(ctx context.Context) VectorOperationsData {
|
||||
data := s.getVectorNodesStatus(ctx)
|
||||
for _, worker := range s.GetPluginWorkers() {
|
||||
if capability := worker.Capabilities["lance_vector_index"]; capability != nil && capability.CanExecute {
|
||||
data.MaintenanceWorkers++
|
||||
}
|
||||
}
|
||||
data.MaintenanceJobs = s.ListPluginJobs("lance_vector_index", "", 5)
|
||||
return data
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package dash
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/health"
|
||||
"google.golang.org/grpc/health/grpc_health_v1"
|
||||
)
|
||||
|
||||
func TestVectorNodeStatus(t *testing.T) {
|
||||
for _, want := range []string{"Ready", "Not ready", "Registered (health unavailable)", "Unknown service"} {
|
||||
t.Run(want, func(t *testing.T) {
|
||||
listener, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
server := grpc.NewServer()
|
||||
if want != "Registered (health unavailable)" {
|
||||
checker := health.NewServer()
|
||||
state := grpc_health_v1.HealthCheckResponse_NOT_SERVING
|
||||
if want == "Ready" {
|
||||
state = grpc_health_v1.HealthCheckResponse_SERVING
|
||||
}
|
||||
if want != "Unknown service" {
|
||||
checker.SetServingStatus("vector_pb.VectorService", state)
|
||||
}
|
||||
grpc_health_v1.RegisterHealthServer(server, checker)
|
||||
}
|
||||
go server.Serve(listener)
|
||||
t.Cleanup(server.Stop)
|
||||
expected := want
|
||||
if want == "Unknown service" {
|
||||
expected = "Registered (health unavailable)"
|
||||
}
|
||||
if got := vectorNodeStatus(t.Context(), listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())); got != expected {
|
||||
t.Fatalf("got %s want %s", got, want)
|
||||
}
|
||||
})
|
||||
}
|
||||
ctx, cancel := context.WithCancel(t.Context())
|
||||
cancel()
|
||||
if got := vectorNodeStatus(ctx, "127.0.0.1:1", grpc.WithTransportCredentials(insecure.NewCredentials())); got != "Unreachable" {
|
||||
t.Fatal(got)
|
||||
}
|
||||
}
|
||||
@@ -131,6 +131,7 @@ func (h *AdminHandlers) registerUIRoutes(r *mux.Router) {
|
||||
r.HandleFunc("/cluster/masters", h.clusterHandlers.ShowClusterMasters).Methods(http.MethodGet)
|
||||
r.HandleFunc("/cluster/filers", h.clusterHandlers.ShowClusterFilers).Methods(http.MethodGet)
|
||||
r.HandleFunc("/cluster/s3", h.clusterHandlers.ShowClusterS3Servers).Methods(http.MethodGet)
|
||||
r.HandleFunc("/cluster/vector-servers", h.clusterHandlers.ShowClusterVectorServers).Methods(http.MethodGet)
|
||||
r.HandleFunc("/cluster/volume-servers", h.clusterHandlers.ShowClusterVolumeServers).Methods(http.MethodGet)
|
||||
r.HandleFunc("/cluster/mount-clients", h.clusterHandlers.ShowMountClients).Methods(http.MethodGet)
|
||||
|
||||
@@ -256,6 +257,7 @@ func (h *AdminHandlers) registerAPIRoutes(api *mux.Router, enforceWrite bool) {
|
||||
s3TablesApi.Handle("/tags", wrapWrite(h.adminServer.UntagS3TablesResource)).Methods(http.MethodDelete)
|
||||
|
||||
s3VectorsApi := api.PathPrefix("/s3vectors").Subrouter()
|
||||
s3VectorsApi.HandleFunc("/operations", h.adminServer.ExecuteS3VectorsOperationAPI).Methods(http.MethodPost)
|
||||
s3VectorsApi.HandleFunc("/buckets", h.adminServer.ListS3VectorsBucketsAPI).Methods(http.MethodGet)
|
||||
s3VectorsApi.Handle("/buckets", wrapWrite(h.adminServer.CreateS3VectorsBucket)).Methods(http.MethodPost)
|
||||
s3VectorsApi.Handle("/buckets", wrapWrite(h.adminServer.DeleteS3VectorsBucket)).Methods(http.MethodDelete)
|
||||
|
||||
@@ -388,6 +388,16 @@ func (h *ClusterHandlers) ShowClusterS3Servers(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
}
|
||||
|
||||
// ShowClusterVectorServers renders the vector engines registered with the master
|
||||
func (h *ClusterHandlers) ShowClusterVectorServers(w http.ResponseWriter, r *http.Request) {
|
||||
data := h.adminServer.GetVectorOperationsData(r.Context())
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
viewCtx := layout.NewViewContext(r, usernameOrDefault(r), dash.CSRFTokenFromContext(r.Context()))
|
||||
if err := layout.Layout(viewCtx, app.ClusterVectorServers(data)).Render(r.Context(), w); err != nil {
|
||||
writeJSONError(w, http.StatusInternalServerError, "Failed to render template: "+err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// GetClusterTopology returns the cluster topology as JSON
|
||||
func (h *ClusterHandlers) GetClusterTopology(w http.ResponseWriter, r *http.Request) {
|
||||
topology, err := h.adminServer.GetClusterTopology()
|
||||
|
||||
@@ -1120,13 +1120,15 @@ func (r *Plugin) trackExecutionCompletion(completed *plugin_pb.JobCompleted) *Tr
|
||||
if completed.RequestId != "" {
|
||||
tracked.RequestID = completed.RequestId
|
||||
}
|
||||
if completed.Result != nil {
|
||||
tracked.ResultSummary = completed.Result.Summary
|
||||
} else {
|
||||
tracked.ResultSummary = ""
|
||||
}
|
||||
if completed.Success {
|
||||
tracked.State = strings.ToLower(plugin_pb.JobState_JOB_STATE_SUCCEEDED.String())
|
||||
tracked.Progress = 100
|
||||
tracked.Stage = "completed"
|
||||
if completed.Result != nil {
|
||||
tracked.ResultSummary = completed.Result.Summary
|
||||
}
|
||||
tracked.Message = tracked.ResultSummary
|
||||
if tracked.Message == "" {
|
||||
tracked.Message = "completed"
|
||||
@@ -1159,7 +1161,7 @@ func (r *Plugin) trackExecutionCompletion(completed *plugin_pb.JobCompleted) *Tr
|
||||
detail.Message = clone.Message
|
||||
detail.ErrorMessage = clone.ErrorMessage
|
||||
detail.ResultSummary = clone.ResultSummary
|
||||
if completed.Success && completed.Result != nil {
|
||||
if completed.Result != nil {
|
||||
detail.ResultOutputValues = configValueMapToPlain(completed.Result.OutputValues)
|
||||
} else {
|
||||
detail.ResultOutputValues = nil
|
||||
|
||||
@@ -594,6 +594,95 @@ func TestBuildJobDetailIncludesActivitiesAndRunRecord(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildJobDetailKeepsFailedJobResult(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
pluginSvc, err := New(Options{DataDir: t.TempDir()})
|
||||
if err != nil {
|
||||
t.Fatalf("New: %v", err)
|
||||
}
|
||||
defer pluginSvc.Shutdown()
|
||||
|
||||
pluginSvc.trackExecutionStart("req-failed", "worker-f", &plugin_pb.JobSpec{
|
||||
JobId: "job-failed",
|
||||
JobType: "s3_lifecycle",
|
||||
}, 1)
|
||||
pluginSvc.handleJobCompleted(&plugin_pb.JobCompleted{
|
||||
RequestId: "req-failed",
|
||||
JobId: "job-failed",
|
||||
JobType: "s3_lifecycle",
|
||||
Success: false,
|
||||
ErrorMessage: "walk bad-a: filer down",
|
||||
Result: &plugin_pb.JobResult{
|
||||
Summary: "pass failed",
|
||||
OutputValues: map[string]*plugin_pb.ConfigValue{
|
||||
"buckets_failed": {Kind: &plugin_pb.ConfigValue_Int64Value{Int64Value: 2}},
|
||||
},
|
||||
},
|
||||
CompletedAt: timestamppb.Now(),
|
||||
})
|
||||
pluginSvc.Shutdown()
|
||||
|
||||
detail, found, err := pluginSvc.BuildJobDetail("job-failed", 100, 5)
|
||||
if err != nil {
|
||||
t.Fatalf("BuildJobDetail error: %v", err)
|
||||
}
|
||||
if !found || detail == nil || detail.Job == nil {
|
||||
t.Fatalf("expected job detail")
|
||||
}
|
||||
if detail.Job.State != "job_state_failed" || detail.Job.ErrorMessage != "walk bad-a: filer down" {
|
||||
t.Fatalf("expected the failure to be kept, got state=%q error=%q", detail.Job.State, detail.Job.ErrorMessage)
|
||||
}
|
||||
if detail.Job.ResultSummary != "pass failed" {
|
||||
t.Fatalf("expected the failed job's result summary, got %q", detail.Job.ResultSummary)
|
||||
}
|
||||
if detail.Job.ResultOutputValues["buckets_failed"] == nil {
|
||||
t.Fatalf("expected the failed job's result output values, got %+v", detail.Job.ResultOutputValues)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRetryWithoutResultDropsFailedAttemptSummary(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
pluginSvc, err := New(Options{DataDir: t.TempDir()})
|
||||
if err != nil {
|
||||
t.Fatalf("New: %v", err)
|
||||
}
|
||||
defer pluginSvc.Shutdown()
|
||||
|
||||
job := &plugin_pb.JobSpec{JobId: "job-retry", JobType: "s3_lifecycle"}
|
||||
pluginSvc.trackExecutionStart("req-retry", "worker-r", job, 1)
|
||||
pluginSvc.handleJobCompleted(&plugin_pb.JobCompleted{
|
||||
RequestId: "req-retry",
|
||||
JobId: "job-retry",
|
||||
JobType: "s3_lifecycle",
|
||||
Success: false,
|
||||
ErrorMessage: "walk bad-a: filer down",
|
||||
Result: &plugin_pb.JobResult{Summary: "pass failed"},
|
||||
CompletedAt: timestamppb.Now(),
|
||||
})
|
||||
pluginSvc.trackExecutionStart("req-retry", "worker-r", job, 2)
|
||||
pluginSvc.handleJobCompleted(&plugin_pb.JobCompleted{
|
||||
RequestId: "req-retry",
|
||||
JobId: "job-retry",
|
||||
JobType: "s3_lifecycle",
|
||||
Success: true,
|
||||
CompletedAt: timestamppb.Now(),
|
||||
})
|
||||
pluginSvc.Shutdown()
|
||||
|
||||
detail, found, err := pluginSvc.BuildJobDetail("job-retry", 100, 5)
|
||||
if err != nil {
|
||||
t.Fatalf("BuildJobDetail error: %v", err)
|
||||
}
|
||||
if !found || detail == nil || detail.Job == nil {
|
||||
t.Fatalf("expected job detail")
|
||||
}
|
||||
if detail.Job.ResultSummary != "" || detail.Job.Message != "completed" {
|
||||
t.Fatalf("expected the failed attempt's summary to be dropped, got summary=%q message=%q", detail.Job.ResultSummary, detail.Job.Message)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildJobDetailLoadsFromDiskWhenMemoryCleared(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -704,6 +793,64 @@ func TestExpireStaleJobsCancelsTheJobOnItsWorker(t *testing.T) {
|
||||
expectCancelFor(t, session, "req-stale")
|
||||
}
|
||||
|
||||
// A job older than the stale limit stays active while its worker reports
|
||||
// progress for it; the worker's heartbeat alone does not keep it alive.
|
||||
func TestExpireStaleJobsKeepsAJobThatReportsProgress(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
pluginSvc, err := New(Options{})
|
||||
if err != nil {
|
||||
t.Fatalf("New: %v", err)
|
||||
}
|
||||
defer pluginSvc.Shutdown()
|
||||
|
||||
const workerID = "worker-1"
|
||||
session := &streamSession{workerID: workerID, outgoing: make(chan *plugin_pb.AdminToWorkerMessage, 8), done: make(chan struct{})}
|
||||
pluginSvc.putSession(session)
|
||||
pluginSvc.handleWorkerMessage(session, &plugin_pb.WorkerToAdminMessage{
|
||||
Body: &plugin_pb.WorkerToAdminMessage_Hello{Hello: &plugin_pb.WorkerHello{WorkerId: workerID}},
|
||||
})
|
||||
pluginSvc.trackExecutionStart("req-working", workerID, &plugin_pb.JobSpec{JobId: "job-working", JobType: "s3_lifecycle"}, 1)
|
||||
pluginSvc.trackExecutionStart("req-stalled", workerID, &plugin_pb.JobSpec{JobId: "job-stalled", JobType: "s3_lifecycle"}, 1)
|
||||
|
||||
startedAt := time.Now().UTC().Add(-defaultStaleActiveJobTimeout - time.Hour)
|
||||
pluginSvc.jobsMu.Lock()
|
||||
for _, job := range pluginSvc.jobs {
|
||||
job.CreatedAt = timeToPtr(startedAt)
|
||||
job.UpdatedAt = timeToPtr(startedAt)
|
||||
}
|
||||
pluginSvc.jobsMu.Unlock()
|
||||
|
||||
pluginSvc.handleWorkerMessage(session, &plugin_pb.WorkerToAdminMessage{
|
||||
Body: &plugin_pb.WorkerToAdminMessage_Heartbeat{Heartbeat: &plugin_pb.WorkerHeartbeat{
|
||||
WorkerId: workerID,
|
||||
ExecutionSlotsTotal: 4,
|
||||
ExecutionSlotsUsed: 2,
|
||||
RunningWork: []*plugin_pb.RunningWork{
|
||||
{WorkId: "job-working", Kind: plugin_pb.WorkKind_WORK_KIND_EXECUTION, JobType: "s3_lifecycle"},
|
||||
{WorkId: "job-stalled", Kind: plugin_pb.WorkKind_WORK_KIND_EXECUTION, JobType: "s3_lifecycle"},
|
||||
},
|
||||
}},
|
||||
})
|
||||
pluginSvc.handleWorkerMessage(session, &plugin_pb.WorkerToAdminMessage{
|
||||
Body: &plugin_pb.WorkerToAdminMessage_JobProgressUpdate{JobProgressUpdate: &plugin_pb.JobProgressUpdate{
|
||||
JobId: "job-working", JobType: "s3_lifecycle", RequestId: "req-working",
|
||||
State: plugin_pb.JobState_JOB_STATE_RUNNING, Stage: "walk", Message: "entries=10",
|
||||
}},
|
||||
})
|
||||
|
||||
if n := pluginSvc.expireStaleJobs(time.Now().UTC()); n != 1 {
|
||||
t.Fatalf("expired %d jobs, want only the stalled one", n)
|
||||
}
|
||||
if got, _ := pluginSvc.GetTrackedJob("job-working"); got == nil || got.State != "job_state_running" {
|
||||
t.Fatalf("expected the job reporting progress to stay running, got %+v", got)
|
||||
}
|
||||
if got, _ := pluginSvc.GetTrackedJob("job-stalled"); got == nil || got.State != StateFailed {
|
||||
t.Fatalf("expected the heartbeat-only job to be failed, got %+v", got)
|
||||
}
|
||||
expectCancelFor(t, session, "req-stalled")
|
||||
}
|
||||
|
||||
func expectNoCancel(t *testing.T, session *streamSession) {
|
||||
t.Helper()
|
||||
select {
|
||||
|
||||
+888
-230
File diff suppressed because it is too large.
Load diff
@@ -129,21 +129,6 @@ function setupSubmenuBehavior() {
|
||||
}
|
||||
}
|
||||
|
||||
// If we're on an object store page, expand the object store submenu
|
||||
if (currentPathStartsWith('/object-store/')) {
|
||||
const objectStoreSubmenu = document.getElementById('objectStoreSubmenu');
|
||||
if (objectStoreSubmenu) {
|
||||
objectStoreSubmenu.classList.add('show');
|
||||
|
||||
// Update the parent toggle button state
|
||||
const toggleButton = document.querySelector('[data-bs-target="#objectStoreSubmenu"]');
|
||||
if (toggleButton) {
|
||||
toggleButton.classList.remove('collapsed');
|
||||
toggleButton.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent submenu from collapsing when clicking on submenu items
|
||||
const clusterSubmenuLinks = document.querySelectorAll('#clusterSubmenu .nav-link');
|
||||
clusterSubmenuLinks.forEach(function (link) {
|
||||
@@ -152,61 +137,6 @@ function setupSubmenuBehavior() {
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
|
||||
const objectStoreSubmenuLinks = document.querySelectorAll('#objectStoreSubmenu .nav-link');
|
||||
objectStoreSubmenuLinks.forEach(function (link) {
|
||||
link.addEventListener('click', function (e) {
|
||||
// Don't prevent the navigation, just stop the collapse behavior
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
|
||||
// Handle the main cluster toggle
|
||||
const clusterToggle = document.querySelector('[data-bs-target="#clusterSubmenu"]');
|
||||
if (clusterToggle) {
|
||||
clusterToggle.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const submenu = document.getElementById('clusterSubmenu');
|
||||
const isExpanded = submenu.classList.contains('show');
|
||||
|
||||
if (isExpanded) {
|
||||
// Collapse
|
||||
submenu.classList.remove('show');
|
||||
this.classList.add('collapsed');
|
||||
this.setAttribute('aria-expanded', 'false');
|
||||
} else {
|
||||
// Expand
|
||||
submenu.classList.add('show');
|
||||
this.classList.remove('collapsed');
|
||||
this.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Handle the main object store toggle
|
||||
const objectStoreToggle = document.querySelector('[data-bs-target="#objectStoreSubmenu"]');
|
||||
if (objectStoreToggle) {
|
||||
objectStoreToggle.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const submenu = document.getElementById('objectStoreSubmenu');
|
||||
const isExpanded = submenu.classList.contains('show');
|
||||
|
||||
if (isExpanded) {
|
||||
// Collapse
|
||||
submenu.classList.remove('show');
|
||||
this.classList.add('collapsed');
|
||||
this.setAttribute('aria-expanded', 'false');
|
||||
} else {
|
||||
// Expand
|
||||
submenu.classList.add('show');
|
||||
this.classList.remove('collapsed');
|
||||
this.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Mobile sidebar toggle and backdrop behavior
|
||||
@@ -573,52 +503,6 @@ function refreshBuckets() {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
// Export bucket list
|
||||
function exportBucketList() {
|
||||
// Get table data
|
||||
const table = document.getElementById('bucketsTable');
|
||||
if (!table) return;
|
||||
|
||||
const rows = Array.from(table.querySelectorAll('tbody tr'));
|
||||
const data = rows.map(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length < 5) return null; // Skip empty state row
|
||||
|
||||
return {
|
||||
name: cells[0].textContent.trim(),
|
||||
owner: cells[1].textContent.trim(),
|
||||
created: cells[2].textContent.trim(),
|
||||
logicalSize: cells[3].textContent.trim(),
|
||||
physicalSize: cells[4].textContent.trim(),
|
||||
quota: cells[5].textContent.trim()
|
||||
};
|
||||
}).filter(item => item !== null);
|
||||
|
||||
// Convert to CSV
|
||||
const csv = [
|
||||
['Name', 'Owner', 'Created', 'Logical Size', 'Physical Size', 'Quota'].join(','),
|
||||
...data.map(row => [
|
||||
row.name,
|
||||
row.owner,
|
||||
row.created,
|
||||
row.logicalSize,
|
||||
row.physicalSize,
|
||||
row.quota
|
||||
].join(','))
|
||||
].join('\n');
|
||||
|
||||
// Download CSV
|
||||
const blob = new Blob([csv], { type: 'text/csv' });
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `seaweedfs-buckets-${new Date().toISOString().split('T')[0]}.csv`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
// showAlert is provided by modal-alerts.js with signature: showAlert(message, type)
|
||||
|
||||
// Format date for display
|
||||
@@ -871,19 +755,18 @@ function exportUsers() {
|
||||
return;
|
||||
}
|
||||
|
||||
let csvContent = 'Username,Email,Access Key,Status,Created,Last Login\n';
|
||||
let csvContent = 'Username,Email,Access Key\n';
|
||||
|
||||
rows.forEach(row => {
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length >= 6) {
|
||||
const username = cells[0].textContent.trim();
|
||||
if (cells.length >= 3) {
|
||||
const username = (cells[0].querySelector('strong') || cells[0]).textContent.trim();
|
||||
const email = cells[1].textContent.trim();
|
||||
const accessKey = cells[2].textContent.trim();
|
||||
const status = cells[3].textContent.trim();
|
||||
const created = cells[4].textContent.trim();
|
||||
const lastLogin = cells[5].textContent.trim();
|
||||
|
||||
csvContent += `"${username}","${email}","${accessKey}","${status}","${created}","${lastLogin}"\n`;
|
||||
csvContent += [username, email, accessKey]
|
||||
.map(value => `"${value.replace(/"/g, '""')}"`)
|
||||
.join(',') + '\n';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Binary file not shown.
Loaded 100 of 592 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user