mirror of
https://github.com/hanzoai/s3-csi.git
synced 2026-09-30 23:52:32 +00:00
* fix(docker): clone the fork that exists, at a commit that exists
The s3-mount image has never built. A global rename turned the upstream
seaweedfs reference into `github.com/s3/s3`, which is not a repository, so the
build died on `git clone ... exit code 128` before compiling anything.
Three more things were wrong behind it, each of which would have failed the next
step in turn:
clone github.com/s3/s3 -> github.com/hanzoai/s3
path /go/src/github.com/s3/s3 -> /go/src/github.com/hanzoai/s3
dir cd weed -> cd s3 (the fork renamed it)
commit 19ce7c0b6fdb -> 6dda4e4d6bca
That commit is the real one. 19ce7c0b6fdb is an UPSTREAM seaweedfs hash and does
not exist in our fork — the API 422s on it — so the checkout could never have
succeeded even with the URL fixed. The ARG stays so a build can still pin.
SEAWEEDFS_COMMIT is renamed S3_COMMIT while we are here; nothing consumed it yet.
* chore: no seaweed, no weed — it is s3
369 occurrences across 33 files, plus nine files whose names carried it. All of
it gone: manifests, helm chart, nomad jobs, workflows, docs and code.
Two of these were not cosmetic.
The driver spawned a binary called "weed":
DefaultWeedBinary = "weed"
Our fork builds it as `s3` — the running filer pod has /usr/bin/s3 and no weed
at all — so every mount would have failed with an executable that is not there,
however well the image built.
And the crash-recovery integration test killed processes matching `pgrep -x
weed`. Nothing is named that any more, so it would have found no pids, killed
nothing, and passed while testing exactly nothing. It now matches `s3`. The test
already had a guard that fails when there is nothing to kill, which is the only
reason this would have been noticed at all.
The rest follows the same rename the Dockerfile got: SEAWEEDFS_COMMIT is
S3_COMMIT, and the release/sync workflows that patch that ARG were updated with
it or they would silently stop pinning anything.
No upstream import paths were touched — go.mod depends on github.com/hanzoai/s3,
not on anything upstream, so nothing here was load-bearing for the build.
Verified: go build clean, all three test packages pass.
---------
Co-authored-by: hanzo-dev <[email protected]>
Co-authored-by: Hanzo Dev <[email protected]>
S3 CSI-Driver Docker Plugin
This Docker plugin integrates the S3 CSI-Driver with Docker. It allows you to use S3 as a volume driver in Docker environments.
Environment Variables
| Variable | Description |
|---|---|
FILER |
Filer endpoint(s), format: <IP1>:<PORT>,<IP2>:<PORT2> |
CACHE_SIZE |
The size of the cache to use in MB. Default: 256MB |
CACHE_DIR |
The cache directory. |
C_WRITER |
Limit concurrent goroutine writers if not 0. Default 32 |
DATACENTER |
Data center this node is running in (locality-definition). Default: DefaultDataCenter |
UID_MAP |
Map local UID to UID on filer, comma-separated <local_uid>:<filer_uid> |
GID_MAP |
Map local GID to GID on filer, comma-separated <local_gid>:<filer_gid> |
Mounts
| Mount Destination | Source Path | Description |
|---|---|---|
/node_hostname |
/etc/hostname |
Used to get the nodename |
/tmp |
/tmp |
Used for caching |
Usage
docker plugin install --disable --alias s3-csi:swarm --grant-all-permissions gradlon/swarm-csi-swas3fs:v1.2.0
docker plugin set s3-csi:swarm FILER=<IP>:8888,<IP>:8888
docker plugin set s3-csi:swarm CACHE_SIZE=512
docker plugin enable s3-csi:swarm
docker volume create --driver s3-csi:swarm --availability active --scope single --sharing none --type mount --opt path="/docker/volumes/teste1" test-volume
docker volume create \
--driver s3-csi:swarm \
--availability active \
--scope multi \
--sharing all \
--type mount \
testVolume
docker service create --name testService --mount type=cluster,src=testVolume,dst=/usr/share/nginx/html --publish 2080:80 nginx
Build Guide
Follow these steps to build the S3 CSI-Driver Docker plugin:
#!/bin/bash
USAGE="Usage: ./build.sh [PREFIX] [VERSION] [TAG] [PLUGIN_NAME] [ARCH]"
if [[ "$1" == "-h" ]]; then
echo "$USAGE"
exit 0
fi
VERSION=${2:-latest}
ARCH=${5:-linux/amd64}
PLUGIN_NAME=${4:-swarm-csi-swas3fs}
PLUGIN_TAG=${3:-v1.2.0}
PREFIX=${1:-gradlon}
docker build --platform ${ARCH} --build-arg BASE_IMAGE=chrislusf/s3-csi-driver:${VERSION} --build-arg ARCH=$ARCH -t seawadd-csi_tmp_img .
mkdir -p ./plugin/rootfs
cp config.json ./plugin/
docker container create --name seawadd-csi_tmp seawadd-csi_tmp_img
docker container export seawadd-csi_tmp | tar -x -C ./plugin/rootfs
docker container rm -vf seawadd-csi_tmp
docker image rm seawadd-csi_tmp_img
docker plugin disable ${PREFIX}/swarm-csi-swas3fs:v1.2.0
docker plugin rm ${PREFIX}/${PLUGIN_NAME}:${PLUGIN_TAG} 2> /dev/null || true
docker plugin create ${PREFIX}/${PLUGIN_NAME}:${PLUGIN_TAG} ./plugin
docker plugin push ${PREFIX}/${PLUGIN_NAME}:${PLUGIN_TAG}
rm -rf ./plugin/
Volumes are store in the "/buckets" folder on the S3 server.