Files
seaweedfs/docker/s3vectors/README.md
T
Chris LuandClaude Opus 5.5 13d9f3b104 mini: run weed-vector and weed-worker by default, continuing without either if missing (#13207)
* mini: start weed-worker with the vector engine

With -vector, mini now also starts weed-worker, the Lance maintenance
worker that builds vector and metadata indexes, finding it the way it
finds weed-vector: beside weed, then on PATH. -vector.worker=false leaves
it out and -vector.worker.binary names another binary.

The Lance Namespace trusts the worker only by a token derived from
jwt.filer_signing.key. A cluster with that key hands it to the worker
through security.toml as before. Without one, mini makes a key for the
run, gives it to the worker in its environment, and lets the namespace
accept it while no cluster key is set. The filer and the other services
are unaffected, so unauthenticated filer writes keep working.

* mini: run the vector engine by default, without failing when it is missing

-vector now defaults to true, so a plain weed mini starts weed-vector and
weed-worker whenever they are installed. Both binaries are looked up
before ports are reserved; one that is not found is logged and left out,
and mini runs without it. A vector engine that fails to start is logged
the same way instead of shutting mini down. -vector=false still leaves
vector search out.

* mini: clear the vector state a previous in-process run prepared

prepareMiniVector returned early without clearing the paths and key an
earlier run in the same process had set, so a rerun with
-vector.worker=false still started that run's weed-worker.

* mini: pass the [grpc.worker] certificates to weed-worker

weed-worker takes its admin TLS only from --tls-ca, --tls-cert and
--tls-key, not from security.toml, so behind an admin secured with
[grpc.admin] the worker mini started dialed in plaintext and never
connected. Mini now passes the certificates its Go workers dial admin
with, chosen as security.LoadClientTLS chooses them.

* mini: find weed-worker without new flags

Drop -vector.worker and -vector.worker.binary. weed-worker is looked up
beside weed, then beside the weed-vector mini starts (so an explicit
-vector.binary also locates it), then on PATH; -vector=false leaves both
out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docker/s3vectors: keep mini from starting a second engine and worker

The demo runs weed-vector and weed-worker in their own containers. With
-vector on by default, mini in an image that ships both binaries would
start another engine and worker beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* mini: look for weed-worker beside a relative -vector.binary

filepath.Join drops the "." of ./weed-vector, so the sibling candidate
became a bare name and LookPath searched PATH instead. Resolve the
directory first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:58:00 -08:00

2.1 KiB

Vector buckets locally

Run on Linux containers (amd64 or arm64):

docker compose up -d
export AWS_ACCESS_KEY_ID=vector-demo
export AWS_SECRET_ACCESS_KEY=vector-demo-secret
export AWS_DEFAULT_REGION=us-east-1
aws --endpoint-url http://localhost:8333 s3vectors create-index \
  --vector-bucket-name embeddings --index-name images \
  --data-type float32 --dimension 3 --distance-metric cosine
aws --endpoint-url http://localhost:8333 s3vectors put-vectors \
  --vector-bucket-name embeddings --index-name images \
  --vectors '[{"key":"first","data":{"float32":[1,0,0]}}]'
aws --endpoint-url http://localhost:8333 s3vectors query-vectors \
  --vector-bucket-name embeddings --index-name images \
  --query-vector '{"float32":[1,0,0]}' --top-k 1

The engine registers with the master. Wait for that registration before creating an index. The Lance worker builds and refreshes ANN indexes as data grows; queries can scan data before an ANN index is built. The demo's admin UI is at http://localhost:12535 (user admin, password vector-demo). Demo credentials and plaintext cluster connections are for this local example. Production settings are in the Helm/operator TLS and authentication documentation.

docker compose down preserves the named data volume. Add -v to discard it. Override SEAWEEDFS_IMAGE to test a newer image. With metrics-enabled engines, append --metrics-port=9329 --metrics-ip=0.0.0.0 to the vector command and scrape vector:9329/metrics inside the Compose network.

A native development setup can use weed mini -vectorBucket=embeddings. Mini starts weed-vector and the weed-worker maintenance worker when it finds them beside weed or on PATH, and logs and continues without one it cannot find. -vector.binary selects an explicit engine binary, and weed-worker is also looked up beside it. -vector=false leaves both out, and -vector.metricsPort=9329 enables HTTP readiness and metrics on a compatible engine. The children inherit the cluster's configuration directory and stop with mini. weed shell provides s3vectors -operation <Operation> -file request.json for the same API operations using trusted cluster credentials.