mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d002c5d43 | ||
|
|
396927d1ec |
No files matched your search
@@ -38,7 +38,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
|
||||
- name: Set BUILD_TIME env
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
|
||||
- name: Set BUILD_TIME env
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@481a2c1a0f1be199722e3e9b74d7199acafc30a8 # v1.22
|
||||
with:
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
@@ -16,11 +16,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -42,14 +42,14 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Login to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -17,11 +17,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -43,14 +43,14 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Login to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
|
||||
@@ -16,11 +16,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -17,11 +17,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -17,11 +17,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -16,11 +16,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -16,11 +16,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v3
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v3
|
||||
with:
|
||||
images: |
|
||||
chrislusf/seaweedfs
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v1
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -21,10 +21,10 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.24'
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b
|
||||
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9
|
||||
@@ -24,62 +24,22 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v2
|
||||
uses: actions/setup-go@8e57b58e57be52ac95949151e2777ffda8501267 # v2
|
||||
with:
|
||||
go-version: ^1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-e2e-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-e2e-
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
# Use faster mirrors and install with timeout
|
||||
echo "deb http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" | sudo tee /etc/apt/sources.list
|
||||
echo "deb http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
|
||||
|
||||
sudo apt-get update --fix-missing
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends fuse
|
||||
|
||||
# Verify FUSE installation
|
||||
echo "FUSE version: $(fusermount --version 2>&1 || echo 'fusermount not found')"
|
||||
echo "FUSE device: $(ls -la /dev/fuse 2>&1 || echo '/dev/fuse not found')"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y fuse
|
||||
|
||||
- name: Start SeaweedFS
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
# Enable Docker buildkit for better caching
|
||||
export DOCKER_BUILDKIT=1
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
|
||||
# Build with retry logic
|
||||
for i in {1..3}; do
|
||||
echo "Build attempt $i/3"
|
||||
if make build_e2e; then
|
||||
echo "Build successful on attempt $i"
|
||||
break
|
||||
elif [ $i -eq 3 ]; then
|
||||
echo "Build failed after 3 attempts"
|
||||
exit 1
|
||||
else
|
||||
echo "Build attempt $i failed, retrying in 30 seconds..."
|
||||
sleep 30
|
||||
fi
|
||||
done
|
||||
|
||||
# Start services with wait
|
||||
docker compose -f ./compose/e2e-mount.yml up --wait
|
||||
timeout-minutes: 5
|
||||
run: make build_e2e && docker compose -f ./compose/e2e-mount.yml up --wait
|
||||
|
||||
- name: Run FIO 4k
|
||||
timeout-minutes: 15
|
||||
|
||||
@@ -22,7 +22,7 @@ permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.24'
|
||||
GO_VERSION: '1.21'
|
||||
TEST_TIMEOUT: '45m'
|
||||
|
||||
jobs:
|
||||
@@ -33,10 +33,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v2
|
||||
uses: actions/setup-go@8e57b58e57be52ac95949151e2777ffda8501267 # v2
|
||||
with:
|
||||
go-version: ^1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
|
||||
@@ -12,9 +12,9 @@ jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||
- name: Publish Helm charts
|
||||
uses: stefanprodan/helm-gh-pages@v1.7.0
|
||||
uses: stefanprodan/helm-gh-pages@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
charts_dir: k8s/charts
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
with:
|
||||
version: v3.18.4
|
||||
|
||||
- uses: actions/setup-python@v6
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
check-latest: true
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -89,10 +89,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -137,10 +137,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -188,10 +188,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -255,10 +255,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -319,10 +319,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -370,10 +370,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -409,6 +409,4 @@ jobs:
|
||||
with:
|
||||
name: s3-versioning-stress-logs
|
||||
path: test/s3/versioning/weed-test*.log
|
||||
retention-days: 7
|
||||
|
||||
# Removed SSE-C integration tests and compatibility job
|
||||
retention-days: 7
|
||||
@@ -1,283 +0,0 @@
|
||||
name: "S3 IAM Integration Tests"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'weed/iam/**'
|
||||
- 'weed/s3api/**'
|
||||
- 'test/s3/iam/**'
|
||||
- '.github/workflows/s3-iam-tests.yml'
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/iam/**'
|
||||
- 'weed/s3api/**'
|
||||
- 'test/s3/iam/**'
|
||||
- '.github/workflows/s3-iam-tests.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}/s3-iam-tests
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: weed
|
||||
|
||||
jobs:
|
||||
# Unit tests for IAM components
|
||||
iam-unit-tests:
|
||||
name: IAM Unit Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go mod download
|
||||
|
||||
- name: Run IAM Unit Tests
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set -x
|
||||
echo "=== Running IAM STS Tests ==="
|
||||
go test -v -timeout 5m ./iam/sts/...
|
||||
|
||||
echo "=== Running IAM Policy Tests ==="
|
||||
go test -v -timeout 5m ./iam/policy/...
|
||||
|
||||
echo "=== Running IAM Integration Tests ==="
|
||||
go test -v -timeout 5m ./iam/integration/...
|
||||
|
||||
echo "=== Running S3 API IAM Tests ==="
|
||||
go test -v -timeout 5m ./s3api/... -run ".*IAM.*|.*JWT.*|.*Auth.*"
|
||||
|
||||
- name: Upload test results on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: iam-unit-test-results
|
||||
path: |
|
||||
weed/testdata/
|
||||
weed/**/testdata/
|
||||
retention-days: 3
|
||||
|
||||
# S3 IAM integration tests with SeaweedFS services
|
||||
s3-iam-integration-tests:
|
||||
name: S3 IAM Integration Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
strategy:
|
||||
matrix:
|
||||
test-type: ["basic", "advanced", "policy-enforcement"]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
working-directory: weed
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run S3 IAM Integration Tests - ${{ matrix.test-type }}
|
||||
timeout-minutes: 20
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
df -h
|
||||
echo "=== Starting S3 IAM Integration Tests (${{ matrix.test-type }}) ==="
|
||||
|
||||
# Set WEED_BINARY to use the installed version
|
||||
export WEED_BINARY=$(which weed)
|
||||
export TEST_TIMEOUT=15m
|
||||
|
||||
# Run tests based on type
|
||||
case "${{ matrix.test-type }}" in
|
||||
"basic")
|
||||
echo "Running basic IAM functionality tests..."
|
||||
make clean setup start-services wait-for-services
|
||||
go test -v -timeout 15m -run "TestS3IAMAuthentication|TestS3IAMBasicWorkflow|TestS3IAMTokenValidation" ./...
|
||||
;;
|
||||
"advanced")
|
||||
echo "Running advanced IAM feature tests..."
|
||||
make clean setup start-services wait-for-services
|
||||
go test -v -timeout 15m -run "TestS3IAMSessionExpiration|TestS3IAMMultipart|TestS3IAMPresigned" ./...
|
||||
;;
|
||||
"policy-enforcement")
|
||||
echo "Running policy enforcement tests..."
|
||||
make clean setup start-services wait-for-services
|
||||
go test -v -timeout 15m -run "TestS3IAMPolicyEnforcement|TestS3IAMBucketPolicy|TestS3IAMContextual" ./...
|
||||
;;
|
||||
*)
|
||||
echo "Unknown test type: ${{ matrix.test-type }}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Always cleanup
|
||||
make stop-services
|
||||
|
||||
- name: Show service logs on failure
|
||||
if: failure()
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
echo "=== Service Logs ==="
|
||||
echo "--- Master Log ---"
|
||||
tail -50 weed-master.log 2>/dev/null || echo "No master log found"
|
||||
echo ""
|
||||
echo "--- Filer Log ---"
|
||||
tail -50 weed-filer.log 2>/dev/null || echo "No filer log found"
|
||||
echo ""
|
||||
echo "--- Volume Log ---"
|
||||
tail -50 weed-volume.log 2>/dev/null || echo "No volume log found"
|
||||
echo ""
|
||||
echo "--- S3 API Log ---"
|
||||
tail -50 weed-s3.log 2>/dev/null || echo "No S3 log found"
|
||||
echo ""
|
||||
|
||||
echo "=== Process Information ==="
|
||||
ps aux | grep -E "(weed|test)" || true
|
||||
netstat -tlnp | grep -E "(8333|8888|9333|8080)" || true
|
||||
|
||||
- name: Upload test logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-iam-integration-logs-${{ matrix.test-type }}
|
||||
path: test/s3/iam/weed-*.log
|
||||
retention-days: 5
|
||||
|
||||
# Distributed IAM tests
|
||||
s3-iam-distributed-tests:
|
||||
name: S3 IAM Distributed Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
working-directory: weed
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run Distributed IAM Tests
|
||||
timeout-minutes: 20
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
export WEED_BINARY=$(which weed)
|
||||
export TEST_TIMEOUT=15m
|
||||
|
||||
# Test distributed configuration
|
||||
echo "Testing distributed IAM configuration..."
|
||||
make clean setup
|
||||
|
||||
# Start services with distributed IAM config
|
||||
echo "Starting services with distributed configuration..."
|
||||
make start-services
|
||||
make wait-for-services
|
||||
|
||||
# Run distributed-specific tests
|
||||
export ENABLE_DISTRIBUTED_TESTS=true
|
||||
go test -v -timeout 15m -run "TestS3IAMDistributedTests" ./... || {
|
||||
echo "❌ Distributed tests failed, checking logs..."
|
||||
make logs
|
||||
exit 1
|
||||
}
|
||||
|
||||
make stop-services
|
||||
|
||||
- name: Upload distributed test logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-iam-distributed-logs
|
||||
path: test/s3/iam/weed-*.log
|
||||
retention-days: 7
|
||||
|
||||
# Performance and stress tests
|
||||
s3-iam-performance-tests:
|
||||
name: S3 IAM Performance Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
working-directory: weed
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run IAM Performance Benchmarks
|
||||
timeout-minutes: 25
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
set -x
|
||||
echo "=== Running IAM Performance Tests ==="
|
||||
|
||||
export WEED_BINARY=$(which weed)
|
||||
export TEST_TIMEOUT=20m
|
||||
|
||||
make clean setup start-services wait-for-services
|
||||
|
||||
# Run performance tests (benchmarks disabled for CI)
|
||||
echo "Running performance tests..."
|
||||
export ENABLE_PERFORMANCE_TESTS=true
|
||||
go test -v -timeout 15m -run "TestS3IAMPerformanceTests" ./... || {
|
||||
echo "❌ Performance tests failed"
|
||||
make logs
|
||||
exit 1
|
||||
}
|
||||
|
||||
make stop-services
|
||||
|
||||
- name: Upload performance test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-iam-performance-results
|
||||
path: |
|
||||
test/s3/iam/weed-*.log
|
||||
test/s3/iam/*.test
|
||||
retention-days: 7
|
||||
@@ -1,161 +0,0 @@
|
||||
name: "S3 Keycloak Integration Tests"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'weed/iam/**'
|
||||
- 'weed/s3api/**'
|
||||
- 'test/s3/iam/**'
|
||||
- '.github/workflows/s3-keycloak-tests.yml'
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/iam/**'
|
||||
- 'weed/s3api/**'
|
||||
- 'test/s3/iam/**'
|
||||
- '.github/workflows/s3-keycloak-tests.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}/s3-keycloak-tests
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: weed
|
||||
|
||||
jobs:
|
||||
# Dedicated job for Keycloak integration tests
|
||||
s3-keycloak-integration-tests:
|
||||
name: S3 Keycloak Integration Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
working-directory: weed
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run Keycloak Integration Tests
|
||||
timeout-minutes: 25
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
df -h
|
||||
echo "=== Starting S3 Keycloak Integration Tests ==="
|
||||
|
||||
# Set WEED_BINARY to use the installed version
|
||||
export WEED_BINARY=$(which weed)
|
||||
export TEST_TIMEOUT=20m
|
||||
|
||||
echo "Running Keycloak integration tests..."
|
||||
# Start Keycloak container first
|
||||
docker run -d \
|
||||
--name keycloak \
|
||||
-p 8080:8080 \
|
||||
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
|
||||
-e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
|
||||
-e KC_HTTP_ENABLED=true \
|
||||
-e KC_HOSTNAME_STRICT=false \
|
||||
-e KC_HOSTNAME_STRICT_HTTPS=false \
|
||||
quay.io/keycloak/keycloak:26.0 \
|
||||
start-dev
|
||||
|
||||
# Wait for Keycloak with better health checking
|
||||
timeout 300 bash -c '
|
||||
while true; do
|
||||
if curl -s http://localhost:8080/health/ready > /dev/null 2>&1; then
|
||||
echo "✅ Keycloak health check passed"
|
||||
break
|
||||
fi
|
||||
echo "... waiting for Keycloak to be ready"
|
||||
sleep 5
|
||||
done
|
||||
'
|
||||
|
||||
# Setup Keycloak configuration
|
||||
./setup_keycloak.sh
|
||||
|
||||
# Start SeaweedFS services
|
||||
make clean setup start-services wait-for-services
|
||||
|
||||
# Verify service accessibility
|
||||
echo "=== Verifying Service Accessibility ==="
|
||||
curl -f http://localhost:8080/realms/master
|
||||
curl -s http://localhost:8333
|
||||
echo "✅ SeaweedFS S3 API is responding (IAM-protected endpoint)"
|
||||
|
||||
# Run Keycloak-specific tests
|
||||
echo "=== Running Keycloak Tests ==="
|
||||
export KEYCLOAK_URL=http://localhost:8080
|
||||
export S3_ENDPOINT=http://localhost:8333
|
||||
|
||||
# Wait for realm to be properly configured
|
||||
timeout 120 bash -c 'until curl -fs http://localhost:8080/realms/seaweedfs-test/.well-known/openid-configuration > /dev/null; do echo "... waiting for realm"; sleep 3; done'
|
||||
|
||||
# Run the Keycloak integration tests
|
||||
go test -v -timeout 20m -run "TestKeycloak" ./...
|
||||
|
||||
- name: Show server logs on failure
|
||||
if: failure()
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
echo "=== Service Logs ==="
|
||||
echo "--- Keycloak logs ---"
|
||||
docker logs keycloak --tail=100 || echo "No Keycloak container logs"
|
||||
|
||||
echo "--- SeaweedFS Master logs ---"
|
||||
if [ -f weed-master.log ]; then
|
||||
tail -100 weed-master.log
|
||||
fi
|
||||
|
||||
echo "--- SeaweedFS S3 logs ---"
|
||||
if [ -f weed-s3.log ]; then
|
||||
tail -100 weed-s3.log
|
||||
fi
|
||||
|
||||
echo "--- SeaweedFS Filer logs ---"
|
||||
if [ -f weed-filer.log ]; then
|
||||
tail -100 weed-filer.log
|
||||
fi
|
||||
|
||||
echo "=== System Status ==="
|
||||
ps aux | grep -E "(weed|keycloak)" || true
|
||||
netstat -tlnp | grep -E "(8333|9333|8080|8888)" || true
|
||||
docker ps -a || true
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
working-directory: test/s3/iam
|
||||
run: |
|
||||
# Stop Keycloak container
|
||||
docker stop keycloak || true
|
||||
docker rm keycloak || true
|
||||
|
||||
# Stop SeaweedFS services
|
||||
make clean || true
|
||||
|
||||
- name: Upload test logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-keycloak-test-logs
|
||||
path: |
|
||||
test/s3/iam/*.log
|
||||
test/s3/iam/test-volume-data/
|
||||
retention-days: 3
|
||||
@@ -1,345 +0,0 @@
|
||||
name: "S3 SSE Tests"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'weed/s3api/s3_sse_*.go'
|
||||
- 'weed/s3api/s3api_object_handlers_put.go'
|
||||
- 'weed/s3api/s3api_object_handlers_copy*.go'
|
||||
- 'weed/server/filer_server_handlers_*.go'
|
||||
- 'weed/kms/**'
|
||||
- 'test/s3/sse/**'
|
||||
- '.github/workflows/s3-sse-tests.yml'
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
paths:
|
||||
- 'weed/s3api/s3_sse_*.go'
|
||||
- 'weed/s3api/s3api_object_handlers_put.go'
|
||||
- 'weed/s3api/s3api_object_handlers_copy*.go'
|
||||
- 'weed/server/filer_server_handlers_*.go'
|
||||
- 'weed/kms/**'
|
||||
- 'test/s3/sse/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref }}/s3-sse-tests
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: weed
|
||||
|
||||
jobs:
|
||||
s3-sse-integration-tests:
|
||||
name: S3 SSE Integration Tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
matrix:
|
||||
test-type: ["quick", "comprehensive"]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run S3 SSE Integration Tests - ${{ matrix.test-type }}
|
||||
timeout-minutes: 25
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
df -h
|
||||
echo "=== Starting SSE Tests ==="
|
||||
|
||||
# Run tests with automatic server management
|
||||
# The test-with-server target handles server startup/shutdown automatically
|
||||
if [ "${{ matrix.test-type }}" = "quick" ]; then
|
||||
# Quick tests - basic SSE-C and SSE-KMS functionality
|
||||
make test-with-server TEST_PATTERN="TestSSECIntegrationBasic|TestSSEKMSIntegrationBasic|TestSimpleSSECIntegration"
|
||||
else
|
||||
# Comprehensive tests - SSE-C/KMS functionality, excluding copy operations (pre-existing SSE-C issues)
|
||||
make test-with-server TEST_PATTERN="TestSSECIntegrationBasic|TestSSECIntegrationVariousDataSizes|TestSSEKMSIntegrationBasic|TestSSEKMSIntegrationVariousDataSizes|.*Multipart.*Integration|TestSimpleSSECIntegration"
|
||||
fi
|
||||
|
||||
- name: Show server logs on failure
|
||||
if: failure()
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
echo "=== Server Logs ==="
|
||||
if [ -f weed-test.log ]; then
|
||||
echo "Last 100 lines of server logs:"
|
||||
tail -100 weed-test.log
|
||||
else
|
||||
echo "No server log file found"
|
||||
fi
|
||||
|
||||
echo "=== Test Environment ==="
|
||||
ps aux | grep -E "(weed|test)" || true
|
||||
netstat -tlnp | grep -E "(8333|9333|8080|8888)" || true
|
||||
|
||||
- name: Upload test logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-test-logs-${{ matrix.test-type }}
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 3
|
||||
|
||||
s3-sse-compatibility:
|
||||
name: S3 SSE Compatibility Test
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run Core SSE Compatibility Test (AWS S3 equivalent)
|
||||
timeout-minutes: 15
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
# Run the specific tests that validate AWS S3 SSE compatibility - both SSE-C and SSE-KMS basic functionality
|
||||
make test-with-server TEST_PATTERN="TestSSECIntegrationBasic|TestSSEKMSIntegrationBasic" || {
|
||||
echo "❌ SSE compatibility test failed, checking logs..."
|
||||
if [ -f weed-test.log ]; then
|
||||
echo "=== Server logs ==="
|
||||
tail -100 weed-test.log
|
||||
fi
|
||||
echo "=== Process information ==="
|
||||
ps aux | grep -E "(weed|test)" || true
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Upload server logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-compatibility-logs
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 3
|
||||
|
||||
s3-sse-metadata-persistence:
|
||||
name: S3 SSE Metadata Persistence Test
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run SSE Metadata Persistence Test
|
||||
timeout-minutes: 15
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
# Run the specific test that would catch filer metadata storage bugs
|
||||
# This test validates that encryption metadata survives the full PUT/GET cycle
|
||||
make test-metadata-persistence || {
|
||||
echo "❌ SSE metadata persistence test failed, checking logs..."
|
||||
if [ -f weed-test.log ]; then
|
||||
echo "=== Server logs ==="
|
||||
tail -100 weed-test.log
|
||||
fi
|
||||
echo "=== Process information ==="
|
||||
ps aux | grep -E "(weed|test)" || true
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Upload server logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-metadata-persistence-logs
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 3
|
||||
|
||||
s3-sse-copy-operations:
|
||||
name: S3 SSE Copy Operations Test
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run SSE Copy Operations Tests
|
||||
timeout-minutes: 20
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
# Run tests that validate SSE copy operations and cross-encryption scenarios
|
||||
echo "🚀 Running SSE copy operations tests..."
|
||||
echo "📋 Note: SSE-C copy operations have pre-existing functionality gaps"
|
||||
echo " Cross-encryption copy security fix has been implemented and maintained"
|
||||
|
||||
# Skip SSE-C copy operations due to pre-existing HTTP 500 errors
|
||||
# The critical security fix for cross-encryption (SSE-C → SSE-KMS) has been preserved
|
||||
echo "⏭️ Skipping SSE copy operations tests due to known limitations:"
|
||||
echo " - SSE-C copy operations: HTTP 500 errors (pre-existing functionality gap)"
|
||||
echo " - Cross-encryption security fix: ✅ Implemented and tested (forces streaming copy)"
|
||||
echo " - These limitations are documented as pre-existing issues"
|
||||
exit 0 # Job succeeds with security fix preserved and limitations documented
|
||||
|
||||
- name: Upload server logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-copy-operations-logs
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 3
|
||||
|
||||
s3-sse-multipart:
|
||||
name: S3 SSE Multipart Upload Test
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run SSE Multipart Upload Tests
|
||||
timeout-minutes: 20
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
# Multipart tests - Document known architectural limitations
|
||||
echo "🚀 Running multipart upload tests..."
|
||||
echo "📋 Note: SSE-KMS multipart upload has known architectural limitation requiring per-chunk metadata storage"
|
||||
echo " SSE-C multipart tests will be skipped due to pre-existing functionality gaps"
|
||||
|
||||
# Test SSE-C basic multipart (skip advanced multipart that fails with HTTP 500)
|
||||
# Skip SSE-KMS multipart due to architectural limitation (each chunk needs independent metadata)
|
||||
echo "⏭️ Skipping multipart upload tests due to known limitations:"
|
||||
echo " - SSE-C multipart GET operations: HTTP 500 errors (pre-existing functionality gap)"
|
||||
echo " - SSE-KMS multipart decryption: Requires per-chunk SSE metadata architecture changes"
|
||||
echo " - These limitations are documented and require future architectural work"
|
||||
exit 0 # Job succeeds with clear documentation of known limitations
|
||||
|
||||
- name: Upload server logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-multipart-logs
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 3
|
||||
|
||||
s3-sse-performance:
|
||||
name: S3 SSE Performance Test
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 35
|
||||
# Only run performance tests on master branch pushes to avoid overloading PR testing
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
go install -buildvcs=false
|
||||
|
||||
- name: Run S3 SSE Performance Tests
|
||||
timeout-minutes: 30
|
||||
working-directory: test/s3/sse
|
||||
run: |
|
||||
set -x
|
||||
echo "=== System Information ==="
|
||||
uname -a
|
||||
free -h
|
||||
|
||||
# Run performance tests with various data sizes
|
||||
make perf || {
|
||||
echo "❌ SSE performance test failed, checking logs..."
|
||||
if [ -f weed-test.log ]; then
|
||||
echo "=== Server logs ==="
|
||||
tail -200 weed-test.log
|
||||
fi
|
||||
make clean
|
||||
exit 1
|
||||
}
|
||||
make clean
|
||||
|
||||
- name: Upload performance test logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: s3-sse-performance-logs
|
||||
path: test/s3/sse/weed-test*.log
|
||||
retention-days: 7
|
||||
@@ -20,16 +20,16 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
@@ -313,16 +313,16 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
@@ -439,16 +439,16 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
@@ -562,10 +562,10 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
@@ -662,16 +662,16 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v6
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
id: go
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.24
|
||||
|
||||
|
||||
@@ -115,11 +115,3 @@ test/s3/versioning/weed-test.log
|
||||
/docker/admin_integration/data
|
||||
docker/agent_pub_record
|
||||
docker/admin_integration/weed-local
|
||||
/seaweedfs-rdma-sidecar/bin
|
||||
/test/s3/encryption/filerldb2
|
||||
/test/s3/sse/filerldb2
|
||||
test/s3/sse/weed-test.log
|
||||
ADVANCED_IAM_DEVELOPMENT_PLAN.md
|
||||
/test/s3/iam/test-volume-data
|
||||
*.log
|
||||
weed-iam
|
||||
@@ -1,145 +0,0 @@
|
||||
# SQL Query Engine Feature, Dev, and Test Plan
|
||||
|
||||
This document outlines the plan for adding SQL querying support to SeaweedFS, focusing on reading and analyzing data from Message Queue (MQ) topics.
|
||||
|
||||
## Feature Plan
|
||||
|
||||
**1. Goal**
|
||||
|
||||
To provide a SQL querying interface for SeaweedFS, enabling analytics on existing MQ topics. This enables:
|
||||
- Basic querying with SELECT, WHERE, aggregations on MQ topics
|
||||
- Schema discovery and metadata operations (SHOW DATABASES, SHOW TABLES, DESCRIBE)
|
||||
- In-place analytics on Parquet-stored messages without data movement
|
||||
|
||||
**2. Key Features**
|
||||
|
||||
* **Schema Discovery and Metadata:**
|
||||
* `SHOW DATABASES` - List all MQ namespaces
|
||||
* `SHOW TABLES` - List all topics in a namespace
|
||||
* `DESCRIBE table_name` - Show topic schema details
|
||||
* Automatic schema detection from existing Parquet data
|
||||
* **Basic Query Engine:**
|
||||
* `SELECT` support with `WHERE`, `LIMIT`, `OFFSET`
|
||||
* Aggregation functions: `COUNT()`, `SUM()`, `AVG()`, `MIN()`, `MAX()`
|
||||
* Temporal queries with timestamp-based filtering
|
||||
* **User Interfaces:**
|
||||
* New CLI command `weed sql` with interactive shell mode
|
||||
* Optional: Web UI for query execution and result visualization
|
||||
* **Output Formats:**
|
||||
* JSON (default), CSV, Parquet for result sets
|
||||
* Streaming results for large queries
|
||||
* Pagination support for result navigation
|
||||
|
||||
## Development Plan
|
||||
|
||||
|
||||
|
||||
**3. Data Source Integration**
|
||||
|
||||
* **MQ Topic Connector (Primary):**
|
||||
* Build on existing `weed/mq/logstore/read_parquet_to_log.go`
|
||||
* Implement efficient Parquet scanning with predicate pushdown
|
||||
* Support schema evolution and backward compatibility
|
||||
* Handle partition-based parallelism for scalable queries
|
||||
* **Schema Registry Integration:**
|
||||
* Extend `weed/mq/schema/schema.go` for SQL metadata operations
|
||||
* Read existing topic schemas for query planning
|
||||
* Handle schema evolution during query execution
|
||||
|
||||
**4. API & CLI Integration**
|
||||
|
||||
* **CLI Command:**
|
||||
* New `weed sql` command with interactive shell mode (similar to `weed shell`)
|
||||
* Support for script execution and result formatting
|
||||
* Connection management for remote SeaweedFS clusters
|
||||
* **gRPC API:**
|
||||
* Add SQL service to existing MQ broker gRPC interface
|
||||
* Enable efficient query execution with streaming results
|
||||
|
||||
## Example Usage Scenarios
|
||||
|
||||
**Scenario 1: Schema Discovery and Metadata**
|
||||
```sql
|
||||
-- List all namespaces (databases)
|
||||
SHOW DATABASES;
|
||||
|
||||
-- List topics in a namespace
|
||||
USE my_namespace;
|
||||
SHOW TABLES;
|
||||
|
||||
-- View topic structure and discovered schema
|
||||
DESCRIBE user_events;
|
||||
```
|
||||
|
||||
**Scenario 2: Data Querying**
|
||||
```sql
|
||||
-- Basic filtering and projection
|
||||
SELECT user_id, event_type, timestamp
|
||||
FROM user_events
|
||||
WHERE timestamp > 1640995200000
|
||||
LIMIT 100;
|
||||
|
||||
-- Aggregation queries
|
||||
SELECT COUNT(*) as event_count
|
||||
FROM user_events
|
||||
WHERE timestamp >= 1640995200000;
|
||||
|
||||
-- More aggregation examples
|
||||
SELECT MAX(timestamp), MIN(timestamp)
|
||||
FROM user_events;
|
||||
```
|
||||
|
||||
**Scenario 3: Analytics & Monitoring**
|
||||
```sql
|
||||
-- Basic analytics
|
||||
SELECT COUNT(*) as total_events
|
||||
FROM user_events
|
||||
WHERE timestamp >= 1640995200000;
|
||||
|
||||
-- Simple monitoring
|
||||
SELECT AVG(response_time) as avg_response
|
||||
FROM api_logs
|
||||
WHERE timestamp >= 1640995200000;
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
```
|
||||
SQL Query Flow:
|
||||
1. Parse SQL 2. Plan & Optimize 3. Execute Query
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐ ┌──────────────┐
|
||||
│ Client │ │ SQL Parser │ │ Query Planner │ │ Execution │
|
||||
│ (CLI) │──→ │ PostgreSQL │──→ │ & Optimizer │──→ │ Engine │
|
||||
│ │ │ (Custom) │ │ │ │ │
|
||||
└─────────────┘ └──────────────┘ └─────────────────┘ └──────────────┘
|
||||
│ │
|
||||
│ Schema Lookup │ Data Access
|
||||
▼ ▼
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
│ Schema Catalog │
|
||||
│ • Namespace → Database mapping │
|
||||
│ • Topic → Table mapping │
|
||||
│ • Schema version management │
|
||||
└─────────────────────────────────────────────────────────────┘
|
||||
▲
|
||||
│ Metadata
|
||||
│
|
||||
┌─────────────────────────────────────────────────────────────────────────────┐
|
||||
│ MQ Storage Layer │
|
||||
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ▲ │
|
||||
│ │ Topic A │ │ Topic B │ │ Topic C │ │ ... │ │ │
|
||||
│ │ (Parquet) │ │ (Parquet) │ │ (Parquet) │ │ (Parquet) │ │ │
|
||||
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │ │
|
||||
└──────────────────────────────────────────────────────────────────────────│──┘
|
||||
│
|
||||
Data Access
|
||||
```
|
||||
|
||||
|
||||
## Success Metrics
|
||||
|
||||
* **Feature Completeness:** Support for all specified SELECT operations and metadata commands
|
||||
* **Performance:**
|
||||
* **Simple SELECT queries**: < 100ms latency for single-table queries with up to 3 WHERE predicates on ≤ 100K records
|
||||
* **Complex queries**: < 1s latency for queries involving aggregations (COUNT, SUM, MAX, MIN) on ≤ 1M records
|
||||
* **Time-range queries**: < 500ms for timestamp-based filtering on ≤ 500K records within 24-hour windows
|
||||
* **Scalability:** Handle topics with millions of messages efficiently
|
||||
@@ -1,169 +0,0 @@
|
||||
# Server-Side Encryption with Customer-Provided Keys (SSE-C) Implementation
|
||||
|
||||
This document describes the implementation of SSE-C support in SeaweedFS, addressing the feature request from [GitHub Discussion #5361](https://github.com/seaweedfs/seaweedfs/discussions/5361).
|
||||
|
||||
## Overview
|
||||
|
||||
SSE-C allows clients to provide their own encryption keys for server-side encryption of objects stored in SeaweedFS. The server encrypts the data using the customer-provided AES-256 key but does not store the key itself - only an MD5 hash of the key for validation purposes.
|
||||
|
||||
## Implementation Details
|
||||
|
||||
### Architecture
|
||||
|
||||
The SSE-C implementation follows a transparent encryption/decryption pattern:
|
||||
|
||||
1. **Upload (PUT/POST)**: Data is encrypted with the customer key before being stored
|
||||
2. **Download (GET/HEAD)**: Encrypted data is decrypted on-the-fly using the customer key
|
||||
3. **Metadata Storage**: Only the encryption algorithm and key MD5 are stored as metadata
|
||||
|
||||
### Key Components
|
||||
|
||||
#### 1. Constants and Headers (`weed/s3api/s3_constants/header.go`)
|
||||
- Added AWS-compatible SSE-C header constants
|
||||
- Support for both regular and copy-source SSE-C headers
|
||||
|
||||
#### 2. Core SSE-C Logic (`weed/s3api/s3_sse_c.go`)
|
||||
- **SSECustomerKey**: Structure to hold customer encryption key and metadata
|
||||
- **SSECEncryptedReader**: Streaming encryption with AES-256-CTR mode
|
||||
- **SSECDecryptedReader**: Streaming decryption with IV extraction
|
||||
- **validateAndParseSSECHeaders**: Shared validation logic (DRY principle)
|
||||
- **ParseSSECHeaders**: Parse regular SSE-C headers
|
||||
- **ParseSSECCopySourceHeaders**: Parse copy-source SSE-C headers
|
||||
- Header validation and parsing functions
|
||||
- Metadata extraction and response handling
|
||||
|
||||
#### 3. Error Handling (`weed/s3api/s3err/s3api_errors.go`)
|
||||
- New error codes for SSE-C validation failures
|
||||
- AWS-compatible error messages and HTTP status codes
|
||||
|
||||
#### 4. S3 API Integration
|
||||
- **PUT Object Handler**: Encrypts data streams transparently
|
||||
- **GET Object Handler**: Decrypts data streams transparently
|
||||
- **HEAD Object Handler**: Validates keys and returns appropriate headers
|
||||
- **Metadata Storage**: Integrates with existing `SaveAmzMetaData` function
|
||||
|
||||
### Encryption Scheme
|
||||
|
||||
- **Algorithm**: AES-256-CTR (Counter mode)
|
||||
- **Key Size**: 256 bits (32 bytes)
|
||||
- **IV Generation**: Random 16-byte IV per object
|
||||
- **Storage Format**: `[IV][EncryptedData]` where IV is prepended to encrypted content
|
||||
|
||||
### Metadata Storage
|
||||
|
||||
SSE-C metadata is stored in the filer's extended attributes:
|
||||
```
|
||||
x-amz-server-side-encryption-customer-algorithm: "AES256"
|
||||
x-amz-server-side-encryption-customer-key-md5: "<md5-hash-of-key>"
|
||||
```
|
||||
|
||||
## API Compatibility
|
||||
|
||||
### Required Headers for Encryption (PUT/POST)
|
||||
```
|
||||
x-amz-server-side-encryption-customer-algorithm: AES256
|
||||
x-amz-server-side-encryption-customer-key: <base64-encoded-256-bit-key>
|
||||
x-amz-server-side-encryption-customer-key-md5: <md5-hash-of-key>
|
||||
```
|
||||
|
||||
### Required Headers for Decryption (GET/HEAD)
|
||||
Same headers as encryption - the server validates the key MD5 matches.
|
||||
|
||||
### Copy Operations
|
||||
Support for copy-source SSE-C headers:
|
||||
```
|
||||
x-amz-copy-source-server-side-encryption-customer-algorithm
|
||||
x-amz-copy-source-server-side-encryption-customer-key
|
||||
x-amz-copy-source-server-side-encryption-customer-key-md5
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
The implementation provides AWS-compatible error responses:
|
||||
|
||||
- **InvalidEncryptionAlgorithmError**: Non-AES256 algorithm specified
|
||||
- **InvalidArgument**: Invalid key format, size, or MD5 mismatch
|
||||
- **Missing customer key**: Object encrypted but no key provided
|
||||
- **Unnecessary customer key**: Object not encrypted but key provided
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **Key Management**: Customer keys are never stored - only MD5 hashes for validation
|
||||
2. **IV Randomness**: Fresh random IV generated for each object
|
||||
3. **Transparent Security**: Volume servers never see unencrypted data
|
||||
4. **Key Validation**: Strict validation of key format, size, and MD5
|
||||
|
||||
## Testing
|
||||
|
||||
Comprehensive test suite covers:
|
||||
- Header validation and parsing (regular and copy-source)
|
||||
- Encryption/decryption round-trip
|
||||
- Error condition handling
|
||||
- Metadata extraction
|
||||
- Code reuse validation (DRY principle)
|
||||
- AWS S3 compatibility
|
||||
|
||||
Run tests with:
|
||||
```bash
|
||||
go test -v ./weed/s3api
|
||||
|
||||
## Usage Example
|
||||
|
||||
### Upload with SSE-C
|
||||
```bash
|
||||
# Generate a 256-bit key
|
||||
KEY=$(openssl rand -base64 32)
|
||||
KEY_MD5=$(echo -n "$KEY" | base64 -d | openssl dgst -md5 -binary | base64)
|
||||
|
||||
# Upload object with SSE-C
|
||||
curl -X PUT "http://localhost:8333/bucket/object" \
|
||||
-H "x-amz-server-side-encryption-customer-algorithm: AES256" \
|
||||
-H "x-amz-server-side-encryption-customer-key: $KEY" \
|
||||
-H "x-amz-server-side-encryption-customer-key-md5: $KEY_MD5" \
|
||||
--data-binary @file.txt
|
||||
```
|
||||
|
||||
### Download with SSE-C
|
||||
```bash
|
||||
# Download object with SSE-C (same key required)
|
||||
curl "http://localhost:8333/bucket/object" \
|
||||
-H "x-amz-server-side-encryption-customer-algorithm: AES256" \
|
||||
-H "x-amz-server-side-encryption-customer-key: $KEY" \
|
||||
-H "x-amz-server-side-encryption-customer-key-md5: $KEY_MD5"
|
||||
```
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Existing SeaweedFS Features
|
||||
- **Filer Metadata**: Extends existing metadata storage
|
||||
- **Volume Servers**: No changes required - store encrypted data transparently
|
||||
- **S3 API**: Integrates seamlessly with existing handlers
|
||||
- **Versioning**: Compatible with object versioning
|
||||
- **Multipart Upload**: Ready for multipart upload integration
|
||||
|
||||
### Future Enhancements
|
||||
- **SSE-S3**: Server-managed encryption keys
|
||||
- **SSE-KMS**: External key management service integration
|
||||
- **Performance Optimization**: Hardware acceleration for encryption
|
||||
- **Compliance**: Enhanced audit logging for encrypted objects
|
||||
|
||||
## File Changes Summary
|
||||
|
||||
1. **`weed/s3api/s3_constants/header.go`** - Added SSE-C header constants
|
||||
2. **`weed/s3api/s3_sse_c.go`** - Core SSE-C implementation (NEW)
|
||||
3. **`weed/s3api/s3_sse_c_test.go`** - Comprehensive test suite (NEW)
|
||||
4. **`weed/s3api/s3err/s3api_errors.go`** - Added SSE-C error codes
|
||||
5. **`weed/s3api/s3api_object_handlers.go`** - GET/HEAD with SSE-C support
|
||||
6. **`weed/s3api/s3api_object_handlers_put.go`** - PUT with SSE-C support
|
||||
7. **`weed/server/filer_server_handlers_write_autochunk.go`** - Metadata storage
|
||||
|
||||
## Compliance
|
||||
|
||||
This implementation follows the [AWS S3 SSE-C specification](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html) for maximum compatibility with existing S3 clients and tools.
|
||||
|
||||
## Performance Impact
|
||||
|
||||
- **Encryption Overhead**: Minimal CPU impact with efficient AES-CTR streaming
|
||||
- **Memory Usage**: Constant memory usage via streaming encryption/decryption
|
||||
- **Storage Overhead**: 16 bytes per object for IV storage
|
||||
- **Network**: No additional network overhead
|
||||
+1
-12
@@ -2,18 +2,7 @@ FROM ubuntu:22.04
|
||||
|
||||
LABEL author="Chris Lu"
|
||||
|
||||
# Use faster mirrors and optimize package installation
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
--no-install-recommends \
|
||||
--no-install-suggests \
|
||||
curl \
|
||||
fio \
|
||||
fuse \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /tmp/* \
|
||||
&& rm -rf /var/tmp/*
|
||||
RUN apt-get update && apt-get install -y curl fio fuse
|
||||
RUN mkdir -p /etc/seaweedfs /data/filerldb2
|
||||
|
||||
COPY ./weed /usr/bin/
|
||||
|
||||
+1
-9
@@ -20,15 +20,7 @@ build: binary
|
||||
docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .
|
||||
|
||||
build_e2e: binary_race
|
||||
docker buildx build \
|
||||
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
|
||||
--load \
|
||||
-t chrislusf/seaweedfs:e2e \
|
||||
-f Dockerfile.e2e .
|
||||
# Move cache to avoid growing cache size
|
||||
rm -rf /tmp/.buildx-cache || true
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
|
||||
docker build --no-cache -t chrislusf/seaweedfs:e2e -f Dockerfile.e2e .
|
||||
|
||||
go_build: # make go_build tags=elastic,ydb,gocdk,hdfs,5BytesOffset,tarantool
|
||||
docker build --build-arg TAGS=$(tags) --no-cache -t chrislusf/seaweedfs:go_build -f Dockerfile.go_build .
|
||||
|
||||
@@ -6,20 +6,16 @@ services:
|
||||
command: "-v=4 master -ip=master -ip.bind=0.0.0.0 -raftBootstrap"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:9333/cluster/healthz" ]
|
||||
interval: 2s
|
||||
timeout: 10s
|
||||
retries: 30
|
||||
start_period: 10s
|
||||
interval: 1s
|
||||
timeout: 60s
|
||||
|
||||
volume:
|
||||
image: chrislusf/seaweedfs:e2e
|
||||
command: "-v=4 volume -mserver=master:9333 -ip=volume -ip.bind=0.0.0.0 -preStopSeconds=1"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:8080/healthz" ]
|
||||
interval: 2s
|
||||
timeout: 10s
|
||||
retries: 15
|
||||
start_period: 5s
|
||||
interval: 1s
|
||||
timeout: 30s
|
||||
depends_on:
|
||||
master:
|
||||
condition: service_healthy
|
||||
@@ -29,10 +25,8 @@ services:
|
||||
command: "-v=4 filer -master=master:9333 -ip=filer -ip.bind=0.0.0.0"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "--fail", "-I", "http://localhost:8888" ]
|
||||
interval: 2s
|
||||
timeout: 10s
|
||||
retries: 15
|
||||
start_period: 5s
|
||||
interval: 1s
|
||||
timeout: 30s
|
||||
depends_on:
|
||||
volume:
|
||||
condition: service_healthy
|
||||
@@ -52,10 +46,8 @@ services:
|
||||
memory: 4096m
|
||||
healthcheck:
|
||||
test: [ "CMD", "mountpoint", "-q", "--", "/mnt/seaweedfs" ]
|
||||
interval: 2s
|
||||
timeout: 10s
|
||||
retries: 15
|
||||
start_period: 10s
|
||||
interval: 1s
|
||||
timeout: 30s
|
||||
depends_on:
|
||||
filer:
|
||||
condition: service_healthy
|
||||
@@ -1,17 +1,17 @@
|
||||
module github.com/seaweedfs/seaweedfs
|
||||
|
||||
go 1.24.0
|
||||
go 1.24
|
||||
|
||||
toolchain go1.24.1
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.121.6 // indirect
|
||||
cloud.google.com/go/pubsub v1.50.1
|
||||
cloud.google.com/go/storage v1.56.1
|
||||
cloud.google.com/go v0.121.4 // indirect
|
||||
cloud.google.com/go/pubsub v1.49.0
|
||||
cloud.google.com/go/storage v1.56.0
|
||||
github.com/Azure/azure-pipeline-go v0.2.3
|
||||
github.com/Azure/azure-storage-blob-go v0.15.0
|
||||
github.com/Shopify/sarama v1.38.1
|
||||
github.com/aws/aws-sdk-go v1.55.8
|
||||
github.com/aws/aws-sdk-go v1.55.7
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bwmarrin/snowflake v0.3.0
|
||||
github.com/cenkalti/backoff/v4 v4.3.0
|
||||
@@ -21,8 +21,8 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/eapache/go-resiliency v1.6.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||
github.com/eapache/go-resiliency v1.3.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect
|
||||
github.com/eapache/queue v1.1.0 // indirect
|
||||
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
|
||||
@@ -45,7 +45,6 @@ require (
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/jackc/pgx/v5 v5.7.5
|
||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||
github.com/jinzhu/copier v0.4.0
|
||||
@@ -55,7 +54,8 @@ require (
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/reedsolomon v1.12.5
|
||||
github.com/kurin/blazer v0.5.3
|
||||
github.com/linxGnu/grocksdb v1.10.2
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/linxGnu/grocksdb v1.10.1
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-ieproxy v0.0.11 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
@@ -67,9 +67,9 @@ require (
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/posener/complete v1.2.3
|
||||
github.com/pquerna/cachecontrol v0.2.0
|
||||
github.com/prometheus/client_golang v1.23.2
|
||||
github.com/prometheus/client_golang v1.22.0
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.66.1 // indirect
|
||||
github.com/prometheus/common v0.64.0 // indirect
|
||||
github.com/prometheus/procfs v0.17.0
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
@@ -79,7 +79,7 @@ require (
|
||||
github.com/spf13/afero v1.12.0 // indirect
|
||||
github.com/spf13/cast v1.7.1 // indirect
|
||||
github.com/spf13/viper v1.20.1
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
||||
github.com/tidwall/gjson v1.18.0
|
||||
@@ -99,66 +99,61 @@ require (
|
||||
gocloud.dev v0.43.0
|
||||
gocloud.dev/pubsub/natspubsub v0.43.0
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.43.0
|
||||
golang.org/x/crypto v0.41.0
|
||||
golang.org/x/exp v0.0.0-20250811191247-51f88131bc50
|
||||
golang.org/x/image v0.30.0
|
||||
golang.org/x/net v0.43.0
|
||||
golang.org/x/crypto v0.40.0
|
||||
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
|
||||
golang.org/x/image v0.29.0
|
||||
golang.org/x/net v0.42.0
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sys v0.36.0
|
||||
golang.org/x/text v0.28.0 // indirect
|
||||
golang.org/x/tools v0.36.0
|
||||
golang.org/x/sys v0.34.0
|
||||
golang.org/x/text v0.27.0 // indirect
|
||||
golang.org/x/tools v0.35.0
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.247.0
|
||||
google.golang.org/api v0.243.0
|
||||
google.golang.org/genproto v0.0.0-20250715232539-7130f93afb79 // indirect
|
||||
google.golang.org/grpc v1.75.0
|
||||
google.golang.org/protobuf v1.36.8
|
||||
google.golang.org/grpc v1.74.2
|
||||
google.golang.org/protobuf v1.36.6
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
modernc.org/b v1.0.0 // indirect
|
||||
modernc.org/mathutil v1.7.1
|
||||
modernc.org/memory v1.11.0 // indirect
|
||||
modernc.org/sqlite v1.38.2
|
||||
modernc.org/sqlite v1.38.1
|
||||
modernc.org/strutil v1.2.1
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/kms v1.22.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0
|
||||
github.com/Jille/raft-grpc-transport v1.6.1
|
||||
github.com/ThreeDotsLabs/watermill v1.5.0
|
||||
github.com/ThreeDotsLabs/watermill v1.4.7
|
||||
github.com/a-h/templ v0.3.924
|
||||
github.com/arangodb/go-driver v1.6.6
|
||||
github.com/armon/go-metrics v0.4.1
|
||||
github.com/aws/aws-sdk-go-v2 v1.38.3
|
||||
github.com/aws/aws-sdk-go-v2/config v1.31.3
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.18.10
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.87.1
|
||||
github.com/cockroachdb/cockroachdb-parser v0.25.2
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.6
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.18
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.71
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.84.1
|
||||
github.com/cognusion/imaging v1.0.2
|
||||
github.com/fluent/fluent-logger-golang v1.10.1
|
||||
github.com/getsentry/sentry-go v0.35.0
|
||||
github.com/fluent/fluent-logger-golang v1.10.0
|
||||
github.com/getsentry/sentry-go v0.34.1
|
||||
github.com/gin-contrib/sessions v1.0.4
|
||||
github.com/gin-gonic/gin v1.10.1
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0
|
||||
github.com/golang-jwt/jwt/v5 v5.2.3
|
||||
github.com/google/flatbuffers/go v0.0.0-20230108230133-3b8644d32c50
|
||||
github.com/hanwen/go-fuse/v2 v2.8.0
|
||||
github.com/hashicorp/raft v1.7.3
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.3.1
|
||||
github.com/hashicorp/vault/api v1.20.0
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/minio/crc64nvme v1.1.1
|
||||
github.com/minio/crc64nvme v1.1.0
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1
|
||||
github.com/parquet-go/parquet-go v0.25.1
|
||||
github.com/pkg/sftp v1.13.9
|
||||
github.com/rabbitmq/amqp091-go v1.10.0
|
||||
github.com/rclone/rclone v1.71.0
|
||||
github.com/rclone/rclone v1.70.3
|
||||
github.com/rdleal/intervalst v1.5.0
|
||||
github.com/redis/go-redis/v9 v9.12.1
|
||||
github.com/redis/go-redis/v9 v9.11.0
|
||||
github.com/schollz/progressbar/v3 v3.18.0
|
||||
github.com/shirou/gopsutil/v3 v3.24.5
|
||||
github.com/tarantool/go-tarantool/v2 v2.4.0
|
||||
github.com/tikv/client-go/v2 v2.0.7
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.0
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.113.5
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.113.2
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.6.4
|
||||
go.uber.org/atomic v1.11.0
|
||||
golang.org/x/sync v0.16.0
|
||||
@@ -168,73 +163,30 @@ require (
|
||||
require github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
|
||||
|
||||
require (
|
||||
cloud.google.com/go/longrunning v0.6.7 // indirect
|
||||
cloud.google.com/go/pubsub/v2 v2.0.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
|
||||
github.com/bazelbuild/rules_go v0.46.0 // indirect
|
||||
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
|
||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
|
||||
github.com/cockroachdb/apd/v3 v3.1.0 // indirect
|
||||
github.com/cockroachdb/errors v1.11.3 // indirect
|
||||
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect
|
||||
github.com/cockroachdb/redact v1.1.5 // indirect
|
||||
github.com/cockroachdb/version v0.0.0-20250314144055-3860cd14adf2 // indirect
|
||||
github.com/dave/dst v0.27.2 // indirect
|
||||
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jaegertracing/jaeger v1.47.0 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
|
||||
github.com/pierrre/geohash v1.0.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/twpayne/go-geom v1.4.1 // indirect
|
||||
github.com/twpayne/go-kml v1.5.2 // indirect
|
||||
github.com/zeebo/xxh3 v1.0.2 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.36.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
golang.org/x/mod v0.27.0 // indirect
|
||||
gonum.org/v1/gonum v0.16.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.24.0 // indirect
|
||||
cloud.google.com/go/auth v0.16.5 // indirect
|
||||
cloud.google.com/go/auth v0.16.3 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.8.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.7.0 // indirect
|
||||
cloud.google.com/go/iam v1.5.2 // indirect
|
||||
cloud.google.com/go/monitoring v1.24.2 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.5.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.5.1 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.2.218 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.2.173 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
|
||||
github.com/IBM/go-sdk-core/v5 v5.21.0 // indirect
|
||||
github.com/IBM/go-sdk-core/v5 v5.20.0 // indirect
|
||||
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf // indirect
|
||||
@@ -245,28 +197,28 @@ require (
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.9.0 // indirect
|
||||
github.com/PuerkitoBio/goquery v1.10.3 // indirect
|
||||
github.com/abbot/go-http-auth v0.4.0 // indirect
|
||||
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.3 // 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/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.18.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.11 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.84 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.37 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.37 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.37 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.7.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.34.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.38.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.29.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.38.2 // indirect
|
||||
github.com/aws/smithy-go v1.23.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.25.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.34.1 // indirect
|
||||
github.com/aws/smithy-go v1.22.4 // indirect
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/bradenaw/juniper v0.15.3 // indirect
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
||||
@@ -276,7 +228,7 @@ require (
|
||||
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||
github.com/chilts/sid v0.0.0-20190607042430-660e94789ec9 // indirect
|
||||
github.com/cloudflare/circl v1.6.1 // indirect
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.12.0 // indirect
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.10.0 // indirect
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20250228001242-d4c70e6251cc // indirect
|
||||
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc // indirect
|
||||
github.com/cloudwego/base64x v0.1.5 // indirect
|
||||
@@ -286,10 +238,10 @@ require (
|
||||
github.com/cronokirby/saferith v0.33.0 // indirect
|
||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 // indirect
|
||||
github.com/ebitengine/purego v0.8.4 // indirect
|
||||
github.com/elastic/gosigar v0.14.3 // indirect
|
||||
github.com/elastic/gosigar v0.14.2 // indirect
|
||||
github.com/emersion/go-message v0.18.2 // indirect
|
||||
github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff // indirect
|
||||
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
|
||||
@@ -306,13 +258,13 @@ require (
|
||||
github.com/go-logr/logr v1.4.3 // 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.2 // indirect
|
||||
github.com/go-openapi/errors v0.22.1 // indirect
|
||||
github.com/go-openapi/strfmt v0.23.0 // 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.27.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.26.0 // indirect
|
||||
github.com/go-resty/resty/v2 v2.16.5 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/gofrs/flock v0.12.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
@@ -323,14 +275,14 @@ require (
|
||||
github.com/gorilla/schema v1.4.1 // indirect
|
||||
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||
github.com/gorilla/sessions v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // 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
|
||||
github.com/hashicorp/go-metrics v0.5.4 // indirect
|
||||
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/golang-lru v0.6.0 // indirect
|
||||
github.com/henrybear327/Proton-API-Bridge v1.0.0 // indirect
|
||||
github.com/henrybear327/go-proton-api v1.0.0 // indirect
|
||||
@@ -344,12 +296,12 @@ require (
|
||||
github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7 // indirect
|
||||
github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 // indirect
|
||||
github.com/k0kubun/pp v3.0.1+incompatible
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/koofr/go-httpclient v0.0.0-20240520111329-e20f8f203988 // indirect
|
||||
github.com/koofr/go-koofrclient v0.0.0-20221207135200-cbd7fc9ad6a6 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/lanrat/extsort v1.4.0 // indirect
|
||||
github.com/lanrat/extsort v1.0.2 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/lpar/date v1.0.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
|
||||
@@ -357,7 +309,7 @@ require (
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
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.43.0 // indirect
|
||||
@@ -369,19 +321,19 @@ require (
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.23.3 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.98.0 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.93.0 // indirect
|
||||
github.com/panjf2000/ants/v2 v2.11.3 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // 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.22 // indirect
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
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
|
||||
github.com/pingcap/log v1.1.1-0.20221110025148-ca232912c9f3 // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/xattr v0.4.12 // indirect
|
||||
github.com/pkg/xattr v0.4.10 // indirect
|
||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 // indirect
|
||||
@@ -390,15 +342,15 @@ require (
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
|
||||
github.com/sagikazarmark/locafero v0.7.0 // indirect
|
||||
github.com/samber/lo v1.51.0 // indirect
|
||||
github.com/shirou/gopsutil/v4 v4.25.7 // indirect
|
||||
github.com/samber/lo v1.50.0 // indirect
|
||||
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||
github.com/smartystreets/goconvey v1.8.1 // indirect
|
||||
github.com/sony/gobreaker v1.0.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.24 // indirect
|
||||
github.com/spf13/pflag v1.0.7 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20241213151442-a19cff0ec7b5 // indirect
|
||||
@@ -423,7 +375,7 @@ require (
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
github.com/zeebo/errs v1.4.0 // indirect
|
||||
go.etcd.io/bbolt v1.4.2 // indirect
|
||||
go.etcd.io/bbolt v1.4.0 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.6.4 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.37.0 // indirect
|
||||
@@ -437,18 +389,18 @@ require (
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/arch v0.16.0 // indirect
|
||||
golang.org/x/term v0.34.0 // indirect
|
||||
golang.org/x/term v0.33.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/validator.v2 v2.0.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
modernc.org/libc v1.66.3 // indirect
|
||||
moul.io/http2curl/v2 v2.3.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
storj.io/common v0.0.0-20250808122759-804533d519c1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
storj.io/common v0.0.0-20250605163628-70ca83b6228e // indirect
|
||||
storj.io/drpc v0.0.35-0.20250513201419-f7819ea69b55 // indirect
|
||||
storj.io/eventkit v0.0.0-20250410172343-61f26d3de156 // indirect
|
||||
storj.io/infectious v0.0.2 // indirect
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
description: SeaweedFS
|
||||
name: seaweedfs
|
||||
appVersion: "3.97"
|
||||
appVersion: "3.96"
|
||||
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
|
||||
version: 4.0.397
|
||||
version: 4.0.396
|
||||
+3
-6
@@ -96,16 +96,13 @@ Inject extra environment vars in the format key:value, if populated
|
||||
{{/* Computes the container image name for all components (if they are not overridden) */}}
|
||||
{{- define "common.image" -}}
|
||||
{{- $registryName := default .Values.image.registry .Values.global.registry | toString -}}
|
||||
{{- $repositoryName := default .Values.image.repository .Values.global.repository | toString -}}
|
||||
{{- $repositoryName := .Values.image.repository | toString -}}
|
||||
{{- $name := .Values.global.imageName | toString -}}
|
||||
{{- $tag := default .Chart.AppVersion .Values.image.tag | toString -}}
|
||||
{{- if $repositoryName -}}
|
||||
{{- $name = printf "%s/%s" (trimSuffix "/" $repositoryName) (base $name) -}}
|
||||
{{- end -}}
|
||||
{{- if $registryName -}}
|
||||
{{- printf "%s/%s:%s" $registryName $name $tag -}}
|
||||
{{- printf "%s/%s%s:%s" $registryName $repositoryName $name $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s:%s" $name $tag -}}
|
||||
{{- printf "%s%s:%s" $repositoryName $name $tag -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
@@ -15,6 +15,7 @@ spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: objectstorage-provisioner
|
||||
template:
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -53,7 +53,7 @@ spec:
|
||||
{{- $configSecret := (lookup "v1" "Secret" .Release.Namespace .Values.filer.s3.existingConfigSecret) | default dict }}
|
||||
checksum/s3config: {{ $configSecret | toYaml | sha256sum }}
|
||||
{{- else }}
|
||||
checksum/s3config: {{ include (print .Template.BasePath "/s3/s3-secret.yaml") . | sha256sum }}
|
||||
checksum/s3config: {{ include (print .Template.BasePath "/s3-secret.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.restartPolicy .Values.filer.restartPolicy }}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -41,6 +41,6 @@ spec:
|
||||
servicePort: {{ .Values.s3.port }}
|
||||
{{- end }}
|
||||
{{- if .Values.s3.ingress.host }}
|
||||
host: {{ .Values.s3.ingress.host | quote }}
|
||||
host: {{ .Values.s3.ingress.host }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -21,9 +21,9 @@ metadata:
|
||||
{{- with $.Values.global.monitoring.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $volume.annotations }}
|
||||
{{- if .Values.volume.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- toYaml .Values.volume.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
File renamed without changes.
@@ -3,7 +3,6 @@
|
||||
global:
|
||||
createClusterRole: true
|
||||
registry: ""
|
||||
# if repository is set, it overrides the namespace part of imageName
|
||||
repository: ""
|
||||
imageName: chrislusf/seaweedfs
|
||||
imagePullPolicy: IfNotPresent
|
||||
@@ -202,7 +201,8 @@ master:
|
||||
# nodeSelector labels for master pod assignment, formatted as a muli-line string.
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
# Example:
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
# nodeSelector: |
|
||||
# sw-backend: "true"
|
||||
|
||||
@@ -358,7 +358,7 @@ volume:
|
||||
# This will automatically create a job for patching Kubernetes resources if the dataDirs type is 'persistentVolumeClaim' and the size has changed.
|
||||
resizeHook:
|
||||
enabled: true
|
||||
image: alpine/k8s:1.28.4
|
||||
image: bitnami/kubectl
|
||||
|
||||
# idx can be defined by:
|
||||
#
|
||||
@@ -478,7 +478,8 @@ volume:
|
||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
# Example:
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
# nodeSelector: |
|
||||
# sw-volume: "true"
|
||||
|
||||
@@ -734,7 +735,8 @@ filer:
|
||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
# Example:
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
# nodeSelector: |
|
||||
# sw-backend: "true"
|
||||
|
||||
@@ -930,7 +932,8 @@ s3:
|
||||
# nodeSelector labels for server pod assignment, formatted as a muli-line string.
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
# Example:
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
# nodeSelector: |
|
||||
# sw-backend: "true"
|
||||
|
||||
@@ -1048,7 +1051,8 @@ sftp:
|
||||
annotations: {}
|
||||
resources: {}
|
||||
tolerations: ""
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
priorityClassName: ""
|
||||
serviceAccountName: ""
|
||||
podSecurityContext: {}
|
||||
@@ -1084,6 +1088,7 @@ allInOne:
|
||||
enabled: false
|
||||
imageOverride: null
|
||||
restartPolicy: Always
|
||||
replicas: 1
|
||||
|
||||
# Core configuration
|
||||
idleTimeout: 30 # Connection idle seconds
|
||||
@@ -1175,7 +1180,8 @@ allInOne:
|
||||
|
||||
# nodeSelector labels for master pod assignment, formatted as a muli-line string.
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
|
||||
nodeSelector: ""
|
||||
nodeSelector: |
|
||||
kubernetes.io/arch: amd64
|
||||
|
||||
# Used to assign priority to master pods
|
||||
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
|
||||
@@ -142,13 +142,6 @@ message EventNotification {
|
||||
repeated int32 signatures = 6;
|
||||
}
|
||||
|
||||
enum SSEType {
|
||||
NONE = 0; // No server-side encryption
|
||||
SSE_C = 1; // Server-Side Encryption with Customer-Provided Keys
|
||||
SSE_KMS = 2; // Server-Side Encryption with KMS-Managed Keys
|
||||
SSE_S3 = 3; // Server-Side Encryption with S3-Managed Keys
|
||||
}
|
||||
|
||||
message FileChunk {
|
||||
string file_id = 1; // to be deprecated
|
||||
int64 offset = 2;
|
||||
@@ -161,8 +154,6 @@ message FileChunk {
|
||||
bytes cipher_key = 9;
|
||||
bool is_compressed = 10;
|
||||
bool is_chunk_manifest = 11; // content is a list of FileChunks
|
||||
SSEType sse_type = 12; // Server-side encryption type
|
||||
bytes sse_metadata = 13; // Serialized SSE metadata for this chunk (SSE-C, SSE-KMS, or SSE-S3)
|
||||
}
|
||||
|
||||
message FileChunkManifest {
|
||||
|
||||
@@ -1,414 +0,0 @@
|
||||
# SeaweedFS PostgreSQL Protocol Examples
|
||||
|
||||
This directory contains examples demonstrating how to connect to SeaweedFS using the PostgreSQL wire protocol.
|
||||
|
||||
## Starting the PostgreSQL Server
|
||||
|
||||
```bash
|
||||
# Start with trust authentication (no password required)
|
||||
weed postgres -port=5432 -master=localhost:9333
|
||||
|
||||
# Start with password authentication
|
||||
weed postgres -port=5432 -auth=password -users="admin:secret;readonly:view123"
|
||||
|
||||
# Start with MD5 authentication (more secure)
|
||||
weed postgres -port=5432 -auth=md5 -users="user1:pass1;user2:pass2"
|
||||
|
||||
# Start with TLS encryption
|
||||
weed postgres -port=5432 -tls-cert=server.crt -tls-key=server.key
|
||||
|
||||
# Allow connections from any host
|
||||
weed postgres -host=0.0.0.0 -port=5432
|
||||
```
|
||||
|
||||
## Client Connections
|
||||
|
||||
### psql Command Line
|
||||
|
||||
```bash
|
||||
# Basic connection (trust auth)
|
||||
psql -h localhost -p 5432 -U seaweedfs -d default
|
||||
|
||||
# With password
|
||||
PGPASSWORD=secret psql -h localhost -p 5432 -U admin -d default
|
||||
|
||||
# Connection string format
|
||||
psql "postgresql://admin:secret@localhost:5432/default"
|
||||
|
||||
# Connection string with parameters
|
||||
psql "host=localhost port=5432 dbname=default user=admin password=secret"
|
||||
```
|
||||
|
||||
### Programming Languages
|
||||
|
||||
#### Python (psycopg2)
|
||||
```python
|
||||
import psycopg2
|
||||
|
||||
# Connect to SeaweedFS
|
||||
conn = psycopg2.connect(
|
||||
host="localhost",
|
||||
port=5432,
|
||||
user="seaweedfs",
|
||||
database="default"
|
||||
)
|
||||
|
||||
# Execute queries
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT * FROM my_topic LIMIT 10")
|
||||
|
||||
for row in cursor.fetchall():
|
||||
print(row)
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
```
|
||||
|
||||
#### Java JDBC
|
||||
```java
|
||||
import java.sql.*;
|
||||
|
||||
public class SeaweedFSExample {
|
||||
public static void main(String[] args) throws SQLException {
|
||||
String url = "jdbc:postgresql://localhost:5432/default";
|
||||
|
||||
Connection conn = DriverManager.getConnection(url, "seaweedfs", "");
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM my_topic LIMIT 10");
|
||||
while (rs.next()) {
|
||||
System.out.println("ID: " + rs.getLong("id"));
|
||||
System.out.println("Message: " + rs.getString("message"));
|
||||
}
|
||||
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Go (lib/pq)
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
func main() {
|
||||
db, err := sql.Open("postgres",
|
||||
"host=localhost port=5432 user=seaweedfs dbname=default sslmode=disable")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
rows, err := db.Query("SELECT * FROM my_topic LIMIT 10")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
for rows.Next() {
|
||||
var id int64
|
||||
var message string
|
||||
err := rows.Scan(&id, &message)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("ID: %d, Message: %s\n", id, message)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Node.js (pg)
|
||||
```javascript
|
||||
const { Client } = require('pg');
|
||||
|
||||
const client = new Client({
|
||||
host: 'localhost',
|
||||
port: 5432,
|
||||
user: 'seaweedfs',
|
||||
database: 'default',
|
||||
});
|
||||
|
||||
async function query() {
|
||||
await client.connect();
|
||||
|
||||
const result = await client.query('SELECT * FROM my_topic LIMIT 10');
|
||||
console.log(result.rows);
|
||||
|
||||
await client.end();
|
||||
}
|
||||
|
||||
query().catch(console.error);
|
||||
```
|
||||
|
||||
## SQL Operations
|
||||
|
||||
### Basic Queries
|
||||
```sql
|
||||
-- List databases
|
||||
SHOW DATABASES;
|
||||
|
||||
-- List tables (topics)
|
||||
SHOW TABLES;
|
||||
|
||||
-- Describe table structure
|
||||
DESCRIBE my_topic;
|
||||
-- or use the shorthand: DESC my_topic;
|
||||
|
||||
-- Basic select
|
||||
SELECT * FROM my_topic;
|
||||
|
||||
-- With WHERE clause
|
||||
SELECT id, message FROM my_topic WHERE id > 1000;
|
||||
|
||||
-- With LIMIT
|
||||
SELECT * FROM my_topic LIMIT 100;
|
||||
```
|
||||
|
||||
### Aggregations
|
||||
```sql
|
||||
-- Count records
|
||||
SELECT COUNT(*) FROM my_topic;
|
||||
|
||||
-- Multiple aggregations
|
||||
SELECT
|
||||
COUNT(*) as total_messages,
|
||||
MIN(id) as min_id,
|
||||
MAX(id) as max_id,
|
||||
AVG(amount) as avg_amount
|
||||
FROM my_topic;
|
||||
|
||||
-- Aggregations with WHERE
|
||||
SELECT COUNT(*) FROM my_topic WHERE status = 'active';
|
||||
```
|
||||
|
||||
### System Columns
|
||||
```sql
|
||||
-- Access system columns
|
||||
SELECT
|
||||
id,
|
||||
message,
|
||||
_timestamp_ns as timestamp,
|
||||
_key as partition_key,
|
||||
_source as data_source
|
||||
FROM my_topic;
|
||||
|
||||
-- Filter by timestamp
|
||||
SELECT * FROM my_topic
|
||||
WHERE _timestamp_ns > 1640995200000000000
|
||||
LIMIT 10;
|
||||
```
|
||||
|
||||
### PostgreSQL System Queries
|
||||
```sql
|
||||
-- Version information
|
||||
SELECT version();
|
||||
|
||||
-- Current database
|
||||
SELECT current_database();
|
||||
|
||||
-- Current user
|
||||
SELECT current_user;
|
||||
|
||||
-- Server settings
|
||||
SELECT current_setting('server_version');
|
||||
SELECT current_setting('server_encoding');
|
||||
```
|
||||
|
||||
## psql Meta-Commands
|
||||
|
||||
```sql
|
||||
-- List tables
|
||||
\d
|
||||
\dt
|
||||
|
||||
-- List databases
|
||||
\l
|
||||
|
||||
-- Describe specific table
|
||||
\d my_topic
|
||||
\dt my_topic
|
||||
|
||||
-- List schemas
|
||||
\dn
|
||||
|
||||
-- Help
|
||||
\h
|
||||
\?
|
||||
|
||||
-- Quit
|
||||
\q
|
||||
```
|
||||
|
||||
## Database Tools Integration
|
||||
|
||||
### DBeaver
|
||||
1. Create New Connection → PostgreSQL
|
||||
2. Settings:
|
||||
- **Host**: localhost
|
||||
- **Port**: 5432
|
||||
- **Database**: default
|
||||
- **Username**: seaweedfs (or configured user)
|
||||
- **Password**: (if using password auth)
|
||||
|
||||
### pgAdmin
|
||||
1. Add New Server
|
||||
2. Connection tab:
|
||||
- **Host**: localhost
|
||||
- **Port**: 5432
|
||||
- **Username**: seaweedfs
|
||||
- **Database**: default
|
||||
|
||||
### DataGrip
|
||||
1. New Data Source → PostgreSQL
|
||||
2. Configure:
|
||||
- **Host**: localhost
|
||||
- **Port**: 5432
|
||||
- **User**: seaweedfs
|
||||
- **Database**: default
|
||||
|
||||
### Grafana
|
||||
1. Add Data Source → PostgreSQL
|
||||
2. Configuration:
|
||||
- **Host**: localhost:5432
|
||||
- **Database**: default
|
||||
- **User**: seaweedfs
|
||||
- **SSL Mode**: disable
|
||||
|
||||
## BI Tools
|
||||
|
||||
### Tableau
|
||||
1. Connect to Data → PostgreSQL
|
||||
2. Server: localhost
|
||||
3. Port: 5432
|
||||
4. Database: default
|
||||
5. Username: seaweedfs
|
||||
|
||||
### Power BI
|
||||
1. Get Data → Database → PostgreSQL
|
||||
2. Server: localhost
|
||||
3. Database: default
|
||||
4. Username: seaweedfs
|
||||
|
||||
## Connection Pooling
|
||||
|
||||
### Java (HikariCP)
|
||||
```java
|
||||
HikariConfig config = new HikariConfig();
|
||||
config.setJdbcUrl("jdbc:postgresql://localhost:5432/default");
|
||||
config.setUsername("seaweedfs");
|
||||
config.setMaximumPoolSize(10);
|
||||
|
||||
HikariDataSource dataSource = new HikariDataSource(config);
|
||||
```
|
||||
|
||||
### Python (connection pooling)
|
||||
```python
|
||||
from psycopg2 import pool
|
||||
|
||||
connection_pool = psycopg2.pool.SimpleConnectionPool(
|
||||
1, 20,
|
||||
host="localhost",
|
||||
port=5432,
|
||||
user="seaweedfs",
|
||||
database="default"
|
||||
)
|
||||
|
||||
conn = connection_pool.getconn()
|
||||
# Use connection
|
||||
connection_pool.putconn(conn)
|
||||
```
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
### Use TLS Encryption
|
||||
```bash
|
||||
# Generate self-signed certificate for testing
|
||||
openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -nodes
|
||||
|
||||
# Start with TLS
|
||||
weed postgres -tls-cert=server.crt -tls-key=server.key
|
||||
```
|
||||
|
||||
### Use MD5 Authentication
|
||||
```bash
|
||||
# More secure than password auth
|
||||
weed postgres -auth=md5 -users="admin:secret123;readonly:view456"
|
||||
```
|
||||
|
||||
### Limit Connections
|
||||
```bash
|
||||
# Limit concurrent connections
|
||||
weed postgres -max-connections=50 -idle-timeout=30m
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Connection Issues
|
||||
```bash
|
||||
# Test connectivity
|
||||
telnet localhost 5432
|
||||
|
||||
# Check if server is running
|
||||
ps aux | grep "weed postgres"
|
||||
|
||||
# Check logs for errors
|
||||
tail -f /var/log/seaweedfs/postgres.log
|
||||
```
|
||||
|
||||
### Common Errors
|
||||
|
||||
**"Connection refused"**
|
||||
- Ensure PostgreSQL server is running
|
||||
- Check host/port configuration
|
||||
- Verify firewall settings
|
||||
|
||||
**"Authentication failed"**
|
||||
- Check username/password
|
||||
- Verify auth method configuration
|
||||
- Ensure user is configured in server
|
||||
|
||||
**"Database does not exist"**
|
||||
- Use correct database name (default: 'default')
|
||||
- Check available databases: `SHOW DATABASES`
|
||||
|
||||
**"Permission denied"**
|
||||
- Check user permissions
|
||||
- Verify authentication method
|
||||
- Use correct credentials
|
||||
|
||||
## Performance Tips
|
||||
|
||||
1. **Use LIMIT clauses** for large result sets
|
||||
2. **Filter with WHERE clauses** to reduce data transfer
|
||||
3. **Use connection pooling** for multi-threaded applications
|
||||
4. **Close resources properly** (connections, statements, result sets)
|
||||
5. **Use prepared statements** for repeated queries
|
||||
|
||||
## Monitoring
|
||||
|
||||
### Connection Statistics
|
||||
```sql
|
||||
-- Current connections (if supported)
|
||||
SELECT COUNT(*) FROM pg_stat_activity;
|
||||
|
||||
-- Server version
|
||||
SELECT version();
|
||||
|
||||
-- Current settings
|
||||
SELECT name, setting FROM pg_settings WHERE name LIKE '%connection%';
|
||||
```
|
||||
|
||||
### Query Performance
|
||||
```sql
|
||||
-- Use EXPLAIN for query plans (if supported)
|
||||
EXPLAIN SELECT * FROM my_topic WHERE id > 1000;
|
||||
```
|
||||
|
||||
This PostgreSQL protocol support makes SeaweedFS accessible to the entire PostgreSQL ecosystem, enabling seamless integration with existing tools, applications, and workflows.
|
||||
@@ -1,374 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test client for SeaweedFS PostgreSQL protocol support.
|
||||
|
||||
This script demonstrates how to connect to SeaweedFS using standard PostgreSQL
|
||||
libraries and execute various types of queries.
|
||||
|
||||
Requirements:
|
||||
pip install psycopg2-binary
|
||||
|
||||
Usage:
|
||||
python test_client.py
|
||||
python test_client.py --host localhost --port 5432 --user seaweedfs --database default
|
||||
"""
|
||||
|
||||
import sys
|
||||
import argparse
|
||||
import time
|
||||
import traceback
|
||||
|
||||
try:
|
||||
import psycopg2
|
||||
import psycopg2.extras
|
||||
except ImportError:
|
||||
print("Error: psycopg2 not found. Install with: pip install psycopg2-binary")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def test_connection(host, port, user, database, password=None):
|
||||
"""Test basic connection to SeaweedFS PostgreSQL server."""
|
||||
print(f"🔗 Testing connection to {host}:{port}/{database} as user '{user}'")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database,
|
||||
'connect_timeout': 10
|
||||
}
|
||||
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
print("✅ Connection successful!")
|
||||
|
||||
# Test basic query
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT 1 as test")
|
||||
result = cursor.fetchone()
|
||||
print(f"✅ Basic query successful: {result}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Connection failed: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def test_system_queries(host, port, user, database, password=None):
|
||||
"""Test PostgreSQL system queries."""
|
||||
print("\n🔧 Testing PostgreSQL system queries...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
|
||||
system_queries = [
|
||||
("Version", "SELECT version()"),
|
||||
("Current Database", "SELECT current_database()"),
|
||||
("Current User", "SELECT current_user"),
|
||||
("Server Encoding", "SELECT current_setting('server_encoding')"),
|
||||
("Client Encoding", "SELECT current_setting('client_encoding')"),
|
||||
]
|
||||
|
||||
for name, query in system_queries:
|
||||
try:
|
||||
cursor.execute(query)
|
||||
result = cursor.fetchone()
|
||||
print(f" ✅ {name}: {result[0]}")
|
||||
except Exception as e:
|
||||
print(f" ❌ {name}: {e}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ System queries failed: {e}")
|
||||
|
||||
|
||||
def test_schema_queries(host, port, user, database, password=None):
|
||||
"""Test schema and metadata queries."""
|
||||
print("\n📊 Testing schema queries...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
|
||||
schema_queries = [
|
||||
("Show Databases", "SHOW DATABASES"),
|
||||
("Show Tables", "SHOW TABLES"),
|
||||
("List Schemas", "SELECT 'public' as schema_name"),
|
||||
]
|
||||
|
||||
for name, query in schema_queries:
|
||||
try:
|
||||
cursor.execute(query)
|
||||
results = cursor.fetchall()
|
||||
print(f" ✅ {name}: Found {len(results)} items")
|
||||
for row in results[:3]: # Show first 3 results
|
||||
print(f" - {dict(row)}")
|
||||
if len(results) > 3:
|
||||
print(f" ... and {len(results) - 3} more")
|
||||
except Exception as e:
|
||||
print(f" ❌ {name}: {e}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Schema queries failed: {e}")
|
||||
|
||||
|
||||
def test_data_queries(host, port, user, database, password=None):
|
||||
"""Test data queries on actual topics."""
|
||||
print("\n📝 Testing data queries...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
|
||||
# First, try to get available tables/topics
|
||||
cursor.execute("SHOW TABLES")
|
||||
tables = cursor.fetchall()
|
||||
|
||||
if not tables:
|
||||
print(" ℹ️ No tables/topics found for data testing")
|
||||
cursor.close()
|
||||
conn.close()
|
||||
return
|
||||
|
||||
# Test with first available table
|
||||
table_name = tables[0][0] if tables[0] else 'test_topic'
|
||||
print(f" 📋 Testing with table: {table_name}")
|
||||
|
||||
test_queries = [
|
||||
(f"Count records in {table_name}", f"SELECT COUNT(*) FROM \"{table_name}\""),
|
||||
(f"Sample data from {table_name}", f"SELECT * FROM \"{table_name}\" LIMIT 3"),
|
||||
(f"System columns from {table_name}", f"SELECT _timestamp_ns, _key, _source FROM \"{table_name}\" LIMIT 3"),
|
||||
(f"Describe {table_name}", f"DESCRIBE \"{table_name}\""),
|
||||
]
|
||||
|
||||
for name, query in test_queries:
|
||||
try:
|
||||
cursor.execute(query)
|
||||
results = cursor.fetchall()
|
||||
|
||||
if "COUNT" in query.upper():
|
||||
count = results[0][0] if results else 0
|
||||
print(f" ✅ {name}: {count} records")
|
||||
elif "DESCRIBE" in query.upper():
|
||||
print(f" ✅ {name}: {len(results)} columns")
|
||||
for row in results[:5]: # Show first 5 columns
|
||||
print(f" - {dict(row)}")
|
||||
else:
|
||||
print(f" ✅ {name}: {len(results)} rows")
|
||||
for row in results:
|
||||
print(f" - {dict(row)}")
|
||||
|
||||
except Exception as e:
|
||||
print(f" ❌ {name}: {e}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Data queries failed: {e}")
|
||||
|
||||
|
||||
def test_prepared_statements(host, port, user, database, password=None):
|
||||
"""Test prepared statements."""
|
||||
print("\n📝 Testing prepared statements...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Test parameterized query
|
||||
try:
|
||||
cursor.execute("SELECT %s as param1, %s as param2", ("hello", 42))
|
||||
result = cursor.fetchone()
|
||||
print(f" ✅ Prepared statement: {result}")
|
||||
except Exception as e:
|
||||
print(f" ❌ Prepared statement: {e}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Prepared statements test failed: {e}")
|
||||
|
||||
|
||||
def test_transaction_support(host, port, user, database, password=None):
|
||||
"""Test transaction support (should be no-op for read-only)."""
|
||||
print("\n🔄 Testing transaction support...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor()
|
||||
|
||||
transaction_commands = [
|
||||
"BEGIN",
|
||||
"SELECT 1 as in_transaction",
|
||||
"COMMIT",
|
||||
"SELECT 1 as after_commit",
|
||||
]
|
||||
|
||||
for cmd in transaction_commands:
|
||||
try:
|
||||
cursor.execute(cmd)
|
||||
if "SELECT" in cmd:
|
||||
result = cursor.fetchone()
|
||||
print(f" ✅ {cmd}: {result}")
|
||||
else:
|
||||
print(f" ✅ {cmd}: OK")
|
||||
except Exception as e:
|
||||
print(f" ❌ {cmd}: {e}")
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Transaction test failed: {e}")
|
||||
|
||||
|
||||
def test_performance(host, port, user, database, password=None, iterations=10):
|
||||
"""Test query performance."""
|
||||
print(f"\n⚡ Testing performance ({iterations} iterations)...")
|
||||
|
||||
try:
|
||||
conn_params = {
|
||||
'host': host,
|
||||
'port': port,
|
||||
'user': user,
|
||||
'database': database
|
||||
}
|
||||
if password:
|
||||
conn_params['password'] = password
|
||||
|
||||
times = []
|
||||
|
||||
for i in range(iterations):
|
||||
start_time = time.time()
|
||||
|
||||
conn = psycopg2.connect(**conn_params)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT 1")
|
||||
result = cursor.fetchone()
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
elapsed = time.time() - start_time
|
||||
times.append(elapsed)
|
||||
|
||||
if i < 3: # Show first 3 iterations
|
||||
print(f" Iteration {i+1}: {elapsed:.3f}s")
|
||||
|
||||
avg_time = sum(times) / len(times)
|
||||
min_time = min(times)
|
||||
max_time = max(times)
|
||||
|
||||
print(f" ✅ Performance results:")
|
||||
print(f" - Average: {avg_time:.3f}s")
|
||||
print(f" - Min: {min_time:.3f}s")
|
||||
print(f" - Max: {max_time:.3f}s")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Performance test failed: {e}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Test SeaweedFS PostgreSQL Protocol")
|
||||
parser.add_argument("--host", default="localhost", help="PostgreSQL server host")
|
||||
parser.add_argument("--port", type=int, default=5432, help="PostgreSQL server port")
|
||||
parser.add_argument("--user", default="seaweedfs", help="PostgreSQL username")
|
||||
parser.add_argument("--password", help="PostgreSQL password")
|
||||
parser.add_argument("--database", default="default", help="PostgreSQL database")
|
||||
parser.add_argument("--skip-performance", action="store_true", help="Skip performance tests")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
print("🧪 SeaweedFS PostgreSQL Protocol Test Client")
|
||||
print("=" * 50)
|
||||
|
||||
# Test basic connection first
|
||||
if not test_connection(args.host, args.port, args.user, args.database, args.password):
|
||||
print("\n❌ Basic connection failed. Cannot continue with other tests.")
|
||||
sys.exit(1)
|
||||
|
||||
# Run all tests
|
||||
try:
|
||||
test_system_queries(args.host, args.port, args.user, args.database, args.password)
|
||||
test_schema_queries(args.host, args.port, args.user, args.database, args.password)
|
||||
test_data_queries(args.host, args.port, args.user, args.database, args.password)
|
||||
test_prepared_statements(args.host, args.port, args.user, args.database, args.password)
|
||||
test_transaction_support(args.host, args.port, args.user, args.database, args.password)
|
||||
|
||||
if not args.skip_performance:
|
||||
test_performance(args.host, args.port, args.user, args.database, args.password)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n\n⚠️ Tests interrupted by user")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"\n❌ Unexpected error during testing: {e}")
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
print("\n🎉 All tests completed!")
|
||||
print("\nTo use SeaweedFS with PostgreSQL tools:")
|
||||
print(f" psql -h {args.host} -p {args.port} -U {args.user} -d {args.database}")
|
||||
print(f" Connection string: postgresql://{args.user}@{args.host}:{args.port}/{args.database}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,65 +0,0 @@
|
||||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
.gitmodules
|
||||
|
||||
# Documentation
|
||||
*.md
|
||||
docs/
|
||||
|
||||
# Development files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Build artifacts
|
||||
# bin/ (commented out for Docker build - needed for mount container)
|
||||
# target/ (commented out for Docker build)
|
||||
*.exe
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Go specific
|
||||
vendor/
|
||||
*.test
|
||||
*.prof
|
||||
go.work
|
||||
go.work.sum
|
||||
|
||||
# Rust specific
|
||||
Cargo.lock
|
||||
# rdma-engine/target/ (commented out for Docker build)
|
||||
*.pdb
|
||||
|
||||
# Docker
|
||||
Dockerfile*
|
||||
docker-compose*.yml
|
||||
.dockerignore
|
||||
|
||||
# Test files (tests/ needed for integration test container)
|
||||
# tests/
|
||||
# scripts/ (commented out for Docker build - needed for mount container)
|
||||
*.log
|
||||
|
||||
# Temporary files
|
||||
tmp/
|
||||
temp/
|
||||
*.tmp
|
||||
*.temp
|
||||
|
||||
# IDE and editor files
|
||||
*.sublime-*
|
||||
.vscode/
|
||||
.idea/
|
||||
@@ -1,196 +0,0 @@
|
||||
# ✅ Correct RDMA Sidecar Approach - Simple Parameter-Based
|
||||
|
||||
## 🎯 **You're Right - Simplified Architecture**
|
||||
|
||||
The RDMA sidecar should be **simple** and just take the volume server address as a parameter. The volume lookup complexity should stay in `weed mount`, not in the sidecar.
|
||||
|
||||
## 🏗️ **Correct Architecture**
|
||||
|
||||
### **1. weed mount (Client Side) - Does Volume Lookup**
|
||||
```go
|
||||
// File: weed/mount/filehandle_read.go (integration point)
|
||||
func (fh *FileHandle) tryRDMARead(ctx context.Context, buff []byte, offset int64) (int64, int64, error) {
|
||||
entry := fh.GetEntry()
|
||||
|
||||
for _, chunk := range entry.GetEntry().Chunks {
|
||||
if offset >= chunk.Offset && offset < chunk.Offset+int64(chunk.Size) {
|
||||
// Parse chunk info
|
||||
volumeID, needleID, cookie, err := ParseFileId(chunk.FileId)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
// 🔍 VOLUME LOOKUP (in weed mount, not sidecar)
|
||||
volumeServerAddr, err := fh.wfs.lookupVolumeServer(ctx, volumeID)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
// 🚀 SIMPLE RDMA REQUEST WITH VOLUME SERVER PARAMETER
|
||||
data, isRDMA, err := fh.wfs.rdmaClient.ReadNeedleFromServer(
|
||||
ctx, volumeServerAddr, volumeID, needleID, cookie, chunkOffset, readSize)
|
||||
|
||||
return int64(copy(buff, data)), time.Now().UnixNano(), nil
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **2. RDMA Mount Client - Passes Volume Server Address**
|
||||
```go
|
||||
// File: weed/mount/rdma_client.go (modify existing)
|
||||
func (c *RDMAMountClient) ReadNeedleFromServer(ctx context.Context, volumeServerAddr string, volumeID uint32, needleID uint64, cookie uint32, offset, size uint64) ([]byte, bool, error) {
|
||||
// Simple HTTP request with volume server as parameter
|
||||
reqURL := fmt.Sprintf("http://%s/rdma/read", c.sidecarAddr)
|
||||
|
||||
requestBody := map[string]interface{}{
|
||||
"volume_server": volumeServerAddr, // ← KEY: Pass volume server address
|
||||
"volume_id": volumeID,
|
||||
"needle_id": needleID,
|
||||
"cookie": cookie,
|
||||
"offset": offset,
|
||||
"size": size,
|
||||
}
|
||||
|
||||
// POST request with volume server parameter
|
||||
jsonBody, err := json.Marshal(requestBody)
|
||||
if err != nil {
|
||||
return nil, false, fmt.Errorf("failed to marshal request body: %w", err)
|
||||
}
|
||||
resp, err := c.httpClient.Post(reqURL, "application/json", bytes.NewBuffer(jsonBody))
|
||||
if err != nil {
|
||||
return nil, false, fmt.Errorf("http post to sidecar: %w", err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### **3. RDMA Sidecar - Simple, No Lookup Logic**
|
||||
```go
|
||||
// File: seaweedfs-rdma-sidecar/cmd/demo-server/main.go
|
||||
func (s *DemoServer) rdmaReadHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
// Parse request body
|
||||
var req struct {
|
||||
VolumeServer string `json:"volume_server"` // ← Receive volume server address
|
||||
VolumeID uint32 `json:"volume_id"`
|
||||
NeedleID uint64 `json:"needle_id"`
|
||||
Cookie uint32 `json:"cookie"`
|
||||
Offset uint64 `json:"offset"`
|
||||
Size uint64 `json:"size"`
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
http.Error(w, "Invalid request", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
s.logger.WithFields(logrus.Fields{
|
||||
"volume_server": req.VolumeServer, // ← Use provided volume server
|
||||
"volume_id": req.VolumeID,
|
||||
"needle_id": req.NeedleID,
|
||||
}).Info("📖 Processing RDMA read with volume server parameter")
|
||||
|
||||
// 🚀 SIMPLE: Use the provided volume server address
|
||||
// No complex lookup logic needed!
|
||||
resp, err := s.rdmaClient.ReadFromVolumeServer(r.Context(), req.VolumeServer, req.VolumeID, req.NeedleID, req.Cookie, req.Offset, req.Size)
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("RDMA read failed: %v", err), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// Return binary data
|
||||
w.Header().Set("Content-Type", "application/octet-stream")
|
||||
w.Header().Set("X-RDMA-Used", "true")
|
||||
w.Write(resp.Data)
|
||||
}
|
||||
```
|
||||
|
||||
### **4. Volume Lookup in weed mount (Where it belongs)**
|
||||
```go
|
||||
// File: weed/mount/weedfs.go (add method)
|
||||
func (wfs *WFS) lookupVolumeServer(ctx context.Context, volumeID uint32) (string, error) {
|
||||
// Use existing SeaweedFS volume lookup logic
|
||||
vid := fmt.Sprintf("%d", volumeID)
|
||||
|
||||
// Query master server for volume location
|
||||
locations, err := operation.LookupVolumeId(wfs.getMasterFn(), wfs.option.GrpcDialOption, vid)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("volume lookup failed: %w", err)
|
||||
}
|
||||
|
||||
if len(locations.Locations) == 0 {
|
||||
return "", fmt.Errorf("no locations found for volume %d", volumeID)
|
||||
}
|
||||
|
||||
// Return first available location (or implement smart selection)
|
||||
return locations.Locations[0].Url, nil
|
||||
}
|
||||
```
|
||||
|
||||
## 🎯 **Key Differences from Over-Complicated Approach**
|
||||
|
||||
### **❌ Over-Complicated (What I Built Before):**
|
||||
- ❌ Sidecar does volume lookup
|
||||
- ❌ Sidecar has master client integration
|
||||
- ❌ Sidecar has volume location caching
|
||||
- ❌ Sidecar forwards requests to remote sidecars
|
||||
- ❌ Complex distributed logic in sidecar
|
||||
|
||||
### **✅ Correct Simple Approach:**
|
||||
- ✅ **weed mount** does volume lookup (where it belongs)
|
||||
- ✅ **weed mount** passes volume server address to sidecar
|
||||
- ✅ **Sidecar** is simple and stateless
|
||||
- ✅ **Sidecar** just does local RDMA read for given server
|
||||
- ✅ **No complex distributed logic in sidecar**
|
||||
|
||||
## 🚀 **Request Flow (Corrected)**
|
||||
|
||||
1. **User Application** → `read()` system call
|
||||
2. **FUSE** → `weed mount` WFS.Read()
|
||||
3. **weed mount** → Volume lookup: "Where is volume 7?"
|
||||
4. **SeaweedFS Master** → "Volume 7 is on server-B:8080"
|
||||
5. **weed mount** → HTTP POST to sidecar: `{volume_server: "server-B:8080", volume: 7, needle: 12345}`
|
||||
6. **RDMA Sidecar** → Connect to server-B:8080, do local RDMA read
|
||||
7. **RDMA Engine** → Direct memory access to volume file
|
||||
8. **Response** → Binary data back to weed mount → user
|
||||
|
||||
## 📝 **Implementation Changes Needed**
|
||||
|
||||
### **1. Simplify Sidecar (Remove Complex Logic)**
|
||||
- Remove `DistributedRDMAClient`
|
||||
- Remove volume lookup logic
|
||||
- Remove master client integration
|
||||
- Keep simple RDMA engine communication
|
||||
|
||||
### **2. Add Volume Lookup to weed mount**
|
||||
- Add `lookupVolumeServer()` method to WFS
|
||||
- Modify `RDMAMountClient` to accept volume server parameter
|
||||
- Integrate with existing SeaweedFS volume lookup
|
||||
|
||||
### **3. Simple Sidecar API**
|
||||
```
|
||||
POST /rdma/read
|
||||
{
|
||||
"volume_server": "server-B:8080",
|
||||
"volume_id": 7,
|
||||
"needle_id": 12345,
|
||||
"cookie": 0,
|
||||
"offset": 0,
|
||||
"size": 4096
|
||||
}
|
||||
```
|
||||
|
||||
## ✅ **Benefits of Simple Approach**
|
||||
|
||||
- **🎯 Single Responsibility**: Sidecar only does RDMA, weed mount does lookup
|
||||
- **🔧 Maintainable**: Less complex logic in sidecar
|
||||
- **⚡ Performance**: No extra network hops for volume lookup
|
||||
- **🏗️ Clean Architecture**: Separation of concerns
|
||||
- **🐛 Easier Debugging**: Clear responsibility boundaries
|
||||
|
||||
You're absolutely right - this is much cleaner! The sidecar should be a simple RDMA accelerator, not a distributed system coordinator.
|
||||
@@ -1,165 +0,0 @@
|
||||
# SeaweedFS RDMA Sidecar - Current Status Summary
|
||||
|
||||
## 🎉 **IMPLEMENTATION COMPLETE**
|
||||
**Status**: ✅ **READY FOR PRODUCTION** (Mock Mode) / 🔄 **READY FOR HARDWARE INTEGRATION**
|
||||
|
||||
---
|
||||
|
||||
## 📊 **What's Working Right Now**
|
||||
|
||||
### ✅ **Complete Integration Pipeline**
|
||||
- **SeaweedFS Mount** → **Go Sidecar** → **Rust Engine** → **Mock RDMA**
|
||||
- End-to-end data flow with proper error handling
|
||||
- Zero-copy page cache optimization
|
||||
- Connection pooling for performance
|
||||
|
||||
### ✅ **Production-Ready Components**
|
||||
- HTTP API with RESTful endpoints
|
||||
- Robust health checks and monitoring
|
||||
- Docker multi-service orchestration
|
||||
- Comprehensive error handling and fallback
|
||||
- Volume lookup and server discovery
|
||||
|
||||
### ✅ **Performance Features**
|
||||
- **Zero-Copy**: Direct kernel page cache population
|
||||
- **Connection Pooling**: Reused IPC connections
|
||||
- **Async Operations**: Non-blocking I/O throughout
|
||||
- **Metrics**: Detailed performance monitoring
|
||||
|
||||
### ✅ **Code Quality**
|
||||
- All GitHub PR review comments addressed
|
||||
- Memory-safe operations (no dangerous channel closes)
|
||||
- Proper file ID parsing using SeaweedFS functions
|
||||
- RESTful API design with correct HTTP methods
|
||||
|
||||
---
|
||||
|
||||
## 🔄 **What's Mock/Simulated**
|
||||
|
||||
### 🟡 **Mock RDMA Engine** (Rust)
|
||||
- **Location**: `rdma-engine/src/rdma.rs`
|
||||
- **Function**: Simulates RDMA hardware operations
|
||||
- **Data**: Generates pattern data (0,1,2...255,0,1,2...)
|
||||
- **Performance**: Realistic latency simulation (150ns reads)
|
||||
|
||||
### 🟡 **Simulated Hardware**
|
||||
- **Device Info**: Mock Mellanox ConnectX-5 capabilities
|
||||
- **Memory Regions**: Fake registration without HCA
|
||||
- **Transfers**: Pattern generation instead of network transfer
|
||||
- **Completions**: Synthetic work completions
|
||||
|
||||
---
|
||||
|
||||
## 📈 **Current Performance**
|
||||
- **Throughput**: ~403 operations/second
|
||||
- **Latency**: ~2.48ms average (mock overhead)
|
||||
- **Success Rate**: 100% in integration tests
|
||||
- **Memory Usage**: Optimized with zero-copy
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ **Architecture Overview**
|
||||
|
||||
```
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ SeaweedFS │────▶│ Go Sidecar │────▶│ Rust Engine │
|
||||
│ Mount Client │ │ HTTP Server │ │ Mock RDMA │
|
||||
│ (REAL) │ │ (REAL) │ │ (MOCK) │
|
||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ - File ID Parse │ │ - Zero-Copy │ │ - UCX Ready │
|
||||
│ - Volume Lookup │ │ - Conn Pooling │ │ - Memory Mgmt │
|
||||
│ - HTTP Fallback │ │ - Health Checks │ │ - IPC Protocol │
|
||||
│ - Error Handling│ │ - REST API │ │ - Async Ops │
|
||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔧 **Key Files & Locations**
|
||||
|
||||
### **Core Integration**
|
||||
- `weed/mount/filehandle_read.go` - RDMA read integration in FUSE
|
||||
- `weed/mount/rdma_client.go` - Mount client RDMA communication
|
||||
- `cmd/demo-server/main.go` - Main RDMA sidecar HTTP server
|
||||
|
||||
### **RDMA Engine**
|
||||
- `rdma-engine/src/rdma.rs` - Mock RDMA implementation
|
||||
- `rdma-engine/src/ipc.rs` - IPC protocol with Go sidecar
|
||||
- `pkg/rdma/client.go` - Go client for RDMA engine
|
||||
|
||||
### **Configuration**
|
||||
- `docker-compose.mount-rdma.yml` - Complete integration test setup
|
||||
- `go.mod` - Dependencies with local SeaweedFS replacement
|
||||
|
||||
---
|
||||
|
||||
## 🚀 **Ready For Next Steps**
|
||||
|
||||
### **Immediate Capability**
|
||||
- ✅ **Development**: Full testing without RDMA hardware
|
||||
- ✅ **Integration Testing**: Complete pipeline validation
|
||||
- ✅ **Performance Benchmarking**: Baseline metrics
|
||||
- ✅ **CI/CD**: Mock mode for automated testing
|
||||
|
||||
### **Production Transition**
|
||||
- 🔄 **Hardware Integration**: Replace mock with UCX library
|
||||
- 🔄 **Real Data Transfer**: Remove pattern generation
|
||||
- 🔄 **Device Detection**: Enumerate actual RDMA NICs
|
||||
- 🔄 **Performance Optimization**: Hardware-specific tuning
|
||||
|
||||
---
|
||||
|
||||
## 📋 **Commands to Resume Work**
|
||||
|
||||
### **Start Development Environment**
|
||||
```bash
|
||||
# Navigate to your seaweedfs-rdma-sidecar directory
|
||||
cd /path/to/your/seaweedfs/seaweedfs-rdma-sidecar
|
||||
|
||||
# Build components
|
||||
go build -o bin/demo-server ./cmd/demo-server
|
||||
cargo build --manifest-path rdma-engine/Cargo.toml
|
||||
|
||||
# Run integration tests
|
||||
docker-compose -f docker-compose.mount-rdma.yml up
|
||||
```
|
||||
|
||||
### **Test Current Implementation**
|
||||
```bash
|
||||
# Test sidecar HTTP API
|
||||
curl http://localhost:8081/health
|
||||
curl http://localhost:8081/stats
|
||||
|
||||
# Test RDMA read
|
||||
curl "http://localhost:8081/read?volume=1&needle=123&cookie=456&offset=0&size=1024&volume_server=http://localhost:8080"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 **Success Metrics Achieved**
|
||||
|
||||
- ✅ **Functional**: Complete RDMA integration pipeline
|
||||
- ✅ **Reliable**: Robust error handling and fallback
|
||||
- ✅ **Performant**: Zero-copy and connection pooling
|
||||
- ✅ **Testable**: Comprehensive mock implementation
|
||||
- ✅ **Maintainable**: Clean code with proper documentation
|
||||
- ✅ **Scalable**: Async operations and pooling
|
||||
- ✅ **Production-Ready**: All review comments addressed
|
||||
|
||||
---
|
||||
|
||||
## 📚 **Documentation**
|
||||
|
||||
- `FUTURE-WORK-TODO.md` - Next steps for hardware integration
|
||||
- `DOCKER-TESTING.md` - Integration testing guide
|
||||
- `docker-compose.mount-rdma.yml` - Complete test environment
|
||||
- GitHub PR reviews - All issues addressed and documented
|
||||
|
||||
---
|
||||
|
||||
**🏆 ACHIEVEMENT**: Complete RDMA sidecar architecture with production-ready infrastructure and seamless mock-to-real transition path!
|
||||
|
||||
**Next**: Follow `FUTURE-WORK-TODO.md` to replace mock with real UCX hardware integration.
|
||||
@@ -1,290 +0,0 @@
|
||||
# 🐳 Docker Integration Testing Guide
|
||||
|
||||
This guide provides comprehensive Docker-based integration testing for the SeaweedFS RDMA sidecar system.
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
The Docker Compose setup includes:
|
||||
|
||||
```
|
||||
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
|
||||
│ SeaweedFS Master │ │ SeaweedFS Volume │ │ Rust RDMA │
|
||||
│ :9333 │◄──►│ :8080 │ │ Engine │
|
||||
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
|
||||
│ Go RDMA Sidecar │◄──►│ Unix Socket │◄──►│ Integration │
|
||||
│ :8081 │ │ /tmp/rdma.sock │ │ Test Suite │
|
||||
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
|
||||
```
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### 1. Start All Services
|
||||
|
||||
```bash
|
||||
# Using the helper script (recommended)
|
||||
./tests/docker-test-helper.sh start
|
||||
|
||||
# Or using docker-compose directly
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### 2. Run Integration Tests
|
||||
|
||||
```bash
|
||||
# Run the complete test suite
|
||||
./tests/docker-test-helper.sh test
|
||||
|
||||
# Or run tests manually
|
||||
docker-compose run --rm integration-tests
|
||||
```
|
||||
|
||||
### 3. Interactive Testing
|
||||
|
||||
```bash
|
||||
# Open a shell in the test container
|
||||
./tests/docker-test-helper.sh shell
|
||||
|
||||
# Inside the container, you can run:
|
||||
./test-rdma ping
|
||||
./test-rdma capabilities
|
||||
./test-rdma read --volume 1 --needle 12345 --size 1024
|
||||
curl http://rdma-sidecar:8081/health
|
||||
curl http://rdma-sidecar:8081/stats
|
||||
```
|
||||
|
||||
## 📋 Test Helper Commands
|
||||
|
||||
The `docker-test-helper.sh` script provides convenient commands:
|
||||
|
||||
```bash
|
||||
# Service Management
|
||||
./tests/docker-test-helper.sh start # Start all services
|
||||
./tests/docker-test-helper.sh stop # Stop all services
|
||||
./tests/docker-test-helper.sh clean # Stop and clean volumes
|
||||
|
||||
# Testing
|
||||
./tests/docker-test-helper.sh test # Run integration tests
|
||||
./tests/docker-test-helper.sh shell # Interactive testing shell
|
||||
|
||||
# Monitoring
|
||||
./tests/docker-test-helper.sh status # Check service health
|
||||
./tests/docker-test-helper.sh logs # Show all logs
|
||||
./tests/docker-test-helper.sh logs rdma-engine # Show specific service logs
|
||||
```
|
||||
|
||||
## 🧪 Test Coverage
|
||||
|
||||
The integration test suite covers:
|
||||
|
||||
### ✅ Core Components
|
||||
- **SeaweedFS Master**: Cluster leadership and status
|
||||
- **SeaweedFS Volume Server**: Volume operations and health
|
||||
- **Rust RDMA Engine**: Socket communication and operations
|
||||
- **Go RDMA Sidecar**: HTTP API and RDMA integration
|
||||
|
||||
### ✅ Integration Points
|
||||
- **IPC Communication**: Unix socket + MessagePack protocol
|
||||
- **RDMA Operations**: Ping, capabilities, read operations
|
||||
- **HTTP API**: All sidecar endpoints and error handling
|
||||
- **Fallback Logic**: RDMA → HTTP fallback behavior
|
||||
|
||||
### ✅ Performance Testing
|
||||
- **Direct RDMA Benchmarks**: Engine-level performance
|
||||
- **Sidecar Benchmarks**: End-to-end performance
|
||||
- **Latency Measurements**: Operation timing validation
|
||||
- **Throughput Testing**: Operations per second
|
||||
|
||||
## 🔧 Service Details
|
||||
|
||||
### SeaweedFS Master
|
||||
- **Port**: 9333
|
||||
- **Health Check**: `/cluster/status`
|
||||
- **Data**: Persistent volume `master-data`
|
||||
|
||||
### SeaweedFS Volume Server
|
||||
- **Port**: 8080
|
||||
- **Health Check**: `/status`
|
||||
- **Data**: Persistent volume `volume-data`
|
||||
- **Depends on**: SeaweedFS Master
|
||||
|
||||
### Rust RDMA Engine
|
||||
- **Socket**: `/tmp/rdma-engine.sock`
|
||||
- **Mode**: Mock RDMA (development)
|
||||
- **Health Check**: Socket existence
|
||||
- **Privileged**: Yes (for RDMA access)
|
||||
|
||||
### Go RDMA Sidecar
|
||||
- **Port**: 8081
|
||||
- **Health Check**: `/health`
|
||||
- **API Endpoints**: `/stats`, `/read`, `/benchmark`
|
||||
- **Depends on**: RDMA Engine, Volume Server
|
||||
|
||||
### Test Client
|
||||
- **Purpose**: Integration testing and interactive debugging
|
||||
- **Tools**: curl, jq, test-rdma binary
|
||||
- **Environment**: All service URLs configured
|
||||
|
||||
## 📊 Expected Test Results
|
||||
|
||||
### ✅ Successful Output Example
|
||||
|
||||
```
|
||||
===============================================
|
||||
🚀 SEAWEEDFS RDMA INTEGRATION TEST SUITE
|
||||
===============================================
|
||||
|
||||
🔵 Waiting for SeaweedFS Master to be ready...
|
||||
✅ SeaweedFS Master is ready
|
||||
✅ SeaweedFS Master is leader and ready
|
||||
|
||||
🔵 Waiting for SeaweedFS Volume Server to be ready...
|
||||
✅ SeaweedFS Volume Server is ready
|
||||
Volume Server Version: 3.60
|
||||
|
||||
🔵 Checking RDMA engine socket...
|
||||
✅ RDMA engine socket exists
|
||||
🔵 Testing RDMA engine ping...
|
||||
✅ RDMA engine ping successful
|
||||
|
||||
🔵 Waiting for RDMA Sidecar to be ready...
|
||||
✅ RDMA Sidecar is ready
|
||||
✅ RDMA Sidecar is healthy
|
||||
RDMA Status: true
|
||||
|
||||
🔵 Testing needle read via sidecar...
|
||||
✅ Sidecar needle read successful
|
||||
⚠️ HTTP fallback used. Duration: 2.48ms
|
||||
|
||||
🔵 Running sidecar performance benchmark...
|
||||
✅ Sidecar benchmark completed
|
||||
Benchmark Results:
|
||||
RDMA Operations: 5
|
||||
HTTP Operations: 0
|
||||
Average Latency: 2.479ms
|
||||
Operations/sec: 403.2
|
||||
|
||||
===============================================
|
||||
🎉 ALL INTEGRATION TESTS COMPLETED!
|
||||
===============================================
|
||||
```
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Service Not Starting
|
||||
|
||||
```bash
|
||||
# Check service logs
|
||||
./tests/docker-test-helper.sh logs [service-name]
|
||||
|
||||
# Check container status
|
||||
docker-compose ps
|
||||
|
||||
# Restart specific service
|
||||
docker-compose restart [service-name]
|
||||
```
|
||||
|
||||
### RDMA Engine Issues
|
||||
|
||||
```bash
|
||||
# Check socket permissions
|
||||
docker-compose exec rdma-engine ls -la /tmp/rdma/rdma-engine.sock
|
||||
|
||||
# Check RDMA engine logs
|
||||
./tests/docker-test-helper.sh logs rdma-engine
|
||||
|
||||
# Test socket directly
|
||||
docker-compose exec test-client ./test-rdma ping
|
||||
```
|
||||
|
||||
### Sidecar Connection Issues
|
||||
|
||||
```bash
|
||||
# Test sidecar health directly
|
||||
curl http://localhost:8081/health
|
||||
|
||||
# Check sidecar logs
|
||||
./tests/docker-test-helper.sh logs rdma-sidecar
|
||||
|
||||
# Verify environment variables
|
||||
docker-compose exec rdma-sidecar env | grep RDMA
|
||||
```
|
||||
|
||||
### Volume Server Issues
|
||||
|
||||
```bash
|
||||
# Check SeaweedFS status
|
||||
curl http://localhost:9333/cluster/status
|
||||
curl http://localhost:8080/status
|
||||
|
||||
# Check volume server logs
|
||||
./tests/docker-test-helper.sh logs seaweedfs-volume
|
||||
```
|
||||
|
||||
## 🔍 Manual Testing Examples
|
||||
|
||||
### Test RDMA Engine Directly
|
||||
|
||||
```bash
|
||||
# Enter test container
|
||||
./tests/docker-test-helper.sh shell
|
||||
|
||||
# Test RDMA operations
|
||||
./test-rdma ping --socket /tmp/rdma-engine.sock
|
||||
./test-rdma capabilities --socket /tmp/rdma-engine.sock
|
||||
./test-rdma read --socket /tmp/rdma-engine.sock --volume 1 --needle 12345
|
||||
./test-rdma bench --socket /tmp/rdma-engine.sock --iterations 10
|
||||
```
|
||||
|
||||
### Test Sidecar HTTP API
|
||||
|
||||
```bash
|
||||
# Health and status
|
||||
curl http://rdma-sidecar:8081/health | jq '.'
|
||||
curl http://rdma-sidecar:8081/stats | jq '.'
|
||||
|
||||
# Needle operations
|
||||
curl "http://rdma-sidecar:8081/read?volume=1&needle=12345&size=1024" | jq '.'
|
||||
|
||||
# Benchmarking
|
||||
curl "http://rdma-sidecar:8081/benchmark?iterations=5&size=2048" | jq '.benchmark_results'
|
||||
```
|
||||
|
||||
### Test SeaweedFS Integration
|
||||
|
||||
```bash
|
||||
# Check cluster status
|
||||
curl http://seaweedfs-master:9333/cluster/status | jq '.'
|
||||
|
||||
# Check volume status
|
||||
curl http://seaweedfs-volume:8080/status | jq '.'
|
||||
|
||||
# List volumes
|
||||
curl http://seaweedfs-master:9333/vol/status | jq '.'
|
||||
```
|
||||
|
||||
## 🚀 Production Deployment
|
||||
|
||||
This Docker setup can be adapted for production by:
|
||||
|
||||
1. **Replacing Mock RDMA**: Switch to `real-ucx` feature in Rust
|
||||
2. **RDMA Hardware**: Add RDMA device mappings and capabilities
|
||||
3. **Security**: Remove privileged mode, add proper user/group mapping
|
||||
4. **Scaling**: Use Docker Swarm or Kubernetes for orchestration
|
||||
5. **Monitoring**: Add Prometheus metrics and Grafana dashboards
|
||||
6. **Persistence**: Configure proper volume management
|
||||
|
||||
## 📚 Additional Resources
|
||||
|
||||
- [Main README](README.md) - Complete project overview
|
||||
- [Docker Compose Reference](https://docs.docker.com/compose/)
|
||||
- [SeaweedFS Documentation](https://github.com/seaweedfs/seaweedfs/wiki)
|
||||
- [UCX Documentation](https://github.com/openucx/ucx)
|
||||
|
||||
---
|
||||
|
||||
**🐳 Happy Docker Testing!**
|
||||
|
||||
For issues or questions, please check the logs first and refer to the troubleshooting section above.
|
||||
@@ -1,25 +0,0 @@
|
||||
# Dockerfile for RDMA Mount Integration Tests
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
wget \
|
||||
ca-certificates \
|
||||
jq \
|
||||
bc \
|
||||
time \
|
||||
util-linux \
|
||||
coreutils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create test directories
|
||||
RUN mkdir -p /usr/local/bin /test-results
|
||||
|
||||
# Copy test scripts
|
||||
COPY scripts/run-integration-tests.sh /usr/local/bin/run-integration-tests.sh
|
||||
COPY scripts/test-rdma-mount.sh /usr/local/bin/test-rdma-mount.sh
|
||||
RUN chmod +x /usr/local/bin/*.sh
|
||||
|
||||
# Default command
|
||||
CMD ["/usr/local/bin/run-integration-tests.sh"]
|
||||
@@ -1,40 +0,0 @@
|
||||
# Dockerfile for SeaweedFS Mount with RDMA support
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
fuse3 \
|
||||
curl \
|
||||
wget \
|
||||
ca-certificates \
|
||||
procps \
|
||||
util-linux \
|
||||
jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /usr/local/bin /mnt/seaweedfs /var/log/seaweedfs
|
||||
|
||||
# Copy SeaweedFS binary (will be built from context)
|
||||
COPY bin/weed /usr/local/bin/weed
|
||||
RUN chmod +x /usr/local/bin/weed
|
||||
|
||||
# Copy mount helper scripts
|
||||
COPY scripts/mount-helper.sh /usr/local/bin/mount-helper.sh
|
||||
RUN chmod +x /usr/local/bin/mount-helper.sh
|
||||
|
||||
# Create mount point
|
||||
RUN mkdir -p /mnt/seaweedfs
|
||||
|
||||
# Set up FUSE permissions
|
||||
RUN echo 'user_allow_other' >> /etc/fuse.conf
|
||||
|
||||
# Health check script
|
||||
COPY scripts/mount-health-check.sh /usr/local/bin/mount-health-check.sh
|
||||
RUN chmod +x /usr/local/bin/mount-health-check.sh
|
||||
|
||||
# Expose mount point as volume
|
||||
VOLUME ["/mnt/seaweedfs"]
|
||||
|
||||
# Default command
|
||||
CMD ["/usr/local/bin/mount-helper.sh"]
|
||||
@@ -1,26 +0,0 @@
|
||||
# Dockerfile for RDMA Mount Performance Tests
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
wget \
|
||||
ca-certificates \
|
||||
jq \
|
||||
bc \
|
||||
time \
|
||||
util-linux \
|
||||
coreutils \
|
||||
fio \
|
||||
iozone3 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create test directories
|
||||
RUN mkdir -p /usr/local/bin /performance-results
|
||||
|
||||
# Copy test scripts
|
||||
COPY scripts/run-performance-tests.sh /usr/local/bin/run-performance-tests.sh
|
||||
RUN chmod +x /usr/local/bin/*.sh
|
||||
|
||||
# Default command
|
||||
CMD ["/usr/local/bin/run-performance-tests.sh"]
|
||||
@@ -1,63 +0,0 @@
|
||||
# Multi-stage build for Rust RDMA Engine
|
||||
FROM rust:1.80-slim AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
libudev-dev \
|
||||
build-essential \
|
||||
libc6-dev \
|
||||
linux-libc-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy Rust project files
|
||||
COPY rdma-engine/Cargo.toml ./
|
||||
COPY rdma-engine/Cargo.lock ./
|
||||
COPY rdma-engine/src ./src
|
||||
|
||||
# Build the release binary
|
||||
RUN cargo build --release
|
||||
|
||||
# Runtime stage
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ca-certificates \
|
||||
libssl3 \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create app user
|
||||
RUN useradd -m -u 1001 appuser
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy binary from builder stage
|
||||
COPY --from=builder /app/target/release/rdma-engine-server .
|
||||
|
||||
# Change ownership
|
||||
RUN chown -R appuser:appuser /app
|
||||
|
||||
# Set default socket path (can be overridden)
|
||||
ENV RDMA_SOCKET_PATH=/tmp/rdma/rdma-engine.sock
|
||||
|
||||
# Create socket directory with proper permissions (before switching user)
|
||||
RUN mkdir -p /tmp/rdma && chown -R appuser:appuser /tmp/rdma
|
||||
|
||||
USER appuser
|
||||
|
||||
# Expose any needed ports (none for this service as it uses Unix sockets)
|
||||
# EXPOSE 18515
|
||||
|
||||
# Health check - verify both process and socket using environment variable
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD pgrep rdma-engine-server >/dev/null && test -S "$RDMA_SOCKET_PATH"
|
||||
|
||||
# Default command using environment variable
|
||||
CMD sh -c "./rdma-engine-server --debug --ipc-socket \"$RDMA_SOCKET_PATH\""
|
||||
@@ -1,36 +0,0 @@
|
||||
# Simplified Dockerfile for Rust RDMA Engine (using pre-built binary)
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ca-certificates \
|
||||
libssl3 \
|
||||
curl \
|
||||
procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create app user
|
||||
RUN useradd -m -u 1001 appuser
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy pre-built binary from local build
|
||||
COPY ./rdma-engine/target/release/rdma-engine-server .
|
||||
|
||||
# Change ownership
|
||||
RUN chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
# Set default socket path (can be overridden)
|
||||
ENV RDMA_SOCKET_PATH=/tmp/rdma-engine.sock
|
||||
|
||||
# Create socket directory
|
||||
RUN mkdir -p /tmp
|
||||
|
||||
# Health check - verify both process and socket using environment variable
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD pgrep rdma-engine-server >/dev/null && test -S "$RDMA_SOCKET_PATH"
|
||||
|
||||
# Default command using environment variable
|
||||
CMD sh -c "./rdma-engine-server --debug --ipc-socket \"$RDMA_SOCKET_PATH\""
|
||||
@@ -1,55 +0,0 @@
|
||||
# Multi-stage build for Go Sidecar
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache git ca-certificates tzdata
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY cmd/ ./cmd/
|
||||
COPY pkg/ ./pkg/
|
||||
|
||||
# Build the binaries
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o demo-server ./cmd/demo-server
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o sidecar ./cmd/sidecar
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o test-rdma ./cmd/test-rdma
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:3.18
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk --no-cache add ca-certificates curl jq
|
||||
|
||||
# Create app user
|
||||
RUN addgroup -g 1001 appgroup && \
|
||||
adduser -D -s /bin/sh -u 1001 -G appgroup appuser
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy binaries from builder stage
|
||||
COPY --from=builder /app/demo-server .
|
||||
COPY --from=builder /app/sidecar .
|
||||
COPY --from=builder /app/test-rdma .
|
||||
|
||||
# Change ownership
|
||||
RUN chown -R appuser:appgroup /app
|
||||
USER appuser
|
||||
|
||||
# Expose the demo server port
|
||||
EXPOSE 8081
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=10s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD curl -f http://localhost:8081/health || exit 1
|
||||
|
||||
# Default command (demo server)
|
||||
CMD ["./demo-server", "--port", "8081", "--enable-rdma", "--debug"]
|
||||
@@ -1,59 +0,0 @@
|
||||
# Multi-stage build for Test Client
|
||||
FROM golang:1.23-alpine AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache git ca-certificates tzdata
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY cmd/ ./cmd/
|
||||
COPY pkg/ ./pkg/
|
||||
|
||||
# Build the test binaries
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o test-rdma ./cmd/test-rdma
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o demo-server ./cmd/demo-server
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:3.18
|
||||
|
||||
# Install runtime dependencies and testing tools
|
||||
RUN apk --no-cache add \
|
||||
ca-certificates \
|
||||
curl \
|
||||
jq \
|
||||
bash \
|
||||
wget \
|
||||
netcat-openbsd \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# Create app user
|
||||
RUN addgroup -g 1001 appgroup && \
|
||||
adduser -D -s /bin/bash -u 1001 -G appgroup appuser
|
||||
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy binaries from builder stage
|
||||
COPY --from=builder /app/test-rdma .
|
||||
COPY --from=builder /app/demo-server .
|
||||
|
||||
# Copy test scripts
|
||||
COPY tests/ ./tests/
|
||||
RUN chmod +x ./tests/*.sh
|
||||
|
||||
# Change ownership
|
||||
RUN chown -R appuser:appgroup /app
|
||||
|
||||
# Switch to app user
|
||||
USER appuser
|
||||
|
||||
# Default command
|
||||
CMD ["/bin/bash"]
|
||||
@@ -1,276 +0,0 @@
|
||||
# SeaweedFS RDMA Sidecar - Future Work TODO
|
||||
|
||||
## 🎯 **Current Status (✅ COMPLETED)**
|
||||
|
||||
### **Phase 1: Architecture & Integration - DONE**
|
||||
- ✅ **Complete Go ↔ Rust IPC Pipeline**: Unix sockets + MessagePack
|
||||
- ✅ **SeaweedFS Integration**: Mount client with RDMA acceleration
|
||||
- ✅ **Docker Orchestration**: Multi-service setup with proper networking
|
||||
- ✅ **Error Handling**: Robust fallback and recovery mechanisms
|
||||
- ✅ **Performance Optimizations**: Zero-copy page cache + connection pooling
|
||||
- ✅ **Code Quality**: All GitHub PR review comments addressed
|
||||
- ✅ **Testing Framework**: Integration tests and benchmarking tools
|
||||
|
||||
### **Phase 2: Mock Implementation - DONE**
|
||||
- ✅ **Mock RDMA Engine**: Complete Rust implementation for development
|
||||
- ✅ **Pattern Data Generation**: Predictable test data for validation
|
||||
- ✅ **Simulated Performance**: Realistic latency and throughput modeling
|
||||
- ✅ **Development Environment**: Full testing without hardware requirements
|
||||
|
||||
---
|
||||
|
||||
## 🚀 **PHASE 3: REAL RDMA IMPLEMENTATION**
|
||||
|
||||
### **3.1 Hardware Abstraction Layer** 🔴 **HIGH PRIORITY**
|
||||
|
||||
#### **Replace Mock RDMA Context**
|
||||
**File**: `rdma-engine/src/rdma.rs`
|
||||
**Current**:
|
||||
```rust
|
||||
RdmaContextImpl::Mock(MockRdmaContext::new(config).await?)
|
||||
```
|
||||
**TODO**:
|
||||
```rust
|
||||
// Enable UCX feature and implement
|
||||
RdmaContextImpl::Ucx(UcxRdmaContext::new(config).await?)
|
||||
```
|
||||
|
||||
**Tasks**:
|
||||
- [ ] Implement `UcxRdmaContext` struct
|
||||
- [ ] Add UCX FFI bindings for Rust
|
||||
- [ ] Handle UCX initialization and cleanup
|
||||
- [ ] Add feature flag: `real-ucx` vs `mock`
|
||||
|
||||
#### **Real Memory Management**
|
||||
**File**: `rdma-engine/src/rdma.rs` lines 245-270
|
||||
**Current**: Fake memory regions in vector
|
||||
**TODO**:
|
||||
- [ ] Integrate with UCX memory registration APIs
|
||||
- [ ] Implement HugePage support for large transfers
|
||||
- [ ] Add memory region caching for performance
|
||||
- [ ] Handle registration/deregistration errors
|
||||
|
||||
#### **Actual RDMA Operations**
|
||||
**File**: `rdma-engine/src/rdma.rs` lines 273-335
|
||||
**Current**: Pattern data + artificial latency
|
||||
**TODO**:
|
||||
- [ ] Replace `post_read()` with real UCX RDMA operations
|
||||
- [ ] Implement `post_write()` with actual memory transfers
|
||||
- [ ] Add completion polling from hardware queues
|
||||
- [ ] Handle partial transfers and retries
|
||||
|
||||
### **3.2 Data Path Replacement** 🟡 **MEDIUM PRIORITY**
|
||||
|
||||
#### **Real Data Transfer**
|
||||
**File**: `pkg/rdma/client.go` lines 420-442
|
||||
**Current**:
|
||||
```go
|
||||
// MOCK: Pattern generation
|
||||
mockData[i] = byte(i % 256)
|
||||
```
|
||||
**TODO**:
|
||||
```go
|
||||
// Get actual data from RDMA buffer
|
||||
realData := getRdmaBufferContents(startResp.LocalAddr, startResp.TransferSize)
|
||||
validateDataIntegrity(realData, completeResp.ServerCrc)
|
||||
```
|
||||
|
||||
**Tasks**:
|
||||
- [ ] Remove mock data generation
|
||||
- [ ] Access actual RDMA transferred data
|
||||
- [ ] Implement CRC validation: `completeResp.ServerCrc`
|
||||
- [ ] Add data integrity error handling
|
||||
|
||||
#### **Hardware Device Detection**
|
||||
**File**: `rdma-engine/src/rdma.rs` lines 222-233
|
||||
**Current**: Hardcoded Mellanox device info
|
||||
**TODO**:
|
||||
- [ ] Enumerate real RDMA devices using UCX
|
||||
- [ ] Query actual device capabilities
|
||||
- [ ] Handle multiple device scenarios
|
||||
- [ ] Add device selection logic
|
||||
|
||||
### **3.3 Performance Optimization** 🟢 **LOW PRIORITY**
|
||||
|
||||
#### **Memory Registration Caching**
|
||||
**TODO**:
|
||||
- [ ] Implement MR (Memory Region) cache
|
||||
- [ ] Add LRU eviction for memory pressure
|
||||
- [ ] Optimize for frequently accessed regions
|
||||
- [ ] Monitor cache hit rates
|
||||
|
||||
#### **Advanced RDMA Features**
|
||||
**TODO**:
|
||||
- [ ] Implement RDMA Write operations
|
||||
- [ ] Add Immediate Data support
|
||||
- [ ] Implement RDMA Write with Immediate
|
||||
- [ ] Add Atomic operations (if needed)
|
||||
|
||||
#### **Multi-Transport Support**
|
||||
**TODO**:
|
||||
- [ ] Leverage UCX's automatic transport selection
|
||||
- [ ] Add InfiniBand support
|
||||
- [ ] Add RoCE (RDMA over Converged Ethernet) support
|
||||
- [ ] Implement TCP fallback via UCX
|
||||
|
||||
---
|
||||
|
||||
## 🔧 **PHASE 4: PRODUCTION HARDENING**
|
||||
|
||||
### **4.1 Error Handling & Recovery**
|
||||
- [ ] Add RDMA-specific error codes
|
||||
- [ ] Implement connection recovery
|
||||
- [ ] Add retry logic for transient failures
|
||||
- [ ] Handle device hot-plug scenarios
|
||||
|
||||
### **4.2 Monitoring & Observability**
|
||||
- [ ] Add RDMA-specific metrics (bandwidth, latency, errors)
|
||||
- [ ] Implement tracing for RDMA operations
|
||||
- [ ] Add health checks for RDMA devices
|
||||
- [ ] Create performance dashboards
|
||||
|
||||
### **4.3 Configuration & Tuning**
|
||||
- [ ] Add RDMA-specific configuration options
|
||||
- [ ] Implement auto-tuning based on workload
|
||||
- [ ] Add support for multiple RDMA ports
|
||||
- [ ] Create deployment guides for different hardware
|
||||
|
||||
---
|
||||
|
||||
## 📋 **IMMEDIATE NEXT STEPS**
|
||||
|
||||
### **Step 1: UCX Integration Setup**
|
||||
1. **Add UCX dependencies to Rust**:
|
||||
```toml
|
||||
[dependencies]
|
||||
ucx-sys = "0.1" # UCX FFI bindings
|
||||
```
|
||||
|
||||
2. **Create UCX wrapper module**:
|
||||
```bash
|
||||
touch rdma-engine/src/ucx.rs
|
||||
```
|
||||
|
||||
3. **Implement basic UCX context**:
|
||||
```rust
|
||||
pub struct UcxRdmaContext {
|
||||
context: *mut ucx_sys::ucp_context_h,
|
||||
worker: *mut ucx_sys::ucp_worker_h,
|
||||
}
|
||||
```
|
||||
|
||||
### **Step 2: Development Environment**
|
||||
1. **Install UCX library**:
|
||||
```bash
|
||||
# Ubuntu/Debian
|
||||
sudo apt-get install libucx-dev
|
||||
|
||||
# CentOS/RHEL
|
||||
sudo yum install ucx-devel
|
||||
```
|
||||
|
||||
2. **Update Cargo.toml features**:
|
||||
```toml
|
||||
[features]
|
||||
default = ["mock"]
|
||||
mock = []
|
||||
real-ucx = ["ucx-sys"]
|
||||
```
|
||||
|
||||
### **Step 3: Testing Strategy**
|
||||
1. **Add hardware detection tests**
|
||||
2. **Create UCX initialization tests**
|
||||
3. **Implement gradual feature migration**
|
||||
4. **Maintain mock fallback for CI/CD**
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ **ARCHITECTURE NOTES**
|
||||
|
||||
### **Current Working Components**
|
||||
- ✅ **Go Sidecar**: Production-ready HTTP API
|
||||
- ✅ **IPC Layer**: Robust Unix socket + MessagePack
|
||||
- ✅ **SeaweedFS Integration**: Complete mount client integration
|
||||
- ✅ **Docker Setup**: Multi-service orchestration
|
||||
- ✅ **Error Handling**: Comprehensive fallback mechanisms
|
||||
|
||||
### **Mock vs Real Boundary**
|
||||
```
|
||||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||||
│ SeaweedFS │────▶│ Go Sidecar │────▶│ Rust Engine │
|
||||
│ (REAL) │ │ (REAL) │ │ (MOCK) │
|
||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────────┐
|
||||
│ RDMA Hardware │
|
||||
│ (TO IMPLEMENT) │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
||||
### **Performance Expectations**
|
||||
- **Current Mock**: ~403 ops/sec, 2.48ms latency
|
||||
- **Target Real**: ~4000 ops/sec, 250μs latency (UCX optimized)
|
||||
- **Bandwidth Goal**: 25-100 Gbps (depending on hardware)
|
||||
|
||||
---
|
||||
|
||||
## 📚 **REFERENCE MATERIALS**
|
||||
|
||||
### **UCX Documentation**
|
||||
- **GitHub**: https://github.com/openucx/ucx
|
||||
- **API Reference**: https://openucx.readthedocs.io/
|
||||
- **Rust Bindings**: https://crates.io/crates/ucx-sys
|
||||
|
||||
### **RDMA Programming**
|
||||
- **InfiniBand Architecture**: Volume 1 Specification
|
||||
- **RoCE Standards**: IBTA Annex A17
|
||||
- **Performance Tuning**: UCX Performance Guide
|
||||
|
||||
### **SeaweedFS Integration**
|
||||
- **File ID Format**: `weed/storage/needle/file_id.go`
|
||||
- **Volume Server**: `weed/server/volume_server_handlers_read.go`
|
||||
- **Mount Client**: `weed/mount/filehandle_read.go`
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ **IMPORTANT NOTES**
|
||||
|
||||
### **Breaking Changes to Avoid**
|
||||
- **Keep IPC Protocol Stable**: Don't change MessagePack format
|
||||
- **Maintain HTTP API**: Existing endpoints must remain compatible
|
||||
- **Preserve Configuration**: Environment variables should work unchanged
|
||||
|
||||
### **Testing Requirements**
|
||||
- **Hardware Tests**: Require actual RDMA NICs
|
||||
- **CI/CD Compatibility**: Must fallback to mock for automated testing
|
||||
- **Performance Benchmarks**: Compare mock vs real performance
|
||||
|
||||
### **Security Considerations**
|
||||
- **Memory Protection**: Ensure RDMA regions are properly isolated
|
||||
- **Access Control**: Validate remote memory access permissions
|
||||
- **Data Validation**: Always verify CRC checksums
|
||||
|
||||
---
|
||||
|
||||
## 🎯 **SUCCESS CRITERIA**
|
||||
|
||||
### **Phase 3 Complete When**:
|
||||
- [ ] Real RDMA data transfers working
|
||||
- [ ] Hardware device detection functional
|
||||
- [ ] Performance exceeds mock implementation
|
||||
- [ ] All integration tests passing with real hardware
|
||||
|
||||
### **Phase 4 Complete When**:
|
||||
- [ ] Production deployment successful
|
||||
- [ ] Monitoring and alerting operational
|
||||
- [ ] Performance targets achieved
|
||||
- [ ] Error handling validated under load
|
||||
|
||||
---
|
||||
|
||||
**📅 Last Updated**: December 2024
|
||||
**👤 Contact**: Resume from `seaweedfs-rdma-sidecar/` directory
|
||||
**🏷️ Version**: v1.0 (Mock Implementation Complete)
|
||||
|
||||
**🚀 Ready to resume**: All infrastructure is in place, just need to replace the mock RDMA layer with UCX integration!
|
||||
@@ -1,205 +0,0 @@
|
||||
# SeaweedFS RDMA Sidecar Makefile
|
||||
|
||||
.PHONY: help build test clean docker-build docker-test docker-clean integration-test
|
||||
|
||||
# Default target
|
||||
help: ## Show this help message
|
||||
@echo "SeaweedFS RDMA Sidecar - Available Commands:"
|
||||
@echo ""
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
@echo ""
|
||||
@echo "Examples:"
|
||||
@echo " make build # Build all components locally"
|
||||
@echo " make docker-test # Run complete Docker integration tests"
|
||||
@echo " make test # Run unit tests"
|
||||
|
||||
# Local Build Targets
|
||||
build: build-go build-rust ## Build all components locally
|
||||
|
||||
build-go: ## Build Go components (sidecar, demo-server, test-rdma)
|
||||
@echo "🔨 Building Go components..."
|
||||
go build -o bin/sidecar ./cmd/sidecar
|
||||
go build -o bin/demo-server ./cmd/demo-server
|
||||
go build -o bin/test-rdma ./cmd/test-rdma
|
||||
@echo "✅ Go build complete"
|
||||
|
||||
build-rust: ## Build Rust RDMA engine
|
||||
@echo "🦀 Building Rust RDMA engine..."
|
||||
cd rdma-engine && cargo build --release
|
||||
@echo "✅ Rust build complete"
|
||||
|
||||
# Testing Targets
|
||||
test: test-go test-rust ## Run all unit tests
|
||||
|
||||
test-go: ## Run Go tests
|
||||
@echo "🧪 Running Go tests..."
|
||||
go test ./...
|
||||
@echo "✅ Go tests complete"
|
||||
|
||||
test-rust: ## Run Rust tests
|
||||
@echo "🧪 Running Rust tests..."
|
||||
cd rdma-engine && cargo test
|
||||
@echo "✅ Rust tests complete"
|
||||
|
||||
integration-test: build ## Run local integration test
|
||||
@echo "🔗 Running local integration test..."
|
||||
./scripts/demo-e2e.sh
|
||||
@echo "✅ Local integration test complete"
|
||||
|
||||
# Docker Targets
|
||||
docker-build: ## Build all Docker images
|
||||
@echo "🐳 Building Docker images..."
|
||||
docker-compose build
|
||||
@echo "✅ Docker images built"
|
||||
|
||||
docker-start: ## Start Docker services
|
||||
@echo "🚀 Starting Docker services..."
|
||||
./tests/docker-test-helper.sh start
|
||||
@echo "✅ Docker services started"
|
||||
|
||||
docker-test: ## Run Docker integration tests
|
||||
@echo "🧪 Running Docker integration tests..."
|
||||
./tests/docker-test-helper.sh test
|
||||
@echo "✅ Docker integration tests complete"
|
||||
|
||||
docker-stop: ## Stop Docker services
|
||||
@echo "🛑 Stopping Docker services..."
|
||||
./tests/docker-test-helper.sh stop
|
||||
@echo "✅ Docker services stopped"
|
||||
|
||||
docker-clean: ## Clean Docker services and volumes
|
||||
@echo "🧹 Cleaning Docker environment..."
|
||||
./tests/docker-test-helper.sh clean
|
||||
docker system prune -f
|
||||
@echo "✅ Docker cleanup complete"
|
||||
|
||||
docker-logs: ## Show Docker logs
|
||||
./tests/docker-test-helper.sh logs
|
||||
|
||||
docker-status: ## Show Docker service status
|
||||
./tests/docker-test-helper.sh status
|
||||
|
||||
docker-shell: ## Open interactive shell in test container
|
||||
./tests/docker-test-helper.sh shell
|
||||
|
||||
# RDMA Simulation Targets
|
||||
rdma-sim-build: ## Build RDMA simulation environment
|
||||
@echo "🚀 Building RDMA simulation environment..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml build
|
||||
@echo "✅ RDMA simulation images built"
|
||||
|
||||
rdma-sim-start: ## Start RDMA simulation environment
|
||||
@echo "🚀 Starting RDMA simulation environment..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml up -d
|
||||
@echo "✅ RDMA simulation environment started"
|
||||
|
||||
rdma-sim-test: ## Run RDMA simulation tests
|
||||
@echo "🧪 Running RDMA simulation tests..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml run --rm integration-tests-rdma
|
||||
@echo "✅ RDMA simulation tests complete"
|
||||
|
||||
rdma-sim-stop: ## Stop RDMA simulation environment
|
||||
@echo "🛑 Stopping RDMA simulation environment..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml down
|
||||
@echo "✅ RDMA simulation environment stopped"
|
||||
|
||||
rdma-sim-clean: ## Clean RDMA simulation environment
|
||||
@echo "🧹 Cleaning RDMA simulation environment..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml down -v --remove-orphans
|
||||
docker system prune -f
|
||||
@echo "✅ RDMA simulation cleanup complete"
|
||||
|
||||
rdma-sim-status: ## Check RDMA simulation status
|
||||
@echo "📊 RDMA simulation status:"
|
||||
docker-compose -f docker-compose.rdma-sim.yml ps
|
||||
@echo ""
|
||||
@echo "🔍 RDMA device status:"
|
||||
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /opt/rdma-sim/test-rdma.sh || true
|
||||
|
||||
rdma-sim-shell: ## Open shell in RDMA simulation container
|
||||
@echo "🐚 Opening RDMA simulation shell..."
|
||||
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /bin/bash
|
||||
|
||||
rdma-sim-logs: ## Show RDMA simulation logs
|
||||
docker-compose -f docker-compose.rdma-sim.yml logs
|
||||
|
||||
rdma-sim-ucx: ## Show UCX information in simulation
|
||||
@echo "📋 UCX information in simulation:"
|
||||
docker-compose -f docker-compose.rdma-sim.yml exec rdma-simulation /opt/rdma-sim/ucx-info.sh
|
||||
|
||||
# Development Targets
|
||||
dev-setup: ## Set up development environment
|
||||
@echo "🛠️ Setting up development environment..."
|
||||
go mod tidy
|
||||
cd rdma-engine && cargo check
|
||||
chmod +x scripts/*.sh tests/*.sh
|
||||
@echo "✅ Development environment ready"
|
||||
|
||||
format: ## Format code
|
||||
@echo "✨ Formatting code..."
|
||||
go fmt ./...
|
||||
cd rdma-engine && cargo fmt
|
||||
@echo "✅ Code formatted"
|
||||
|
||||
lint: ## Run linters
|
||||
@echo "🔍 Running linters..."
|
||||
go vet ./...
|
||||
cd rdma-engine && cargo clippy -- -D warnings
|
||||
@echo "✅ Linting complete"
|
||||
|
||||
# Cleanup Targets
|
||||
clean: clean-go clean-rust ## Clean all build artifacts
|
||||
|
||||
clean-go: ## Clean Go build artifacts
|
||||
@echo "🧹 Cleaning Go artifacts..."
|
||||
rm -rf bin/
|
||||
go clean -testcache
|
||||
@echo "✅ Go artifacts cleaned"
|
||||
|
||||
clean-rust: ## Clean Rust build artifacts
|
||||
@echo "🧹 Cleaning Rust artifacts..."
|
||||
cd rdma-engine && cargo clean
|
||||
@echo "✅ Rust artifacts cleaned"
|
||||
|
||||
# Full Workflow Targets
|
||||
check: format lint test ## Format, lint, and test everything
|
||||
|
||||
ci: check integration-test docker-test ## Complete CI workflow
|
||||
|
||||
demo: build ## Run local demo
|
||||
@echo "🎮 Starting local demo..."
|
||||
./scripts/demo-e2e.sh
|
||||
|
||||
# Docker Development Workflow
|
||||
docker-dev: docker-clean docker-build docker-test ## Complete Docker development cycle
|
||||
|
||||
# Quick targets
|
||||
quick-test: build ## Quick local test
|
||||
./bin/test-rdma --help
|
||||
|
||||
quick-docker: ## Quick Docker test
|
||||
docker-compose up -d rdma-engine rdma-sidecar
|
||||
sleep 5
|
||||
curl -s http://localhost:8081/health | jq '.'
|
||||
docker-compose down
|
||||
|
||||
# Help and Documentation
|
||||
docs: ## Generate/update documentation
|
||||
@echo "📚 Documentation ready:"
|
||||
@echo " README.md - Main project documentation"
|
||||
@echo " DOCKER-TESTING.md - Docker integration testing guide"
|
||||
@echo " Use 'make help' for available commands"
|
||||
|
||||
# Environment Info
|
||||
info: ## Show environment information
|
||||
@echo "🔍 Environment Information:"
|
||||
@echo " Go Version: $$(go version)"
|
||||
@echo " Rust Version: $$(cd rdma-engine && cargo --version)"
|
||||
@echo " Docker Version: $$(docker --version)"
|
||||
@echo " Docker Compose Version: $$(docker-compose --version)"
|
||||
@echo ""
|
||||
@echo "🏗️ Project Structure:"
|
||||
@echo " Go Components: cmd/ pkg/"
|
||||
@echo " Rust Engine: rdma-engine/"
|
||||
@echo " Tests: tests/"
|
||||
@echo " Scripts: scripts/"
|
||||
Loaded 100 of 576 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user