feat: run SeaweedFS admin and worker instance#4259
Conversation
Cleanup using the 'worker' service weren't running on the default setup with 'server' mode. This PR adds both admin and worker to solve that. Fixes #4106
Changelog Preview📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Deps
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: New services missing
depends_onfor startup ordering- Added
depends_onsoseaweedfs-adminwaits for healthyseaweedfsandseaweedfs-workerwaits for startedseaweedfs-admin.
- Added
- ✅ Fixed: Worker flag
-jobTypelikely incorrect, should be-capabilities- Replaced
-jobType=allwith the valid-capabilities=vacuum,ec,remote,replication,balanceworker flag configuration.
- Replaced
Or push these changes by commenting:
@cursor push 870ac31000
Preview (870ac31000)
diff --git a/docker-compose.yml b/docker-compose.yml
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -295,6 +295,9 @@
seaweedfs-admin:
<<: *restart_policy
image: "chrislusf/seaweedfs:4.17_large_disk"
+ depends_on:
+ seaweedfs:
+ <<: *depends_on-healthy
entrypoint: "weed"
command: >-
admin
@@ -303,11 +306,14 @@
seaweedfs-worker:
<<: *restart_policy
image: "chrislusf/seaweedfs:4.17_large_disk"
+ depends_on:
+ seaweedfs-admin:
+ <<: *depends_on-default
entrypoint: "weed"
command: >-
worker
-admin=seaweedfs-admin:23646
- -jobType=all
+ -capabilities=vacuum,ec,remote,replication,balance
snuba-api:
<<: *snuba_defaults
healthcheck:This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| command: >- | ||
| worker | ||
| -admin=seaweedfs-admin:23646 | ||
| -jobType=all |
There was a problem hiding this comment.
Worker flag -jobType likely incorrect, should be -capabilities
High Severity
The seaweedfs-worker service uses -jobType=all, but all SeaweedFS documentation and issue trackers reference -capabilities as the correct flag for the weed worker command (accepting values like "vacuum,ec,balance"). If -jobType is an unrecognized flag, the Go binary will exit immediately on startup and the container will crash-loop, meaning cleanup tasks (the entire purpose of this PR) will never run.
There was a problem hiding this comment.
It is the correct flag. See the help command:
$ docker run chrislusf/seaweedfs:4.17_large_disk worker --help
Example: weed worker -admin=<admin_server> [-id=<worker_id>] [-jobType=all] [-workingDir=<path>] [-heartbeat=15s] [-reconnect=5s] [-maxDetect=1] [-maxExecute=4] [-metricsPort=<port>] [-metricsIp=<ip>] [-debug]
Default Usage:
-address string
worker address advertised to admin
-admin string
admin server address (default "localhost:23646")
-debug
serves runtime profiling data via pprof on the port specified by -debug.port
-debug.port int
http port for debugging (default 6060)
-heartbeat duration
heartbeat interval (default 15s)
-id string
worker ID (auto-generated when empty)
-jobType string
job types or categories to serve: all, default, heavy, or explicit names/aliases such as ec, balance, iceberg (comma-separated) (default "all")
-maxDetect int
max concurrent detection requests (default 1)
-maxExecute int
max concurrent execute requests (default 4)
-metricsIp string
Prometheus metrics listen IP (default "0.0.0.0")
-metricsPort int
Prometheus metrics listen port
-options string
a file of command line options, each line in optionName=optionValue format
-reconnect duration
reconnect delay (default 5s)
-workingDir string
working directory for persistent worker state
Description:
Start an external plugin worker using weed/pb/plugin.proto over gRPC.
This command provides plugin job type handlers for cluster maintenance,
including descriptor delivery, heartbeat/load reporting, detection, and execution.
Behavior:
- Use -jobType to choose handlers by category or explicit name (comma-separated)
- Categories: "all" (every registered handler), "default" (lightweight jobs),
"heavy" (resource-intensive jobs like erasure coding)
- Explicit job type names and aliases are still supported (e.g. "vacuum", "ec")
- Categories and explicit names can be mixed (e.g. "default,iceberg")
- Use -workingDir to persist worker.id for stable worker identity across restarts
- Use -metricsPort/-metricsIp to expose /health, /ready, and /metrics
Examples:
weed worker -admin=localhost:23646
weed worker -admin=localhost:23646 -jobType=all
weed worker -admin=localhost:23646 -jobType=default
weed worker -admin=localhost:23646 -jobType=heavy
weed worker -admin=localhost:23646 -jobType=default,iceberg
weed worker -admin=localhost:23646 -jobType=vacuum,volume_balance
weed worker -admin=localhost:23646 -jobType=erasure_coding
weed worker -admin=admin.example.com:23646 -id=plugin-vacuum-a -heartbeat=10s
weed worker -admin=localhost:23646 -workingDir=/var/lib/seaweedfs-plugin
weed worker -admin=localhost:23646 -metricsPort=9327 -metricsIp=0.0.0.0
aminvakil
left a comment
There was a problem hiding this comment.
What is the necessity of adding seaweedfs admin?
Also I'm seeing this from : https://github.com/seaweedfs/seaweedfs/wiki/Admin-UI
This is still work in progress. Some features work, some not. Everything is subject to change.
The worker (responsible for vacuum/cleanup) depends on master, it cannot connect directly into master/filer/volume. The
Well, I would argue the "work in progress" part is the UI, not the functionality. |
aminvakil
left a comment
There was a problem hiding this comment.
Sorry, I misread the worker section, you're right.
LGTM



Cleanup using the 'worker' service weren't running on the default setup with 'server' mode. This PR adds both admin and worker to solve that.
Fixes #4106