Skip to content

feat: run SeaweedFS admin and worker instance#4259

Open
aldy505 wants to merge 2 commits intomasterfrom
aldy505/feat/run-seaweedfs-admin-worker
Open

feat: run SeaweedFS admin and worker instance#4259
aldy505 wants to merge 2 commits intomasterfrom
aldy505/feat/run-seaweedfs-admin-worker

Conversation

@aldy505
Copy link
Copy Markdown
Collaborator

@aldy505 aldy505 commented Apr 2, 2026

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

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
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Changelog Preview

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Run SeaweedFS admin and worker instance by aldy505 in #4259
  • Support custom CA certificates for all containers by aldy505 in #4216
  • Remove 'vroom-cleanup' container by aldy505 in #4217

Bug Fixes 🐛

  • (install) Gracefully handle missing containers in minimize-downtime by shameemkpofficial-git in #4246
  • Use default buildx builder to resolve local images during build by maiqigh in #4250

Internal Changes 🔧

Deps

  • Bump getsentry/craft from 2.23.2 to 2.24.1 by dependabot in #4221
  • Bump astral-sh/setup-uv from 7.2.1 to 7.5.0 by dependabot in #4220

Other

  • Restore unpinned actions by aldy505 in #4243
  • Swap pre-commit with prek by aldy505 in #4235

Other

  • Bump postgres 14.22-bookworm by aminvakil in #4249

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: New services missing depends_on for startup ordering
    • Added depends_on so seaweedfs-admin waits for healthy seaweedfs and seaweedfs-worker waits for started seaweedfs-admin.
  • ✅ Fixed: Worker flag -jobType likely incorrect, should be -capabilities
    • Replaced -jobType=all with the valid -capabilities=vacuum,ec,remote,replication,balance worker flag configuration.

Create PR

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

@aminvakil aminvakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aldy505
Copy link
Copy Markdown
Collaborator Author

aldy505 commented Apr 3, 2026

What is the necessity of adding seaweedfs admin?

The worker (responsible for vacuum/cleanup) depends on master, it cannot connect directly into master/filer/volume. The weed server we've been using does not spawn both admin and worker.

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.

Well, I would argue the "work in progress" part is the UI, not the functionality.

Copy link
Copy Markdown
Collaborator

@aminvakil aminvakil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misread the worker section, you're right.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

SeaweedFS Storage Space Issue - Large Volume Usage

2 participants