mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 19:17:28 +01:00
Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f400a0c696 | ||
|
|
a957802c6d | ||
|
|
19b51cec32 | ||
|
|
916bba2609 | ||
|
|
8b783a3933 | ||
|
|
fb3a41f224 | ||
|
|
f1eac773cc | ||
|
|
15e7aecdaa | ||
|
|
bf02a57bf2 | ||
|
|
f697808439 | ||
|
|
8ce51ce629 | ||
|
|
7144c3c5cf | ||
|
|
1fb0d8d53f |
No files matched your search
@@ -22,5 +22,3 @@ ignore-regex = \b[a-z]+[A-Z]\w*\b|\b[A-Z][a-z]+[A-Z]\w*\b
|
||||
# sme: local variable for a *streamMutateError in mount tests
|
||||
# nin: AWS S3 Vectors "$nin" filter operator literal (API-defined, cannot rename)
|
||||
ignore-words-list = visibles,fo,te,ser,bject,unparseable,keep-alives,tread,anc,ue,auther,thirdparty,unknwon,atleast,sme,nin
|
||||
# poligon: Yandex Disk API sandbox URL path (https://yandex.ru/dev/disk/poligon/)
|
||||
uri-ignore-words-list = poligon
|
||||
@@ -16,7 +16,6 @@ runs:
|
||||
if: inputs.target == 'x86_64-unknown-linux-musl'
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y musl-tools
|
||||
# C deps (aws-lc-sys) must compile against musl headers, not the host
|
||||
# gcc's glibc headers — glibc's C23 redirects (__isoc23_sscanf,
|
||||
@@ -27,7 +26,6 @@ runs:
|
||||
if: inputs.target == 'aarch64-unknown-linux-musl'
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu
|
||||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
|
||||
# Disable glibc fortify source — its __memcpy_chk etc. symbols don't exist in musl
|
||||
|
||||
@@ -28,9 +28,7 @@ runs:
|
||||
# Cosign 3 also defaults to --use-signing-config, which insists on a
|
||||
# bundle for its output; turning it off falls back to the default
|
||||
# Fulcio and Rekor URLs, which is all the .sig layout ever used.
|
||||
# --recursive signs every platform manifest in every registry, which
|
||||
# outlasts the 3m default timeout when Fulcio or Rekor is slow.
|
||||
cosign sign --yes --recursive --timeout 15m \
|
||||
cosign sign --yes --recursive \
|
||||
--new-bundle-format=false --use-signing-config=false \
|
||||
$IMAGES
|
||||
|
||||
|
||||
@@ -22,16 +22,6 @@ CHART = ROOT / "k8s/charts/seaweedfs"
|
||||
SECTIONS = ("jwt.signing", "jwt.signing.read", "jwt.filer_signing", "jwt.filer_signing.read")
|
||||
KEYS = {section: f"active-{index}" for index, section in enumerate(SECTIONS)}
|
||||
ESCAPED_HEADER = '["jw\\u0074".signing]\nkey = "existing"'
|
||||
# No workload is needed to exercise Helm's real lookup and update.
|
||||
RELEASE_SETTINGS = (
|
||||
"master.enabled=false", "volume.enabled=false", "filer.enabled=false",
|
||||
"global.seaweedfs.createClusterRole=false",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.volumeWrite=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.volumeRead=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.filerWrite=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.filerRead=true",
|
||||
)
|
||||
CONFIGMAP_CHART = ("seaweedfs", "--repo", "https://seaweedfs.github.io/seaweedfs/helm", "--version", "4.54.0")
|
||||
|
||||
|
||||
def run(*args):
|
||||
@@ -87,7 +77,8 @@ def fixtures():
|
||||
|
||||
|
||||
def check_generated(value):
|
||||
assert len(value) == 64 and value.isascii() and value.isalnum(), "invalid generated JWT key"
|
||||
decoded = base64.b64decode(value, validate=True).decode("ascii")
|
||||
assert len(decoded) == 10 and decoded.isascii() and decoded.isalnum(), "invalid generated JWT key"
|
||||
|
||||
|
||||
def check_helpers(helm, reference_helm):
|
||||
@@ -156,11 +147,20 @@ def check_upgrades(helm, context):
|
||||
legacy = "seaweedfs-security-config"
|
||||
kubectl = ["kubectl", "--context", context, "-n", namespace]
|
||||
release_args = ["jk", str(CHART), "--kube-context", context, "-n", namespace]
|
||||
for setting in RELEASE_SETTINGS:
|
||||
# No workload is needed to exercise Helm's real ConfigMap lookup and update.
|
||||
for setting in (
|
||||
"master.enabled=false", "volume.enabled=false", "filer.enabled=false",
|
||||
"global.seaweedfs.createClusterRole=false",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.volumeWrite=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.volumeRead=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.filerWrite=true",
|
||||
"global.seaweedfs.securityConfig.jwtSigning.filerRead=true",
|
||||
):
|
||||
release_args += ["--set", setting]
|
||||
|
||||
def stored():
|
||||
return secret_keys(kubectl, current)
|
||||
cm = json.loads(run(*kubectl, "get", "configmap", current, "-o", "json"))
|
||||
return keys(cm["data"]["security.toml"])
|
||||
|
||||
def upgrade():
|
||||
run(helm, "upgrade", *release_args)
|
||||
@@ -168,8 +168,8 @@ def check_upgrades(helm, context):
|
||||
|
||||
def patch(raw):
|
||||
# Seed previous-release content without taking Helm 4's SSA ownership.
|
||||
run(*kubectl, "patch", "secret", current, "--type=merge", "--field-manager=helm", "-p",
|
||||
json.dumps({"stringData": {"security.toml": raw}}))
|
||||
run(*kubectl, "patch", "configmap", current, "--type=merge", "--field-manager=helm", "-p",
|
||||
json.dumps({"data": {"security.toml": raw}}))
|
||||
|
||||
run(*kubectl, "create", "namespace", namespace)
|
||||
try:
|
||||
@@ -194,24 +194,17 @@ def check_upgrades(helm, context):
|
||||
assert upgrade() == actual, f"{name}: subsequent upgrade changed a key"
|
||||
print(f"PASS upgrade: {name}")
|
||||
|
||||
# Migration from the ConfigMaps of earlier chart versions, then precedence of the Secret.
|
||||
configmap_raw = "\n".join(f'[{section}]\nkey = "configmap-{index}"'
|
||||
for index, section in enumerate(SECTIONS))
|
||||
run(*kubectl, "create", "configmap", current, "--from-literal=security.toml=" + configmap_raw)
|
||||
run(*kubectl, "delete", "secret", current)
|
||||
assert upgrade() == keys(configmap_raw), "ConfigMap keys were not preserved"
|
||||
print("PASS upgrade: ConfigMap migration")
|
||||
# Migration from the old chart name, followed by precedence of the current name.
|
||||
legacy_raw = "\n".join(f'[{section}]\nkey = "legacy-{index}"'
|
||||
for index, section in enumerate(SECTIONS))
|
||||
run(*kubectl, "delete", "configmap", current)
|
||||
run(*kubectl, "create", "configmap", legacy, "--from-literal=security.toml=" + legacy_raw)
|
||||
run(*kubectl, "delete", "secret", current)
|
||||
run(*kubectl, "delete", "configmap", current)
|
||||
assert upgrade() == keys(legacy_raw), "legacy ConfigMap keys were not preserved"
|
||||
print("PASS upgrade: legacy ConfigMap migration")
|
||||
current_raw = next(fixtures())[1]
|
||||
patch(current_raw)
|
||||
assert upgrade() == keys(current_raw), "legacy ConfigMap overrode the Secret"
|
||||
print("PASS upgrade: Secret takes precedence")
|
||||
assert upgrade() == keys(current_raw), "legacy ConfigMap overrode current ConfigMap"
|
||||
print("PASS upgrade: current ConfigMap takes precedence")
|
||||
|
||||
patch(ESCAPED_HEADER)
|
||||
try:
|
||||
@@ -220,76 +213,13 @@ def check_upgrades(helm, context):
|
||||
assert "unsupported quoted section header" in error.stderr, error.stderr
|
||||
else:
|
||||
raise AssertionError("unsupported quoted header silently rotated its key")
|
||||
assert stored()["jwt.signing"] == "existing"
|
||||
assert keys(run(*kubectl, "get", "configmap", current, "-o",
|
||||
"jsonpath={.data.security\\.toml}"))["jwt.signing"] == "existing"
|
||||
print("PASS upgrade: unsupported quoted header leaves stored key untouched")
|
||||
finally:
|
||||
run(*kubectl, "delete", "namespace", namespace, "--wait=false")
|
||||
|
||||
|
||||
def secret_keys(kubectl, name):
|
||||
secret = json.loads(run(*kubectl, "get", "secret", name, "-o", "json"))
|
||||
return keys(base64.b64decode(secret["data"]["security.toml"]).decode())
|
||||
|
||||
|
||||
def check_configmap_release_upgrade(helm, context):
|
||||
namespace = "jwt-key-migrate-" + uuid.uuid4().hex[:8]
|
||||
name = "jk-seaweedfs-security-config"
|
||||
kubectl = ["kubectl", "--context", context, "-n", namespace]
|
||||
common = ["--kube-context", context, "-n", namespace]
|
||||
for setting in RELEASE_SETTINGS:
|
||||
common += ["--set", setting]
|
||||
upgrade = ["upgrade", "jk", str(CHART), *common, "--set", "master.enabled=true"]
|
||||
|
||||
def refuse_partitioned(stage):
|
||||
try:
|
||||
run(helm, *upgrade, "--set", "master.updatePartition=1")
|
||||
except subprocess.CalledProcessError as error:
|
||||
assert "updatePartition=0" in error.stderr, error.stderr
|
||||
else:
|
||||
raise AssertionError(f"partitioned upgrade removed the ConfigMap ({stage})")
|
||||
|
||||
def exists(kind):
|
||||
return run(*kubectl, "get", kind, name, "--ignore-not-found", "-o", "name").strip()
|
||||
|
||||
run(*kubectl, "create", "namespace", namespace)
|
||||
try:
|
||||
run(helm, "install", "jk", *CONFIGMAP_CHART, *common)
|
||||
before = keys(run(*kubectl, "get", "configmap", name, "-o", "jsonpath={.data.security\\.toml}"))
|
||||
assert set(before) == set(SECTIONS), "ConfigMap chart omitted a JWT section"
|
||||
refuse_partitioned("ConfigMap release")
|
||||
print("PASS upgrade: partitioned upgrade from the ConfigMap chart is refused")
|
||||
|
||||
# Fail an upgrade after Helm created the Secret, so it never removes the ConfigMap.
|
||||
run(*kubectl, "create", "quota", "no-statefulsets", "--hard=count/statefulsets.apps=0")
|
||||
try:
|
||||
run(helm, *upgrade)
|
||||
except subprocess.CalledProcessError as error:
|
||||
assert "quota" in error.stderr, error.stderr
|
||||
else:
|
||||
raise AssertionError("upgrade was not blocked by the quota")
|
||||
run(*kubectl, "delete", "quota", "no-statefulsets")
|
||||
assert exists("secret") and exists("configmap"), "failed upgrade did not leave both objects"
|
||||
refuse_partitioned("retry after a failed upgrade")
|
||||
print("PASS upgrade: partitioned retry after a failed migration is refused")
|
||||
|
||||
run(helm, "upgrade", "jk", str(CHART), *common)
|
||||
assert secret_keys(kubectl, name) == before, "upgrade from the ConfigMap chart changed a key"
|
||||
assert not exists("configmap"), "upgrade left the ConfigMap behind"
|
||||
print("PASS upgrade: ConfigMap chart release moves its keys to the Secret")
|
||||
|
||||
# The unprefixed legacy name can belong to another release in the namespace.
|
||||
other = "seaweedfs-security-config"
|
||||
run(*kubectl, "create", "configmap", other, '--from-literal=security.toml=[jwt.signing]\nkey = "other"')
|
||||
run(*kubectl, "annotate", "configmap", other, "meta.helm.sh/release-name=other",
|
||||
"meta.helm.sh/release-namespace=" + namespace)
|
||||
run(helm, *upgrade, "--set", "master.updatePartition=1")
|
||||
assert secret_keys(kubectl, name) == before, "another release's ConfigMap changed a key"
|
||||
assert run(*kubectl, "get", "configmap", other, "-o", "name").strip(), "removed another release's ConfigMap"
|
||||
print("PASS upgrade: another release's legacy ConfigMap does not block a partitioned upgrade")
|
||||
finally:
|
||||
run(*kubectl, "delete", "namespace", namespace, "--wait=false")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--helm", default="helm")
|
||||
@@ -300,7 +230,6 @@ def main():
|
||||
check_helpers(args.helm, args.reference_helm)
|
||||
if args.context:
|
||||
check_upgrades(args.helm, args.context)
|
||||
check_configmap_release_upgrade(args.helm, args.context)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Regroup a GitHub release's generated notes by component.
|
||||
|
||||
GitHub's generated notes are one flat list of PRs in merge order. This keeps every
|
||||
line as GitHub wrote it, but sorts the PRs under component headings (S3 API, Filer,
|
||||
Mount, Volume Server, ...), with dependency bumps folded at the end.
|
||||
|
||||
The component comes from the PR title prefix, which nearly every PR has
|
||||
("s3api: ...", "fix(mount): ...", "filer.sync: ...", "rust volume: ..."). A PR with
|
||||
no recognised prefix is placed by the files it changes.
|
||||
|
||||
Usage:
|
||||
release_notes_by_component.py --tag 4.54 # print the regrouped notes
|
||||
release_notes_by_component.py --tag 4.54 --write # also update the release
|
||||
|
||||
Running it again on notes it already regrouped gives the same result.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Display order. Each PR lands in exactly one section.
|
||||
SECTIONS = [
|
||||
"S3 API",
|
||||
"S3 Tables and Iceberg",
|
||||
"Vectors",
|
||||
"Filer",
|
||||
"Mount",
|
||||
"Volume Server",
|
||||
"Rust Volume Server",
|
||||
"Erasure Coding",
|
||||
"Master and Topology",
|
||||
"Admin UI and Workers",
|
||||
"Shell",
|
||||
"Security",
|
||||
"Message Queue",
|
||||
"Kubernetes, Helm and Deployment",
|
||||
"Core and CLI",
|
||||
"Documentation",
|
||||
"Tests and CI",
|
||||
"Other",
|
||||
"Dependencies",
|
||||
]
|
||||
|
||||
# Title scope -> section, first match wins. Matched against each lower-cased scope
|
||||
# token, e.g. "filer.sync", "s3 lifecycle", "weed/s3api" (a "weed/" prefix is
|
||||
# dropped first). Order matters: specific scopes come before the general ones
|
||||
# they start with (s3tables before s3, volume.fsck before volume).
|
||||
SCOPE_RULES = [
|
||||
(r"(build\(deps\)|deps|dependabot)\b", "Dependencies"),
|
||||
(r"(test|tests|e2e|integration)\b|.*\btests?$|test/", "Tests and CI"),
|
||||
(r"(rust[ -]?volume|seaweed-volume|volume\(rust\)|rust)\b", "Rust Volume Server"),
|
||||
(r"(s3 ?vectors?|vectors?|seaweed-vector|weed-vector|lance)\b", "Vectors"),
|
||||
(r"(s3 ?tables|iceberg)\b", "S3 Tables and Iceberg"),
|
||||
(r"(s3 sink|remote|remote_storage|filer|webdav|sftp|ftp|notification|replication|"
|
||||
r"redis\d*|leveldb\d*|backup)\b", "Filer"),
|
||||
(r"(s3|s3api|iam|oidc|sts|credential|sse|cors|policy|object ?lock)\b", "S3 API"),
|
||||
(r"(mount|fuse)\b", "Mount"),
|
||||
(r"(ec|ec_\w+|ec\.\w+|erasure[ _-]?coding|worker/ec)\b", "Erasure Coding"),
|
||||
(r"(master|topology|wdclient|cluster|raft|placement)\b", "Master and Topology"),
|
||||
(r"(admin|worker|weed-worker|plugin|plugin worker|maintenance)\b",
|
||||
"Admin UI and Workers"),
|
||||
(r"(shell|fsck|volume\.\w+|fs\.\w+|collection\.\w+|bucket\.\w+)", "Shell"),
|
||||
(r"(volume|volume_\w+|storage|vacuum|operation|compression|needle)\b", "Volume Server"),
|
||||
(r"(security|tls|mtls|jwt|grpc|kms)\b", "Security"),
|
||||
(r"(mq|kafka|messaging)\b", "Message Queue"),
|
||||
(r"(helm|k8s|kubernetes|operator|csi|docker|grafana|install\.sh|chart|snap|terraform)\b",
|
||||
"Kubernetes, Helm and Deployment"),
|
||||
(r"(docs?|readme|wiki)\b", "Documentation"),
|
||||
(r"(ci|release|build|github|workflow|actions)\b", "Tests and CI"),
|
||||
(r"(server|command|mini|weed-db|weed|util|pb|cmd|glog|stats|telemetry|query|config)\b",
|
||||
"Core and CLI"),
|
||||
]
|
||||
|
||||
# Changed path prefix -> section, for PRs whose title has no usable prefix.
|
||||
# Longest prefix wins.
|
||||
PATH_RULES = {
|
||||
"weed/s3api/s3tables/": "S3 Tables and Iceberg",
|
||||
"weed/s3api/iceberg/": "S3 Tables and Iceberg",
|
||||
"weed/s3api/s3vectors/": "Vectors",
|
||||
"weed/s3api/lance/": "Vectors",
|
||||
"seaweed-vector/": "Vectors",
|
||||
"weed/s3api/": "S3 API",
|
||||
"weed/iam/": "S3 API",
|
||||
"weed/iamapi/": "S3 API",
|
||||
"weed/credential/": "S3 API",
|
||||
"weed/filer/": "Filer",
|
||||
"weed/filer_client/": "Filer",
|
||||
"weed/server/filer": "Filer",
|
||||
"weed/server/webdav": "Filer",
|
||||
"weed/sftpd/": "Filer",
|
||||
"weed/replication/": "Filer",
|
||||
"weed/notification/": "Filer",
|
||||
"weed/remote_storage/": "Filer",
|
||||
"weed/mount/": "Mount",
|
||||
"weed/storage/erasure_coding/": "Erasure Coding",
|
||||
"weed/ec/": "Erasure Coding",
|
||||
"weed/worker/tasks/erasure_coding/": "Erasure Coding",
|
||||
"weed/storage/": "Volume Server",
|
||||
"weed/server/volume": "Volume Server",
|
||||
"weed/operation/": "Volume Server",
|
||||
"seaweed-volume/": "Rust Volume Server",
|
||||
"weed/topology/": "Master and Topology",
|
||||
"weed/server/master": "Master and Topology",
|
||||
"weed/wdclient/": "Master and Topology",
|
||||
"weed/cluster/": "Master and Topology",
|
||||
"weed/placement/": "Master and Topology",
|
||||
"weed/admin/": "Admin UI and Workers",
|
||||
"weed/worker/": "Admin UI and Workers",
|
||||
"weed/plugin/": "Admin UI and Workers",
|
||||
"seaweed-worker/": "Admin UI and Workers",
|
||||
"weed/shell/": "Shell",
|
||||
"weed/security/": "Security",
|
||||
"weed/kms/": "Security",
|
||||
"weed/mq/": "Message Queue",
|
||||
"k8s/": "Kubernetes, Helm and Deployment",
|
||||
"docker/": "Kubernetes, Helm and Deployment",
|
||||
"snap/": "Kubernetes, Helm and Deployment",
|
||||
"terraform/": "Kubernetes, Helm and Deployment",
|
||||
"weed/": "Core and CLI",
|
||||
"test/": "Tests and CI",
|
||||
".github/": "Tests and CI",
|
||||
}
|
||||
|
||||
PR_LINE = re.compile(r"^\* (?P<title>.+?) by @(?P<author>\S+) in https://github\.com/\S+/pull/(?P<num>\d+)\s*$")
|
||||
# Lines regroup() writes between the PRs, so a second run accepts them.
|
||||
SCAFFOLD = re.compile(r"^$|^### (%s)$|^<details><summary>Dependencies \(\d+ updates?\)</summary>$|^</details>$"
|
||||
% "|".join(re.escape(s) for s in SECTIONS))
|
||||
# "fix(s3tables,s3vectors): ...", "s3 lifecycle: ...", "[Volume] ...", "Fix/admin ..."
|
||||
CONVENTIONAL = re.compile(r"^(?P<type>[a-z]+)\((?P<scope>[^)]*)\)!?$")
|
||||
TYPE_ONLY = {"fix", "feat", "feature", "perf", "refactor", "chore", "style", "revert", "improvement"}
|
||||
|
||||
|
||||
def scope_of(title):
|
||||
"""Return the raw scope text of a PR title, or ""."""
|
||||
t = title.strip()
|
||||
m = re.match(r"^\[([^\]]{1,40})\]", t)
|
||||
if m:
|
||||
return m.group(1)
|
||||
m = re.match(r"^(?:fix|feat|feature)/(\S+)", t, re.I)
|
||||
if m:
|
||||
return m.group(1)
|
||||
head, sep, _ = t.partition(":")
|
||||
if not sep or len(head) > 50:
|
||||
return ""
|
||||
head = head.strip()
|
||||
m = CONVENTIONAL.match(head.lower())
|
||||
if m:
|
||||
kind, scope = m.group("type"), m.group("scope")
|
||||
if kind in ("test", "tests", "ci"):
|
||||
return "test"
|
||||
if kind == "docs":
|
||||
return "docs"
|
||||
if kind == "build" and scope == "deps":
|
||||
return "build(deps)"
|
||||
return scope
|
||||
if head.lower() in TYPE_ONLY:
|
||||
return ""
|
||||
return head
|
||||
|
||||
|
||||
def section_by_scope(scope):
|
||||
if scope.strip().lower() == "build(deps)":
|
||||
return "Dependencies"
|
||||
for token in re.split(r"\s*[,+&]\s*|\s+and\s+", scope.lower()):
|
||||
token = token.strip()
|
||||
token = re.sub(r"^weed[/ ]", "", token)
|
||||
if not token:
|
||||
continue
|
||||
for pattern, section in SCOPE_RULES:
|
||||
if re.match(pattern, token):
|
||||
return section
|
||||
return ""
|
||||
|
||||
|
||||
def section_by_paths(paths):
|
||||
votes = {}
|
||||
code = [p for p in paths if not p.endswith(("_test.go", "_test.rs")) and not p.startswith("test/")]
|
||||
for p in code or paths:
|
||||
if p.endswith(".md"):
|
||||
section = "Documentation"
|
||||
else:
|
||||
best = max((pre for pre in PATH_RULES if p.startswith(pre)), key=len, default="")
|
||||
section = PATH_RULES.get(best, "Other")
|
||||
votes[section] = votes.get(section, 0) + 1
|
||||
if not votes:
|
||||
return "Other"
|
||||
# Most files wins; ties go to the earlier section in display order.
|
||||
return max(votes, key=lambda s: (votes[s], -SECTIONS.index(s)))
|
||||
|
||||
|
||||
def classify(title, author, pr_files):
|
||||
if author.startswith("dependabot") or title.lower().startswith("build(deps)"):
|
||||
return "Dependencies"
|
||||
section = section_by_scope(scope_of(title))
|
||||
if section:
|
||||
return section
|
||||
return section_by_paths(pr_files())
|
||||
|
||||
|
||||
def split_notes(body):
|
||||
"""Split generated notes into (PR lines, the text before them, the text after,
|
||||
the non-blank lines of What's Changed)."""
|
||||
lines = body.replace("\r\n", "\n").split("\n")
|
||||
start = next((i for i, l in enumerate(lines) if l.strip() == "## What's Changed"), None)
|
||||
if start is None:
|
||||
return [], body, "", []
|
||||
end = next((i for i in range(start + 1, len(lines))
|
||||
if lines[i].startswith(("## ", "**Full Changelog**"))), len(lines))
|
||||
prs, stray = [], []
|
||||
block = [l.rstrip() for l in lines[start + 1:end] if l.strip()]
|
||||
for line in lines[start + 1:end]:
|
||||
if PR_LINE.match(line):
|
||||
prs.append(line)
|
||||
elif not SCAFFOLD.match(line.strip()):
|
||||
stray.append(line)
|
||||
if prs and stray:
|
||||
raise ValueError("What's Changed has lines that are not PRs: %r" % stray[:3])
|
||||
before = "\n".join(lines[:start]).rstrip()
|
||||
after = "\n".join(lines[end:]).strip()
|
||||
return prs, before, after, block
|
||||
|
||||
|
||||
def regroup(body, pr_files):
|
||||
prs, before, after, block = split_notes(body)
|
||||
if not prs:
|
||||
return body
|
||||
groups = {s: [] for s in SECTIONS}
|
||||
for line in prs:
|
||||
m = PR_LINE.match(line)
|
||||
num = int(m.group("num"))
|
||||
groups[classify(m.group("title"), m.group("author"), lambda: pr_files(num))].append(line)
|
||||
|
||||
out = [before, ""] if before else []
|
||||
out.append("## What's Changed")
|
||||
for section in SECTIONS:
|
||||
items = groups[section]
|
||||
if not items:
|
||||
continue
|
||||
out.append("")
|
||||
if section == "Dependencies":
|
||||
out.append("<details><summary>Dependencies (%d update%s)</summary>" % (len(items), "" if len(items) == 1 else "s"))
|
||||
out.append("")
|
||||
out.extend(items)
|
||||
out.append("")
|
||||
out.append("</details>")
|
||||
else:
|
||||
out.append("### " + section)
|
||||
out.extend(items)
|
||||
if after:
|
||||
out.extend(["", after])
|
||||
notes = "\n".join(out).strip() + "\n"
|
||||
# Headings are accepted only as this script's own grouping: a hand-written
|
||||
# "### Security" over PRs of other components would otherwise be dropped.
|
||||
if len(block) != len(prs) and split_notes(notes)[3] != block:
|
||||
raise ValueError("What's Changed has headings that do not match the component grouping")
|
||||
return notes
|
||||
|
||||
|
||||
def gh(*args, stdin=None):
|
||||
return subprocess.run(["gh", *args], input=stdin, capture_output=True, text=True, check=True).stdout
|
||||
|
||||
|
||||
def pr_files(repo, num):
|
||||
return gh("pr", "view", str(num), "-R", repo, "--json", "files", "--jq", ".files[].path").splitlines()
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
ap.add_argument("--repo", default="seaweedfs/seaweedfs")
|
||||
ap.add_argument("--tag", required=True)
|
||||
ap.add_argument("--write", action="store_true", help="update the release notes on GitHub")
|
||||
args = ap.parse_args()
|
||||
|
||||
body = json.loads(gh("release", "view", args.tag, "-R", args.repo, "--json", "body"))["body"]
|
||||
|
||||
failed = []
|
||||
|
||||
def files_of(num):
|
||||
try:
|
||||
return pr_files(args.repo, num)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("warning: files of #%d: %s" % (num, e.stderr.strip()), file=sys.stderr)
|
||||
failed.append(num)
|
||||
return []
|
||||
|
||||
try:
|
||||
notes = regroup(body, files_of)
|
||||
except ValueError as e:
|
||||
sys.exit("release %s: %s" % (args.tag, e))
|
||||
sys.stdout.write(notes)
|
||||
if notes.strip() == body.replace("\r\n", "\n").strip():
|
||||
print("release %s: notes already grouped, nothing to change" % args.tag, file=sys.stderr)
|
||||
return
|
||||
if failed and args.write:
|
||||
sys.exit("release %s: not writing, could not read the files of %s"
|
||||
% (args.tag, ", ".join("#%d" % n for n in failed)))
|
||||
if args.write:
|
||||
gh("release", "edit", args.tag, "-R", args.repo, "--notes-file", "-", stdin=notes)
|
||||
print("release %s: notes updated" % args.tag, file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,190 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
|
||||
def load():
|
||||
path = Path(__file__).with_name("release_notes_by_component.py")
|
||||
spec = importlib.util.spec_from_file_location("release_notes_by_component", path)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
rn = load()
|
||||
|
||||
|
||||
def no_files(num):
|
||||
raise AssertionError("files of #%d should not be needed" % num)
|
||||
|
||||
|
||||
class ClassifyTest(unittest.TestCase):
|
||||
def check(self, title, section, author="someone", files=None):
|
||||
got = rn.classify(title, author, (lambda: files) if files is not None else (lambda: no_files(0)))
|
||||
self.assertEqual(got, section, title)
|
||||
|
||||
def test_title_prefixes(self):
|
||||
cases = {
|
||||
"s3: keep serving for -preStopSeconds after SIGTERM": "S3 API",
|
||||
"s3api: keep a multipart upload's state on the object's owner filer": "S3 API",
|
||||
"fix(s3api): reject an invalid storage class before uploading the body": "S3 API",
|
||||
"s3 lifecycle: count filer entries a walk reads but skips as progress": "S3 API",
|
||||
"iam/oidc: accept a list audience": "S3 API",
|
||||
"fix(s3tables,s3vectors): bind DeleteNamespace to the authorized records": "S3 Tables and Iceberg",
|
||||
"iceberg maintenance: expire snapshots": "S3 Tables and Iceberg",
|
||||
"s3vectors: support TagResource": "Vectors",
|
||||
"s3 vectors: page ListVectors": "Vectors",
|
||||
"vector: compact segments": "Vectors",
|
||||
"filer: fail health check when absent from lock ring": "Filer",
|
||||
"filer.sync: skip a rewritten source version": "Filer",
|
||||
"filer.remote.sync: retry": "Filer",
|
||||
"webdav: honor locks": "Filer",
|
||||
"remote.uncache, remote.meta.sync, remote.cache: keep local writes": "Filer",
|
||||
"mount: cache dir": "Mount",
|
||||
"fix(mount): flush on close": "Mount",
|
||||
"volume: keep reads over the download limit local": "Volume Server",
|
||||
"[Volume] Preserve request semantics in replica proxy reads": "Volume Server",
|
||||
"operation: pad the marginal gzip test": "Volume Server",
|
||||
"fix(storage): update deletion metrics": "Volume Server",
|
||||
"rust volume: bulk-load needle maps": "Rust Volume Server",
|
||||
"seaweed-volume: pin the status": "Rust Volume Server",
|
||||
"volume(rust): fix": "Rust Volume Server",
|
||||
"ec: mount shards through the encode's .vif": "Erasure Coding",
|
||||
"ec.rebuild: pick the right disk": "Erasure Coding",
|
||||
"ec_balance: spread shards": "Erasure Coding",
|
||||
"master: unregister a volume server whose heartbeats stop": "Master and Topology",
|
||||
"topology: never report negative free volume slots": "Master and Topology",
|
||||
"wdclient: let master-pushed adds replace locations": "Master and Topology",
|
||||
"admin: manage filer webhook targets": "Admin UI and Workers",
|
||||
"Fix/admin cluster submenu": "Admin UI and Workers",
|
||||
"weed-worker: retry": "Admin UI and Workers",
|
||||
"shell: fix s3.circuitBreaker help examples": "Shell",
|
||||
"volume.fsck: skip deleted": "Shell",
|
||||
"fix(fsck): inspect references to deleted volumes": "Shell",
|
||||
"security: optional dialed-host check": "Security",
|
||||
"helm: drop the 4.53 vector metrics render guard": "Kubernetes, Helm and Deployment",
|
||||
"install.sh: add --enterprise": "Kubernetes, Helm and Deployment",
|
||||
"mq/kafka: commit offsets": "Message Queue",
|
||||
"server: add -grpc.localSocketDir": "Core and CLI",
|
||||
"pb: recover when a local gRPC socket file is deleted": "Core and CLI",
|
||||
"docs: explain the 3-filer recommendation": "Documentation",
|
||||
"test(fuse): two mounts staging the same files": "Tests and CI",
|
||||
"test/s3vectors: a hardened cluster": "Tests and CI",
|
||||
"s3vectors test: cover tags": "Tests and CI",
|
||||
"ci: run the Python 3.9 jobs on 3.10": "Tests and CI",
|
||||
"build(deps): bump actions/setup-go from 6 to 7": "Dependencies",
|
||||
}
|
||||
for title, section in cases.items():
|
||||
self.check(title, section)
|
||||
|
||||
def test_dependabot_author(self):
|
||||
self.check("Bump x from 1 to 2", "Dependencies", author="dependabot[bot]")
|
||||
|
||||
def test_no_prefix_uses_files(self):
|
||||
self.check("Fix s3 cancelled read relookup", "S3 API",
|
||||
files=["weed/s3api/s3api_object_handlers.go", "weed/s3api/s3api_object_handlers_test.go"])
|
||||
self.check("Retry transient failures in star history generation", "Tests and CI",
|
||||
files=[".github/scripts/star_history.py"])
|
||||
self.check("fix: handle empty chunk list", "Filer",
|
||||
files=["weed/filer/filechunks.go", "weed/storage/needle/needle.go", "weed/filer/reader_at.go"])
|
||||
self.check("Improve everything", "Other", files=[])
|
||||
|
||||
def test_test_files_count_only_when_alone(self):
|
||||
self.check("Make it faster", "Mount",
|
||||
files=["weed/mount/weedfs.go", "test/fuse/a_test.go", "test/fuse/b_test.go"])
|
||||
self.check("Make it right", "S3 API",
|
||||
files=["weed/s3api/auth.go", "test/s3/iam/test_a.py", "test/s3/iam/test_b.py"])
|
||||
self.check("Cover more", "Tests and CI", files=["test/s3/iam/test_a.py"])
|
||||
|
||||
def test_path_with_space(self):
|
||||
with mock.patch.object(rn, "gh", return_value="test/s3/iam/policy cases.json\n"):
|
||||
files = rn.pr_files("seaweedfs/seaweedfs", 1)
|
||||
self.assertEqual(files, ["test/s3/iam/policy cases.json"])
|
||||
self.check("Cover more", "Tests and CI", files=files)
|
||||
|
||||
|
||||
NOTES = """## What's Changed
|
||||
* filer: fail health check when absent from lock ring by @a in https://github.com/seaweedfs/seaweedfs/pull/12709
|
||||
* s3: answer ClientDisconnected by @b in https://github.com/seaweedfs/seaweedfs/pull/12707
|
||||
* build(deps): bump actions/setup-go from 6 to 7 by @dependabot[bot] in https://github.com/seaweedfs/seaweedfs/pull/12685
|
||||
* filer.sync: skip a rewritten source version by @a in https://github.com/seaweedfs/seaweedfs/pull/12366
|
||||
* Fix s3 cancelled read relookup by @c in https://github.com/seaweedfs/seaweedfs/pull/12600
|
||||
|
||||
## New Contributors
|
||||
* @c made their first contribution in https://github.com/seaweedfs/seaweedfs/pull/12600
|
||||
|
||||
**Full Changelog**: https://github.com/seaweedfs/seaweedfs/compare/4.53...4.54
|
||||
"""
|
||||
|
||||
|
||||
class RegroupTest(unittest.TestCase):
|
||||
def files(self, num):
|
||||
self.assertEqual(num, 12600)
|
||||
return ["weed/s3api/s3api_object_handlers.go"]
|
||||
|
||||
def test_regroup(self):
|
||||
out = rn.regroup(NOTES, self.files)
|
||||
self.assertEqual(out, """## What's Changed
|
||||
|
||||
### S3 API
|
||||
* s3: answer ClientDisconnected by @b in https://github.com/seaweedfs/seaweedfs/pull/12707
|
||||
* Fix s3 cancelled read relookup by @c in https://github.com/seaweedfs/seaweedfs/pull/12600
|
||||
|
||||
### Filer
|
||||
* filer: fail health check when absent from lock ring by @a in https://github.com/seaweedfs/seaweedfs/pull/12709
|
||||
* filer.sync: skip a rewritten source version by @a in https://github.com/seaweedfs/seaweedfs/pull/12366
|
||||
|
||||
<details><summary>Dependencies (1 update)</summary>
|
||||
|
||||
* build(deps): bump actions/setup-go from 6 to 7 by @dependabot[bot] in https://github.com/seaweedfs/seaweedfs/pull/12685
|
||||
|
||||
</details>
|
||||
|
||||
## New Contributors
|
||||
* @c made their first contribution in https://github.com/seaweedfs/seaweedfs/pull/12600
|
||||
|
||||
**Full Changelog**: https://github.com/seaweedfs/seaweedfs/compare/4.53...4.54
|
||||
""")
|
||||
|
||||
def test_idempotent(self):
|
||||
once = rn.regroup(NOTES, self.files)
|
||||
self.assertEqual(rn.regroup(once, self.files), once)
|
||||
|
||||
def test_every_pr_kept(self):
|
||||
out = rn.regroup(NOTES, self.files)
|
||||
for n in (12709, 12707, 12685, 12366, 12600):
|
||||
self.assertEqual(out.count("/pull/%d\n" % n), 2 if n == 12600 else 1)
|
||||
|
||||
def test_changelog_kept_without_new_contributors(self):
|
||||
body = NOTES.replace(
|
||||
"## New Contributors\n* @c made their first contribution in https://github.com/seaweedfs/seaweedfs/pull/12600\n\n", "")
|
||||
out = rn.regroup(body, self.files)
|
||||
self.assertTrue(out.endswith("</details>\n\n**Full Changelog**: https://github.com/seaweedfs/seaweedfs/compare/4.53...4.54\n"), out)
|
||||
self.assertEqual(rn.regroup(out, self.files), out)
|
||||
|
||||
def test_unknown_line_refused(self):
|
||||
body = NOTES.replace("## New Contributors", "* a hand-written note\n\n## New Contributors")
|
||||
with self.assertRaises(ValueError):
|
||||
rn.regroup(body, self.files)
|
||||
with self.assertRaises(ValueError):
|
||||
rn.regroup(NOTES.replace("## What's Changed\n", "## What's Changed\n### Known issue\n"), self.files)
|
||||
|
||||
def test_hand_written_component_heading_refused(self):
|
||||
with self.assertRaises(ValueError):
|
||||
rn.regroup(NOTES.replace("## What's Changed\n", "## What's Changed\n### Security\n"), self.files)
|
||||
once = rn.regroup(NOTES, self.files)
|
||||
with self.assertRaises(ValueError):
|
||||
rn.regroup(once.replace("\n### Filer\n", "\n ### Filer\n"), self.files)
|
||||
|
||||
def test_author_from_the_by_clause(self):
|
||||
body = "## What's Changed\n* Bump a by @dependabot[bot] in docs by @alice in https://github.com/seaweedfs/seaweedfs/pull/7\n"
|
||||
self.assertIn("### Documentation", rn.regroup(body, lambda n: ["README.md"]))
|
||||
|
||||
def test_notes_without_prs_unchanged(self):
|
||||
body = "Hand-written notes\n\n**Full Changelog**: x"
|
||||
self.assertEqual(rn.regroup(body, no_files), body)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -5,11 +5,13 @@ on:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '.github/actions/**'
|
||||
- '.github/scripts/*release_notes_by_component.py'
|
||||
- '.github/workflows/action-tests.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '.github/actions/**'
|
||||
- '.github/scripts/*release_notes_by_component.py'
|
||||
- '.github/workflows/action-tests.yml'
|
||||
|
||||
concurrency:
|
||||
@@ -28,3 +30,12 @@ jobs:
|
||||
|
||||
- name: Run cleanup action unit tests
|
||||
run: python3 .github/actions/cleanup-stale-fuse-mounts/test_cleanup.py
|
||||
|
||||
release-notes-by-component:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Run release notes grouping unit tests
|
||||
run: python3 .github/scripts/test_release_notes_by_component.py
|
||||
@@ -8,44 +8,38 @@ on:
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/binaries_dev.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
# Let an in-progress dev build finish. A new push replaces only the pending
|
||||
# run; cancelling mid-build left the dev release without assets.
|
||||
concurrency:
|
||||
group: binaries-dev-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
prepare:
|
||||
cleanup:
|
||||
permissions:
|
||||
contents: write # for mknejp/delete-release-assets to delete release assets
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_time: ${{ steps.build_time.outputs.value }}
|
||||
steps:
|
||||
- name: Ref guard
|
||||
if: github.ref != 'refs/heads/master'
|
||||
env:
|
||||
GH_REF: ${{ github.ref }}
|
||||
run: |
|
||||
echo "dev builds only publish from master (got $GH_REF)" >&2
|
||||
exit 1
|
||||
|
||||
- name: Set BUILD_TIME
|
||||
id: build_time
|
||||
run: |
|
||||
echo "value=$(date -u +%Y%m%d-%H%M)" >> "$GITHUB_OUTPUT"
|
||||
steps:
|
||||
|
||||
- name: Delete old release assets
|
||||
uses: mknejp/delete-release-assets@v1
|
||||
continue-on-error: true
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
tag: dev
|
||||
fail-if-no-assets: false
|
||||
assets: |
|
||||
weed-*
|
||||
|
||||
build_dev_linux_windows:
|
||||
permissions:
|
||||
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||
needs: prepare
|
||||
needs: cleanup
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [linux, windows]
|
||||
@@ -53,17 +47,15 @@ jobs:
|
||||
|
||||
steps:
|
||||
|
||||
- name: Validate BUILD_TIME
|
||||
run: |
|
||||
: "${BUILD_TIME:?prepare output missing}"
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v2
|
||||
|
||||
- name: Set BUILD_TIME env
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||
|
||||
- name: Go Release Binaries Large Disk
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -80,7 +72,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -96,10 +87,8 @@ jobs:
|
||||
build_dev_darwin:
|
||||
permissions:
|
||||
contents: write # for wangyoucao577/go-release-action to upload release assets
|
||||
needs: [prepare, build_dev_linux_windows]
|
||||
needs: build_dev_linux_windows
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [darwin]
|
||||
@@ -107,17 +96,15 @@ jobs:
|
||||
|
||||
steps:
|
||||
|
||||
- name: Validate BUILD_TIME
|
||||
run: |
|
||||
: "${BUILD_TIME:?prepare output missing}"
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v2
|
||||
|
||||
- name: Set BUILD_TIME env
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> ${GITHUB_ENV}
|
||||
|
||||
- name: Go Release Binaries Large Disk
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -134,7 +121,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -146,79 +132,3 @@ jobs:
|
||||
project_path: weed
|
||||
binary_name: weed-normal-disk
|
||||
asset_name: "weed-${{ env.BUILD_TIME }}-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||||
|
||||
prune:
|
||||
needs: [prepare, build_dev_linux_windows, build_dev_darwin]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
RELEASE_TAG: dev
|
||||
steps:
|
||||
- name: Delete dev binaries from older builds
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
: "${BUILD_TIME:?BUILD_TIME is empty}"
|
||||
case "$BUILD_TIME" in
|
||||
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]) ;;
|
||||
*) echo "Invalid BUILD_TIME: $BUILD_TIME" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
release_tag="${RELEASE_TAG:-dev}"
|
||||
if ! release_json=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$release_tag" 2>&1); then
|
||||
case "$release_json" in
|
||||
*"Not Found"*) echo "No $release_tag release; nothing to prune"; exit 0 ;;
|
||||
esac
|
||||
echo "Release lookup failed: $release_json" >&2
|
||||
exit 1
|
||||
fi
|
||||
release_id=$(jq -r '.id // empty' <<<"$release_json")
|
||||
if [ -z "$release_id" ]; then
|
||||
echo "Release lookup returned no id" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
assets_file=$(mktemp)
|
||||
trap 'rm -f "$assets_file"' EXIT
|
||||
if ! gh api "repos/$GITHUB_REPOSITORY/releases/$release_id/assets" --paginate \
|
||||
--jq '.[] | select((.name | startswith("weed-large-disk-")) or (.name | test("^weed-[0-9]"))) | [.id, .name] | @tsv' \
|
||||
> "$assets_file"; then
|
||||
echo "Failed to list release assets" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
total=$(awk 'END{print NR+0}' "$assets_file")
|
||||
matching=$(awk -v s="-$BUILD_TIME-" 'index($0,s){n++} END{print n+0}' "$assets_file")
|
||||
if [ "$matching" -eq 0 ]; then
|
||||
echo "No assets carry stamp $BUILD_TIME; refusing to prune" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_key=${BUILD_TIME/-/}
|
||||
kept=0; newer=0; deleted=0; gone=0; failed=0
|
||||
while IFS=$'\t' read -r id name || [ -n "${name:-}" ]; do
|
||||
[ -n "${id:-}" ] || continue
|
||||
case "$name" in
|
||||
*"-$BUILD_TIME-"*) kept=$((kept+1)); continue ;;
|
||||
esac
|
||||
if [[ "$name" =~ -([0-9]{8})-([0-9]{4})- ]] && [ "${BASH_REMATCH[1]}${BASH_REMATCH[2]}" -gt "$build_key" ]; then
|
||||
newer=$((newer+1)); continue
|
||||
fi
|
||||
if out=$(gh api -X DELETE "repos/$GITHUB_REPOSITORY/releases/assets/$id" </dev/null 2>&1); then
|
||||
deleted=$((deleted+1))
|
||||
else
|
||||
case "$out" in
|
||||
*"Not Found"*) gone=$((gone+1)) ;;
|
||||
*) failed=$((failed+1)); echo "Failed to delete asset $name ($id): $out" >&2 ;;
|
||||
esac
|
||||
fi
|
||||
done < "$assets_file"
|
||||
|
||||
[ "$((kept+newer+deleted+gone+failed))" -eq "$total" ] || { echo "Processed $((kept+newer+deleted+gone+failed)) of $total assets" >&2; exit 1; }
|
||||
echo "Kept $kept assets from this build and $newer from newer builds; deleted $deleted older assets; $gone already gone; $failed failures"
|
||||
[ "$failed" -eq 0 ] || { echo "::warning::prune: $failed deletions failed"; exit 1; }
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -47,7 +46,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -47,7 +46,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -47,7 +46,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -47,7 +46,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -48,7 +47,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -32,7 +32,6 @@ jobs:
|
||||
- name: Go Release Binaries Normal Volume Size
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
@@ -47,7 +46,6 @@ jobs:
|
||||
- name: Go Release Large Disk Binaries
|
||||
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.22
|
||||
with:
|
||||
goversion: go.mod # reads the go directive, so releases build with the toolchain go.mod declares
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4.39.4
|
||||
uses: github/codeql-action/init@v4.39.3
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: go
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below).
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v4.39.4
|
||||
uses: github/codeql-action/autobuild@v4.39.3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -55,4 +55,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v4.39.4
|
||||
uses: github/codeql-action/analyze@v4.39.3
|
||||
@@ -434,7 +434,7 @@ jobs:
|
||||
output: trivy-results.sarif
|
||||
exit-code: '0'
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
uses: github/codeql-action/upload-sarif@v4.39.4
|
||||
uses: github/codeql-action/upload-sarif@v4.39.3
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
|
||||
@@ -515,7 +515,7 @@ jobs:
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security
|
||||
if: always()
|
||||
uses: github/codeql-action/upload-sarif@v4.39.4
|
||||
uses: github/codeql-action/upload-sarif@v4.39.3
|
||||
with:
|
||||
sarif_file: trivy-results.sarif
|
||||
category: trivy-${{ matrix.variant }}
|
||||
|
||||
@@ -15,4 +15,4 @@ jobs:
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@bbc44d14a204704ccc493733616cd1e93a0321ec
|
||||
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294
|
||||
@@ -31,16 +31,16 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Build weed binary
|
||||
run: |
|
||||
cd weed && go build -o weed .
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
name: Graph
|
||||
|
||||
# Builds a code knowledge graph with the open-source Graphify CLI and uploads
|
||||
# it as an artifact; a published release, or a dispatch naming a tag, also
|
||||
# gets it as a release asset. Code-only mode parses the repository with
|
||||
# tree-sitter and needs no API key or secret. Only the release job holds a
|
||||
# write token, and it runs no third-party code.
|
||||
#
|
||||
# A release created with the default GITHUB_TOKEN does not trigger this
|
||||
# workflow; dispatch it with the tag in that case.
|
||||
#
|
||||
# The graph is not committed: graph.json is ~150 MiB, above GitHub's 100 MiB
|
||||
# file limit.
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "23 4 * * *"
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Release tag to build and attach the bundle to (empty: artifact only)"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: graph-${{ github.ref }}-${{ inputs.tag }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
GRAPHIFY_VERSION: "0.9.112"
|
||||
# Stable community ids across runs.
|
||||
PYTHONHASHSEED: "0"
|
||||
# Never call an LLM, even if a runner image ships an API key or the claude
|
||||
# CLI: cluster-only auto-detects a labeling backend otherwise.
|
||||
GRAPHIFY_BACKEND: "none"
|
||||
TAG: ${{ github.event.release.tag_name || inputs.tag }}
|
||||
|
||||
jobs:
|
||||
graph:
|
||||
name: Build code graph
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ env.TAG && format('refs/tags/{0}', env.TAG) || '' }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install graphify
|
||||
run: python -m pip install "graphifyy==${GRAPHIFY_VERSION}"
|
||||
|
||||
# Always a full extraction: graphify update re-extracts only changed
|
||||
# files, so callers in unchanged files keep edges to a function's old
|
||||
# id after it moves to another file.
|
||||
- name: Build the graph
|
||||
run: |
|
||||
# Cluster once: extract alone does not write the report or HTML.
|
||||
# cluster-only names communities after their hub nodes
|
||||
# (GRAPHIFY_BACKEND=none keeps it from calling an LLM).
|
||||
graphify extract . --code-only --no-cluster
|
||||
graphify cluster-only .
|
||||
|
||||
- name: Graph health
|
||||
run: |
|
||||
graphify diagnose multigraph --json > graph-health.json
|
||||
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
|
||||
import json
|
||||
|
||||
summary = json.load(open("graph-health.json")).get("summary", {})
|
||||
print("### Graph health")
|
||||
print(f"- nodes: {summary.get('node_count', 'n/a')}")
|
||||
print(f"- edges: {summary.get('raw_edge_count', 'n/a')}")
|
||||
print(f"- dangling endpoints: {summary.get('dangling_endpoint_edges', 'n/a')}")
|
||||
print(f"- duplicate edges: {summary.get('exact_duplicate_edges', 'n/a')}")
|
||||
PY
|
||||
|
||||
- name: Bundle outputs
|
||||
run: |
|
||||
gzip -9 -c graphify-out/graph.json > graph.json.gz
|
||||
files=(graph.json.gz graphify-out/GRAPH_REPORT.md graph-health.json)
|
||||
# graphify skips graph.html when it cannot aggregate a large graph.
|
||||
if [ -f graphify-out/graph.html ]; then
|
||||
files+=(graphify-out/graph.html)
|
||||
else
|
||||
echo "::warning::graphify-out/graph.html was not generated"
|
||||
fi
|
||||
tar -czf graph-bundle.tar.gz "${files[@]}"
|
||||
|
||||
- name: Upload graph artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: graph-${{ github.sha }}
|
||||
path: graph-bundle.tar.gz
|
||||
retention-days: 14
|
||||
|
||||
release:
|
||||
name: Attach graph bundle
|
||||
needs: graph
|
||||
if: github.event_name == 'release' || inputs.tag != ''
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download graph artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: graph-${{ github.sha }}
|
||||
|
||||
- name: Upload release asset
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
asset="graph-${TAG//\//-}.tar.gz"
|
||||
mv graph-bundle.tar.gz "${asset}"
|
||||
gh release upload "${TAG}" "${asset}" --clobber --repo "${GITHUB_REPOSITORY}"
|
||||
+20
-131
@@ -149,83 +149,6 @@ jobs:
|
||||
grep -q "terminationGracePeriodSeconds: 85$" /tmp/aio-s3-prestop-own.yaml
|
||||
echo "S3 preStopSeconds renders correctly"
|
||||
|
||||
echo "=== Testing shareProcessNamespace ==="
|
||||
for workload in filer:templates/filer/filer-statefulset.yaml s3:templates/s3/s3-deployment.yaml; do
|
||||
component=${workload%%:*}
|
||||
template=${workload#*:}
|
||||
helm template test $CHART_DIR --show-only "$template" \
|
||||
--set "$component.enabled=true" > /tmp/spn-default.yaml
|
||||
test "$(grep -c 'shareProcessNamespace' /tmp/spn-default.yaml)" -eq 0
|
||||
helm template test $CHART_DIR --show-only "$template" \
|
||||
--set "$component.enabled=true" --set "$component.shareProcessNamespace=true" > /tmp/spn.yaml
|
||||
grep -q '^ shareProcessNamespace: true$' /tmp/spn.yaml
|
||||
done
|
||||
echo "shareProcessNamespace renders correctly"
|
||||
|
||||
echo "=== Testing volumeAttributesClassName ==="
|
||||
pvc_args=(--set allInOne.enabled=true --set allInOne.data.type=persistentVolumeClaim
|
||||
--set admin.enabled=true --set admin.allowInsecureBind=true --set volume.dataDirs[0].name=data1)
|
||||
for claim in master.data master.logs filer.data filer.logs admin.data admin.logs \
|
||||
volume.idx volume.logs volume.dataDirs[0]; do
|
||||
pvc_args+=(--set "$claim.type=persistentVolumeClaim" --set "$claim.size=1Gi")
|
||||
done
|
||||
helm template test $CHART_DIR "${pvc_args[@]}" > /tmp/vac-default.yaml
|
||||
test "$(grep -c 'volumeAttributesClassName' /tmp/vac-default.yaml)" -eq 0
|
||||
for claim in master.data master.logs filer.data filer.logs admin.data admin.logs \
|
||||
volume.idx volume.logs volume.dataDirs[0] allInOne.data; do
|
||||
pvc_args+=(--set "$claim.volumeAttributesClassName=fast")
|
||||
done
|
||||
helm template test $CHART_DIR "${pvc_args[@]}" > /tmp/vac.yaml
|
||||
test "$(grep -c '^ *volumeAttributesClassName: "fast"$' /tmp/vac.yaml)" -eq 10
|
||||
helm template test $CHART_DIR --set master.data.type=persistentVolumeClaim \
|
||||
--set-string master.data.volumeAttributesClassName=null > /tmp/vac-null.yaml
|
||||
grep -q '^ *volumeAttributesClassName: "null"$' /tmp/vac-null.yaml
|
||||
echo "volumeAttributesClassName renders correctly"
|
||||
|
||||
echo "=== Testing the S3 config reloader ==="
|
||||
for workload in filer.s3:templates/filer/filer-statefulset.yaml s3:templates/s3/s3-deployment.yaml; do
|
||||
prefix=${workload%%:*}
|
||||
template=${workload#*:}
|
||||
component=${prefix%%.*}
|
||||
reloader_args=(--set "$prefix.enabled=true" --set "$prefix.enableAuth=true"
|
||||
--set "$prefix.existingConfigSecret=s3-identities"
|
||||
--set "$component.containerSecurityContext.enabled=true"
|
||||
--set "$component.containerSecurityContext.runAsUser=1000")
|
||||
helm template test $CHART_DIR --show-only "$template" "${reloader_args[@]}" > /tmp/reloader-off.yaml
|
||||
test "$(grep -c 's3-config-reloader\|shareProcessNamespace' /tmp/reloader-off.yaml)" -eq 0
|
||||
helm template test $CHART_DIR --show-only "$template" "${reloader_args[@]}" \
|
||||
--set "$prefix.configReloader.enabled=true" \
|
||||
--set "$prefix.configReloader.resources.limits.memory=32Mi" > /tmp/reloader-on.yaml
|
||||
python3 - /tmp/reloader-off.yaml /tmp/reloader-on.yaml <<'PYEOF'
|
||||
import sys, yaml
|
||||
off, on = (yaml.safe_load(open(path)) for path in sys.argv[1:])
|
||||
pod = on["spec"]["template"]["spec"]
|
||||
main = pod["containers"][0]
|
||||
reloader = next(c for c in pod["containers"] if c["name"] == "s3-config-reloader")
|
||||
assert pod["shareProcessNamespace"] is True
|
||||
assert reloader["image"] == main["image"]
|
||||
# It must run as the same user as SeaweedFS to signal it.
|
||||
assert reloader["securityContext"] == main["securityContext"], reloader.get("securityContext")
|
||||
assert {"name": "config-users", "mountPath": "/etc/sw", "readOnly": True} in reloader["volumeMounts"]
|
||||
assert reloader["resources"] == {"limits": {"memory": "32Mi"}}
|
||||
# Without the reloader, the checksum hashes the existing Secret, so a change to it restarts the pod.
|
||||
# With it, nothing may: not the Secret, and not the values of the Secret the chart generates.
|
||||
annotations = lambda d: d["spec"]["template"]["metadata"].get("annotations") or {}
|
||||
assert "checksum/s3config" in annotations(off)
|
||||
assert "checksum/s3config" not in annotations(on), annotations(on)
|
||||
PYEOF
|
||||
# A release from a chart without configReloader, upgraded with --reuse-values, has no such map.
|
||||
helm template test $CHART_DIR --show-only "$template" "${reloader_args[@]}" \
|
||||
--set "$prefix.configReloader=null" > /tmp/reloader-old-values.yaml
|
||||
test "$(grep -c 's3-config-reloader' /tmp/reloader-old-values.yaml)" -eq 0
|
||||
if helm template test $CHART_DIR --show-only "$template" \
|
||||
--set "$prefix.enabled=true" --set "$prefix.configReloader.enabled=true" > /tmp/reloader-noauth.yaml 2>&1; then
|
||||
echo "FAIL: $prefix.configReloader rendered without $prefix.enableAuth"; exit 1
|
||||
fi
|
||||
grep -q "configReloader.enabled needs" /tmp/reloader-noauth.yaml
|
||||
done
|
||||
echo "S3 config reloader renders correctly"
|
||||
|
||||
echo "=== Testing the S3 config checksum is stable across renders ==="
|
||||
# s3-secret.yaml keeps its generated keys with lookup. Hashing the rendered
|
||||
# Secret drew new keys for the checksum whenever lookup found nothing (on
|
||||
@@ -336,40 +259,6 @@ jobs:
|
||||
grep -q "security-config" /tmp/security.yaml
|
||||
echo "Security configuration renders correctly"
|
||||
|
||||
echo "=== Testing volume server HTTPS ==="
|
||||
awk '/^ *\[https.client\]$/{f=1;next} /^ *\[/{f=0} f' /tmp/security.yaml | grep -q 'enabled = false'
|
||||
helm template test $CHART_DIR \
|
||||
--set global.seaweedfs.enableSecurity=true \
|
||||
--set global.seaweedfs.volumeHttps.enabled=true \
|
||||
--set volumes.hot.replicas=1 \
|
||||
> /tmp/volume-https.yaml
|
||||
awk '/^ *\[https.client\]$/{f=1;next} /^ *\[/{f=0} f' /tmp/volume-https.yaml > /tmp/volume-https-client.txt
|
||||
grep -q 'enabled = true' /tmp/volume-https-client.txt
|
||||
grep -q 'cert = "/usr/local/share/ca-certificates/client/tls.crt"' /tmp/volume-https-client.txt
|
||||
grep -q 'ca = "/usr/local/share/ca-certificates/ca/tls.crt"' /tmp/volume-https-client.txt
|
||||
awk '/^ *\[https.volume\]$/{f=1;next} /^ *\[/{f=0} f' /tmp/volume-https.yaml \
|
||||
| grep -q 'cert = "/usr/local/share/ca-certificates/volume/tls.crt"'
|
||||
grep -q "'\*.test-seaweedfs-volume.default'" /tmp/volume-https.yaml
|
||||
grep -q "'\*.test-seaweedfs-volume-hot.default'" /tmp/volume-https.yaml
|
||||
test "$(grep -c 'scheme: HTTPS' /tmp/volume-https.yaml)" -eq 4
|
||||
test "$(grep -c 'checksum/volume-https:' /tmp/volume-https.yaml)" -eq 4
|
||||
if grep -q 'checksum/volume-https' /tmp/security.yaml; then
|
||||
echo "FAIL: the volume HTTPS rollout annotation should only render while the option is on"
|
||||
exit 1
|
||||
fi
|
||||
if helm template test $CHART_DIR --set global.seaweedfs.volumeHttps.enabled=true > /dev/null 2>/tmp/volume-https-nosec.err; then
|
||||
echo "FAIL: volumeHttps without enableSecurity should fail to render"
|
||||
exit 1
|
||||
fi
|
||||
grep -q "requires global.seaweedfs.enableSecurity" /tmp/volume-https-nosec.err
|
||||
if helm template test $CHART_DIR --set global.seaweedfs.enableSecurity=true \
|
||||
--set global.seaweedfs.volumeHttps.enabled=true --set allInOne.enabled=true > /dev/null 2>/tmp/volume-https-aio.err; then
|
||||
echo "FAIL: volumeHttps with allInOne should fail to render"
|
||||
exit 1
|
||||
fi
|
||||
grep -q "not supported with allInOne" /tmp/volume-https-aio.err
|
||||
echo "Volume server HTTPS renders [https.volume], [https.client], certificate names, HTTPS probes and rollout annotations"
|
||||
|
||||
echo "=== Testing secure bucket-creation hook certificate mounts ==="
|
||||
helm template test $CHART_DIR \
|
||||
--show-only templates/shared/post-install-bucket-hook.yaml \
|
||||
@@ -471,9 +360,9 @@ jobs:
|
||||
def docs(manifest):
|
||||
return [d for d in yaml.safe_load_all(manifest) if d]
|
||||
|
||||
def security_config(manifest, name):
|
||||
def configmap(manifest, name):
|
||||
for d in docs(manifest):
|
||||
if d.get("kind") == "Secret" and d["metadata"]["name"] == name:
|
||||
if d.get("kind") == "ConfigMap" and d["metadata"]["name"] == name:
|
||||
return d
|
||||
return None
|
||||
|
||||
@@ -498,13 +387,13 @@ jobs:
|
||||
# security-related; preserve that so this PR is non-breaking on
|
||||
# existing installs.
|
||||
out = render({})
|
||||
if security_config(out, "test-seaweedfs-security-config") is not None:
|
||||
failed.append("defaults: security Secret should not render")
|
||||
if configmap(out, "test-seaweedfs-security-config") is not None:
|
||||
failed.append("defaults: security ConfigMap should not render")
|
||||
else:
|
||||
print("defaults: no security-config Secret (unchanged)")
|
||||
print("defaults: no security-config ConfigMap (unchanged)")
|
||||
|
||||
# Case 2: filerWrite=true alone is the documented opt-in for
|
||||
# the Admin UI Users tab. The Secret must render with
|
||||
# the Admin UI Users tab. Configmap must render with
|
||||
# [jwt.filer_signing] and NO [grpc.*] sections (cert paths
|
||||
# only exist with mTLS).
|
||||
out = render({
|
||||
@@ -514,11 +403,11 @@ jobs:
|
||||
# refuses to bind without authentication.
|
||||
"admin.secret.adminPassword": "ci-admin-password",
|
||||
})
|
||||
cm = security_config(out, "test-seaweedfs-security-config")
|
||||
cm = configmap(out, "test-seaweedfs-security-config")
|
||||
if cm is None:
|
||||
failed.append("filerWrite=true: security Secret missing")
|
||||
failed.append("filerWrite=true: security ConfigMap missing")
|
||||
else:
|
||||
toml = cm["stringData"]["security.toml"]
|
||||
toml = cm["data"]["security.toml"]
|
||||
if "[jwt.filer_signing]" not in toml:
|
||||
failed.append("filerWrite=true: security.toml missing [jwt.filer_signing]")
|
||||
if "[grpc" in toml:
|
||||
@@ -526,7 +415,7 @@ jobs:
|
||||
if "[jwt.filer_signing]" in toml and "[grpc" not in toml:
|
||||
print("filerWrite=true: security.toml has [jwt.filer_signing], no [grpc.*]")
|
||||
|
||||
# Case 3: filer + admin pods must MOUNT the security Secret
|
||||
# Case 3: filer + admin pods must MOUNT the security ConfigMap
|
||||
# under filerWrite=true so the JWT key reaches both processes.
|
||||
# Cert volumes must NOT be present (no mTLS).
|
||||
for wl in ("test-seaweedfs-filer", "test-seaweedfs-admin"):
|
||||
@@ -546,11 +435,11 @@ jobs:
|
||||
# with both [jwt.signing] and [grpc.*]. Guards against the
|
||||
# decoupling change accidentally regressing the mTLS path.
|
||||
out = render({"global.seaweedfs.enableSecurity": "true"})
|
||||
cm = security_config(out, "test-seaweedfs-security-config")
|
||||
cm = configmap(out, "test-seaweedfs-security-config")
|
||||
if cm is None:
|
||||
failed.append("enableSecurity=true: security Secret missing")
|
||||
failed.append("enableSecurity=true: security ConfigMap missing")
|
||||
else:
|
||||
toml = cm["stringData"]["security.toml"]
|
||||
toml = cm["data"]["security.toml"]
|
||||
missing = [s for s in ("[jwt.signing]", "[grpc.master]") if s not in toml]
|
||||
if missing:
|
||||
failed.append(f"enableSecurity=true: security.toml missing {missing}")
|
||||
@@ -567,8 +456,8 @@ jobs:
|
||||
except subprocess.CalledProcessError as e:
|
||||
failed.append(f"{null_path}=null: render failed: {e.output[:200] if e.output else e}")
|
||||
continue
|
||||
if security_config(out, "test-seaweedfs-security-config") is not None:
|
||||
failed.append(f"{null_path}=null: should not render the security Secret")
|
||||
if configmap(out, "test-seaweedfs-security-config") is not None:
|
||||
failed.append(f"{null_path}=null: should not render configmap")
|
||||
else:
|
||||
print(f"{null_path}=null: render tolerates explicit null")
|
||||
|
||||
@@ -672,16 +561,16 @@ jobs:
|
||||
mount = next((m for m in pod["containers"][0].get("volumeMounts", []) if m["name"] == "security-config"), None)
|
||||
# The file has to land on one of weed's config search paths, so
|
||||
# the target matters as much as the volume itself - and a volume
|
||||
# of that name backed by anything but the chart's Secret
|
||||
# of that name backed by anything but the chart's ConfigMap
|
||||
# leaves `weed shell` without the signing key just the same.
|
||||
target = ("/etc/seaweedfs/security.toml", "security.toml")
|
||||
secret = "test-seaweedfs-security-config"
|
||||
configmap = "test-seaweedfs-security-config"
|
||||
if vol is None or mount is None:
|
||||
failed.append("filerWrite=true: bucket hook does not mount security-config (s3.configure would fail)")
|
||||
elif (mount.get("mountPath"), mount.get("subPath")) != target:
|
||||
failed.append(f"filerWrite=true: bucket hook mounts security-config as {mount}")
|
||||
elif vol.get("secret", {}).get("secretName") != secret:
|
||||
failed.append(f"filerWrite=true: security-config is not backed by the {secret} Secret: {vol}")
|
||||
elif vol.get("configMap", {}).get("name") != configmap:
|
||||
failed.append(f"filerWrite=true: security-config is not backed by the {configmap} ConfigMap: {vol}")
|
||||
else:
|
||||
print("filerWrite=true: bucket hook mounts security-config at /etc/seaweedfs/security.toml")
|
||||
|
||||
@@ -2187,7 +2076,7 @@ jobs:
|
||||
"--set", "admin.enabled=true", "--set", "admin.secret.adminPassword=ci",
|
||||
"--set", "cosi.enabled=true", "--set", "networkPolicy.enabled=true",
|
||||
"--set", "volumes.dc2.replicas=1",
|
||||
# render the security Secret without its generated jwt key
|
||||
# render the security ConfigMap without its generated jwt key
|
||||
"--set", "global.seaweedfs.enableSecurity=true",
|
||||
"--set", "global.seaweedfs.securityConfig.jwtSigning.volumeWrite=false",
|
||||
]
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
|
||||
@@ -43,23 +43,23 @@ jobs:
|
||||
matrix:
|
||||
container-id: [unit-tests-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 1.0 --memory 1g --hostname kafka-unit-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 1
|
||||
CGO_ENABLED: 0
|
||||
CONTAINER_ID: ${{ matrix.container-id }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Container Environment
|
||||
run: |
|
||||
apk add --no-cache git
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [integration-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 2.0 --memory 2g --ulimit nofile=1024:1024 --hostname kafka-integration-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 2
|
||||
@@ -96,16 +96,16 @@ jobs:
|
||||
KAFKA_TEST_ISOLATION: "true"
|
||||
CONTAINER_ID: ${{ matrix.container-id }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Integration Container Environment
|
||||
run: |
|
||||
apk add --no-cache git procps
|
||||
@@ -136,7 +136,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [e2e-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 2.0 --memory 2g --hostname kafka-e2e-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 2
|
||||
@@ -150,7 +150,7 @@ jobs:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
@@ -315,7 +315,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [consumer-group-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 1.0 --memory 2g --ulimit nofile=512:512 --hostname kafka-consumer-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 1
|
||||
@@ -329,7 +329,7 @@ jobs:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
@@ -477,7 +477,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [client-compat-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 1.0 --memory 1.5g --shm-size 256m --hostname kafka-client-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 1
|
||||
@@ -491,7 +491,7 @@ jobs:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
@@ -635,7 +635,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [smq-integration-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 1.0 --memory 2g --hostname kafka-smq-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 1
|
||||
@@ -649,7 +649,7 @@ jobs:
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
@@ -796,7 +796,7 @@ jobs:
|
||||
matrix:
|
||||
container-id: [protocol-1]
|
||||
container:
|
||||
image: golang:1.27-alpine
|
||||
image: golang:1.26-alpine
|
||||
options: --cpus 1.0 --memory 1g --tmpfs /tmp:exec --hostname kafka-protocol-${{ matrix.container-id }}
|
||||
env:
|
||||
GOMAXPROCS: 1
|
||||
@@ -804,16 +804,16 @@ jobs:
|
||||
KAFKA_PROTOCOL_ISOLATION: "true"
|
||||
CONTAINER_ID: ${{ matrix.container-id }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Protocol Container Environment
|
||||
run: |
|
||||
apk add --no-cache git procps
|
||||
|
||||
@@ -42,15 +42,15 @@ jobs:
|
||||
path: test/plugin_workers/volume_balance
|
||||
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Run plugin worker tests
|
||||
run: go test -v ./${{ matrix.path }}
|
||||
@@ -39,6 +39,7 @@ permissions:
|
||||
issues: write
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.26'
|
||||
TIMEOUT: '45m'
|
||||
|
||||
jobs:
|
||||
@@ -60,11 +61,10 @@ jobs:
|
||||
- name: Clean up stale FUSE mounts
|
||||
uses: ./.github/actions/cleanup-stale-fuse-mounts
|
||||
|
||||
- name: Set up Go
|
||||
id: setup-go
|
||||
- name: Set up Go ${{ env.GO_VERSION }}
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
cache-dependency-path: |
|
||||
go.sum
|
||||
@@ -532,7 +532,7 @@ jobs:
|
||||
const report = fs.readFileSync(reportPath, 'utf8');
|
||||
const comment = `## POSIX Compliance Test Results
|
||||
|
||||
**Go Version:** ${{ steps.setup-go.outputs.go-version }}
|
||||
**Go Version:** ${{ env.GO_VERSION }}
|
||||
**FUSE Version:** ${{ matrix.fuse-version }}
|
||||
**Test Type:** ${{ github.event.inputs.test_type || 'full' }}
|
||||
|
||||
@@ -570,7 +570,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Install macFUSE
|
||||
@@ -623,7 +623,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Install security analysis tools
|
||||
@@ -680,7 +680,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -733,7 +733,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -38,16 +38,16 @@ jobs:
|
||||
run:
|
||||
working-directory: test/postgres
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Configure Docker Hub mirror
|
||||
run: |
|
||||
echo '{"registry-mirrors": ["https://mirror.gcr.io"]}' | sudo tee /etc/docker/daemon.json
|
||||
|
||||
@@ -4,7 +4,9 @@ name: "release: bump version and cut the release"
|
||||
# 1. bump MAJOR/MINOR in constants.go and the Helm Chart.yaml, commit to master
|
||||
# 2. push the <appVersion> tag, which fans out to the workflows that trigger on
|
||||
# `push: tags` (binaries_release*, container_release_unified, helm_manual_release)
|
||||
# 3. create the GitHub release, with GitHub's generated notes
|
||||
# 3. create the GitHub release, with GitHub's generated notes, then regroup those
|
||||
# notes by component (S3 API, Filer, Mount, ...) with
|
||||
# .github/scripts/release_notes_by_component.py
|
||||
# 4. dispatch "Prepare release" in seaweedfs-csi-driver and seaweedfs-operator,
|
||||
# which pick up the new master through `go get -u`, and wait for both
|
||||
#
|
||||
@@ -41,6 +43,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read # the notes step reads a PR's files when its title has no component prefix
|
||||
outputs:
|
||||
app_version: ${{ steps.compute.outputs.app_version }}
|
||||
sha: ${{ steps.tag.outputs.sha }}
|
||||
@@ -174,6 +177,19 @@ jobs:
|
||||
TAG: ${{ steps.compute.outputs.app_version }}
|
||||
run: gh release create "$TAG" --title "$TAG" --generate-notes --verify-tag
|
||||
|
||||
# GitHub's generated notes are one flat list of PRs. Sort them under
|
||||
# component headings by title prefix (or changed files). The release is
|
||||
# already published, so a failure here only leaves the flat list; rerun
|
||||
# the script by hand to fix it:
|
||||
# python3 .github/scripts/release_notes_by_component.py --tag <tag> --write
|
||||
- name: Group the release notes by component
|
||||
if: ${{ !inputs.dry_run }}
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ steps.compute.outputs.app_version }}
|
||||
run: python3 .github/scripts/release_notes_by_component.py --repo "$GITHUB_REPOSITORY" --tag "$TAG" --write > /dev/null
|
||||
|
||||
downstream:
|
||||
needs: release
|
||||
if: ${{ inputs.downstream && !inputs.dry_run }}
|
||||
|
||||
@@ -7,43 +7,32 @@ on:
|
||||
- 'seaweed-volume/**'
|
||||
- 'seaweed-common/**'
|
||||
- '.github/workflows/rust_binaries_dev.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
# Serialize dev builds of the shared "dev" release without cancelling a run.
|
||||
concurrency:
|
||||
group: rust-binaries-dev-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
prepare:
|
||||
cleanup:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_time: ${{ steps.build_time.outputs.value }}
|
||||
steps:
|
||||
- name: Ref guard
|
||||
if: github.ref != 'refs/heads/master'
|
||||
env:
|
||||
GH_REF: ${{ github.ref }}
|
||||
run: |
|
||||
echo "dev builds only publish from master (got $GH_REF)" >&2
|
||||
exit 1
|
||||
|
||||
- name: Set BUILD_TIME
|
||||
id: build_time
|
||||
run: |
|
||||
echo "value=$(date -u +%Y%m%d-%H%M)" >> "$GITHUB_OUTPUT"
|
||||
- name: Delete old Rust volume dev assets
|
||||
uses: mknejp/delete-release-assets@v1
|
||||
continue-on-error: true
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
tag: dev
|
||||
fail-if-no-assets: false
|
||||
assets: |
|
||||
weed-volume-*
|
||||
|
||||
build-rust-volume-dev-linux:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: prepare
|
||||
needs: cleanup
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -51,11 +40,6 @@ jobs:
|
||||
asset_suffix: linux-amd64
|
||||
|
||||
steps:
|
||||
|
||||
- name: Validate BUILD_TIME
|
||||
run: |
|
||||
: "${BUILD_TIME:?prepare output missing}"
|
||||
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Install Rust toolchain
|
||||
@@ -73,6 +57,9 @@ jobs:
|
||||
restore-keys: |
|
||||
rust-dev-${{ matrix.target }}-
|
||||
|
||||
- name: Set BUILD_TIME
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build Rust volume server (large disk)
|
||||
env:
|
||||
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
||||
@@ -109,10 +96,8 @@ jobs:
|
||||
build-rust-volume-dev-darwin:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [prepare, build-rust-volume-dev-linux]
|
||||
needs: build-rust-volume-dev-linux
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -122,11 +107,6 @@ jobs:
|
||||
asset_suffix: darwin-amd64
|
||||
|
||||
steps:
|
||||
|
||||
- name: Validate BUILD_TIME
|
||||
run: |
|
||||
: "${BUILD_TIME:?prepare output missing}"
|
||||
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Install Rust toolchain
|
||||
@@ -146,6 +126,9 @@ jobs:
|
||||
restore-keys: |
|
||||
rust-dev-${{ matrix.target }}-
|
||||
|
||||
- name: Set BUILD_TIME
|
||||
run: echo BUILD_TIME=$(date -u +%Y%m%d-%H%M) >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build Rust volume server (large disk)
|
||||
env:
|
||||
SEAWEEDFS_COMMIT: ${{ github.sha }}
|
||||
@@ -178,79 +161,3 @@ jobs:
|
||||
weed-volume-${{ env.BUILD_TIME }}-${{ matrix.asset_suffix }}.tar.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
prune:
|
||||
needs: [prepare, build-rust-volume-dev-linux, build-rust-volume-dev-darwin]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: write
|
||||
env:
|
||||
BUILD_TIME: ${{ needs.prepare.outputs.build_time }}
|
||||
RELEASE_TAG: dev
|
||||
steps:
|
||||
- name: Delete Rust dev binaries from older builds
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
: "${BUILD_TIME:?BUILD_TIME is empty}"
|
||||
case "$BUILD_TIME" in
|
||||
[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]) ;;
|
||||
*) echo "Invalid BUILD_TIME: $BUILD_TIME" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
release_tag="${RELEASE_TAG:-dev}"
|
||||
if ! release_json=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$release_tag" 2>&1); then
|
||||
case "$release_json" in
|
||||
*"Not Found"*) echo "No $release_tag release; nothing to prune"; exit 0 ;;
|
||||
esac
|
||||
echo "Release lookup failed: $release_json" >&2
|
||||
exit 1
|
||||
fi
|
||||
release_id=$(jq -r '.id // empty' <<<"$release_json")
|
||||
if [ -z "$release_id" ]; then
|
||||
echo "Release lookup returned no id" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
assets_file=$(mktemp)
|
||||
trap 'rm -f "$assets_file"' EXIT
|
||||
if ! gh api "repos/$GITHUB_REPOSITORY/releases/$release_id/assets" --paginate \
|
||||
--jq '.[] | select(.name | startswith("weed-volume-")) | [.id, .name] | @tsv' \
|
||||
> "$assets_file"; then
|
||||
echo "Failed to list release assets" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
total=$(awk 'END{print NR+0}' "$assets_file")
|
||||
matching=$(awk -v s="-$BUILD_TIME-" 'index($0,s){n++} END{print n+0}' "$assets_file")
|
||||
if [ "$matching" -eq 0 ]; then
|
||||
echo "No assets carry stamp $BUILD_TIME; refusing to prune" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_key=${BUILD_TIME/-/}
|
||||
kept=0; newer=0; deleted=0; gone=0; failed=0
|
||||
while IFS=$'\t' read -r id name || [ -n "${name:-}" ]; do
|
||||
[ -n "${id:-}" ] || continue
|
||||
case "$name" in
|
||||
*"-$BUILD_TIME-"*) kept=$((kept+1)); continue ;;
|
||||
esac
|
||||
if [[ "$name" =~ -([0-9]{8})-([0-9]{4})- ]] && [ "${BASH_REMATCH[1]}${BASH_REMATCH[2]}" -gt "$build_key" ]; then
|
||||
newer=$((newer+1)); continue
|
||||
fi
|
||||
if out=$(gh api -X DELETE "repos/$GITHUB_REPOSITORY/releases/assets/$id" </dev/null 2>&1); then
|
||||
deleted=$((deleted+1))
|
||||
else
|
||||
case "$out" in
|
||||
*"Not Found"*) gone=$((gone+1)) ;;
|
||||
*) failed=$((failed+1)); echo "Failed to delete asset $name ($id): $out" >&2 ;;
|
||||
esac
|
||||
fi
|
||||
done < "$assets_file"
|
||||
|
||||
[ "$((kept+newer+deleted+gone+failed))" -eq "$total" ] || { echo "Processed $((kept+newer+deleted+gone+failed)) of $total assets" >&2; exit 1; }
|
||||
echo "Kept $kept assets from this build and $newer from newer builds; deleted $deleted older assets; $gone already gone; $failed failures"
|
||||
[ "$failed" -eq 0 ] || { echo "::warning::prune: $failed deletions failed"; exit 1; }
|
||||
@@ -1,220 +0,0 @@
|
||||
name: "S3 digest and FIPS matrix"
|
||||
|
||||
# Runs the S3 suites in every digest mode with both volume servers and JWT
|
||||
# signing on, so the sha256 digest and GODEBUG=fips140=only stay working:
|
||||
# md5 GODEBUG=fips140=off, the default digest
|
||||
# sha256 GODEBUG=fips140=on with the filer's -digest=sha256
|
||||
# fips140only GODEBUG=fips140=only, built with GOFIPS140=v1.0.0
|
||||
# test/s3/digest_matrix/start_cluster.sh starts each cell's cluster.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'weed/operation/**'
|
||||
- 'weed/storage/**'
|
||||
- 'weed/security/**'
|
||||
- 'weed/util/**'
|
||||
- 'weed/command/**'
|
||||
- 'weed/pb/**'
|
||||
- 'seaweed-volume/**'
|
||||
- 'seaweed-common/**'
|
||||
- 'test/s3/digest_matrix/**'
|
||||
- 'test/s3/compatibility/**'
|
||||
- 'test/s3/etag/**'
|
||||
- 'test/s3/checksum/**'
|
||||
- 'docker/compose/s3.json'
|
||||
- 'docker/compose/s3tests.conf'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/s3-digest-matrix.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'weed/operation/**'
|
||||
- 'weed/storage/**'
|
||||
- 'weed/security/**'
|
||||
- 'weed/util/**'
|
||||
- 'weed/command/**'
|
||||
- 'weed/pb/**'
|
||||
- 'seaweed-volume/**'
|
||||
- 'seaweed-common/**'
|
||||
- 'test/s3/digest_matrix/**'
|
||||
- 'test/s3/compatibility/**'
|
||||
- 'test/s3/etag/**'
|
||||
- 'test/s3/checksum/**'
|
||||
- 'docker/compose/s3.json'
|
||||
- 'docker/compose/s3tests.conf'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/s3-digest-matrix.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build weed (GOFIPS140) and weed-volume
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Fingerprint build toolchain
|
||||
id: toolchain
|
||||
run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache cargo registry and target
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
seaweed-volume/target
|
||||
key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock', 'seaweed-common/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
rust-${{ steps.toolchain.outputs.fingerprint }}-
|
||||
|
||||
# GOFIPS140=v1.0.0 links the frozen Go Cryptographic Module, which the
|
||||
# fips140only cells need; the other cells set GODEBUG to off or on.
|
||||
- name: Build weed
|
||||
run: |
|
||||
cd weed
|
||||
CGO_ENABLED=0 GOFIPS140=v1.0.0 go build -tags s3tests -buildvcs=false -o weed .
|
||||
go version -m weed | grep GOFIPS140
|
||||
|
||||
- name: Build weed-volume
|
||||
run: cd seaweed-volume && cargo build --release
|
||||
|
||||
- name: Package binaries
|
||||
run: tar cf digest-matrix-binaries.tar weed/weed seaweed-volume/target/release/weed-volume
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: digest-matrix-binaries
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
path: digest-matrix-binaries.tar
|
||||
|
||||
suites:
|
||||
name: S3 suites (${{ matrix.digest }}, ${{ matrix.volume }} volume server)
|
||||
needs: build
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
digest: [ md5, sha256, fips140only ]
|
||||
volume: [ go, rust ]
|
||||
# s3_digest names the ETag digest for the Go suites. ceph_deselect
|
||||
# drops ceph tests whose answer the mode changes on purpose:
|
||||
# test_object_write_check_etag expects MD5("bar") as the ETag, and
|
||||
# under fips140=only SSE-C is refused with 501 before its headers are
|
||||
# compared, so the SSE-C conflict tests get 501 where they expect 400.
|
||||
include:
|
||||
- digest: md5
|
||||
s3_digest: md5
|
||||
- digest: sha256
|
||||
s3_digest: sha256
|
||||
ceph_deselect: --deselect s3tests/functional/test_s3.py::test_object_write_check_etag
|
||||
- digest: fips140only
|
||||
s3_digest: sha256
|
||||
ceph_deselect: >-
|
||||
--deselect s3tests/functional/test_s3.py::test_object_write_check_etag
|
||||
--deselect s3tests/functional/test_s3.py::test_put_obj_enc_conflict_c_s3
|
||||
--deselect s3tests/functional/test_s3.py::test_put_obj_enc_conflict_c_kms
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- uses: actions/setup-python@v7
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
# The same s3-tests checkout and fixes as the "Ceph S3 tests" workflow.
|
||||
- name: Clone s3-tests
|
||||
run: |
|
||||
git clone https://github.com/ceph/s3-tests.git
|
||||
cd s3-tests
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq libxml2-dev libxslt1-dev zlib1g-dev
|
||||
python3 -m pip install -r requirements.txt
|
||||
python3 -m pip install tox
|
||||
python3 -m pip install -e .
|
||||
cd ..
|
||||
S3_TESTS_PATH=s3-tests python3 test/s3/compatibility/fix_s3_tests_bucket_conflicts.py
|
||||
sed -i "s/assert prefixes == \['foo%2B1\/', 'foo\/', 'quux%20ab\/'\]/assert prefixes == \['foo\/', 'foo%2B1\/', 'quux%20ab\/'\]/" s3-tests/s3tests/functional/test_s3.py
|
||||
sed -i "/# request PartNumber out of range/,+4{s/assert status == 400/assert status == 416/; s/assert error_code == 'InvalidPart'/assert error_code == 'InvalidPartNumber'/}" s3-tests/s3tests/functional/test_s3.py
|
||||
|
||||
- uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: digest-matrix-binaries
|
||||
|
||||
- name: Restore binaries
|
||||
run: |
|
||||
tar xf digest-matrix-binaries.tar
|
||||
chmod +x weed/weed seaweed-volume/target/release/weed-volume
|
||||
|
||||
- name: Start the cluster
|
||||
env:
|
||||
DIGEST_MODE: ${{ matrix.digest }}
|
||||
VOLUME_SERVER: ${{ matrix.volume }}
|
||||
WEED: ${{ github.workspace }}/weed/weed
|
||||
WEED_VOLUME: ${{ github.workspace }}/seaweed-volume/target/release/weed-volume
|
||||
WORK_DIR: /tmp/digest-matrix
|
||||
S3_CONFIG: ${{ github.workspace }}/docker/compose/s3.json
|
||||
run: bash test/s3/digest_matrix/start_cluster.sh
|
||||
|
||||
- name: Run the basic ceph s3-tests
|
||||
working-directory: s3-tests
|
||||
env:
|
||||
S3TEST_CONF: ${{ github.workspace }}/docker/compose/s3tests.conf
|
||||
run: |
|
||||
mapfile -t tests < <(grep -v '^[[:space:]]*#' "$GITHUB_WORKSPACE/test/s3/compatibility/s3tests_basic.txt")
|
||||
# shellcheck disable=SC2086 # the deselect list is separate arguments
|
||||
tox -- "${tests[@]}" ${{ matrix.ceph_deselect }}
|
||||
|
||||
- name: Run the etag and checksum Go suites
|
||||
env:
|
||||
S3_ENDPOINT: http://127.0.0.1:8000
|
||||
S3_DIGEST: ${{ matrix.s3_digest }}
|
||||
S3_FIPS140_ONLY: ${{ matrix.digest == 'fips140only' && '1' || '0' }}
|
||||
S3_ACCESS_KEY: some_access_key1
|
||||
S3_SECRET_KEY: some_secret_key1
|
||||
run: go test -count=1 -timeout 10m ./test/s3/etag/ ./test/s3/checksum/
|
||||
|
||||
- name: Stop the cluster
|
||||
if: always()
|
||||
run: xargs kill < /tmp/digest-matrix/pids 2>/dev/null || true
|
||||
|
||||
- name: Upload server logs on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: digest-matrix-logs-${{ matrix.digest }}-${{ matrix.volume }}
|
||||
path: /tmp/digest-matrix/*.log
|
||||
retention-days: 3
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
name: "S3 listing study tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'test/s3/listing_study/**'
|
||||
- '.github/workflows/s3-listing-study-tests.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'test/s3/listing_study/**'
|
||||
- '.github/workflows/s3-listing-study-tests.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event.pull_request.number || github.ref }}/s3-listing-study-tests
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
listing-study:
|
||||
name: s3-listing-study tools and strategies
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 40
|
||||
defaults:
|
||||
run:
|
||||
working-directory: test/s3/listing_study
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Cache pinned listing tools
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: test/s3/listing_study/.work/tools
|
||||
key: listing-study-tools-${{ runner.os }}-${{ hashFiles('test/s3/listing_study/Makefile', 'test/s3/listing_study/install_tools.py') }}
|
||||
|
||||
- name: Build weed and install the study's pinned tools
|
||||
run: make build-weed tools
|
||||
|
||||
- name: Run the listing study against SeaweedFS
|
||||
timeout-minutes: 15
|
||||
run: make test
|
||||
|
||||
- name: Show logs on failure
|
||||
if: failure()
|
||||
run: |
|
||||
tail -200 .work/weed.log || true
|
||||
|
||||
- name: Upload results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: s3-listing-study-results
|
||||
path: |
|
||||
test/s3/listing_study/.work/run/results.json
|
||||
test/s3/listing_study/.work/weed.log
|
||||
retention-days: 14
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
@@ -153,7 +153,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Run Go unit tests
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
name: "S3 rclone fstests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'weed/command/mini.go'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- 'test/s3/rclone_fstests/**'
|
||||
- '.github/workflows/s3-rclone-tests.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/filer/**'
|
||||
- 'weed/server/**'
|
||||
- 'weed/command/mini.go'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- 'test/s3/rclone_fstests/**'
|
||||
- '.github/workflows/s3-rclone-tests.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
s3-rclone-fstests:
|
||||
name: rclone fstests (S3 backend)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 40
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Test the result checker
|
||||
working-directory: test/s3/rclone_fstests
|
||||
run: python3 -m unittest -v test_check_results
|
||||
|
||||
- name: Run rclone fstests
|
||||
working-directory: test/s3/rclone_fstests
|
||||
run: make test
|
||||
|
||||
- name: Show server log on failure
|
||||
if: failure()
|
||||
working-directory: test/s3/rclone_fstests
|
||||
run: tail -200 weed-test.log || true
|
||||
|
||||
- name: Upload results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: s3-rclone-fstests-results
|
||||
path: test/s3/rclone_fstests/results.jsonl
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
@@ -68,15 +68,7 @@ jobs:
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache suite Maven dependencies
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: snowflake-s3compat-m2-${{ hashFiles('test/s3/snowflake/run.sh') }}
|
||||
restore-keys: |
|
||||
snowflake-s3compat-m2-
|
||||
cache: ${{ runner.environment == 'github-hosted' && 'maven' || '' }}
|
||||
|
||||
- name: Install SeaweedFS
|
||||
run: |
|
||||
@@ -86,8 +78,6 @@ jobs:
|
||||
|
||||
- name: Run Snowflake S3Compat API tests
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
MAVEN_ARGS: -ntp -s ${{ github.workspace }}/test/s3/snowflake/maven-settings.xml
|
||||
run: |
|
||||
# Starts weed server, creates the buckets/objects the suite needs,
|
||||
# clones the upstream suite, and runs mvn -Dtest=S3CompatApiTest.
|
||||
|
||||
@@ -684,12 +684,6 @@ jobs:
|
||||
pull() { for i in 1 2 3; do docker pull "$1" && return 0; sleep 15; done; return 1; }
|
||||
pull apache/spark:3.5.1
|
||||
|
||||
- name: Cache Iceberg jars
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.cache/seaweedfs-test-jars
|
||||
key: iceberg-jars-${{ hashFiles('test/s3tables/catalog_spark/setup_test.go') }}
|
||||
|
||||
- name: Run go mod tidy
|
||||
run: go mod tidy
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
name: "S3 Tigris Compatibility Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/server/filer_server_handlers_*.go'
|
||||
- 'test/s3/tigris_compat/**'
|
||||
- '.github/workflows/s3-tigris-compat-tests.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'weed/s3api/**'
|
||||
- 'weed/server/filer_server_handlers_*.go'
|
||||
- 'test/s3/tigris_compat/**'
|
||||
- '.github/workflows/s3-tigris-compat-tests.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
s3-tigris-compat-tests:
|
||||
name: s3-api-compat-tests (Tigris)
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Run s3-api-compat-tests
|
||||
working-directory: test/s3/tigris_compat
|
||||
run: make test
|
||||
|
||||
- name: Show server log on failure
|
||||
if: failure()
|
||||
working-directory: test/s3/tigris_compat
|
||||
run: tail -200 weed-test.log || true
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: s3-tigris-compat-results
|
||||
path: test/s3/tigris_compat/results.json
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
@@ -197,9 +197,190 @@ jobs:
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# test/s3/compatibility/s3tests_basic.txt is shared with s3-digest-matrix.yml.
|
||||
mapfile -t basic_tests < <(grep -v '^[[:space:]]*#' "$GITHUB_WORKSPACE/test/s3/compatibility/s3tests_basic.txt")
|
||||
tox -- "${basic_tests[@]}"
|
||||
tox -- \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_distinct \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_many \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_many \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_encoding_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_encoding_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_prefix \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_prefix \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_prefix_ends_with_delimiter \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_prefix_ends_with_delimiter \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_prefix_underscore \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_prefix_underscore \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_percentage \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_percentage \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_whitespace \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_whitespace \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_dot \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_dot \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_delimiter_not_skip_special \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_delimiter_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_delimiter_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_delimiter_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_delimiter_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_delimiter_prefix_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_delimiter_prefix_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_delimiter_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_delimiter_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_delimiter_prefix_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_delimiter_prefix_delimiter_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_fetchowner_notempty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_fetchowner_defaultempty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_fetchowner_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_basic \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_alt \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_not_exist \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_prefix_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_prefix_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_maxkeys_one \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_maxkeys_one \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_maxkeys_zero \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_maxkeys_zero \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_maxkeys_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_maxkeys_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_unordered \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_unordered \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_maxkeys_invalid \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_marker_none \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_marker_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_continuationtoken_empty \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_continuationtoken \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_both_continuationtoken_startafter \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_marker_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_startafter_unreadable \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_marker_not_in_list \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_startafter_not_in_list \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_marker_after_list \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_startafter_after_list \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_return_data \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_objects_anonymous \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_objects_anonymous \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_objects_anonymous_fail \
|
||||
s3tests/functional/test_s3.py::test_bucket_listv2_objects_anonymous_fail \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_long_name \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_special_prefix \
|
||||
s3tests/functional/test_s3.py::test_bucket_delete_notexist \
|
||||
s3tests/functional/test_s3.py::test_bucket_create_delete \
|
||||
s3tests/functional/test_s3.py::test_object_read_not_exist \
|
||||
s3tests/functional/test_s3.py::test_multi_object_delete \
|
||||
s3tests/functional/test_s3.py::test_multi_objectv2_delete \
|
||||
s3tests/functional/test_s3.py::test_object_head_zero_bytes \
|
||||
s3tests/functional/test_s3.py::test_object_write_check_etag \
|
||||
s3tests/functional/test_s3.py::test_object_write_cache_control \
|
||||
s3tests/functional/test_s3.py::test_object_write_expires \
|
||||
s3tests/functional/test_s3.py::test_put_obj_enc_conflict_c_s3 \
|
||||
s3tests/functional/test_s3.py::test_put_obj_enc_conflict_c_kms \
|
||||
s3tests/functional/test_s3.py::test_put_obj_enc_conflict_s3_kms \
|
||||
s3tests/functional/test_s3.py::test_put_obj_enc_conflict_bad_enc_kms \
|
||||
s3tests/functional/test_s3.py::test_object_content_encoding_aws_chunked \
|
||||
s3tests/functional/test_s3.py::test_object_write_read_update_read_delete \
|
||||
s3tests/functional/test_s3.py::test_object_metadata_replaced_on_put \
|
||||
s3tests/functional/test_s3.py::test_object_write_file \
|
||||
s3tests/functional/test_s3.py::test_post_object_invalid_date_format \
|
||||
s3tests/functional/test_s3.py::test_post_object_no_key_specified \
|
||||
s3tests/functional/test_s3.py::test_post_object_missing_signature \
|
||||
s3tests/functional/test_s3.py::test_post_object_condition_is_case_sensitive \
|
||||
s3tests/functional/test_s3.py::test_post_object_expires_is_case_sensitive \
|
||||
s3tests/functional/test_s3.py::test_post_object_missing_expires_condition \
|
||||
s3tests/functional/test_s3.py::test_post_object_missing_conditions_list \
|
||||
s3tests/functional/test_s3.py::test_post_object_upload_size_limit_exceeded \
|
||||
s3tests/functional/test_s3.py::test_post_object_missing_content_length_argument \
|
||||
s3tests/functional/test_s3.py::test_post_object_invalid_content_length_argument \
|
||||
s3tests/functional/test_s3.py::test_post_object_upload_size_below_minimum \
|
||||
s3tests/functional/test_s3.py::test_post_object_empty_conditions \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifmatch_good \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifnonematch_good \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifmatch_failed \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifnonematch_failed \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifmodifiedsince_good \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifmodifiedsince_failed \
|
||||
s3tests/functional/test_s3.py::test_get_object_ifunmodifiedsince_failed \
|
||||
s3tests/functional/test_s3.py::test_get_checksum_object_attributes \
|
||||
s3tests/functional/test_s3.py::test_bucket_head \
|
||||
s3tests/functional/test_s3.py::test_bucket_head_notexist \
|
||||
s3tests/functional/test_s3.py::test_object_raw_authenticated \
|
||||
s3tests/functional/test_s3.py::test_object_raw_authenticated_bucket_acl \
|
||||
s3tests/functional/test_s3.py::test_object_raw_authenticated_object_acl \
|
||||
s3tests/functional/test_s3.py::test_object_raw_authenticated_object_gone \
|
||||
s3tests/functional/test_s3.py::test_object_raw_get_x_amz_expires_out_range_zero \
|
||||
s3tests/functional/test_s3.py::test_object_anon_put \
|
||||
s3tests/functional/test_s3.py::test_object_put_authenticated \
|
||||
s3tests/functional/test_s3.py::test_bucket_recreate_overwrite_acl \
|
||||
s3tests/functional/test_s3.py::test_bucket_recreate_new_acl \
|
||||
s3tests/functional/test_s3.py::test_buckets_create_then_list \
|
||||
s3tests/functional/test_s3.py::test_buckets_list_ctime \
|
||||
s3tests/functional/test_s3.py::test_list_buckets_invalid_auth \
|
||||
s3tests/functional/test_s3.py::test_list_buckets_bad_auth \
|
||||
s3tests/functional/test_s3.py::test_bucket_create_naming_good_contains_period \
|
||||
s3tests/functional/test_s3.py::test_bucket_create_naming_good_contains_hyphen \
|
||||
s3tests/functional/test_s3.py::test_bucket_list_special_prefix \
|
||||
s3tests/functional/test_s3.py::test_object_copy_zero_size \
|
||||
s3tests/functional/test_s3.py::test_object_copy_same_bucket \
|
||||
s3tests/functional/test_s3.py::test_object_copy_to_itself \
|
||||
s3tests/functional/test_s3.py::test_object_copy_diff_bucket \
|
||||
s3tests/functional/test_s3.py::test_object_copy_canned_acl \
|
||||
s3tests/functional/test_s3.py::test_object_copy_bucket_not_found \
|
||||
s3tests/functional/test_s3.py::test_object_copy_key_not_found \
|
||||
s3tests/functional/test_s3.py::test_multipart_copy_small \
|
||||
s3tests/functional/test_s3.py::test_multipart_copy_without_range \
|
||||
s3tests/functional/test_s3.py::test_multipart_copy_special_names \
|
||||
s3tests/functional/test_s3.py::test_multipart_copy_multiple_sizes \
|
||||
s3tests/functional/test_s3.py::test_multipart_get_part \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_empty \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_multiple_sizes \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_contents \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_overwrite_existing_object \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_size_too_small \
|
||||
s3tests/functional/test_s3.py::test_multipart_resend_first_finishes_last \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_resend_part \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_missing_part \
|
||||
s3tests/functional/test_s3.py::test_multipart_upload_incorrect_etag \
|
||||
s3tests/functional/test_s3.py::test_abort_multipart_upload \
|
||||
s3tests/functional/test_s3.py::test_list_multipart_upload \
|
||||
s3tests/functional/test_s3.py::test_atomic_read_1mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_read_4mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_read_8mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_write_1mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_write_4mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_write_8mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_dual_write_1mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_dual_write_4mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_dual_write_8mb \
|
||||
s3tests/functional/test_s3.py::test_atomic_multipart_upload_write \
|
||||
s3tests/functional/test_s3.py::test_ranged_request_response_code \
|
||||
s3tests/functional/test_s3.py::test_ranged_big_request_response_code \
|
||||
s3tests/functional/test_s3.py::test_ranged_request_skip_leading_bytes_response_code \
|
||||
s3tests/functional/test_s3.py::test_ranged_request_return_trailing_bytes_response_code \
|
||||
s3tests/functional/test_s3.py::test_copy_object_ifmatch_good \
|
||||
s3tests/functional/test_s3.py::test_copy_object_ifnonematch_failed \
|
||||
s3tests/functional/test_s3.py::test_copy_object_ifmatch_failed \
|
||||
s3tests/functional/test_s3.py::test_copy_object_ifnonematch_good \
|
||||
s3tests/functional/test_s3.py::test_lifecycle_set \
|
||||
s3tests/functional/test_s3.py::test_lifecycle_get \
|
||||
s3tests/functional/test_s3.py::test_lifecycle_set_filter
|
||||
|
||||
# The expiration tests race the lifecycle worker's meta-log replay;
|
||||
# under the suite's write flood a shard can trail an object's PUT
|
||||
|
||||
@@ -6,16 +6,12 @@ on:
|
||||
paths:
|
||||
- 'telemetry/**'
|
||||
- 'weed/telemetry/**'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/telemetry-integration.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'telemetry/**'
|
||||
- 'weed/telemetry/**'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
- '.github/workflows/telemetry-integration.yml'
|
||||
|
||||
concurrency:
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
|
||||
- name: Build SeaweedFS
|
||||
@@ -56,12 +56,8 @@ jobs:
|
||||
|
||||
- name: Setup Caddy
|
||||
run: |
|
||||
CADDY_VERSION=2.11.9
|
||||
base="https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}"
|
||||
curl -fsSLO "${base}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz"
|
||||
curl -fsSLO "${base}/caddy_${CADDY_VERSION}_checksums.txt"
|
||||
grep " caddy_${CADDY_VERSION}_linux_amd64.tar.gz$" "caddy_${CADDY_VERSION}_checksums.txt" | sha512sum -c -
|
||||
tar -xzf "caddy_${CADDY_VERSION}_linux_amd64.tar.gz" caddy
|
||||
curl -fsSL "https://caddyserver.com/api/download?os=linux&arch=amd64" -o caddy
|
||||
chmod +x caddy
|
||||
./caddy version
|
||||
echo "{
|
||||
auto_https disable_redirects
|
||||
|
||||
@@ -31,16 +31,16 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Build weed binary
|
||||
run: |
|
||||
cd weed && go build -o weed .
|
||||
|
||||
@@ -31,16 +31,16 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
cache: ${{ runner.environment == 'github-hosted' }}
|
||||
go-version-file: 'go.mod'
|
||||
go-version: ^1.26
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Build weed binary
|
||||
run: |
|
||||
cd weed && go build -o weed .
|
||||
|
||||
@@ -151,6 +151,3 @@ __pycache__/
|
||||
/test/s3vectors/weed-worker
|
||||
/test/s3vectors/weed-volume
|
||||
.pytest_cache/
|
||||
|
||||
# Graphify code graph (generated by .github/workflows/graph.yml)
|
||||
graphify-out/
|
||||
@@ -36,7 +36,6 @@ Table of Contents
|
||||
* [Docker Compose](#docker-compose)
|
||||
* [Kubernetes with Helm](#kubernetes-with-helm)
|
||||
* [Build from source](#build-from-source)
|
||||
* [Development builds](#development-builds)
|
||||
* [Scale out](#scale-out)
|
||||
* [Why SeaweedFS](#why-seaweedfs)
|
||||
* [Fast](#fast)
|
||||
@@ -88,7 +87,7 @@ AWS_ACCESS_KEY_ID=admin AWS_SECRET_ACCESS_KEY=secret \
|
||||
|
||||
The same process also runs the master, a volume server, the filer, WebDAV, the Iceberg REST catalog, and the Admin UI. Add `S3_TABLE_BUCKET=warehouse` to also create an Iceberg table bucket, or `warehouse:LANCE` for a Lance one. Drop the AWS keys to run without authentication for development.
|
||||
|
||||
`weed mini` binds the Admin UI/API and WebDAV to `-ip.bind` like its other components, even without authentication, so use it on a trusted network or set `WEED_ADMIN_PASSWORD` or `https.admin` mTLS. Pass `-admin.allowInsecureBind=false` or `-webdav.allowInsecureBind=false` to keep an unauthenticated Admin or WebDAV on loopback. The Admin worker gRPC control plane stays on loopback; remote workers must opt in with `-admin.worker.ip=<address>` and should configure `grpc.admin` mTLS.
|
||||
Without Admin authentication or mTLS, `weed mini` binds the Admin UI/API and its worker gRPC control plane to loopback rather than `-ip.bind`. Set `WEED_ADMIN_PASSWORD` or configure `https.admin` mTLS to keep the network bind. Remote workers must opt in with `-admin.worker.ip=<address>` and should configure `grpc.admin` mTLS. `-admin.allowInsecureBind` restores the legacy unauthenticated network bind and should only be used on an isolated network.
|
||||
|
||||
> macOS: if the binary is quarantined, run `xattr -d com.apple.quarantine ./weed` first.
|
||||
|
||||
@@ -176,15 +175,6 @@ cd seaweedfs/weed && make install
|
||||
|
||||
`weed` lands in `$GOPATH/bin`. [Getting Started][GettingStarted] covers running master, volume, filer, and S3 as separate processes.
|
||||
|
||||
## Development builds ##
|
||||
|
||||
Each dev build workflow publishes its latest successful build of `master`:
|
||||
|
||||
- **Binaries**: the [`dev` release](https://github.com/seaweedfs/seaweedfs/releases/tag/dev) has Linux amd64, Windows amd64, and macOS amd64/arm64 archives named `weed-<yyyymmdd-HHMM>-<linux|windows|darwin>-<arch>.tar.gz` (`.zip` on Windows) and `weed-large-disk-<yyyymmdd-HHMM>-<linux|windows|darwin>-<arch>`, each with an `.md5` checksum. The Rust volume server is published there too as `weed-volume-*` for Linux amd64 (glibc) and macOS amd64/arm64. The Go archives contain `weed-normal-disk` or `weed-large-disk` (`.exe` on Windows) rather than `weed`, and the Rust archives contain `weed-volume-normal` or `weed-volume-large-disk` rather than `weed-volume`, so rename or symlink the one you want. The `.md5` files are published for the Go archives only.
|
||||
- **Containers**: `docker pull chrislusf/seaweedfs:dev` or `ghcr.io/chrislusf/seaweedfs:dev`, built for `linux/amd64` and `linux/arm64`. The [dev compose file](docker/seaweedfs-dev-compose.yml) runs the Docker Hub image as master, volume, filer, S3, WebDAV, and admin.
|
||||
|
||||
The timestamp in a binary name is the UTC start time of the run that built it. The Go binaries, the Rust volume server, and the `:dev` image come from three separate path-filtered workflows, so they can carry different timestamps and lag `master` by hours, or much longer when their paths were not touched. The release can list more than one timestamp for a while, for example after a failed or retried run; use the newest one for your platform. The `dev` release is marked pre-release, so it does not appear under [releases/latest](https://github.com/seaweedfs/seaweedfs/releases/latest); these builds come from `master`, can break at any commit, and are not recommended for production.
|
||||
|
||||
## Scale out ##
|
||||
|
||||
Capacity is a volume server. Start one on any machine with disk and point it at the master:
|
||||
|
||||
+2
-15
@@ -278,24 +278,11 @@ automatic vacuum or another request is running does nothing and gets
|
||||
### Delete a collection
|
||||
|
||||
```bash
|
||||
curl -X DELETE "http://localhost:9333/col/delete?collection=benchmark"
|
||||
curl "http://localhost:9333/col/delete?collection=benchmark"
|
||||
```
|
||||
|
||||
Deletes all volumes of the collection, including erasure-coded shards.
|
||||
`204 No Content` on success. Only the `DELETE` method is accepted; any other
|
||||
method gets `405 Method Not Allowed`.
|
||||
|
||||
The `collection` parameter is required: a request without it, or with an
|
||||
empty value, gets `400 Bad Request`. To delete the default (empty-named)
|
||||
collection, name it explicitly with `collection=_default` or
|
||||
`collection=_default_`, the keywords `weed shell collection.delete` accepts.
|
||||
If a collection is literally named a keyword, that name deletes it, and when
|
||||
it exists next to the default collection the request gets
|
||||
`400 Bad Request`; use the other keyword for the default collection. If both
|
||||
keyword names are literal collections next to the default collection, both
|
||||
keywords get `400 Bad Request`; delete the default collection with
|
||||
`weed shell` `collection.delete -collection _default -apply`, where the
|
||||
keywords always mean the default collection.
|
||||
`204 No Content` on success.
|
||||
|
||||
### Health
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.27 AS builder
|
||||
FROM golang:1.26 AS builder
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y build-essential wget ca-certificates && \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Pin the builder to the host arch and cross-compile the (CGO-free) Go binary,
|
||||
# so arm64/arm/386 targets skip QEMU emulation of the whole compile.
|
||||
FROM --platform=$BUILDPLATFORM golang:1.27-alpine AS builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
|
||||
RUN apk add git g++ fuse
|
||||
RUN mkdir -p /go/src/github.com/seaweedfs/
|
||||
ARG BRANCH=${BRANCH:-master}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.27 AS builder
|
||||
FROM golang:1.26 AS builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.27 AS builder
|
||||
FROM golang:1.26 AS builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
|
||||
|
||||
+1
-3
@@ -21,9 +21,7 @@ docker compose -f seaweedfs-compose.yml -p seaweedfs up
|
||||
|
||||
```
|
||||
|
||||
## Try the latest development image
|
||||
|
||||
The compose file below uses `chrislusf/seaweedfs:dev`, built from `master`. It is a development image, not a stable release, and can lag `master` by hours or more; the `org.opencontainers.image.revision` label records the commit it was built from, and pinning by digest keeps that exact build. See [Development builds](../README.md#development-builds) for the `dev` binaries and image details.
|
||||
## Try latest tip
|
||||
|
||||
```bash
|
||||
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
|
||||
# Enable FIPS 140-3 mode by default (Go 1.24+)
|
||||
# To disable: docker run -e GODEBUG=fips140=off ...
|
||||
# For strict mode: docker run -e GODEBUG=fips140=only ...
|
||||
# The default goes first: Go applies the last of repeated GODEBUG settings, so
|
||||
# the caller's fips140 value wins.
|
||||
# Transparent huge pages are a host-wide setting this image cannot change; to
|
||||
# turn them off for this process only, append GODEBUG=disablethp=1.
|
||||
export GODEBUG="fips140=on${GODEBUG:+,$GODEBUG}"
|
||||
export GODEBUG="${GODEBUG:+$GODEBUG,}fips140=on"
|
||||
|
||||
# Fix permissions for mounted volumes
|
||||
# If /data is mounted from host, it might have different ownership
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
# Yandex Disk as a remote storage
|
||||
|
||||
SeaweedFS can mount a Yandex Disk and mirror buckets to it, the same way it uses
|
||||
S3, Google Cloud Storage, or Azure Blob Storage. The storage type is `yandex`.
|
||||
|
||||
Yandex Disk has no buckets: a **top-level folder under `yandex.root` plays the
|
||||
bucket**, and the folder holds the objects. A file's modification time and
|
||||
content encoding, which the Disk API cannot store natively, travel as custom
|
||||
resource properties (`seaweedfs_modified`, `seaweedfs_content_encoding`). The
|
||||
client also reads `rclone_modified`, so objects uploaded by rclone keep their
|
||||
mtime.
|
||||
|
||||
## Limitations to know first
|
||||
|
||||
- The public Disk API has **no multipart upload**: an object is one PUT. Very
|
||||
large objects are limited by the plan's maximum file size (see `GET /` quota)
|
||||
and need a long HTTP timeout.
|
||||
- Writes are expensive: one upload is an upload-link request, the PUT, a
|
||||
metadata PATCH, and a stat.
|
||||
- Yandex applies rate limits; the client retries 423, 429, 5xx and 509 with a
|
||||
backoff, the sync retries a failed upload from a fresh reader.
|
||||
- The Disk API lists one folder per request, so `remote.cache` and
|
||||
`remote.copy.local`, which walk a whole tree, cost one request per folder.
|
||||
- S3 keys that contain characters Yandex rejects in a path fail; there is no
|
||||
key-encoding layer. S3 keys are not folders: a prefix that only appears as
|
||||
part of object names is created on demand.
|
||||
- This is a consumer product: it fits backups and small mirrors, not millions
|
||||
of objects or a high request rate.
|
||||
|
||||
## 1. Register an OAuth app
|
||||
|
||||
1. Open <https://oauth.yandex.ru/client/new> and create an app.
|
||||
2. Pick the **Web services** platform.
|
||||
3. Set the redirect URI to `https://oauth.yandex.ru/verification_code`. That
|
||||
page shows the authorization code (or the token) for the operator to copy,
|
||||
so no browser is needed on the server.
|
||||
4. Grant the app the permissions you need:
|
||||
- `cloud_api:disk.write` — write anywhere on the disk (needed for buckets
|
||||
and for `-yandex.root` outside the app folder),
|
||||
- `cloud_api:disk.read` — read the disk,
|
||||
- `cloud_api:disk.info` — read the quota,
|
||||
- `cloud_api:disk.app_folder` — app folder only; then the configuration
|
||||
needs `-yandex.app_folder=true`.
|
||||
5. Copy the **ClientID** (and the **Client secret** if you want a refreshable
|
||||
token).
|
||||
|
||||
A Yandex Mail account is required for a working Disk subscription; a token
|
||||
issued for an account without one fails with
|
||||
`403 DiskUnsupportedUserAccountTypeError`.
|
||||
|
||||
## 2. Get a token
|
||||
|
||||
### Refreshable token (recommended)
|
||||
|
||||
```bash
|
||||
# 1. print the authorization url and keep the app credentials
|
||||
weed shell -master=... <<< "remote.configure -name=disk -type=yandex \
|
||||
-yandex.client_id=<client id> -yandex.client_secret=<client secret> -yandex.oauth_url"
|
||||
|
||||
# 2. open the printed url, allow the app, copy the code from the page
|
||||
# 3. store the token
|
||||
weed shell -master=... <<< "remote.configure -name=disk -yandex.code=<code>"
|
||||
```
|
||||
|
||||
The stored value is a token JSON document
|
||||
(`{"access_token","refresh_token","token_type","expiry"}`, the same shape
|
||||
rclone stores), so a token can also be copied from an existing rclone
|
||||
configuration.
|
||||
|
||||
### Debug token (one year, no refresh)
|
||||
|
||||
Open
|
||||
`https://oauth.yandex.ru/authorize?response_type=token&client_id=<client id>`
|
||||
in a browser, allow the app, and copy the token. Then:
|
||||
|
||||
```bash
|
||||
weed shell -master=... <<< "remote.configure -name=disk -type=yandex -yandex.token=<token>"
|
||||
```
|
||||
|
||||
To try the backend without registering an app, the Disk API polygon
|
||||
(<https://yandex.ru/dev/disk/poligon/>) issues a one-year token for its own
|
||||
OAuth app: sign in, click "Получить OAuth-токен", allow the access, and copy
|
||||
`access_token` from the address the page lands on. That token cannot be
|
||||
refreshed; use the code flow above for anything long-lived.
|
||||
|
||||
## 3. Configure
|
||||
|
||||
```bash
|
||||
remote.configure -name=disk -type=yandex -yandex.token=<token> [-yandex.root=/seaweedfs]
|
||||
```
|
||||
|
||||
| flag | meaning |
|
||||
| --- | --- |
|
||||
| `-yandex.token` | token JSON or a bare access token |
|
||||
| `-yandex.client_id`, `-yandex.client_secret` | OAuth app credentials, needed to refresh the token and for `-yandex.code` |
|
||||
| `-yandex.root` | folder that holds the buckets, default `/` |
|
||||
| `-yandex.app_folder` | the token only reaches the app folder: paths are addressed under `app:` |
|
||||
| `-yandex.trash` | move deleted files to the trash instead of deleting them permanently (the trash keeps occupying quota) |
|
||||
| `-yandex.endpoint` | override the API endpoint, e.g. for a proxy (default `https://cloud-api.yandex.net/v1/disk`); it must be `https`, plain `http` is accepted on a loopback host only, since every request carries the OAuth token |
|
||||
|
||||
A dedicated root (`-yandex.root=/seaweedfs`) is recommended: with the default
|
||||
`/`, `remote.mount.buckets` treats every top-level folder of the disk,
|
||||
personal folders included, as a bucket.
|
||||
|
||||
## 4. Mount or mirror
|
||||
|
||||
```bash
|
||||
# mount one folder as a local directory
|
||||
remote.mount -dir=/buckets/photos -remote=disk/photos
|
||||
|
||||
# mount every folder under the root as a bucket and pull its metadata
|
||||
remote.mount.buckets -remote=disk -apply
|
||||
|
||||
# pull remote changes into the local metadata later
|
||||
remote.meta.sync -dir=/buckets/photos
|
||||
|
||||
# mirror local buckets to the disk
|
||||
weed filer.remote.gateway -filer=<filer host>:<filer port> -createBucketAt=disk
|
||||
```
|
||||
|
||||
`weed filer.remote.sync -filer=... -dir=/buckets` uploads changes made under
|
||||
the mounted directories.
|
||||
|
||||
Deleting a local bucket deletes its remote folder only when that folder is
|
||||
empty, the same rule S3 and GCS apply to a bucket: a Disk API delete is
|
||||
recursive, and the folder may hold files SeaweedFS never saw.
|
||||
|
||||
## Token lifetime and refresh
|
||||
|
||||
An access token and its refresh token both live about a year. The client
|
||||
refreshes the access token when it expires or when the API answers 401, and
|
||||
uses the rotated refresh token Yandex returns. The refreshed token is kept in
|
||||
memory only: a client cannot write the configuration back to the filer. A
|
||||
restart within the token's lifetime keeps working with the stored refresh
|
||||
token; once Yandex rejects it (`invalid_grant`), issue a new one with
|
||||
`-yandex.oauth_url` and `-yandex.code` above. Yandex recommends refreshing a
|
||||
long-lived token every three months.
|
||||
|
||||
## Not covered
|
||||
|
||||
- `weed filer.backup` and the legacy `weed/replication/sink` sinks have no
|
||||
Yandex backend; use `filer.remote.sync` / `filer.remote.gateway`.
|
||||
- The Rust volume server (`seaweed-volume`) supports only S3-compatible remote
|
||||
storage; a Yandex remote cannot back a tiered volume there.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- `403 DiskUnsupportedUserAccountTypeError` — the account has no Yandex Mail /
|
||||
Disk subscription.
|
||||
- `401` on every request — the token is wrong or revoked; reissue it.
|
||||
- `invalid_grant` while refreshing — the refresh token expired or was rotated
|
||||
elsewhere; reissue it.
|
||||
- `500` right after an upload — Yandex finalizes an upload asynchronously; the
|
||||
client retries the stat, and a retry of the whole upload succeeds.
|
||||
@@ -1,118 +1,93 @@
|
||||
module github.com/seaweedfs/seaweedfs
|
||||
|
||||
go 1.27.4
|
||||
go 1.26.6
|
||||
|
||||
require (
|
||||
cloud.google.com/go/kms v1.36.1
|
||||
cloud.google.com/go v0.123.0 // indirect
|
||||
cloud.google.com/go/pubsub v1.51.1
|
||||
cloud.google.com/go/storage v1.69.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.24.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.3
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2
|
||||
github.com/Jille/raft-grpc-transport v1.6.1
|
||||
github.com/Shopify/sarama v1.38.1
|
||||
github.com/ThreeDotsLabs/watermill v1.5.3
|
||||
github.com/a-h/templ v0.3.1100
|
||||
github.com/apache/arrow-go/v18 v18.9.0
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2
|
||||
github.com/apache/iceberg-go v0.7.0
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3
|
||||
github.com/arangodb/go-driver v1.6.9
|
||||
github.com/aws/aws-sdk-go v1.55.8
|
||||
github.com/aws/aws-sdk-go-v2 v1.48.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.9
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.9
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.10
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6
|
||||
github.com/aws/smithy-go v1.28.9
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bwmarrin/snowflake v0.3.0
|
||||
github.com/cenkalti/backoff/v4 v4.3.0
|
||||
github.com/cespare/xxhash/v2 v2.3.0
|
||||
github.com/cognusion/imaging v1.0.4
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dustin/go-humanize v1.1.0
|
||||
github.com/eapache/go-resiliency v1.6.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // 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
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
||||
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4
|
||||
github.com/fluent/fluent-logger-golang v1.10.1
|
||||
github.com/getsentry/sentry-go v0.50.0
|
||||
github.com/go-ldap/ldap/v3 v3.4.14
|
||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
|
||||
github.com/fsnotify/fsnotify v1.10.1 // indirect
|
||||
github.com/go-redsync/redsync/v4 v4.18.0
|
||||
github.com/go-sql-driver/mysql v1.10.1
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/go-zookeeper/zk v1.0.4 // indirect
|
||||
github.com/golang/protobuf v1.5.4
|
||||
github.com/golang/snappy v1.0.0
|
||||
github.com/google/btree v1.1.3
|
||||
github.com/google/flatbuffers/go v0.0.0-20230108230133-3b8644d32c50
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/google/wire v0.7.0 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.27.0 // indirect
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/gorilla/sessions v1.4.0
|
||||
github.com/hashicorp/go-metrics v0.7.0
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/hashicorp/raft v1.8.0
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.4.2
|
||||
github.com/hashicorp/vault/api v1.23.0
|
||||
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.10.0
|
||||
github.com/jhump/protoreflect v1.18.1
|
||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||
github.com/jinzhu/copier v0.4.0
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/k0kubun/pp v3.0.1+incompatible
|
||||
github.com/karlseguin/ccache/v2 v2.0.8
|
||||
github.com/klauspost/compress v1.20.3
|
||||
github.com/klauspost/reedsolomon v1.14.2
|
||||
github.com/kurin/blazer v0.5.3
|
||||
github.com/linkedin/goavro/v2 v2.15.0
|
||||
github.com/linxGnu/grocksdb v1.11.1
|
||||
github.com/minio/crc64nvme v1.1.1
|
||||
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
|
||||
github.com/mailru/easyjson v0.9.2 // indirect
|
||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/olivere/elastic/v7 v7.0.32
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1
|
||||
github.com/parquet-go/parquet-go v0.32.0
|
||||
github.com/peterh/liner v1.2.3
|
||||
github.com/pierrec/lz4/v4 v4.1.33
|
||||
github.com/pkg/sftp v1.13.12
|
||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
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.24.1
|
||||
github.com/prometheus/client_model v0.6.3
|
||||
github.com/prometheus/common v0.71.0 // indirect
|
||||
github.com/prometheus/procfs v0.23.0
|
||||
github.com/rabbitmq/amqp091-go v1.17.0
|
||||
github.com/rclone/rclone v1.75.1
|
||||
github.com/rdleal/intervalst v1.5.0
|
||||
github.com/redis/go-redis/v9 v9.23.0
|
||||
github.com/schollz/progressbar/v3 v3.19.1
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.5
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/seaweedfs/goexif v1.0.3
|
||||
github.com/seaweedfs/raft v1.2.4
|
||||
github.com/shirou/gopsutil/v4 v4.26.10
|
||||
github.com/sirupsen/logrus v1.9.4 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/viper v1.21.0
|
||||
github.com/stretchr/testify v1.12.1
|
||||
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
|
||||
github.com/tarantool/go-option v1.1.0
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.2
|
||||
github.com/testcontainers/testcontainers-go v0.45.0
|
||||
github.com/tidwall/gjson v1.20.0
|
||||
github.com/tidwall/match v1.2.0
|
||||
github.com/tikv/client-go/v2 v2.0.7
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/tsuna/gohbase v0.0.0-20201125011725-348991136365
|
||||
github.com/twmb/avro v1.9.0
|
||||
github.com/tylertreat/BoomFilters v0.0.0-20210315201527-1a82519a3e43
|
||||
github.com/valyala/bytebufferpool v1.0.0
|
||||
github.com/viant/ptrie v1.0.1
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20260126094232-f2c4fccdb286
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.2.0
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.3
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.157.1
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.7.3
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.4
|
||||
go.etcd.io/etcd/client/v3 v3.7.3
|
||||
go.mongodb.org/mongo-driver v1.17.9
|
||||
go.uber.org/atomic v1.12.0
|
||||
go.yaml.in/yaml/v3 v3.0.6
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
gocloud.dev v0.49.0
|
||||
gocloud.dev/pubsub/natspubsub v0.49.0
|
||||
gocloud.dev/pubsub/rabbitpubsub v0.47.0
|
||||
@@ -121,39 +96,213 @@ require (
|
||||
golang.org/x/image v0.46.0
|
||||
golang.org/x/net v0.62.0
|
||||
golang.org/x/oauth2 v0.37.0
|
||||
golang.org/x/sync v0.25.0
|
||||
golang.org/x/sys v0.50.0
|
||||
golang.org/x/term v0.48.0
|
||||
golang.org/x/time v0.16.0
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated
|
||||
golang.org/x/sys v0.49.0
|
||||
golang.org/x/text v0.43.0 // indirect
|
||||
golang.org/x/tools v0.52.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.310.0
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b
|
||||
google.golang.org/genproto v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
google.golang.org/grpc v1.86.0-dev.0.20261027044109-d619b5d02089
|
||||
google.golang.org/grpc/security/advancedtls v1.0.0
|
||||
google.golang.org/protobuf v1.36.12
|
||||
modernc.org/sqlite v1.61.1
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
modernc.org/b v1.0.0 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.12.1 // indirect
|
||||
modernc.org/sqlite v1.60.1
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/kms v1.36.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys v0.10.0
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2
|
||||
github.com/Jille/raft-grpc-transport v1.6.1
|
||||
github.com/ThreeDotsLabs/watermill v1.5.3
|
||||
github.com/a-h/templ v0.3.1100
|
||||
github.com/apache/arrow-go/v18 v18.8.0
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2
|
||||
github.com/apache/iceberg-go v0.7.0
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3
|
||||
github.com/arangodb/go-driver v1.6.9
|
||||
github.com/aws/aws-sdk-go-v2 v1.48.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.33.9
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.20.9
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.10
|
||||
github.com/cespare/xxhash/v2 v2.3.0
|
||||
github.com/cognusion/imaging v1.0.4
|
||||
github.com/fluent/fluent-logger-golang v1.10.1
|
||||
github.com/getsentry/sentry-go v0.50.0
|
||||
github.com/go-ldap/ldap/v3 v3.4.14
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||
github.com/google/flatbuffers/go v0.0.0-20230108230133-3b8644d32c50
|
||||
github.com/hashicorp/go-metrics v0.7.0
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/hashicorp/raft v1.8.0
|
||||
github.com/hashicorp/raft-boltdb/v2 v2.4.2
|
||||
github.com/hashicorp/vault/api v1.23.0
|
||||
github.com/jhump/protoreflect v1.18.1
|
||||
github.com/linkedin/goavro/v2 v2.15.0
|
||||
github.com/minio/crc64nvme v1.1.1
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1
|
||||
github.com/parquet-go/parquet-go v0.32.0
|
||||
github.com/pkg/sftp v1.13.12
|
||||
github.com/rabbitmq/amqp091-go v1.16.0
|
||||
github.com/rclone/rclone v1.75.1
|
||||
github.com/rdleal/intervalst v1.5.0
|
||||
github.com/redis/go-redis/v9 v9.23.0
|
||||
github.com/schollz/progressbar/v3 v3.19.1
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4
|
||||
github.com/shirou/gopsutil/v4 v4.26.10
|
||||
github.com/tarantool/go-option v1.1.0
|
||||
github.com/tarantool/go-tarantool/v3 v3.0.2
|
||||
github.com/testcontainers/testcontainers-go v0.45.0
|
||||
github.com/tikv/client-go/v2 v2.0.7
|
||||
github.com/twmb/avro v1.9.0
|
||||
github.com/xeipuuv/gojsonschema v1.2.0
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.3
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.155.1
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3
|
||||
go.uber.org/atomic v1.12.0
|
||||
go.yaml.in/yaml/v3 v3.0.6
|
||||
golang.org/x/sync v0.24.0
|
||||
golang.org/x/tools/godoc v0.1.0-deprecated
|
||||
google.golang.org/grpc/security/advancedtls v1.0.0
|
||||
)
|
||||
|
||||
require github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
|
||||
|
||||
require (
|
||||
cloud.google.com/go/longrunning v1.3.0 // indirect
|
||||
cloud.google.com/go/pubsub/v2 v2.7.0 // indirect
|
||||
dario.cat/mergo v1.0.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/internal v0.1.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39 // indirect
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1 // indirect
|
||||
github.com/RoaringBitmap/roaring/v2 v2.26.0 // indirect
|
||||
github.com/a1ex3/zstd-seekable-format-go/pkg v0.10.0 // indirect
|
||||
github.com/adrg/xdg v0.5.3 // indirect
|
||||
github.com/anchore/go-lzo v0.1.1 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/apache/thrift v0.24.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/bazelbuild/rules_go v0.46.0 // indirect
|
||||
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
|
||||
github.com/bits-and-blooms/bitset v1.24.4 // indirect
|
||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||
github.com/boombuler/barcode v1.1.0 // indirect
|
||||
github.com/buger/jsonparser v1.2.0 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
|
||||
github.com/cockroachdb/errors v1.14.0 // 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/containerd/errdefs v1.0.0 // indirect
|
||||
github.com/containerd/errdefs/pkg v0.3.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/platforms v1.0.0-rc.4 // indirect
|
||||
github.com/cpuguy83/dockercfg v0.3.2 // indirect
|
||||
github.com/dave/dst v0.27.2 // indirect
|
||||
github.com/diskfs/go-diskfs v1.9.4 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.8.2 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/dromara/dongle v1.0.1 // indirect
|
||||
github.com/geoarrow/geoarrow-go v0.0.0-20260403143023-f54751c3e3a1 // indirect
|
||||
github.com/gin-gonic/gin v1.11.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.9.0 // indirect
|
||||
github.com/goccy/go-yaml v1.18.0 // indirect
|
||||
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // 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.2.0 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.7 // indirect
|
||||
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260708165336-dd6561bacfa2 // 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/jhump/protoreflect/v2 v2.0.0-beta.1 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/lib/pq v1.12.3 // indirect
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
|
||||
github.com/lpar/calendar v0.2.0 // indirect
|
||||
github.com/magiconair/properties v1.18.12 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/go-archive v0.3.3 // indirect
|
||||
github.com/moby/moby/api v1.56.1 // indirect
|
||||
github.com/moby/moby/client v0.6.2 // indirect
|
||||
github.com/moby/patternmatcher v0.6.1 // indirect
|
||||
github.com/moby/sys/sequential v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.4.1 // indirect
|
||||
github.com/moby/sys/userns v0.1.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/oklog/ulid/v2 v2.1.2 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
github.com/parquet-go/bitpack v1.0.0 // indirect
|
||||
github.com/parquet-go/jsonlite v1.0.0 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20260113132338-7c7de50cc741 // indirect
|
||||
github.com/pierrre/geohash v1.0.0 // indirect
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5 // indirect
|
||||
github.com/rclone/go-proton-api v1.0.4 // indirect
|
||||
github.com/rogpeppe/go-internal v1.15.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||
github.com/smarty/assertions v1.15.0 // indirect
|
||||
github.com/sony/gobreaker/v2 v2.4.0 // indirect
|
||||
github.com/stretchr/objx v0.5.3 // indirect
|
||||
github.com/substrait-io/substrait v0.87.0 // indirect
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.1 // indirect
|
||||
github.com/substrait-io/substrait-protobuf/go v0.85.0 // indirect
|
||||
github.com/twpayne/go-geom v1.6.1 // indirect
|
||||
github.com/twpayne/go-kml/v3 v3.2.1 // indirect
|
||||
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/zeebo/xxh3 v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.45.0 // indirect
|
||||
go.opentelemetry.io/otel/log v1.47.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
|
||||
go.uber.org/mock v0.5.2 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||
golang.org/x/mod v0.42.0 // indirect
|
||||
gonum.org/v1/gonum v0.17.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
cel.dev/expr v0.25.3 // indirect
|
||||
cloud.google.com/go v0.123.0 // indirect
|
||||
cloud.google.com/go/auth v0.24.1 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.3.0 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.10.0 // indirect
|
||||
cloud.google.com/go/iam v1.14.0 // indirect
|
||||
cloud.google.com/go/longrunning v1.3.0 // indirect
|
||||
cloud.google.com/go/monitoring v1.31.0 // indirect
|
||||
cloud.google.com/go/pubsub/v2 v2.7.0 // indirect
|
||||
dario.cat/mergo v1.0.2 // indirect
|
||||
filippo.io/edwards25519 v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.24.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.13.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.7.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.3
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azfile v1.7.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/internal v0.1.0 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.1.1 // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1 // indirect
|
||||
github.com/FilenCloudDienste/filen-sdk-go v0.0.39 // indirect
|
||||
github.com/Files-com/files-sdk-go/v3 v3.3.194 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0 // indirect
|
||||
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0 // indirect
|
||||
@@ -164,17 +313,10 @@ require (
|
||||
github.com/ProtonMail/gluon v0.17.1-0.20230724134000-308be39be96e // indirect
|
||||
github.com/ProtonMail/go-crypto v1.4.1 // indirect
|
||||
github.com/ProtonMail/go-srp v0.0.7 // indirect
|
||||
github.com/ProtonMail/gopenpgp/v3 v3.4.1 // indirect
|
||||
github.com/PuerkitoBio/goquery v1.12.0 // indirect
|
||||
github.com/RoaringBitmap/roaring/v2 v2.26.0 // indirect
|
||||
github.com/a1ex3/zstd-seekable-format-go/pkg v0.10.0 // indirect
|
||||
github.com/abbot/go-http-auth v0.4.0 // indirect
|
||||
github.com/adrg/xdg v0.5.3 // indirect
|
||||
github.com/anchore/go-lzo v0.1.1 // indirect
|
||||
github.com/andybalholm/brotli v1.2.8 // indirect
|
||||
github.com/andybalholm/brotli v1.2.7 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.4 // indirect
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||
github.com/apache/thrift v0.25.0 // 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/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27 // indirect
|
||||
@@ -187,81 +329,42 @@ require (
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sns v1.47.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sqs v1.52.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/bazelbuild/rules_go v0.46.0 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f // indirect
|
||||
github.com/bits-and-blooms/bitset v1.24.4 // indirect
|
||||
github.com/blevesearch/snowballstem v0.9.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6
|
||||
github.com/aws/smithy-go v1.28.9
|
||||
github.com/boltdb/bolt v1.3.1 // indirect
|
||||
github.com/boombuler/barcode v1.1.0 // indirect
|
||||
github.com/bradenaw/juniper v0.15.3 // indirect
|
||||
github.com/buengese/sgzip v0.1.1 // indirect
|
||||
github.com/buger/jsonparser v1.2.0 // indirect
|
||||
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/chilts/sid v0.0.0-20190607042430-660e94789ec9 // indirect
|
||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||
github.com/cloudflare/circl v1.6.4 // indirect
|
||||
github.com/cloudinary/cloudinary-go/v2 v2.16.0 // indirect
|
||||
github.com/cloudsoda/go-smb2 v0.0.0-20260701064823-d8c5600d73b8 // indirect
|
||||
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc // indirect
|
||||
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
|
||||
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
|
||||
github.com/cockroachdb/errors v1.14.0 // 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/colinmarc/hdfs/v2 v2.4.0 // indirect
|
||||
github.com/containerd/errdefs v1.0.0 // indirect
|
||||
github.com/containerd/errdefs/pkg v0.3.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/platforms v1.0.0-rc.4 // indirect
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
|
||||
github.com/cpuguy83/dockercfg v0.3.2 // indirect
|
||||
github.com/creasty/defaults v1.8.0 // indirect
|
||||
github.com/cronokirby/saferith v0.33.1-0.20250226174546-1f11f94ce488 // indirect
|
||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
|
||||
github.com/d4l3k/messagediff v1.2.1 // indirect
|
||||
github.com/dave/dst v0.27.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
||||
github.com/diskfs/go-diskfs v1.9.4 // indirect
|
||||
github.com/distribution/reference v0.6.0 // indirect
|
||||
github.com/docker/go-connections v0.8.2 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/dromara/dongle v1.0.1 // indirect
|
||||
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.4.0 // indirect
|
||||
github.com/eapache/go-resiliency v1.6.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||
github.com/eapache/queue v1.1.0 // indirect
|
||||
github.com/ebitengine/purego v0.11.2 // indirect
|
||||
github.com/elastic/gosigar v0.14.3 // indirect
|
||||
github.com/emersion/go-message v0.18.2 // indirect
|
||||
github.com/emersion/go-vcard v0.0.0-20260618161152-d854b7e0e2d3 // indirect
|
||||
github.com/envoyproxy/go-control-plane/envoy v1.40.1-0.20261014170222-9c4befd3c419 // indirect
|
||||
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
|
||||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
|
||||
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
|
||||
github.com/fatih/color v1.19.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.1.0 // indirect
|
||||
github.com/flynn/noise v1.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.10.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
||||
github.com/geoarrow/geoarrow-go v0.0.0-20260403143023-f54751c3e3a1 // indirect
|
||||
github.com/geoffgarside/ber v1.2.0 // indirect
|
||||
github.com/gin-gonic/gin v1.11.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.8 // indirect
|
||||
github.com/go-chi/chi/v5 v5.4.0 // indirect
|
||||
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.9.0 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.1.6 // indirect
|
||||
github.com/go-logr/logr v1.4.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
@@ -273,225 +376,129 @@ require (
|
||||
github.com/go-playground/validator/v10 v10.30.3 // indirect
|
||||
github.com/go-resty/resty/v2 v2.17.2 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
|
||||
github.com/go-zookeeper/zk v1.0.4 // indirect
|
||||
github.com/goccy/go-json v0.12.0 // indirect
|
||||
github.com/goccy/go-yaml v1.18.0 // indirect
|
||||
github.com/goccy/go-json v0.11.2 // indirect
|
||||
github.com/gofrs/flock v0.13.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
||||
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/s2a-go v0.1.11 // indirect
|
||||
github.com/google/wire v0.7.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.24 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.27.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/gorilla/schema v1.4.1 // indirect
|
||||
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||
github.com/gorilla/sessions v1.4.0
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.31.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // 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-msgpack/v2 v2.1.5 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
|
||||
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.2.0 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.7 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
|
||||
github.com/internxt/rclone-adapter v0.0.0-20260708165336-dd6561bacfa2 // 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/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
|
||||
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||
github.com/jhump/protoreflect/v2 v2.0.0-beta.1 // indirect
|
||||
github.com/jlaffaye/ftp v0.2.1-0.20251026020404-6602e981a1bb // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.5.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/jtolio/noiseconn v0.0.0-20231127013910-f6d9ecbf1de7 // indirect
|
||||
github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004 // indirect
|
||||
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.4.2 // indirect
|
||||
github.com/k0kubun/pp v3.0.1+incompatible
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 // 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/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/lanrat/extsort v1.4.2 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/lib/pq v1.12.3 // indirect
|
||||
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
|
||||
github.com/lpar/calendar v0.2.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20260627054121-477a66015f15 // indirect
|
||||
github.com/magiconair/properties v1.18.12 // indirect
|
||||
github.com/mailru/easyjson v0.9.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.15 // indirect
|
||||
github.com/mattn/go-isatty v0.0.24 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.31 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/moby/docker-image-spec v1.3.1 // indirect
|
||||
github.com/moby/go-archive v0.3.3 // indirect
|
||||
github.com/moby/moby/api v1.56.1 // indirect
|
||||
github.com/moby/moby/client v0.6.2 // indirect
|
||||
github.com/moby/patternmatcher v0.6.1 // indirect
|
||||
github.com/moby/sys/sequential v0.7.0 // indirect
|
||||
github.com/moby/sys/user v0.4.1 // indirect
|
||||
github.com/moby/sys/userns v0.1.0 // indirect
|
||||
github.com/moby/term v0.5.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/nats-io/nats.go v1.54.0 // indirect
|
||||
github.com/nats-io/nkeys v0.4.16 // indirect
|
||||
github.com/nats-io/nuid v1.0.1 // indirect
|
||||
github.com/ncruces/go-strftime v1.1.0 // indirect
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/ncw/swift/v2 v2.0.5 // indirect
|
||||
github.com/nxadm/tail v1.4.11 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/oklog/ulid/v2 v2.1.2 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.23.3 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.1 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/openzipkin/zipkin-go v0.4.3 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.121.0 // indirect
|
||||
github.com/panjf2000/ants/v2 v2.12.1 // indirect
|
||||
github.com/parquet-go/bitpack v1.0.0 // indirect
|
||||
github.com/parquet-go/jsonlite v1.0.0 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
|
||||
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect
|
||||
github.com/petermattis/goid v0.0.0-20260113132338-7c7de50cc741 // indirect
|
||||
github.com/philhofer/fwd v1.2.0 // indirect
|
||||
github.com/pierrre/geohash v1.0.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.33
|
||||
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/errors v0.9.1 // indirect
|
||||
github.com/pkg/xattr v0.4.12 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
|
||||
github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect
|
||||
github.com/pquerna/otp v1.5.0 // indirect
|
||||
github.com/prometheus/common v0.71.0 // indirect
|
||||
github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5 // indirect
|
||||
github.com/rclone/go-proton-api v1.0.4 // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/relvacode/iso8601 v1.7.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rfjakob/eme v1.2.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/rogpeppe/go-internal v1.15.0 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
|
||||
github.com/sagikazarmark/locafero v0.11.0 // indirect
|
||||
github.com/samber/lo v1.53.0 // indirect
|
||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||
github.com/sirupsen/logrus v1.9.4 // indirect
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||
github.com/smarty/assertions v1.15.0 // indirect
|
||||
github.com/sony/gobreaker v1.0.0 // indirect
|
||||
github.com/sony/gobreaker/v2 v2.4.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.25-0.20251022131615-eb24eb109368 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/spiffe/go-spiffe/v2 v2.9.0 // indirect
|
||||
github.com/stretchr/objx v0.5.3 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/substrait-io/substrait v0.87.0 // indirect
|
||||
github.com/substrait-io/substrait-go/v8 v8.1.1 // indirect
|
||||
github.com/substrait-io/substrait-protobuf/go v0.85.0 // indirect
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20260717075258-c6acd6a5bd04 // indirect
|
||||
github.com/tarantool/go-iproto v1.1.0 // indirect
|
||||
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/tikv/pd/client v0.0.0-20230329114254-1948c247c2b1 // indirect
|
||||
github.com/tinylib/msgp v1.6.4 // indirect
|
||||
github.com/tklauser/go-sysconf v0.4.0 // indirect
|
||||
github.com/tklauser/numcpus v0.12.0 // indirect
|
||||
github.com/twmb/murmur3 v1.1.8 // indirect
|
||||
github.com/twpayne/go-geom v1.6.1 // indirect
|
||||
github.com/twpayne/go-kml/v3 v3.2.1 // indirect
|
||||
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||
github.com/unknwon/goconfig v1.0.0 // indirect
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
||||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
|
||||
github.com/winfsp/cgofuse v1.6.1-0.20260126094232-f2c4fccdb286
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/yandex-cloud/go-genproto v0.0.0-20240819112322-98a264d392f6 // indirect
|
||||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20260810122915-65bfd5c4b705 // indirect
|
||||
github.com/ydb-platform/ydb-go-yc v0.12.5 // indirect
|
||||
github.com/ydb-platform/ydb-go-yc-metadata v0.6.2 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
github.com/yunify/qingstor-sdk-go/v3 v3.2.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
github.com/zeebo/errs v1.4.0 // indirect
|
||||
github.com/zeebo/xxh3 v1.1.0 // indirect
|
||||
go.etcd.io/bbolt v1.5.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.47.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.72.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect
|
||||
go.opentelemetry.io/otel v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/zipkin v1.45.0 // indirect
|
||||
go.opentelemetry.io/otel/log v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.47.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.11.1 // indirect
|
||||
go.uber.org/mock v0.5.2 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.28.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.4 // indirect
|
||||
golang.org/x/mod v0.42.0 // indirect
|
||||
golang.org/x/text v0.43.0 // indirect
|
||||
golang.org/x/tools v0.52.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
gonum.org/v1/gonum v0.17.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
golang.org/x/term v0.47.0
|
||||
golang.org/x/time v0.16.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20261019180522-ce908d29299b // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20261019180522-ce908d29299b
|
||||
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/b v1.0.0 // indirect
|
||||
modernc.org/libc v1.79.0 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.12.1 // indirect
|
||||
modernc.org/libc v1.77.1 // indirect
|
||||
moul.io/http2curl/v2 v2.3.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
storj.io/common v0.0.0-20260629224719-ba1bff0a7846 // indirect
|
||||
|
||||
@@ -142,8 +142,8 @@ github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e h1:4dAU9FXIyQktp
|
||||
github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
|
||||
github.com/anchore/go-lzo v0.1.1 h1:IwL/fvkdtlIrYIXck6WxZ3nb8WjjHziYYmGxlooyOnM=
|
||||
github.com/anchore/go-lzo v0.1.1/go.mod h1:3kLx0bve2oN1iDwgM1U5zGku1Tfbdb0No5qp1eL1fIk=
|
||||
github.com/andybalholm/brotli v1.2.8 h1:H9F6r7RNwzSRsx/lytpIYkbjNFMt2yNBwsJ2+0gpx78=
|
||||
github.com/andybalholm/brotli v1.2.8/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/andybalholm/brotli v1.2.7 h1:UgafRPGMam5ySHfRkhthMqOFA6IFoeF3D7mWIDLjG5A=
|
||||
github.com/andybalholm/brotli v1.2.7/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||
github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg=
|
||||
github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
@@ -151,14 +151,14 @@ github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op h1:kpBdlEPbRvff0m
|
||||
github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
|
||||
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
|
||||
github.com/apache/arrow-go/v18 v18.9.0 h1:o+CdPvv7G7tXRc3UCq7sAkMOEEzvPFhunnWPMtIDZeQ=
|
||||
github.com/apache/arrow-go/v18 v18.9.0/go.mod h1:QbEIuSG88lfEwkBfq1OKoZ5/aFXLObsS2awz9F5OKak=
|
||||
github.com/apache/arrow-go/v18 v18.8.0 h1:BLOzbPv7bxMPgXPacAg6HQjnxupYsZzC4tf+FkqPU/M=
|
||||
github.com/apache/arrow-go/v18 v18.8.0/go.mod h1:uJCFfCwq0KsxCmsCfQg4ft+LsW+iHYzAXiSDh5ug/8U=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2 h1:lu/p0Db2av18enHJvWJQoChLssI0P+AR06STq4VdvCc=
|
||||
github.com/apache/cassandra-gocql-driver/v2 v2.1.2/go.mod h1:QH/asJjB3mHvY6Dot6ZKMMpTcOrWJ8i9GhsvG1g0PK4=
|
||||
github.com/apache/iceberg-go v0.7.0 h1:bTD6Pb4uM4sWcMfIx0/cV1haHMc84r+CvPieUqYzD4I=
|
||||
github.com/apache/iceberg-go v0.7.0/go.mod h1:oGz5MX3/m3GDc6acsrwbdHChj28jZH8MVDWqUrW6WQQ=
|
||||
github.com/apache/thrift v0.25.0 h1:6LLlvoPjy8Cc/0b5TYRcTR3RZa2W0at3WQRcOkDwVGs=
|
||||
github.com/apache/thrift v0.25.0/go.mod h1:4lwyToijD9T70w7GlevFk7FnpY60Wv8I8krMkF6FkAo=
|
||||
github.com/apache/thrift v0.24.0 h1:zy31L1a49QTNB2bG1BBfMXol3yJrTH975G3pPubQVLQ=
|
||||
github.com/apache/thrift v0.24.0/go.mod h1:zPt6WxgvTOM6hF92y8C+MkEM5LMxZuk4JcQOiU4Esvs=
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3 h1:WZaTKNHCfcw7fWSR6/RKnCldVzvYZC+Y20Su4lffEIg=
|
||||
github.com/apple/foundationdb/bindings/go v0.0.0-20250911184653-27f7192f47c3/go.mod h1:OMVSB21p9+xQUIqlGizHPZfjK+SHws1ht+ZytVDoz9U=
|
||||
github.com/appscode/go-querystring v0.0.0-20170504095604-0126cfb3f1dc h1:LoL75er+LKDHDUfU5tRvFwxH0LjPpZN8OoG8Ll+liGU=
|
||||
@@ -544,8 +544,8 @@ github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd
|
||||
github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
|
||||
github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I=
|
||||
github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
|
||||
github.com/goccy/go-json v0.12.0 h1:pD+oWouAiz4yruwXIt/iT+lOMeyhr1aTtxzaMP/RgVI=
|
||||
github.com/goccy/go-json v0.12.0/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY=
|
||||
github.com/goccy/go-json v0.11.2 h1:jdZv93Tt4ioR8yW1CoNsvSxrcZlCXAUU1aZXN7gpXUA=
|
||||
github.com/goccy/go-json v0.11.2/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY=
|
||||
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
|
||||
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
|
||||
@@ -615,8 +615,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
|
||||
github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
|
||||
github.com/google/pprof v0.0.0-20261016150608-1facf8f91b50 h1:PlNWJRxu5APSV0pWqfIsZ0qt9OOGHSWfZQ4zvx+WgWs=
|
||||
github.com/google/pprof v0.0.0-20261016150608-1facf8f91b50/go.mod h1:yUo1AMMpsPIDFGuwDK8nLcf8+vvAd5l2O6JDZ6hpwrM=
|
||||
github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3 h1:LMLX+LgTNWpfvCBdFebv6EsYotImrt/Ppc5cXIriCSo=
|
||||
github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk=
|
||||
github.com/google/s2a-go v0.1.11 h1:7v1V1TraNGP63WptsAkNqr2w8jgm4vM6A6qx6Lsw9iM=
|
||||
github.com/google/s2a-go v0.1.11/go.mod h1:pz4tyvwXvJLLbyrkh6FW1eS2zPUXMaTmyNhYtyP2tNw=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
||||
@@ -784,8 +784,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
|
||||
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE=
|
||||
github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4=
|
||||
github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
|
||||
github.com/klauspost/cpuid/v2 v2.4.2 h1:xRw7IZEsAgVCp6trS/DgWbTAqpixhmywgVgBjYGg1bQ=
|
||||
github.com/klauspost/cpuid/v2 v2.4.2/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw=
|
||||
github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU=
|
||||
github.com/klauspost/reedsolomon v1.14.2 h1:SafJYwpBBQBI6amHUygcjxZjXeN2HpiENHQDwuPWCCQ=
|
||||
github.com/klauspost/reedsolomon v1.14.2/go.mod h1:yjqqjgMTQkBUHSG97/rm4zipffCNbCiZcB3kTqr++sQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
@@ -919,8 +919,8 @@ github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg=
|
||||
github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs=
|
||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk=
|
||||
github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g=
|
||||
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/ncw/swift/v2 v2.0.5 h1:9o5Gsd7bInAFEqsGPcaUdsboMbqf8lnNtxqWKFT9iz8=
|
||||
github.com/ncw/swift/v2 v2.0.5/go.mod h1:cbAO76/ZwcFrFlHdXPjaqWZ9R7Hdar7HpjRXBfbjigk=
|
||||
github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
|
||||
@@ -1049,8 +1049,8 @@ github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||
github.com/rabbitmq/amqp091-go v1.17.0 h1:6KmTqrnJq93cGIE3Q3UnXgsqw6NtLu8MNfFoIbfBAIQ=
|
||||
github.com/rabbitmq/amqp091-go v1.17.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||
github.com/rabbitmq/amqp091-go v1.16.0 h1:1O8oQqnj9hLACoo6CVMgn57z2pLWXvgemhh4GsquV+Y=
|
||||
github.com/rabbitmq/amqp091-go v1.16.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5 h1:K1++Qtk3PvgkiCCiv6Pahju1TMOzKY6VSwiwT7XLAVc=
|
||||
github.com/rclone/Proton-API-Bridge v1.0.5/go.mod h1:vCeOPhlXzevN0AFojgh1zsjhetiShy/ArvJ/xkFUDWk=
|
||||
github.com/rclone/go-proton-api v1.0.4 h1:AJW0e9pB4j0hVK4WqyGErFwaI+5MUQWPCtj5FYYxtPg=
|
||||
@@ -1100,8 +1100,8 @@ github.com/schollz/progressbar/v3 v3.19.1 h1:iv8BgwOvdML/S3p84uBpy/IMigv4U9594vP
|
||||
github.com/schollz/progressbar/v3 v3.19.1/go.mod h1:LFL7jqimKxfhero4K1eCkUr/6R39AgQeiPCJtlTWIW8=
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564 h1:TgxPraf1NmF6XTcUG53ULpLQrKvhtUJxQ3hyekxSDNQ=
|
||||
github.com/seaweedfs/cockroachdb-parser v0.0.0-20260225204133-2f342c5ea564/go.mod h1:JSKCh6uCHBz91lQYFYHCyTrSVIPge4SUFVn28iwMNB0=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.5 h1:qz3tuAGbUJOPJtaxyP35xW3JT23utywXKer0hoTiJPU=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.5/go.mod h1:zABdmWEa6A0bwaBeEOBUeUkGIZlxUhcdv+V1Dcc/U/I=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4 h1:ACyloiuopdhRSjdLLeSWbsVaemMPskORaRF01TY6GyM=
|
||||
github.com/seaweedfs/go-fuse/v2 v2.9.4/go.mod h1:zABdmWEa6A0bwaBeEOBUeUkGIZlxUhcdv+V1Dcc/U/I=
|
||||
github.com/seaweedfs/goexif v1.0.3 h1:ve/OjI7dxPW8X9YQsv3JuVMaxEyF9Rvfd04ouL+Bz30=
|
||||
github.com/seaweedfs/goexif v1.0.3/go.mod h1:Oni780Z236sXpIQzk1XoJlTwqrJ02smEin9zQeff7Fk=
|
||||
github.com/seaweedfs/raft v1.2.4 h1:lEBQ9seDSGrJNs2WitMgfYpaDxLgh9qukm1IJTEV1hk=
|
||||
@@ -1317,8 +1317,8 @@ github.com/ydb-platform/ydb-go-genproto v0.0.0-20260810122915-65bfd5c4b705 h1:7V
|
||||
github.com/ydb-platform/ydb-go-genproto v0.0.0-20260810122915-65bfd5c4b705/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I=
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.3 h1:A48PcmIETWwbEMIGwndv52uME6J1eJ28MBgF7HVR74o=
|
||||
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.5.3/go.mod h1:oRGF+67GWLbtNzqGygsPIUsjXmsRXD1KS5m3o5ppm2k=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.157.1 h1:eaf2VLTwta3VO0+K9+rUd1yWtXU6C5WxZx7v/sdbz/Y=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.157.1/go.mod h1:dJXJ1u00IqO8Vsph8fWmYj8b1E7jyphnvJPqA69emBY=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.155.1 h1:ZMByYe53zZ9R1o23fxJsbNhjzKFQkzpXm6uGj8gWHXQ=
|
||||
github.com/ydb-platform/ydb-go-sdk/v3 v3.155.1/go.mod h1:dJXJ1u00IqO8Vsph8fWmYj8b1E7jyphnvJPqA69emBY=
|
||||
github.com/ydb-platform/ydb-go-yc v0.12.5 h1:qYIeU1N6a92FaDA0+/vR55l5IzRF50MeLZwUWwvy2xQ=
|
||||
github.com/ydb-platform/ydb-go-yc v0.12.5/go.mod h1:DlSltVQKEdXJotaAYwoHzMGDF9EJw5S3hg3LXe/5yYw=
|
||||
github.com/ydb-platform/ydb-go-yc-metadata v0.6.2 h1:CZFawwHjLcjsxcl/g0dGIXbI2r41okPGLCydF4qTHcc=
|
||||
@@ -1351,8 +1351,8 @@ go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU=
|
||||
go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk=
|
||||
go.etcd.io/etcd/api/v3 v3.7.3 h1:2tumepXe+wi7Wab64uUO71K7ISQyUWLGC1DJbbc59sY=
|
||||
go.etcd.io/etcd/api/v3 v3.7.3/go.mod h1:HOR9Qn4gb/1/hVAmYprmlLpvTe6ZgfgNS9Z/+Ty65po=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.4 h1:633yLMDAQHWqLTRMxUNuZfOy6a4REJPcA3juoMRx5qU=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.4/go.mod h1:I1lMmoiq2SF4Wg0Gru7uXMovS1eEo6wwAxcFPFPk/v0=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3 h1:5zMwNu3ycrzCeA5NwOfQbxFRhqq974chq1DrYMua4QI=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.7.3/go.mod h1:/OhzqYrF0U7d1NOk55VMyUQGbYD1WoIe4bJwxb47wOk=
|
||||
go.etcd.io/etcd/client/v3 v3.7.3 h1:UrXcetgkuSEocaBlQlulQRJlXLEnUAHuBRbHh0lue1Q=
|
||||
go.etcd.io/etcd/client/v3 v3.7.3/go.mod h1:DcPxpqcpV8WIaRi/2waPCx0/Uq8rQUweDJaDYZk1gEE=
|
||||
go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU=
|
||||
@@ -1514,8 +1514,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
|
||||
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
|
||||
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
|
||||
golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1557,8 +1557,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
|
||||
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
|
||||
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
@@ -1567,8 +1567,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
|
||||
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
|
||||
golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM=
|
||||
golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
@@ -1705,20 +1705,20 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
modernc.org/b v1.0.0 h1:vpvqeyp17ddcQWF29Czawql4lDdABCDRbXRAS4+aF2o=
|
||||
modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg=
|
||||
modernc.org/cc/v4 v4.30.3 h1:aDq8gIX1X7+VFgO/JYYji6pLWL2H4tv3g8WatT3KCys=
|
||||
modernc.org/cc/v4 v4.30.3/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
|
||||
modernc.org/ccgo/v4 v4.37.0 h1:BAuJCUtIHIxFIYaFhqXIw5YaoMBlNCUlFovejHfMip4=
|
||||
modernc.org/ccgo/v4 v4.37.0/go.mod h1:/8627VhwWtAbqUXmPORxFQU5SgLrAx2jl9seLw9GBhY=
|
||||
modernc.org/cc/v4 v4.29.7 h1:q+NXGJ0bK3b4TXFYQQVr9pYETGnmwFWkrUzJnMya/Tg=
|
||||
modernc.org/cc/v4 v4.29.7/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
|
||||
modernc.org/ccgo/v4 v4.36.1 h1:ZNIUZAryN0UgnJwtyxrdEzcFc3yD4Cu4AzjfPXsLsIE=
|
||||
modernc.org/ccgo/v4 v4.36.1/go.mod h1:rrtGc2QkS239nYb/mQNuBMyjq3/y3ZXWbBjPoV3wqzA=
|
||||
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
|
||||
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
|
||||
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
|
||||
modernc.org/gc/v3 v3.2.0 h1:/Y3LGDMQaoYf55PebP1qsZ5FDGgAZyG1RYKEHeQzh1o=
|
||||
modernc.org/gc/v3 v3.2.0/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
||||
modernc.org/gc/v3 v3.1.5 h1:21ldfPfRYE31Tb7B3mwAK8gy1AxP4+dKjrOQPfqakoc=
|
||||
modernc.org/gc/v3 v3.1.5/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
||||
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
||||
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
||||
modernc.org/libc v1.79.0 h1:9Dvvv++bAMSkSuBzuOFAatbTV5OIoq6Y6FohmD3e7q8=
|
||||
modernc.org/libc v1.79.0/go.mod h1:uT3kR61NsbeKJSLqq83GJwSnZMVLlSjyAz4DfTaBy1M=
|
||||
modernc.org/libc v1.77.1 h1:Ct8j47QtiZ1Enj2DtFXQtUqrPCAjdCmPjtCuvrYQ0Hs=
|
||||
modernc.org/libc v1.77.1/go.mod h1:87/pZ4L6nD1zqW4nItuS12YO7hN1igAah34xjnQo/W0=
|
||||
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
@@ -1728,8 +1728,8 @@ modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
|
||||
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||
modernc.org/sqlite v1.61.1 h1:TBEE49wz7VlxS+qXRXMQiPUZYOXHJ4ku83daYv1fe04=
|
||||
modernc.org/sqlite v1.61.1/go.mod h1:f4gr5tbpx2umklaT/QVtbi/50hNdM+4ng+2zMo8KXJ0=
|
||||
modernc.org/sqlite v1.60.1 h1:/blz53O951KWFOso4QQvEs/Fq6cDBKLtMVrYNSeJVKw=
|
||||
modernc.org/sqlite v1.60.1/go.mod h1:1dIoEagfDE72QytD5scH1lxARtaUgKgHC/NuApA27r0=
|
||||
modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
|
||||
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
description: SeaweedFS
|
||||
name: seaweedfs
|
||||
appVersion: "4.55"
|
||||
appVersion: "4.54"
|
||||
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
|
||||
version: 4.55.0
|
||||
version: 4.54.0
|
||||
@@ -30,12 +30,10 @@ so your deployment will be spread/HA.
|
||||
|
||||
The chart's templates render with Helm 3.16.3 and newer versions tested in CI.
|
||||
Earlier Helm versions are not covered by this chart's compatibility checks.
|
||||
When JWT signing is enabled, `security.toml` is kept in the
|
||||
`<fullname>-security-config` Secret. A live upgrade reuses keys from that
|
||||
Secret, or from the security ConfigMap of earlier chart versions (including
|
||||
the legacy ConfigMap name); a key absent from them is generated. Plain
|
||||
`helm template` does not read cluster state; use an install and upgrade
|
||||
against a cluster to check key persistence.
|
||||
When JWT signing is enabled, a live upgrade reuses keys from the existing
|
||||
security ConfigMap (including the legacy ConfigMap name); a key absent from
|
||||
that ConfigMap is generated. Plain `helm template` does not read cluster state;
|
||||
use an install and upgrade against a cluster to check key persistence.
|
||||
|
||||
The key reader supports single-line quoted TOML strings in JWT sections,
|
||||
including indented assignments, quoted key names, and bare or simply quoted
|
||||
@@ -122,18 +120,6 @@ https://github.com/rancher/local-path-provisioner
|
||||
you can use ANY storage class you like, just update the correct storage-class
|
||||
for your deployment.
|
||||
|
||||
Every claim the chart creates also takes an optional `volumeAttributesClassName`
|
||||
next to its `storageClass` (for example `master.data.volumeAttributesClassName`
|
||||
or `volume.dataDirs[].volumeAttributesClassName`), to set provisioned
|
||||
performance such as IOPS and throughput through a
|
||||
[VolumeAttributesClass](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/).
|
||||
It needs Kubernetes 1.34+, or 1.31+ with the `VolumeAttributesClass` feature gate.
|
||||
`volumeClaimTemplates` cannot be changed on an existing StatefulSet, and a new
|
||||
template only reaches claims created after it. To set it on a release that
|
||||
already exists, patch `spec.volumeAttributesClassName` on each existing claim,
|
||||
and delete the StatefulSet with `--cascade=orphan` before the upgrade so the
|
||||
upgrade can apply the new template.
|
||||
|
||||
### Master data: hostPath vs a claim
|
||||
|
||||
The master's `-mdir` holds its Raft log and snapshots, and with them the
|
||||
@@ -342,47 +328,6 @@ applies. Rotating a key in the Secret takes effect on the next pod restart, as
|
||||
with any other environment variable. The COSI driver parses the config itself
|
||||
and does not resolve these references.
|
||||
|
||||
#### Reload identities without a restart
|
||||
|
||||
The chart hashes `existingConfigSecret` into the filer and S3 pod templates when it renders,
|
||||
so the first Helm upgrade after the Secret's content changes restarts those pods, and every
|
||||
identity change briefly takes S3 down, completely so with a single filer. SeaweedFS also
|
||||
reloads the identities file on SIGHUP, which `configReloader` uses instead:
|
||||
|
||||
```yaml
|
||||
filer:
|
||||
s3:
|
||||
enabled: true
|
||||
enableAuth: true
|
||||
existingConfigSecret: my-s3-identities
|
||||
configReloader:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
`s3.configReloader` does the same for the standalone S3 gateway. With it:
|
||||
|
||||
- An `s3-config-reloader` sidecar checks the mounted identities file every second, and
|
||||
sends SIGHUP to SeaweedFS when it changes and once when it starts. Kubelet updates the
|
||||
file at its next sync of the pod. Secret volumes are eventually consistent, so there is no
|
||||
fixed bound: with the kubelet's default settings (a one-minute sync period and the `Watch`
|
||||
Secret change detection strategy) it typically takes up to about 90 seconds, and changing
|
||||
an annotation on the pod usually brings it down to seconds. Other kubelet settings can make
|
||||
it slower. Until the file is updated, a revoked identity keeps working.
|
||||
- Changes to the content of `existingConfigSecret` no longer restart the pod: the chart
|
||||
leaves `checksum/s3config` off it. Adding, changing, disabling and deleting identities
|
||||
apply without a restart. Other files in the Secret, such as an audit log config, still
|
||||
need one, and so do changes to the values the chart generates its own Secret from, such
|
||||
as `s3.credentials`.
|
||||
- Every reload also re-creates the KMS providers configured in the identities file. The
|
||||
`local` provider keeps its keys in memory, so a reload replaces them, as a restart does;
|
||||
use another provider for objects that must stay readable.
|
||||
- The pod shares its process namespace (see [Sharing the process namespace](#sharing-the-process-namespace)),
|
||||
so the sidecar can see SeaweedFS. It uses the component's image and container security
|
||||
context, because it must run as the same user as SeaweedFS to signal it. If it can't
|
||||
signal SeaweedFS, it logs a warning.
|
||||
|
||||
The all-in-one deployment does not have this option.
|
||||
|
||||
## Admin Component
|
||||
|
||||
The admin component provides a modern web-based administration interface for managing SeaweedFS clusters. It includes:
|
||||
@@ -624,8 +569,6 @@ s3:
|
||||
|
||||
With `rules` left empty the route sends all traffic to the component's own Service and port. A rule may set `matches`, `filters`, `timeouts` and `backendRefs`, and a rule without `backendRefs` still routes to that Service. In all-in-one mode the master, volume, filer and s3 routes target the all-in-one Service. When S3 runs only on the filer (`filer.s3.enabled` without `s3.enabled`), the s3 route uses `filer.s3.port`.
|
||||
|
||||
Outside all-in-one mode, the volume Ingress and the default volume route target the `client-volume` Service, which lists only Ready volume pods. The `volume` Service also publishes pods that are not Ready yet, so their DNS records can exist before readiness. An explicit `backendRefs` entry that names the `volume` Service can therefore reach a volume server before it is Ready. Name the `client-volume` Service instead, with `volume.port`, and copy its `metadata.name` from `helm template` because long release names are truncated.
|
||||
|
||||
## Network Policies
|
||||
|
||||
In a namespace with a default-deny policy the install hangs: the components cannot resolve each other, and the post-install bucket hook waits on the master and filer until it gives up. `networkPolicy.enabled` renders one `NetworkPolicy` per component, selecting its pods by the standard `app.kubernetes.io/{name,instance,component}` labels and admitting traffic from the other pods of the release on the ports that component listens on.
|
||||
@@ -667,25 +610,10 @@ Two things worth knowing before you turn this on:
|
||||
|
||||
The DNS selectors default to CoreDNS as kubeadm, kind and the managed offerings from AWS, Google and Azure install it. On OpenShift, override `egress.dnsNamespaceSelector` and `egress.dnsPodSelector` to match `openshift-dns`; see the comment in `values.yaml`.
|
||||
|
||||
## Volume server HTTPS
|
||||
|
||||
With `global.seaweedfs.enableSecurity`, gRPC between components uses mutual TLS, but the volume servers' HTTP port, which carries the file data, stays plaintext. Set `global.seaweedfs.volumeHttps.enabled: true` to serve it over TLS:
|
||||
|
||||
- `[https.volume]` points at the volume certificate, which then also names every volume group's service (`*.<fullname>-volume.<namespace>`), since volume servers register as `<pod>.<fullname>-volume.<namespace>`. With `certificates.externalCertificates`, the provided `<fullname>-volume-cert` needs those names.
|
||||
- `[https.client]` is enabled with the client certificate and the chart CA, so every chart pod that talks to the volume servers does it over HTTPS.
|
||||
- The volume probes use HTTPS.
|
||||
- Every pod that reads `security.toml` gets a `checksum/volume-https` annotation, so switching the option on or off restarts them together.
|
||||
|
||||
The volume servers do not require client certificates, because kubelet probes cannot present one; enable JWT signing (`securityConfig.jwtSigning`) to authorize volume reads and writes. `[https.client]` also sends the admin UI's HTTP lookups on masters and S3 over HTTPS, which their plain listeners refuse, so the UI can miss volume public URLs and refuse SSE-S3 vector buckets. A volume Ingress or HTTPRoute needs its controller's HTTPS-backend setting. `weed mount`, the CSI driver and other clients outside the chart need their own `[https.client]` with the chart CA. The option is not supported with `allInOne`, whose volume server registers by pod IP.
|
||||
|
||||
## Common labels
|
||||
|
||||
`commonLabels` adds labels to the metadata of every object the chart creates. It may be a map or a template string rendering to one. The chart's own labels cannot be overridden, and pods (see `podLabels`) and `volumeClaimTemplates` are left unchanged.
|
||||
|
||||
## Sharing the process namespace
|
||||
|
||||
`filer.shareProcessNamespace` and `s3.shareProcessNamespace` let the containers in the filer and S3 pods see each other's processes, so a sidecar can signal SeaweedFS, for example with SIGHUP to reload the S3 identities file. SeaweedFS is then no longer PID 1 in its container, and every container in the pod can read the other containers' processes and files through `/proc`. Both are off by default.
|
||||
|
||||
## Pod and container security contexts
|
||||
|
||||
Pod and container security contexts are configurable independently for every built-in workload and remain empty by default for backwards compatibility. The examples in `values.yaml` show how to enable a `RuntimeDefault` seccomp profile, disable privilege escalation and privileged mode, drop all Linux capabilities, and use a read-only root filesystem.
|
||||
@@ -786,7 +714,7 @@ global:
|
||||
|
||||
The engine registers its pod address with the masters and stores indexes through the filers and volume servers. Both Go and Rust volume servers use the same setup. The maintenance worker builds and updates ANN indexes; queries can scan data before indexing completes. Enabling filer write signing also requires clients writing directly to the filer HTTP API to supply a signed JWT.
|
||||
|
||||
The bundled engine images support Linux amd64 and arm64. Use `vector.imageOverride` to select a compatible engine build, `vector.masters` for an external cluster, and `vector.resources` to set memory and CPU limits. The engine sizes its caches to a quarter of its memory limit.
|
||||
The bundled engine images support Linux amd64 and arm64. Use `vector.imageOverride` to select a compatible engine build, `vector.masters` for an external cluster, and `vector.resources` to set memory and CPU limits. The cache defaults to 512 MiB and is configured with `vector.readCacheMB`.
|
||||
|
||||
`global.seaweedfs.enableSecurity` provisions and mounts the vector certificate and shared security configuration. With external certificates, provide the `<fullname>-vector-cert` secret (`my-seaweedfs-vector-cert` for release `my`). `fullname` follows `seaweedfs.fullname`, including `fullnameOverride`, `nameOverride`, and DNS-name truncation. Provide this secret alongside the existing CA and client secrets.
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ spec:
|
||||
{{- with .Values.admin.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.admin.restartPolicy }}
|
||||
{{- if .Values.admin.affinity }}
|
||||
@@ -189,10 +188,6 @@ spec:
|
||||
{{- else }}
|
||||
-masters={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ include "seaweedfs.namespace" $ }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }} \
|
||||
{{- end }}
|
||||
{{- /* admin lists the filers and S3 gateways the workers use from this group */}}
|
||||
{{- if .Values.filer.filerGroup }}
|
||||
-filerGroup={{ .Values.filer.filerGroup }} \
|
||||
{{- end }}
|
||||
{{- if $urlPrefix }}
|
||||
-urlPrefix={{ $urlPrefix }} \
|
||||
{{- end }}
|
||||
@@ -318,8 +313,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
@@ -359,9 +354,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.admin.data.storageClass }}
|
||||
{{- with .Values.admin.data.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.data.size }}
|
||||
@@ -376,9 +368,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.admin.logs.storageClass }}
|
||||
{{- with .Values.admin.logs.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.logs.size }}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if .Values.allInOne.enabled }}
|
||||
{{- if include "seaweedfs.volumeHttps" . }}
|
||||
{{- fail "global.seaweedfs.volumeHttps is not supported with allInOne: its volume server registers by pod IP, which the volume certificate cannot name" }}
|
||||
{{- end }}
|
||||
{{- $s3PreStopSeconds := 0 }}
|
||||
{{- if .Values.allInOne.s3.enabled }}
|
||||
{{- $s3PreStopSeconds = .Values.allInOne.s3.preStopSeconds }}
|
||||
@@ -507,8 +504,8 @@ spec:
|
||||
name: {{ include "seaweedfs.fullname" . }}-master-config
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -22,9 +22,6 @@ spec:
|
||||
{{- if .Values.allInOne.data.storageClass }}
|
||||
storageClassName: {{ .Values.allInOne.data.storageClass }}
|
||||
{{- end }}
|
||||
{{- with .Values.allInOne.data.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.allInOne.data.size | default "10Gi" }}
|
||||
|
||||
@@ -38,14 +38,6 @@ spec:
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-master.{{ include "seaweedfs.namespace" . }}'
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-master.{{ include "seaweedfs.namespace" . }}.svc'
|
||||
- '*.{{ include "seaweedfs.fullname" . }}-master.{{ include "seaweedfs.namespace" . }}.svc.cluster.local'
|
||||
{{- if include "seaweedfs.volumeHttps" . }}
|
||||
{{- range $vname, $_ := deepCopy .Values.volumes | mergeOverwrite (dict "" .Values.volume) }}
|
||||
{{- $volumeService := printf "%s.%s" (include "seaweedfs.componentName" (list $ (trimSuffix "-" (printf "volume-%s" $vname)))) (include "seaweedfs.namespace" $) }}
|
||||
- '*.{{ $volumeService }}'
|
||||
- '*.{{ $volumeService }}.svc'
|
||||
- '*.{{ $volumeService }}.svc.cluster.local'
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.certificates.ipAddresses }}
|
||||
ipAddresses:
|
||||
{{- range .Values.certificates.ipAddresses }}
|
||||
|
||||
@@ -39,7 +39,6 @@ spec:
|
||||
{{- with .Values.cosi.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.cosi.restartPolicy }}
|
||||
{{- if .Values.cosi.affinity }}
|
||||
@@ -196,8 +195,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
{{- if .Values.filer.s3.enabled }}
|
||||
{{- $s3PreStopSeconds = .Values.filer.s3.preStopSeconds | int }}
|
||||
{{- end }}
|
||||
{{- $s3ConfigReloader := (.Values.filer.s3.configReloader | default dict).enabled }}
|
||||
{{- if and $s3ConfigReloader (not (and .Values.filer.s3.enabled .Values.filer.s3.enableAuth)) }}
|
||||
{{- fail "filer.s3.configReloader.enabled needs filer.s3.enabled and filer.s3.enableAuth: it reloads the identities file they mount" }}
|
||||
{{- end }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
@@ -54,17 +50,13 @@ spec:
|
||||
{{- end }}
|
||||
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.filer.podAnnotations | default dict) }}
|
||||
{{- if .Values.filer.s3.existingConfigSecret }}
|
||||
{{- /* With the config reloader, a change to the existing Secret is applied by SIGHUP, so nothing in it may restart the pod. */}}
|
||||
{{- if not $s3ConfigReloader }}
|
||||
{{- $configSecret := (lookup "v1" "Secret" (include "seaweedfs.namespace" .) .Values.filer.s3.existingConfigSecret) | default dict }}
|
||||
{{- $_ := set $podAnnotations "checksum/s3config" ($configSecret | toYaml | sha256sum) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $_ := set $podAnnotations "checksum/s3config" (include "seaweedfs.s3.configChecksum" .) }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- toYaml $podAnnotations | nindent 8 }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.filer.restartPolicy }}
|
||||
{{- if .Values.filer.affinity }}
|
||||
@@ -89,9 +81,6 @@ spec:
|
||||
schedulerName: {{ .Values.filer.schedulerName | quote }}
|
||||
{{- end }}
|
||||
enableServiceLinks: false
|
||||
{{- if or .Values.filer.shareProcessNamespace $s3ConfigReloader }}
|
||||
shareProcessNamespace: true
|
||||
{{- end }}
|
||||
{{- if .Values.filer.initContainers }}
|
||||
initContainers:
|
||||
{{ tpl .Values.filer.initContainers . | nindent 8 | trim }}
|
||||
@@ -407,9 +396,6 @@ spec:
|
||||
{{- if .Values.filer.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.filer.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $s3ConfigReloader }}
|
||||
{{- include "seaweedfs.s3.configReloaderContainer" (dict "root" $ "image" (include "seaweedfs.filer.image" .) "port" .Values.filer.s3.port "resources" .Values.filer.s3.configReloader.resources "securityContext" .Values.filer.containerSecurityContext) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.filer.sidecars }}
|
||||
{{- include "seaweedfs.tplvalues.render" (dict "value" .Values.filer.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -466,8 +452,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
@@ -510,9 +496,6 @@ spec:
|
||||
{{- if .Values.filer.storageClass }}
|
||||
storageClassName: {{ .Values.filer.storageClass }}
|
||||
{{- end }}
|
||||
{{- with .Values.filer.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $pvc_exists := include "seaweedfs.filer.pvc_exists" . -}}
|
||||
{{- if $pvc_exists }}
|
||||
@@ -529,9 +512,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.filer.data.storageClass }}
|
||||
{{- with .Values.filer.data.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.data.size }}
|
||||
@@ -548,9 +528,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.filer.logs.storageClass }}
|
||||
{{- with .Values.filer.logs.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.logs.size }}
|
||||
|
||||
@@ -48,7 +48,6 @@ spec:
|
||||
{{- $_ := set $podAnnotations "checksum/master-config" (include "seaweedfs.master.configChecksum" .) }}
|
||||
annotations:
|
||||
{{- toYaml $podAnnotations | nindent 8 }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.master.restartPolicy }}
|
||||
{{- if .Values.master.affinity }}
|
||||
@@ -300,8 +299,8 @@ spec:
|
||||
name: {{ include "seaweedfs.fullname" . }}-master-config
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
@@ -340,9 +339,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.master.data.storageClass }}
|
||||
{{- with .Values.master.data.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.data.size }}
|
||||
@@ -359,9 +355,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.master.logs.storageClass }}
|
||||
{{- with .Values.master.logs.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.logs.size }}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if .Values.s3.enabled }}
|
||||
{{- $preStopSeconds := .Values.s3.preStopSeconds | int }}
|
||||
{{- $s3ConfigReloader := (.Values.s3.configReloader | default dict).enabled }}
|
||||
{{- if and $s3ConfigReloader (not .Values.s3.enableAuth) }}
|
||||
{{- fail "s3.configReloader.enabled needs s3.enableAuth: it reloads the identities file that mounts" }}
|
||||
{{- end }}
|
||||
{{- $minGracePeriod := add $preStopSeconds 15 }}
|
||||
{{- if and (gt $preStopSeconds 0) (lt (.Values.s3.terminationGracePeriodSeconds | int) $minGracePeriod) }}
|
||||
{{- fail (printf "s3.terminationGracePeriodSeconds (%v) must be at least %d: the gateway keeps serving for s3.preStopSeconds (%d) after SIGTERM, then gives in-flight requests up to 15s to finish; add the time any s3.lifecycle.preStop hook takes" .Values.s3.terminationGracePeriodSeconds $minGracePeriod $preStopSeconds) -}}
|
||||
@@ -51,17 +47,13 @@ spec:
|
||||
{{- end }}
|
||||
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.s3.podAnnotations | default dict) }}
|
||||
{{- if .Values.s3.existingConfigSecret }}
|
||||
{{- /* With the config reloader, a change to the existing Secret is applied by SIGHUP, so nothing in it may restart the pod. */}}
|
||||
{{- if not $s3ConfigReloader }}
|
||||
{{- $configSecret := (lookup "v1" "Secret" (include "seaweedfs.namespace" .) .Values.s3.existingConfigSecret) | default dict }}
|
||||
{{- $_ := set $podAnnotations "checksum/s3config" ($configSecret | toYaml | sha256sum) }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $_ := set $podAnnotations "checksum/s3config" (include "seaweedfs.s3.configChecksum" .) }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- toYaml $podAnnotations | nindent 8 }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.s3.restartPolicy }}
|
||||
{{- if .Values.s3.affinity }}
|
||||
@@ -85,9 +77,6 @@ spec:
|
||||
schedulerName: {{ .Values.s3.schedulerName | quote }}
|
||||
{{- end }}
|
||||
enableServiceLinks: false
|
||||
{{- if or .Values.s3.shareProcessNamespace $s3ConfigReloader }}
|
||||
shareProcessNamespace: true
|
||||
{{- end }}
|
||||
{{- if .Values.s3.serviceAccountName }}
|
||||
serviceAccountName: {{ .Values.s3.serviceAccountName | quote }}
|
||||
{{- end }}
|
||||
@@ -272,9 +261,6 @@ spec:
|
||||
{{- if .Values.s3.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.s3.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $s3ConfigReloader }}
|
||||
{{- include "seaweedfs.s3.configReloaderContainer" (dict "root" $ "image" (include "seaweedfs.s3.image" .) "port" .Values.s3.port "resources" .Values.s3.configReloader.resources "securityContext" .Values.s3.containerSecurityContext) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.s3.sidecars }}
|
||||
{{- include "seaweedfs.tplvalues.render" (dict "value" .Values.s3.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -302,8 +288,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -43,7 +43,6 @@ spec:
|
||||
{{- with .Values.sftp.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.sftp.restartPolicy }}
|
||||
{{- if .Values.sftp.affinity }}
|
||||
@@ -298,8 +297,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -269,20 +269,15 @@ true
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* The S3 service's Lance namespace URL, for a worker pinned before 4.56; empty when it serves none */}}
|
||||
{{/* Lance namespace URL the worker's Lance container maintains; empty when unreachable */}}
|
||||
{{- define "seaweedfs.worker.lanceNamespaceUrl" -}}
|
||||
{{- if and .Values.s3.enabled .Values.s3.lancePort -}}
|
||||
{{- if .Values.worker.namespaceUrl -}}
|
||||
{{- .Values.worker.namespaceUrl -}}
|
||||
{{- else if and .Values.s3.enabled .Values.s3.lancePort -}}
|
||||
{{- printf "http://%s.%s:%d" (include "seaweedfs.componentName" (list . "s3")) (include "seaweedfs.namespace" .) (int .Values.s3.lancePort) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* "true" when the worker runs its Lance container: an S3 gateway of this release serves a Lance namespace, or the worker serves an external admin, which names its cluster's */}}
|
||||
{{- define "seaweedfs.worker.lanceEnabled" -}}
|
||||
{{- if or (include "seaweedfs.worker.lanceNamespaceUrl" .) .Values.filer.s3.enabled .Values.worker.adminServer -}}
|
||||
true
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Return the proper volume image */}}
|
||||
{{- define "seaweedfs.volume.image" -}}
|
||||
{{- if .Values.volume.imageOverride -}}
|
||||
@@ -496,25 +491,6 @@ true
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* True when the volume servers serve HTTPS. Their certificates come from
|
||||
enableSecurity, so the option fails without it. */}}
|
||||
{{- define "seaweedfs.volumeHttps" -}}
|
||||
{{- if ((.Values.global.seaweedfs).volumeHttps).enabled -}}
|
||||
{{- if not .Values.global.seaweedfs.enableSecurity -}}
|
||||
{{- fail "global.seaweedfs.volumeHttps.enabled requires global.seaweedfs.enableSecurity, which provides the certificates" -}}
|
||||
{{- end -}}
|
||||
true
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Pod annotation that restarts the readers of security.toml when volume
|
||||
HTTPS is switched on or off. */}}
|
||||
{{- define "seaweedfs.volumeHttpsAnnotation" -}}
|
||||
{{- with include "seaweedfs.volumeHttps" . -}}
|
||||
checksum/volume-https: {{ sha256sum . | quote }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Read a JWT key from the chart's existing security.toml without fromToml
|
||||
(which requires Helm >=3.17). Args: (list "<section>" $raw).
|
||||
Return the single-line TOML string token, including its quotes, so escapes
|
||||
@@ -789,65 +765,6 @@ on install.
|
||||
| toJson | sha256sum -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
The s3-config-reloader sidecar of the filer and S3 pods. It checks the mounted identities file every
|
||||
second and sends SIGHUP to SeaweedFS when it changes, so SeaweedFS loads it again without a restart.
|
||||
It only signals once SeaweedFS listens on its S3 port, because SeaweedFS registers the reload when it
|
||||
starts serving S3, and it sends one SIGHUP when it starts, which catches changes made while it was not
|
||||
running. It needs the pod's process namespace to see SeaweedFS, and the same user to signal it, so it
|
||||
uses the component's image and container security context.
|
||||
Usage: include "seaweedfs.s3.configReloaderContainer" (dict "root" $ "image" <image> "port" <S3 port>
|
||||
"resources" <resources> "securityContext" <the component's containerSecurityContext>)
|
||||
*/}}
|
||||
{{- define "seaweedfs.s3.configReloaderContainer" -}}
|
||||
- name: s3-config-reloader
|
||||
image: {{ .image }}
|
||||
imagePullPolicy: {{ default "IfNotPresent" .root.Values.global.seaweedfs.imagePullPolicy }}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
config_file=/etc/sw/seaweedfs_s3_config
|
||||
# /proc/net/tcp lists ports in hex, and 0A is the state LISTEN.
|
||||
s3_port=$(printf '%04X' {{ .port }})
|
||||
last_hash=""
|
||||
warned=""
|
||||
while sleep 1; do
|
||||
current_hash=$(sha256sum "$config_file" 2>/dev/null | cut -d' ' -f1)
|
||||
if [ -z "$current_hash" ] || [ "$current_hash" = "$last_hash" ]; then
|
||||
continue
|
||||
fi
|
||||
if ! grep -qE ":$s3_port [0-9A-F]+:[0-9A-F]+ 0A " /proc/net/tcp /proc/net/tcp6 2>/dev/null; then
|
||||
continue
|
||||
fi
|
||||
signalled=""
|
||||
for process_dir in /proc/[0-9]*; do
|
||||
if [ "$(cat "$process_dir/comm" 2>/dev/null)" = "weed" ] && kill -HUP "${process_dir#/proc/}" 2>/dev/null; then
|
||||
echo "S3 config changed (sha256 $current_hash), sent SIGHUP to weed (PID ${process_dir#/proc/})"
|
||||
signalled=1
|
||||
fi
|
||||
done
|
||||
if [ -n "$signalled" ]; then
|
||||
last_hash=$current_hash
|
||||
warned=""
|
||||
elif [ -z "$warned" ]; then
|
||||
echo "S3 config changed, but no weed process is visible: the pod must share its process namespace, and the sidecar must run as the same user as SeaweedFS" >&2
|
||||
warned=1
|
||||
fi
|
||||
done
|
||||
volumeMounts:
|
||||
- name: config-users
|
||||
mountPath: /etc/sw
|
||||
readOnly: true
|
||||
{{- with .resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .securityContext.enabled }}
|
||||
securityContext: {{- omit .securityContext "enabled" | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Master ConfigMap checksum, ignoring commonLabels so labels do not roll the pods */}}
|
||||
{{- define "seaweedfs.master.configChecksum" -}}
|
||||
{{- $context := merge (dict "Values" (omit .Values "commonLabels")) (omit . "Values") -}}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
{{- if .Values.worker.metricsPort }}
|
||||
{{- $ports = append $ports .Values.worker.metricsPort }}
|
||||
{{- end }}
|
||||
{{- if and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceEnabled" .) }}
|
||||
{{- if and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceNamespaceUrl" .) }}
|
||||
{{- $ports = append $ports .Values.worker.lanceMetricsPort }}
|
||||
{{- end }}
|
||||
{{- $targets = append $targets (dict "component" "worker" "ports" $ports) }}
|
||||
|
||||
@@ -286,8 +286,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
@@ -11,8 +11,7 @@ metadata:
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- with include "seaweedfs.commonLabels" $ }}{{ . | nindent 4 }}{{ end }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
data:
|
||||
{{- $fullname := include "seaweedfs.fullname" . }}
|
||||
{{- $securityConfigName := printf "%s-security-config" $fullname }}
|
||||
{{- $existing := lookup "v1" "ConfigMap" (include "seaweedfs.namespace" .) $securityConfigName }}
|
||||
@@ -20,11 +19,7 @@ stringData:
|
||||
{{- $legacyName := printf "%s-%s" (include "seaweedfs.name" .) "security-config" }}
|
||||
{{- $existing = lookup "v1" "ConfigMap" (include "seaweedfs.namespace" .) $legacyName }}
|
||||
{{- end }}
|
||||
{{- $ownConfigMap := eq (dig "metadata" "annotations" "meta.helm.sh/release-name" "" $existing) .Release.Name }}
|
||||
{{- if and $ownConfigMap (or (and .Values.master.enabled (gt (int .Values.master.updatePartition) 0)) (and .Values.filer.enabled (gt (int .Values.filer.updatePartition) 0))) }}
|
||||
{{- fail "this upgrade moves security.toml from a ConfigMap to a Secret and removes the ConfigMap; run it with master.updatePartition=0 and filer.updatePartition=0 so no pod is left on the old template" }}
|
||||
{{- end }}
|
||||
{{- $existingToml := dig "data" "security.toml" "" (lookup "v1" "Secret" (include "seaweedfs.namespace" .) $securityConfigName) | b64dec | default (dig "data" "security.toml" "" $existing) }}
|
||||
{{- $existingToml := dig "data" "security.toml" "" $existing }}
|
||||
{{- $securityConfigValues := .Values.global.seaweedfs.securityConfig | default dict }}
|
||||
{{- $jwtSigning := $securityConfigValues.jwtSigning | default dict }}
|
||||
{{- $expiresAfterSeconds := $jwtSigning.expiresAfterSeconds | default dict }}
|
||||
@@ -35,7 +30,7 @@ stringData:
|
||||
# the jwt signing key is read by master and volume server
|
||||
# the jwt defaults to expire after 10 seconds
|
||||
[jwt.signing]
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.signing" $existingToml) | default (randAlphaNum 64 | quote) }}
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.signing" $existingToml) | default (randAlphaNum 10 | b64enc | quote) }}
|
||||
{{- if gt (int $expiresAfterSeconds.volumeWrite) 0 }}
|
||||
expires_after_seconds = {{ int $expiresAfterSeconds.volumeWrite }}
|
||||
{{- end }}
|
||||
@@ -47,7 +42,7 @@ stringData:
|
||||
# - the Volume server validates the JWT on reading
|
||||
# the jwt defaults to expire after 60 seconds
|
||||
[jwt.signing.read]
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.signing.read" $existingToml) | default (randAlphaNum 64 | quote) }}
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.signing.read" $existingToml) | default (randAlphaNum 10 | b64enc | quote) }}
|
||||
{{- if gt (int $expiresAfterSeconds.volumeRead) 0 }}
|
||||
expires_after_seconds = {{ int $expiresAfterSeconds.volumeRead }}
|
||||
{{- end }}
|
||||
@@ -59,7 +54,7 @@ stringData:
|
||||
# - the Filer server validates the JWT on writing
|
||||
# the jwt defaults to expire after 10 seconds
|
||||
[jwt.filer_signing]
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.filer_signing" $existingToml) | default (randAlphaNum 64 | quote) }}
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.filer_signing" $existingToml) | default (randAlphaNum 10 | b64enc | quote) }}
|
||||
{{- if gt (int $expiresAfterSeconds.filerWrite) 0 }}
|
||||
expires_after_seconds = {{ int $expiresAfterSeconds.filerWrite }}
|
||||
{{- end }}
|
||||
@@ -71,7 +66,7 @@ stringData:
|
||||
# - the Filer server validates the JWT on reading
|
||||
# the jwt defaults to expire after 60 seconds
|
||||
[jwt.filer_signing.read]
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.filer_signing.read" $existingToml) | default (randAlphaNum 64 | quote) }}
|
||||
key = {{ include "seaweedfs.existingTomlKey" (list "jwt.filer_signing.read" $existingToml) | default (randAlphaNum 10 | b64enc | quote) }}
|
||||
{{- if gt (int $expiresAfterSeconds.filerRead) 0 }}
|
||||
expires_after_seconds = {{ int $expiresAfterSeconds.filerRead }}
|
||||
{{- end }}
|
||||
@@ -126,25 +121,13 @@ stringData:
|
||||
cert = "/usr/local/share/ca-certificates/client/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/client/tls.key"
|
||||
|
||||
{{- if include "seaweedfs.volumeHttps" . }}
|
||||
|
||||
[https.client]
|
||||
enabled = true
|
||||
cert = "/usr/local/share/ca-certificates/client/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/client/tls.key"
|
||||
ca = "/usr/local/share/ca-certificates/ca/tls.crt"
|
||||
|
||||
[https.volume]
|
||||
cert = "/usr/local/share/ca-certificates/volume/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/volume/tls.key"
|
||||
{{- else }}
|
||||
|
||||
# volume server https: set global.seaweedfs.volumeHttps.enabled
|
||||
# volume server https options
|
||||
# Note: work in progress!
|
||||
# this does not work with other clients, e.g., "weed filer|mount" etc, yet.
|
||||
[https.client]
|
||||
enabled = false
|
||||
[https.volume]
|
||||
cert = ""
|
||||
key = ""
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -25,7 +25,6 @@ spec:
|
||||
annotations:
|
||||
{{- with .Values.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
{{- with .Values.vector.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
{{- include "seaweedfs.imagePullSecrets" . | nindent 6 }}
|
||||
automountServiceAccountToken: {{ .Values.global.seaweedfs.automountServiceAccountToken }}
|
||||
@@ -56,9 +55,13 @@ spec:
|
||||
- 'case "$POD_IP" in *:*) POD_IP="[$POD_IP]";; esac; exec /usr/bin/weed-vector --listen="$POD_IP:{{ .Values.vector.port }}" "$@"'
|
||||
- vector
|
||||
- {{ printf "--masters=%s" (.Values.vector.masters | default $masters) | quote }}
|
||||
- {{ printf "--read-cache-mb=%d" (int .Values.vector.readCacheMB) | quote }}
|
||||
{{- if .Values.filer.filerGroup }}
|
||||
- {{ printf "--filer-group=%s" .Values.filer.filerGroup | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.vector.nprobes }}
|
||||
- {{ printf "--nprobes=%d" (int .Values.vector.nprobes) | quote }}
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- --security-toml=/etc/seaweedfs/security.toml
|
||||
{{- end }}
|
||||
@@ -147,8 +150,8 @@ spec:
|
||||
emptyDir: {}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
{{- range list "ca" "client" "vector" }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- $volumeEnabled := or .Values.volume.enabled .Values.allInOne.enabled }}
|
||||
{{- if and $volumeEnabled .Values.volume.httpRoute.enabled }}
|
||||
{{- $serviceName := ternary (include "seaweedfs.componentName" (list . "all-in-one")) (include "seaweedfs.componentName" (list . "client-volume")) .Values.allInOne.enabled }}
|
||||
{{- $serviceName := ternary (include "seaweedfs.componentName" (list . "all-in-one")) (include "seaweedfs.componentName" (list . "volume")) .Values.allInOne.enabled }}
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{- $volumeEnabled := or .Values.volume.enabled .Values.allInOne.enabled }}
|
||||
{{- if and $volumeEnabled .Values.volume.ingress.enabled }}
|
||||
{{- /* Determine service name based on deployment mode */}}
|
||||
{{- $serviceName := ternary (include "seaweedfs.componentName" (list . "all-in-one")) (include "seaweedfs.componentName" (list . "client-volume")) .Values.allInOne.enabled }}
|
||||
{{- $serviceName := ternary (include "seaweedfs.componentName" (list . "all-in-one")) (include "seaweedfs.componentName" (list . "volume")) .Values.allInOne.enabled }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
{{- /* Ready-only backend for the volume ingress and HTTPRoute; the volume Service publishes not-ready pods for DNS.
|
||||
Not named volume-client: every volume-<key> name belongs to a group under .Values.volumes. */}}
|
||||
{{- if and .Values.volume.enabled (not .Values.allInOne.enabled) (or .Values.volume.ingress.enabled .Values.volume.httpRoute.enabled) }}
|
||||
{{- $name := include "seaweedfs.componentName" (list . "client-volume") }}
|
||||
{{- $volumes := deepCopy .Values.volumes | mergeOverwrite (dict "" .Values.volume) }}
|
||||
{{- range $vname, $volume := $volumes }}
|
||||
{{- $volumeName := trimSuffix "-" (printf "volume-%s" $vname) }}
|
||||
{{- $volume := mergeOverwrite (deepCopy $.Values.volume) (dict "enabled" true) $volume }}
|
||||
{{- if and $volume.enabled (eq (include "seaweedfs.componentName" (list $ $volumeName)) $name) }}
|
||||
{{- fail (printf "The volume Ingress/HTTPRoute Service %q has the same name as the %s Service after truncation. Shorten fullnameOverride or the release name." $name $volumeName) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
namespace: {{ include "seaweedfs.namespace" . | quote }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: volume
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- with include "seaweedfs.commonLabels" $ }}{{ . | nindent 4 }}{{ end }}
|
||||
{{- if .Values.volume.annotations }}
|
||||
annotations:
|
||||
{{- toYaml .Values.volume.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
internalTrafficPolicy: {{ .Values.volume.internalTrafficPolicy | default "Cluster" }}
|
||||
{{- /* No metrics port, so the volume ServiceMonitor does not scrape each pod twice */}}
|
||||
ports:
|
||||
- name: "swfs-volume"
|
||||
port: {{ .Values.volume.port }}
|
||||
targetPort: {{ .Values.volume.port }}
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: volume
|
||||
{{- end }}
|
||||
@@ -23,9 +23,6 @@ metadata:
|
||||
{{- end }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
{{- /* The master hands out ${POD_NAME}.<this service> as soon as a volume server heartbeats, before it is Ready.
|
||||
Ingress and HTTPRoute use the client-volume Service instead, which publishes only Ready pods. */}}
|
||||
publishNotReadyAddresses: true
|
||||
internalTrafficPolicy: {{ $volume.internalTrafficPolicy | default "Cluster" }}
|
||||
ports:
|
||||
- name: "swfs-volume"
|
||||
|
||||
@@ -55,7 +55,6 @@ spec:
|
||||
{{- with $volume.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
{{- if $volume.affinity }}
|
||||
affinity:
|
||||
@@ -282,7 +281,7 @@ spec:
|
||||
httpGet:
|
||||
path: {{ $volume.readinessProbe.httpGet.path }}
|
||||
port: {{ $volume.port }}
|
||||
scheme: {{ if include "seaweedfs.volumeHttps" $ }}HTTPS{{ else }}{{ $volume.readinessProbe.httpGet.scheme }}{{ end }}
|
||||
scheme: {{ $volume.readinessProbe.httpGet.scheme }}
|
||||
initialDelaySeconds: {{ $volume.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $volume.readinessProbe.periodSeconds }}
|
||||
successThreshold: {{ $volume.readinessProbe.successThreshold }}
|
||||
@@ -294,7 +293,7 @@ spec:
|
||||
httpGet:
|
||||
path: {{ $volume.livenessProbe.httpGet.path }}
|
||||
port: {{ $volume.port }}
|
||||
scheme: {{ if include "seaweedfs.volumeHttps" $ }}HTTPS{{ else }}{{ $volume.livenessProbe.httpGet.scheme }}{{ end }}
|
||||
scheme: {{ $volume.livenessProbe.httpGet.scheme }}
|
||||
initialDelaySeconds: {{ $volume.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $volume.livenessProbe.periodSeconds }}
|
||||
successThreshold: {{ $volume.livenessProbe.successThreshold }}
|
||||
@@ -371,8 +370,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" $ }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" $ }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" $ }}-security-config
|
||||
{{- end }}
|
||||
{{- if $.Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
@@ -412,9 +411,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $dir.storageClass }}
|
||||
{{- with $dir.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $dir.size }}
|
||||
@@ -433,9 +429,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $volume.idx.storageClass }}
|
||||
{{- with $volume.idx.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.idx.size }}
|
||||
@@ -452,9 +445,6 @@ spec:
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $volume.logs.storageClass }}
|
||||
{{- with $volume.logs.volumeAttributesClassName }}
|
||||
volumeAttributesClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.logs.size }}
|
||||
|
||||
@@ -46,7 +46,6 @@ spec:
|
||||
{{- with .Values.worker.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with include "seaweedfs.volumeHttpsAnnotation" $ }}{{ . | nindent 8 }}{{ end }}
|
||||
spec:
|
||||
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.worker.restartPolicy }}
|
||||
{{- if .Values.worker.affinity }}
|
||||
@@ -228,7 +227,7 @@ spec:
|
||||
{{- if .Values.worker.containerSecurityContext.enabled }}
|
||||
securityContext: {{- omit .Values.worker.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.worker.lanceEnabled" . }}
|
||||
{{- if include "seaweedfs.worker.lanceNamespaceUrl" . }}
|
||||
- name: worker-lance
|
||||
image: {{ template "seaweedfs.worker.image" . }}
|
||||
imagePullPolicy: {{ default "IfNotPresent" .Values.global.seaweedfs.imagePullPolicy }}
|
||||
@@ -237,21 +236,13 @@ spec:
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
{{- /* only a worker pinned before 4.56 reads these; later ones learn the cluster from admin */}}
|
||||
{{- with include "seaweedfs.worker.lanceNamespaceUrl" . }}
|
||||
- name: WEED_LANCE_NAMESPACE
|
||||
value: {{ . | quote }}
|
||||
{{- end }}
|
||||
- name: WEED_MASTERS
|
||||
value: {{ include "seaweedfs.masterServerArg" . | quote }}
|
||||
{{- if .Values.filer.filerGroup }}
|
||||
- name: WEED_FILER_GROUP
|
||||
value: {{ .Values.filer.filerGroup | quote }}
|
||||
{{- end }}
|
||||
{{- /* the URL crosses a shell line; metacharacters must arrive as data, not syntax */}}
|
||||
- name: LANCE_NAMESPACE_URL
|
||||
value: {{ include "seaweedfs.worker.lanceNamespaceUrl" . | quote }}
|
||||
{{- $mergedExtraEnvironmentVars := dict }}
|
||||
{{- include "seaweedfs.mergeExtraEnvironmentVars" (dict "global" .Values.global.seaweedfs "component" .Values.worker "target" $mergedExtraEnvironmentVars) }}
|
||||
{{- /* a duplicate would win over the chart's value and change --id or the cluster */}}
|
||||
{{- $mergedExtraEnvironmentVars = omit $mergedExtraEnvironmentVars "POD_NAME" "WEED_LANCE_NAMESPACE" "WEED_MASTERS" "WEED_FILER_GROUP" }}
|
||||
{{- /* a duplicate would win over the chart's value and change --id or --namespace */}}
|
||||
{{- $mergedExtraEnvironmentVars = omit $mergedExtraEnvironmentVars "POD_NAME" "LANCE_NAMESPACE_URL" }}
|
||||
{{- range $key := keys $mergedExtraEnvironmentVars | sortAlpha }}
|
||||
{{- $value := index $mergedExtraEnvironmentVars $key }}
|
||||
- name: {{ $key }}
|
||||
@@ -280,6 +271,11 @@ spec:
|
||||
{{- else }}
|
||||
--admin={{ template "seaweedfs.fullname" . }}-admin.{{ include "seaweedfs.namespace" . }}:{{ .Values.admin.port }}{{ if .Values.admin.grpcPort }}.{{ .Values.admin.grpcPort }}{{ end }} \
|
||||
{{- end }}
|
||||
--namespace="$LANCE_NAMESPACE_URL" \
|
||||
--masters={{ include "seaweedfs.masterServerArg" . }} \
|
||||
{{- if .Values.filer.filerGroup }}
|
||||
--filer-group={{ .Values.filer.filerGroup }} \
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
--tls-ca=/usr/local/share/ca-certificates/ca/tls.crt \
|
||||
--tls-cert=/usr/local/share/ca-certificates/worker/tls.crt \
|
||||
@@ -302,7 +298,7 @@ spec:
|
||||
- name: ca-cert
|
||||
readOnly: true
|
||||
mountPath: /usr/local/share/ca-certificates/ca/
|
||||
{{- /* grpc.client, which the worker dials the filers with */}}
|
||||
{{- /* grpc.client, which the worker dials the masters and filers with */}}
|
||||
- name: client-cert
|
||||
readOnly: true
|
||||
mountPath: /usr/local/share/ca-certificates/client/
|
||||
@@ -345,7 +341,7 @@ spec:
|
||||
{{- include "seaweedfs.tplvalues.render" (dict "value" .Values.worker.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- include "seaweedfs.tmpDirVolume" (list . .Values.worker.containerSecurityContext (tpl (.Values.worker.extraVolumeMounts | default "") .) (tpl (.Values.worker.extraVolumes | default "") .) (ne (include "seaweedfs.worker.lanceEnabled" .) "")) | nindent 8 }}
|
||||
{{- include "seaweedfs.tmpDirVolume" (list . .Values.worker.containerSecurityContext (tpl (.Values.worker.extraVolumeMounts | default "") .) (tpl (.Values.worker.extraVolumes | default "") .) (ne (include "seaweedfs.worker.lanceNamespaceUrl" .) "")) | nindent 8 }}
|
||||
{{- if eq .Values.worker.data.type "hostPath" }}
|
||||
- name: worker-data
|
||||
hostPath:
|
||||
@@ -378,8 +374,8 @@ spec:
|
||||
{{- end }}
|
||||
{{- if include "seaweedfs.securityConfigEnabled" . }}
|
||||
- name: security-config
|
||||
secret:
|
||||
secretName: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
configMap:
|
||||
name: {{ include "seaweedfs.fullname" . }}-security-config
|
||||
{{- end }}
|
||||
{{- if .Values.global.seaweedfs.enableSecurity }}
|
||||
- name: ca-cert
|
||||
|
||||
@@ -13,7 +13,7 @@ metadata:
|
||||
{{- with include "seaweedfs.commonLabels" $ }}{{ . | nindent 4 }}{{ end }}
|
||||
spec:
|
||||
clusterIP: None # Headless service
|
||||
{{- $lanceMetrics := and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceEnabled" .) }}
|
||||
{{- $lanceMetrics := and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceNamespaceUrl" .) }}
|
||||
{{- if or .Values.worker.metricsPort $lanceMetrics }}
|
||||
ports:
|
||||
{{- if .Values.worker.metricsPort }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- include "seaweedfs.compat" . -}}
|
||||
{{- if .Values.worker.enabled }}
|
||||
{{- $lanceMetrics := and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceEnabled" .) }}
|
||||
{{- $lanceMetrics := and .Values.worker.lanceMetricsPort (include "seaweedfs.worker.lanceNamespaceUrl" .) }}
|
||||
{{- if or .Values.worker.metricsPort $lanceMetrics }}
|
||||
{{- if .Values.global.seaweedfs.monitoring.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func findDocument(documents []map[string]interface{}, kind, name string) map[string]interface{} {
|
||||
for _, document := range documents {
|
||||
if document["kind"] == kind && document["metadata"].(map[string]interface{})["name"] == name {
|
||||
return document
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestVolumeServicePublishesNotReadyPods(t *testing.T) {
|
||||
_, documents := render(t)
|
||||
service := findDocument(documents, "Service", "vector-test-seaweedfs-volume")
|
||||
if service == nil {
|
||||
t.Fatal("no volume service")
|
||||
}
|
||||
if service["spec"].(map[string]interface{})["publishNotReadyAddresses"] != true {
|
||||
t.Fatal("volume pod DNS names must resolve before the pods are Ready")
|
||||
}
|
||||
if findDocument(documents, "Service", "vector-test-seaweedfs-client-volume") != nil {
|
||||
t.Fatal("client-volume service rendered without ingress or httpRoute")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeIngressUsesReadyOnlyService(t *testing.T) {
|
||||
_, documents := render(t, "volume.ingress.enabled=true", "volume.httpRoute.enabled=true", "volume.metricsPort=9327")
|
||||
client := findDocument(documents, "Service", "vector-test-seaweedfs-client-volume")
|
||||
if client == nil {
|
||||
t.Fatal("no client-volume service")
|
||||
}
|
||||
spec := client["spec"].(map[string]interface{})
|
||||
if _, found := spec["publishNotReadyAddresses"]; found {
|
||||
t.Fatal("client-volume must publish only Ready pods")
|
||||
}
|
||||
for _, port := range spec["ports"].([]interface{}) {
|
||||
if port.(map[string]interface{})["name"] == "metrics" {
|
||||
t.Fatal("client-volume must not expose metrics, or the ServiceMonitor scrapes each pod twice")
|
||||
}
|
||||
}
|
||||
|
||||
ingress := findDocument(documents, "Ingress", "ingress-vector-test-seaweedfs-volume")
|
||||
if ingress == nil {
|
||||
t.Fatal("no volume ingress")
|
||||
}
|
||||
path := ingress["spec"].(map[string]interface{})["rules"].([]interface{})[0].(map[string]interface{})["http"].(map[string]interface{})["paths"].([]interface{})[0].(map[string]interface{})
|
||||
if backend := path["backend"].(map[string]interface{})["service"].(map[string]interface{})["name"]; backend != "vector-test-seaweedfs-client-volume" {
|
||||
t.Fatalf("volume ingress backend is %v", backend)
|
||||
}
|
||||
|
||||
route := findDocument(documents, "HTTPRoute", "vector-test-seaweedfs-volume")
|
||||
if route == nil {
|
||||
t.Fatal("no volume httpRoute")
|
||||
}
|
||||
rule := route["spec"].(map[string]interface{})["rules"].([]interface{})[0].(map[string]interface{})
|
||||
if backend := rule["backendRefs"].([]interface{})[0].(map[string]interface{})["name"]; backend != "vector-test-seaweedfs-client-volume" {
|
||||
t.Fatalf("volume httpRoute backend is %v", backend)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeRoutingServiceDoesNotCollideWithVolumeGroups(t *testing.T) {
|
||||
_, documents := render(t, "volume.ingress.enabled=true", "volume.httpRoute.enabled=true", "volumes.client.replicas=1")
|
||||
seen := map[string]bool{}
|
||||
for _, document := range documents {
|
||||
key := fmt.Sprint(document["kind"], "/", document["metadata"].(map[string]interface{})["name"])
|
||||
if seen[key] {
|
||||
t.Fatalf("%s rendered twice", key)
|
||||
}
|
||||
seen[key] = true
|
||||
}
|
||||
if !seen["Service/vector-test-seaweedfs-volume-client"] || !seen["Service/vector-test-seaweedfs-client-volume"] {
|
||||
t.Fatal("volumes.client group Service and the routing Service must both render")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeRoutingServiceRejectsTruncatedCollision(t *testing.T) {
|
||||
if _, err := exec.LookPath("helm"); err != nil {
|
||||
t.Skip("helm is not installed")
|
||||
}
|
||||
fullname := strings.Repeat("a", 49) + "-client"
|
||||
output, err := exec.Command("helm", "template", "test", "..", "--set", "fullnameOverride="+fullname, "--set", "volume.ingress.enabled=true").CombinedOutput()
|
||||
if err == nil || !strings.Contains(string(output), "same name as the volume Service") {
|
||||
t.Fatalf("colliding routing Service accepted: %v %s", err, output)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeIngressAllInOne(t *testing.T) {
|
||||
_, documents := render(t, "allInOne.enabled=true", "volume.ingress.enabled=true")
|
||||
if findDocument(documents, "Service", "vector-test-seaweedfs-client-volume") != nil {
|
||||
t.Fatal("client-volume service rendered in all-in-one mode")
|
||||
}
|
||||
ingress := findDocument(documents, "Ingress", "ingress-vector-test-seaweedfs-volume")
|
||||
if ingress == nil {
|
||||
t.Fatal("no volume ingress")
|
||||
}
|
||||
path := ingress["spec"].(map[string]interface{})["rules"].([]interface{})[0].(map[string]interface{})["http"].(map[string]interface{})["paths"].([]interface{})[0].(map[string]interface{})
|
||||
if backend := path["backend"].(map[string]interface{})["service"].(map[string]interface{})["name"]; backend != "vector-test-seaweedfs-all-in-one" {
|
||||
t.Fatalf("all-in-one volume ingress backend is %v", backend)
|
||||
}
|
||||
}
|
||||
@@ -45,18 +45,6 @@ global:
|
||||
volumeRead: 0
|
||||
filerWrite: 0
|
||||
filerRead: 0
|
||||
# Serve the volume servers' HTTP port over TLS with the chart's volume
|
||||
# certificate, and make every chart component reach them over HTTPS
|
||||
# ([https.volume] and [https.client] in security.toml). Requires
|
||||
# enableSecurity and is not supported with allInOne. Clients outside the
|
||||
# chart (weed mount, the CSI driver) need their own [https.client].
|
||||
# The volume servers do not ask for client certificates, because kubelet
|
||||
# probes cannot present one; JWT signing keeps authorizing volume access.
|
||||
# [https.client] also sends the admin UI's HTTP lookups on masters and
|
||||
# S3 over HTTPS, which their plain listeners refuse, so the UI can miss
|
||||
# volume public URLs and refuse SSE-S3 vector buckets.
|
||||
volumeHttps:
|
||||
enabled: false
|
||||
# we will use this serviceAccountName for all ClusterRoles/ClusterRoleBindings
|
||||
serviceAccountName: "seaweedfs"
|
||||
serviceAccountAnnotations: {}
|
||||
@@ -151,14 +139,12 @@ master:
|
||||
# Enter any extra configuration for master.toml here.
|
||||
# It may be a multi-line string.
|
||||
|
||||
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
|
||||
# You may use ANY storage-class, example with local-path-provisioner
|
||||
# Annotations are optional.
|
||||
# data:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "24Ti"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
# annotations:
|
||||
# "key": "value"
|
||||
#
|
||||
@@ -186,7 +172,6 @@ master:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "24Ti"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
# annotations:
|
||||
# "key": "value"
|
||||
|
||||
@@ -419,7 +404,6 @@ volume:
|
||||
# extraArgs: ["-customFlag", "value", "-anotherFlag"]
|
||||
extraArgs: []
|
||||
|
||||
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
|
||||
# For each data disk you may use ANY storage-class, example with local-path-provisioner
|
||||
# Annotations are optional.
|
||||
# dataDirs:
|
||||
@@ -427,7 +411,6 @@ volume:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "24Ti"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
# annotations:
|
||||
# "key": "value"
|
||||
# maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
|
||||
@@ -482,7 +465,6 @@ volume:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "20Gi"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
#
|
||||
# or
|
||||
#
|
||||
@@ -805,16 +787,12 @@ filer:
|
||||
storage: 25Gi
|
||||
# storageClass is the class of storage which defaults to null (the Kube cluster will pick the default).
|
||||
storageClass: null
|
||||
# volumeAttributesClassName is the VolumeAttributesClass of the enablePVC claim; null leaves it unset.
|
||||
volumeAttributesClassName: null
|
||||
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
|
||||
# You may use ANY storage-class, example with local-path-provisioner
|
||||
# Annotations are optional.
|
||||
# data:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "24Ti"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
# annotations:
|
||||
# "key": "value"
|
||||
#
|
||||
@@ -838,7 +816,6 @@ filer:
|
||||
# type: "persistentVolumeClaim"
|
||||
# size: "24Ti"
|
||||
# storageClass: "local-path-provisioner"
|
||||
# volumeAttributesClassName: "my-attributes-class"
|
||||
# annotations:
|
||||
# "key": "value"
|
||||
|
||||
@@ -867,11 +844,6 @@ filer:
|
||||
extraVolumes: ""
|
||||
extraVolumeMounts: ""
|
||||
|
||||
# Share one process namespace between the containers of the filer pod, so a
|
||||
# sidecar can see and signal the filer process, for example to reload its
|
||||
# configuration with SIGHUP. The filer is then no longer PID 1.
|
||||
shareProcessNamespace: false
|
||||
|
||||
# Labels to be added to the filer pods
|
||||
podLabels: {}
|
||||
|
||||
@@ -1107,13 +1079,6 @@ filer:
|
||||
# set to the name of an existing kubernetes Secret with the s3 json config file
|
||||
# should have a secret key called seaweedfs_s3_config with an inline json configure
|
||||
existingConfigSecret: null
|
||||
# Reload the identities file without restarting the filer: a sidecar sends
|
||||
# SIGHUP to SeaweedFS when kubelet updates the mounted config Secret, and the
|
||||
# pod no longer restarts when the content of existingConfigSecret changes.
|
||||
# Needs enableAuth, and turns on shareProcessNamespace. See the README.
|
||||
configReloader:
|
||||
enabled: false
|
||||
resources: {}
|
||||
# To provide explicit credentials for the S3 gateway, set them under
|
||||
# the top-level s3.credentials key (not filer.s3.credentials).
|
||||
# The s3-secret.yaml template only reads from .Values.s3.credentials.
|
||||
@@ -1184,7 +1149,7 @@ s3:
|
||||
# Set to a port number to enable, or 0/null to disable
|
||||
icebergPort: null
|
||||
# Lance Namespace port; weed serves 9101 by default, 0 disables it
|
||||
# (and the worker's Lance container)
|
||||
# (and, unless worker.namespaceUrl points elsewhere, the worker's Lance container)
|
||||
lancePort: 9101
|
||||
loggingOverrideLevel: null
|
||||
# enable user & permission to s3 (need to inject to all services)
|
||||
@@ -1192,13 +1157,6 @@ s3:
|
||||
# set to the name of an existing kubernetes Secret with the s3 json config file
|
||||
# should have a secret key called seaweedfs_s3_config with an inline json config
|
||||
existingConfigSecret: null
|
||||
# Reload the identities file without restarting the gateway: a sidecar sends
|
||||
# SIGHUP to SeaweedFS when kubelet updates the mounted config Secret, and the
|
||||
# pod no longer restarts when the content of existingConfigSecret changes.
|
||||
# Needs enableAuth, and turns on shareProcessNamespace. See the README.
|
||||
configReloader:
|
||||
enabled: false
|
||||
resources: {}
|
||||
# Optionally provide explicit credentials for the S3 gateway.
|
||||
# When set, these are used in the generated s3 secret instead of
|
||||
# auto-generating random credentials.
|
||||
@@ -1258,11 +1216,6 @@ s3:
|
||||
extraVolumes: ""
|
||||
extraVolumeMounts: ""
|
||||
|
||||
# Share one process namespace between the containers of the s3 pod, so a
|
||||
# sidecar can see and signal the gateway process, for example to reload its
|
||||
# configuration with SIGHUP. The gateway is then no longer PID 1.
|
||||
shareProcessNamespace: false
|
||||
|
||||
# Labels to be added to the s3 pods
|
||||
podLabels: {}
|
||||
|
||||
@@ -1644,12 +1597,10 @@ admin:
|
||||
extraArgs: []
|
||||
|
||||
# Storage configuration
|
||||
# volumeAttributesClassName (optional) needs Kubernetes 1.34+, or 1.31+ with the VolumeAttributesClass feature gate.
|
||||
data:
|
||||
type: "emptyDir" # Options: "hostPath", "persistentVolumeClaim", "emptyDir", "existingClaim"
|
||||
size: "10Gi"
|
||||
storageClass: ""
|
||||
volumeAttributesClassName: ""
|
||||
hostPathPrefix: /storage
|
||||
claimName: ""
|
||||
annotations: {}
|
||||
@@ -1658,7 +1609,6 @@ admin:
|
||||
type: "emptyDir" # Options: "hostPath", "persistentVolumeClaim", "emptyDir", "existingClaim"
|
||||
size: "5Gi"
|
||||
storageClass: ""
|
||||
volumeAttributesClassName: ""
|
||||
hostPathPrefix: /storage
|
||||
claimName: ""
|
||||
annotations: {}
|
||||
@@ -1812,6 +1762,8 @@ vector:
|
||||
port: 8090
|
||||
metricsPort: 0
|
||||
masters: ""
|
||||
readCacheMB: 512
|
||||
nprobes: null
|
||||
extraArgs: []
|
||||
extraEnvironmentVars: {}
|
||||
podLabels: {}
|
||||
@@ -1868,7 +1820,7 @@ worker:
|
||||
|
||||
# The lance_* jobs run in their own container, /usr/bin/weed-worker.
|
||||
# amd64/arm64 only; pin mixed clusters with worker.affinity/nodeSelector.
|
||||
# Admin tells it the filers and the S3 gateways' Lance namespaces; it reads
|
||||
# It keeps tables through the filers the masters list and reads
|
||||
# security.toml. The Lance namespace knows it by a token derived from
|
||||
# jwt.filer_signing.key, which the chart renders only with
|
||||
# global.seaweedfs.securityConfig.jwtSigning.filerWrite: true. When S3 has
|
||||
@@ -1877,6 +1829,9 @@ worker:
|
||||
# HTTP writes, so clients writing to the filer's HTTP API directly need a JWT
|
||||
# signed with that key.
|
||||
|
||||
# Lance namespace URL override; empty derives it from s3.lancePort.
|
||||
namespaceUrl: ""
|
||||
|
||||
# Metrics port for the Lance worker container; the Go worker keeps metricsPort
|
||||
lanceMetricsPort: 9328
|
||||
|
||||
@@ -2154,7 +2109,6 @@ allInOne:
|
||||
claimName: seaweedfs-data-pvc # Name of the PVC to use (for existingClaim type)
|
||||
size: null # Size of the PVC (null defaults to 10Gi for persistentVolumeClaim type)
|
||||
storageClass: null # Storage class for the PVC (null uses cluster default)
|
||||
volumeAttributesClassName: null # VolumeAttributesClass for the PVC; needs Kubernetes 1.34+, or 1.31+ with the feature gate
|
||||
# accessModes for the PVC. Default is ["ReadWriteOnce"].
|
||||
# For multi-replica deployments, use ["ReadWriteMany"] with a compatible storage class.
|
||||
accessModes: []
|
||||
|
||||
+1067
-1031
File diff suppressed because it is too large.
Load diff
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 54 KiB |
@@ -156,14 +156,11 @@ public class SeaweedWrite {
|
||||
|
||||
entry.clearChunks();
|
||||
entry.addAllChunks(chunks);
|
||||
FilerProto.CreateEntryResponse response = filerClient.getBlockingStub().createEntry(
|
||||
filerClient.getBlockingStub().createEntry(
|
||||
FilerProto.CreateEntryRequest.newBuilder()
|
||||
.setDirectory(parentDirectory)
|
||||
.setEntry(entry)
|
||||
.build());
|
||||
if (!Strings.isNullOrEmpty(response.getError())) {
|
||||
throw new IOException(response.getError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -262,8 +262,6 @@ message CreateEntryRequest {
|
||||
// Set on a create a filer forwarded to the entry's ring owner, so the owner
|
||||
// applies it locally instead of forwarding again. Clients leave it unset.
|
||||
bool is_moved = 8;
|
||||
// The store write must be durable before the reply, as for ?fsync=true.
|
||||
bool fsync = 9;
|
||||
}
|
||||
|
||||
// WriteCondition is the precondition the filer evaluates against the existing
|
||||
@@ -556,15 +554,9 @@ message AtomicRenameEntryRequest {
|
||||
// already exists. Lets a caller that authorized the rename without delete
|
||||
// access on an absent target stay safe if one is created concurrently.
|
||||
bool fail_if_target_exists = 6;
|
||||
// Set on a rename forwarded to the source's write owner, so it is not
|
||||
// forwarded again.
|
||||
bool is_moved = 7;
|
||||
}
|
||||
|
||||
message AtomicRenameEntryResponse {
|
||||
// Set for a forwarded rename: the owner's metadata log position of
|
||||
// the rename's last event.
|
||||
int64 ts_ns = 1;
|
||||
}
|
||||
|
||||
message StreamRenameEntryRequest {
|
||||
@@ -573,9 +565,6 @@ message StreamRenameEntryRequest {
|
||||
string new_directory = 3;
|
||||
string new_name = 4;
|
||||
repeated int32 signatures = 5;
|
||||
// Set on a rename forwarded to the source's write owner, so it is not
|
||||
// forwarded again.
|
||||
bool is_moved = 6;
|
||||
}
|
||||
message StreamRenameEntryResponse {
|
||||
string directory = 1;
|
||||
@@ -690,7 +679,6 @@ message GetFilerConfigurationResponse {
|
||||
string filer_group = 13;
|
||||
int32 major_version = 14;
|
||||
int32 minor_version = 15;
|
||||
string digest = 16; // "md5" or "sha256": the hash behind ETags and chunk digests
|
||||
}
|
||||
|
||||
message SubscribeMetadataRequest {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,290 +0,0 @@
|
||||
//! The FIPS 140-3 mode a SeaweedFS process runs in.
|
||||
//!
|
||||
//! One setting states it for a whole deployment: `[fips] mode` in
|
||||
//! security.toml, or `WEED_FIPS_MODE`, which wins over the file as viper's
|
||||
//! `AutomaticEnv` does for the Go processes. Go processes take their mode from
|
||||
//! `GODEBUG=fips140` and refuse to start when it differs from the setting; the
|
||||
//! Rust binaries take it from the setting alone, and under [`FipsMode::On`]
|
||||
//! and [`FipsMode::Strict`] restrict TLS to what Go's `crypto/tls` allows in
|
||||
//! FIPS mode (see [`crate::tls`]). This restricts behaviour only: the
|
||||
//! cryptography underneath is still the non-validated aws-lc-rs build.
|
||||
//!
|
||||
//! Each binary reads `fips.mode` with the parser it uses for the rest of
|
||||
//! security.toml and hands the value to [`resolve`], so the mode and the JWT
|
||||
//! keys are either both read from a file or both missed.
|
||||
|
||||
use std::ffi::OsString;
|
||||
use std::fmt;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
/// The security.toml setting, as `section.key`.
|
||||
pub const SETTING: &str = "fips.mode";
|
||||
/// The environment variable that overrides [`SETTING`].
|
||||
pub const ENV: &str = "WEED_FIPS_MODE";
|
||||
|
||||
/// The modes `fips.mode` names. Unset reads as [`FipsMode::Off`], which is
|
||||
/// how every Rust binary behaved before the setting existed.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub enum FipsMode {
|
||||
/// No FIPS restrictions; Go processes need `fips140=off`.
|
||||
#[default]
|
||||
Off,
|
||||
/// FIPS-mode TLS; Go processes need `GODEBUG=fips140=on`.
|
||||
On,
|
||||
/// FIPS-mode TLS; Go processes need `GODEBUG=fips140=only`, which also
|
||||
/// refuses non-approved algorithms outside TLS.
|
||||
Strict,
|
||||
}
|
||||
|
||||
impl FipsMode {
|
||||
/// Parses a value of `fips.mode`: `off`, `on` or `strict`, or `None` for
|
||||
/// an empty value, which leaves the setting unset.
|
||||
pub fn parse(value: &str) -> Result<Option<Self>, FipsModeError> {
|
||||
match value {
|
||||
"" => Ok(None),
|
||||
"off" => Ok(Some(Self::Off)),
|
||||
"on" => Ok(Some(Self::On)),
|
||||
"strict" => Ok(Some(Self::Strict)),
|
||||
other => Err(FipsModeError::Unknown {
|
||||
source: SETTING.to_string(),
|
||||
value: other.to_string(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether TLS is restricted to the FIPS 140-3 lists.
|
||||
pub fn is_fips(self) -> bool {
|
||||
self != Self::Off
|
||||
}
|
||||
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Off => "off",
|
||||
Self::On => "on",
|
||||
Self::Strict => "strict",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for FipsMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(self.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
/// Why the mode could not be resolved or recorded.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum FipsModeError {
|
||||
/// `source` holds a value that is not `off`, `on` or `strict`.
|
||||
Unknown { source: String, value: String },
|
||||
/// The process mode was already set to a different mode.
|
||||
AlreadySet { set: FipsMode, wanted: FipsMode },
|
||||
/// The security.toml at `path` exists but could not be read or parsed, so
|
||||
/// whether it sets `fips.mode` is unknown.
|
||||
File { path: PathBuf, reason: String },
|
||||
}
|
||||
|
||||
impl fmt::Display for FipsModeError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Unknown { source, value } => {
|
||||
write!(f, "{source} is {value:?}; want off, on or strict")
|
||||
}
|
||||
Self::AlreadySet { set, wanted } => {
|
||||
write!(f, "FIPS mode is already {set}, cannot switch to {wanted}")
|
||||
}
|
||||
Self::File { path, reason } => write!(
|
||||
f,
|
||||
"{}: {reason}; cannot tell whether it sets {SETTING}",
|
||||
path.display()
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for FipsModeError {}
|
||||
|
||||
/// A resolved `fips.mode`: the mode, and where it was set (`None` when
|
||||
/// nothing set it and the mode is [`FipsMode::Off`]).
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Setting {
|
||||
pub mode: FipsMode,
|
||||
pub source: Option<String>,
|
||||
}
|
||||
|
||||
impl fmt::Display for Setting {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match &self.source {
|
||||
Some(source) => write!(f, "FIPS mode {} ({source})", self.mode),
|
||||
None => write!(f, "FIPS mode {} ({SETTING} unset)", self.mode),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolves the mode of a process whose own security.toml loader read
|
||||
/// `file_value` for `fips.mode` from `file` (`None` when there is no file or
|
||||
/// it does not set the key): `WEED_FIPS_MODE` when set and non-empty, else
|
||||
/// `file_value`, else [`FipsMode::Off`]. An unknown value is an error naming
|
||||
/// where it came from.
|
||||
pub fn resolve(
|
||||
file: Option<&Path>,
|
||||
file_value: Option<&str>,
|
||||
env: &dyn Fn(&str) -> Option<OsString>,
|
||||
) -> Result<Setting, FipsModeError> {
|
||||
let from_env = env(ENV)
|
||||
.map(|v| v.to_string_lossy().into_owned())
|
||||
.filter(|v| !v.is_empty());
|
||||
let from_file = || {
|
||||
let source = match file {
|
||||
Some(path) => format!("{}: {SETTING}", path.display()),
|
||||
None => SETTING.to_string(),
|
||||
};
|
||||
file_value.map(|value| (source, value.to_string()))
|
||||
};
|
||||
let Some((source, value)) = from_env.map(|v| (ENV.to_string(), v)).or_else(from_file) else {
|
||||
return Ok(Setting {
|
||||
mode: FipsMode::Off,
|
||||
source: None,
|
||||
});
|
||||
};
|
||||
match FipsMode::parse(&value) {
|
||||
Ok(Some(mode)) => Ok(Setting {
|
||||
mode,
|
||||
source: Some(source),
|
||||
}),
|
||||
Ok(None) => Ok(Setting {
|
||||
mode: FipsMode::Off,
|
||||
source: None,
|
||||
}),
|
||||
Err(_) => Err(FipsModeError::Unknown { source, value }),
|
||||
}
|
||||
}
|
||||
|
||||
static PROCESS_MODE: OnceLock<FipsMode> = OnceLock::new();
|
||||
|
||||
/// Records the mode this process runs in. A second call with the same mode is
|
||||
/// a no-op; one with another mode is an error, since providers and
|
||||
/// configurations built under the first would not change.
|
||||
pub fn set_process_mode(mode: FipsMode) -> Result<(), FipsModeError> {
|
||||
let set = *PROCESS_MODE.get_or_init(|| mode);
|
||||
if set != mode {
|
||||
return Err(FipsModeError::AlreadySet { set, wanted: mode });
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The mode recorded by [`set_process_mode`], [`FipsMode::Off`] before.
|
||||
pub fn process_mode() -> FipsMode {
|
||||
PROCESS_MODE.get().copied().unwrap_or_default()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn env_of(pairs: &'static [(&'static str, &'static str)]) -> impl Fn(&str) -> Option<OsString> {
|
||||
move |key| {
|
||||
pairs
|
||||
.iter()
|
||||
.find(|(k, _)| *k == key)
|
||||
.map(|(_, v)| OsString::from(v))
|
||||
}
|
||||
}
|
||||
|
||||
const FILE_PATH: &str = "/etc/seaweedfs/security.toml";
|
||||
|
||||
#[test]
|
||||
fn parse_knows_three_modes_and_empty() {
|
||||
assert_eq!(FipsMode::parse(""), Ok(None));
|
||||
assert_eq!(FipsMode::parse("off"), Ok(Some(FipsMode::Off)));
|
||||
assert_eq!(FipsMode::parse("on"), Ok(Some(FipsMode::On)));
|
||||
assert_eq!(FipsMode::parse("strict"), Ok(Some(FipsMode::Strict)));
|
||||
assert!(FipsMode::parse("only").is_err());
|
||||
assert!(FipsMode::parse("On").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unset_everywhere_is_off() {
|
||||
let off = Setting {
|
||||
mode: FipsMode::Off,
|
||||
source: None,
|
||||
};
|
||||
assert_eq!(resolve(None, None, &env_of(&[])), Ok(off.clone()));
|
||||
assert_eq!(
|
||||
resolve(Some(Path::new(FILE_PATH)), None, &env_of(&[])),
|
||||
Ok(off.clone())
|
||||
);
|
||||
assert_eq!(
|
||||
resolve(Some(Path::new(FILE_PATH)), Some(""), &env_of(&[])),
|
||||
Ok(off.clone())
|
||||
);
|
||||
assert_eq!(off.to_string(), "FIPS mode off (fips.mode unset)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_file_sets_the_mode() {
|
||||
let setting = resolve(Some(Path::new(FILE_PATH)), Some("strict"), &env_of(&[])).unwrap();
|
||||
assert_eq!(setting.mode, FipsMode::Strict);
|
||||
assert_eq!(
|
||||
setting.to_string(),
|
||||
"FIPS mode strict (/etc/seaweedfs/security.toml: fips.mode)"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_environment_wins_over_the_file() {
|
||||
let env = env_of(&[("WEED_FIPS_MODE", "on")]);
|
||||
let setting = resolve(Some(Path::new(FILE_PATH)), Some("off"), &env).unwrap();
|
||||
assert_eq!(setting.mode, FipsMode::On);
|
||||
assert_eq!(setting.to_string(), "FIPS mode on (WEED_FIPS_MODE)");
|
||||
assert_eq!(resolve(None, None, &env).unwrap().mode, FipsMode::On);
|
||||
assert_eq!(
|
||||
resolve(Some(Path::new(FILE_PATH)), Some("[\"strict\"]"), &env)
|
||||
.unwrap()
|
||||
.mode,
|
||||
FipsMode::On
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_empty_environment_variable_counts_as_unset() {
|
||||
let env = env_of(&[("WEED_FIPS_MODE", "")]);
|
||||
assert_eq!(
|
||||
resolve(Some(Path::new(FILE_PATH)), Some("on"), &env)
|
||||
.unwrap()
|
||||
.mode,
|
||||
FipsMode::On
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_unknown_value_is_refused_naming_its_source() {
|
||||
let err = resolve(None, None, &env_of(&[("WEED_FIPS_MODE", "yes")])).unwrap_err();
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
"WEED_FIPS_MODE is \"yes\"; want off, on or strict"
|
||||
);
|
||||
let err = resolve(
|
||||
Some(Path::new(FILE_PATH)),
|
||||
Some("[\"strict\"]"),
|
||||
&env_of(&[]),
|
||||
)
|
||||
.unwrap_err();
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
"/etc/seaweedfs/security.toml: fips.mode is \"[\\\"strict\\\"]\"; want off, on or strict"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_process_mode_is_set_once() {
|
||||
assert_eq!(set_process_mode(process_mode()), Ok(()));
|
||||
let other = if process_mode() == FipsMode::On {
|
||||
FipsMode::Off
|
||||
} else {
|
||||
FipsMode::On
|
||||
};
|
||||
assert!(set_process_mode(other).is_err());
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,7 @@
|
||||
//! rustls provider, which only works if every binary installs the same one.
|
||||
//! The security.toml search path joined them for the same reason: an operator
|
||||
//! mounts the file once and every binary has to look where `weed` looks.
|
||||
//! The FIPS mode joined them because it decides that provider.
|
||||
|
||||
pub mod address;
|
||||
pub mod fips;
|
||||
pub mod security_config;
|
||||
pub mod tls;
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MC4CAQAwBQYDK2VwBCIEIKcJM4ur78AjGRa92XbPxkXK+Dx4z7eObSdEzyhV/iiI
|
||||
-----END PRIVATE KEY-----
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MEcCAQAwBQYDK2VxBDsEOSsBSiCeTY1tto3PFVZFeK55DoEaqWlcSREnSTQ4nfkr
|
||||
Lvw0O5dru34QfckKqoFuEoyMvMh1RIz95g==
|
||||
-----END PRIVATE KEY-----
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIKPgIBADALBglghkgBZQMEAxEEggoqMIIKJgQgQQrP8unrSpS7t1GeYGJIpRto
|
||||
SmG4mJa33bu2HdaeZFsEggoA/gIsLnCAYuY4UDW5CpPcovPbtEmtHbOEZPWYYbiY
|
||||
sGpD93b/wCjXPD+7jcDHohVQJ75aO4Adsj5sq/5zMixfzIPslMUdkX310RVIpi43
|
||||
D6bfBrAxkO0U1Nkn6iDOqw+UWc9YvRM5WkujREA8qng79JZ1gbDEHUw4JahfIs79
|
||||
F4fjQkGAuCxauC0bBCQihk1YpEkLQYUkGDCIBmJMQAUAhUUBIS0LIUyJpGnURilb
|
||||
iBAMRQLEuEEJBHGJJlEhSTHRSA0QESYhRQgjGIEkiCjMkEDJIFBTwnCcomBUBlBb
|
||||
uBFMSGHJxmjZgpAhsyhglkxiBo7BRoDUJEARgojRAiVYEg4AxklcFmCBQGUZiQRR
|
||||
ok2bgI1CpA2USIwjgYnYNIpcICXKMi3RomijokghCSaaokyTwlFaFnEiBCqilkwR
|
||||
iSwLGQEUIFHBsm1kBGVYRmniRnICsRCTJirDoogKSBHcSHHiqBGRGCkDMlJCCDFD
|
||||
tGQAR0rYMATkRnGYAikixkjMhGUSyHAKSWgMkkAZGBLbJGBkIAQDhjCgEkEDR4zA
|
||||
Jg0CQDJSlBEkQCUUGCEjyU1iIClRMBETgSQbR2WRqEWcRoBDIiLjoo1SpCVIuA1j
|
||||
CDAJRYwYEGwEmDBRODFLFnAjwowjAkzbtm3QFE0ZsmVEGGwDRQwKyTBTIgkSxoAc
|
||||
g03SoGRBRm0RSIQihQ0cqSDYSCYMOAqYIgoiFHLghixcRiQhhHEKBwHKOAACKWkR
|
||||
I4pCFI2JyCUSOCkZNwmBxCAcQ3IhJVKEpkUgJgySGHLcJkRRlmHRlk0TgDCauCDg
|
||||
JGURtmgbFWpBOHKKmCUag03BgnAhsohgFAGQuGHDRlEkBTGRFAkhEI7ThoBbyJDC
|
||||
IGSkJkwgs0VjpgWIsE0Ctk0CyQFSBk4SowlDoCRZEmYKGSqiRIACpJGDQgUYRGDI
|
||||
CIyJBCUaKA7EIijcJACEqC0DEgABOE2TyCwTSGAJlyhbgADZkGkDpgVaMFASGGlR
|
||||
RgIBJ4bQQmEjQAlkkFEAGW0JQYIDFm0DNpDIgIQYQ4WTwiwgBAKJMi0ZliCUMEWa
|
||||
GIkaJ5IKwJFjCI0iiGDjEExBtpCcKGVcMm4CsXAIImWEwhDYOI4hgUgCQYoUBZCC
|
||||
soTbtBALEEIcJpAQF1EZlnDEqCgbNyCLBIISMVCLQgwJkmDJGCGCRiIYMYrKkiCa
|
||||
xGTbZXtrCGKSFu3craDAVG1GAKYgmimIF4ktgY7/C4ammULwJmqnjNfOSlCt598v
|
||||
9ofuxnVZlDEtlTjgKQPPfXOp3lEzl9Die1QeZNqcg3IuTVRnUolGKTI62HNqKXfm
|
||||
PrSQ9sPnOdGa4XyXYncraf1UuZ//hknLrM88D+kNoGqP65ni+OQ5MU0nsy52Y6ns
|
||||
G88lSAFypwo+welJJAWxek5PsLbhnYyZfTpKvPC52ZfRCQBCG4n4RK0qtiaFBgly
|
||||
JrBUVnzLvMtxZPr7rK47UipXcQAAnd6m1Ul8wE7/FCBQ6xWQQQUH8lmW8a6ZSuod
|
||||
lW2Evbut2p8B9HadMBRP6+2oPrYfrpTSkDawNPiNIWZvk4F6klljAWmrDJB0v/ou
|
||||
kIzuYiMWkZhbhJO6bVVpW8/h2HQarETnCERtqBjXRDiJgg0gzHQZiNACMV3LiEaS
|
||||
muZIxqzzsOhn/i6RA9qnBqvl3mk/2GFXudiLFVk0cYMBLqn3tIt2k/+S0DsbKvSE
|
||||
0dPSqzXx62oLgqxK8DJmrJ5YHTHSTsJfHO64VX3f1MnFLhV/6TPOteJmE/8CEmZK
|
||||
gtrDpN9wYvmFe3vWUCAsYOzfnzDolq+SsqXAbZhkYNoomAwBK36pU0aE/e8SiCdP
|
||||
I7EM17AyPW5f9mLs0S3g9zVX3NK9zgaW9EtQ8zLXm7sOeazzEp6xxobOvJCBwoav
|
||||
tPzT+vab5u8nNDIcLIAj/mYAjkjS7cog135qOE56WiTOW7gCB75C6WkiAQTOqZ7J
|
||||
+AFUgwN9j61cdTeJW/NbPgndlpjK+HiTYeENdnBQ898/JmUblhzcR/QpMEih3QO/
|
||||
Q7+AfejRpVPpOLDDJwRfc19b6ymZ27nJVQ4GChI6oKX4Po4JNo54UO09bRsCf9Eq
|
||||
sq9EvCBsS6H0xw6Y7EmNab0BpW6iFUmac9Bj4cWh9trZ/bZwExW4YvwX+bDIM/A8
|
||||
mqmpsZSbkE/RoEiKSS7NHc3XgVsGJ2czkftcGbnUBZmIaPVu6XVJyyBwM7GogESv
|
||||
yuQGFbuSlOhrwphtNfpm0T+/vU/elaIPJS0Os2sgmPgGqHE+o5BndkZ/hD8c5Ec0
|
||||
Zs64BZugQoLKLTJtn+JqVWd6PotXBgEazdechsQQfCqOwRUO8VP9Q7A/sPQpgAk8
|
||||
UyMvQliHdF2FFE9BHYMMw2B8a05+MUogYAS+V4RB1mMl35Lv1W3nOvIszSkFGact
|
||||
T4uh7/mQwekpR0AXRcYdF72YDuC7WvMG7cBvZe5oi1c1/vu0R+NgUw1yMiZp3f/C
|
||||
xqM/h1QzQTxSaro4oJm6/nJr3hSj6yx83cPbQzusLAb0CkkGlqw977rxWC56rPUt
|
||||
d7cMOG9L7dMPIzuQ6PkQY6ttgDpH176d2vZphfFqjyUb05ryA+vJw/+xh73le837
|
||||
TaNeTemy+p2UlYdW2LkTrgz0v/t2CsiT6LL9uGyz0rGrs/bGJg3XPMxsukHanThd
|
||||
KKm8leIE02ogDiSfy2Ozf+rdJUGDArr4Jb5IYGE8bQUdfdBvvb1eKDhgKvYHM5XE
|
||||
ExnFQSa8pftsXjS2F7MQr397tBL6WNC+KPnbgXmLhJbmGvnuS7XaHkErrRQwD75M
|
||||
tP6b2fZiKWz9gx+0nkOxM1PX+cPVWrgbrrvpJUZewe1LW+Mctuei8sXTkHQ9stq7
|
||||
23xqQTUe9soXWy277wlPr1eXY2gnKkH7hc7flu5gGSoaG29g4okvu6hrTUJ4tJgd
|
||||
0YaLF0uNt2LvgBNOVxHBFX09GzGsvxfhY9+dRl0CDq3oHvaWCLs52WYx0u6s0Oyq
|
||||
mCKG9lTdKL57pyPAPR1iCZzTDLbjhdxMQUFQ7zHHfQksu5ui3MHnaA+BAijZgmi2
|
||||
0rs/QEh7Wv1AJS2XkNoFN7CxBQueBmXb2OtsqNHPv4lbE17UrHUbi9GHoMhfaGMB
|
||||
9YzcPP/3Qentc3az4T4HsZUdePakJguI3qLBKGLdXtn2JHNoJ/poCxtVEEQ474us
|
||||
YZQvYXbBmeJ+kwczfabNqRdGDnN4e1bfSxnSiVCJJDK5EQGNatqCso5S+5jyAd6z
|
||||
FBbOe72dJxacVdU0esOrRK0cafJpeeCNgtUiRCZeWiFi3d+daLgqcqEiaV2Obk99
|
||||
SiG57HJDpMrQgyzVuucms3bRWlb8H38DBFjclt4ONFx5dymNR/C2QCm+FCXvuFEv
|
||||
UHB9qJcdZuhjkRNszOrvkokJdWWt9GxRWQ6eR+raum0q+Q==
|
||||
-----END PRIVATE KEY-----
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgKQGVRsbYNwfFeCQU
|
||||
4c2Nkjnme5k8eDQ1loKC5/qKNeGhRANCAAQtjdBx4U07ZO68fAkYnGbhCoeVTC9o
|
||||
BejPCRmx9mOOhD3dKK5j9hsgVBd0RagUsgVwkq5xLKrvMB8ZoQe2jKRF
|
||||
-----END PRIVATE KEY-----
|
||||
+6
-419
@@ -5,285 +5,19 @@
|
||||
//! backend and reqwest — so rustls cannot auto-select a provider and tonic's
|
||||
//! client TLS panics on first use. Each binary has to pin one, and it has to be
|
||||
//! the same one, which is why the choice lives here rather than in either tree.
|
||||
//!
|
||||
//! Under [`FipsMode::On`] and [`FipsMode::Strict`] the provider is aws-lc-rs
|
||||
//! filtered to what Go's `crypto/tls` allows when `GODEBUG=fips140` is `on` or
|
||||
//! `only` (`crypto/tls/defaults_fips140.go`, Go 1.27.4, the version go.mod
|
||||
//! requires). TLS 1.2 and 1.3 are all rustls implements, which is Go's FIPS
|
||||
//! version list.
|
||||
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use rustls::crypto::aws_lc_rs;
|
||||
|
||||
use rustls::crypto::{
|
||||
CryptoProvider, KeyProvider, SupportedKxGroup, WebPkiSupportedAlgorithms, aws_lc_rs,
|
||||
};
|
||||
use rustls::pki_types::{PrivateKeyDer, SubjectPublicKeyInfoDer, alg_id};
|
||||
use rustls::sign::{Signer, SigningKey};
|
||||
use rustls::{CipherSuite, NamedGroup, SignatureAlgorithm, SignatureScheme};
|
||||
|
||||
use crate::fips::{self, FipsMode, FipsModeError};
|
||||
|
||||
/// Go's `allowedCipherSuitesTLS13FIPS` and the AES-GCM part of
|
||||
/// `allowedCipherSuitesFIPS`. Go also allows
|
||||
/// `TLS_ECDHE_{ECDSA,RSA}_WITH_AES_128_CBC_SHA256`, which rustls does not
|
||||
/// implement.
|
||||
pub const FIPS_CIPHER_SUITES: &[CipherSuite] = &[
|
||||
CipherSuite::TLS13_AES_128_GCM_SHA256,
|
||||
CipherSuite::TLS13_AES_256_GCM_SHA384,
|
||||
CipherSuite::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
||||
CipherSuite::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
|
||||
CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
|
||||
CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
|
||||
];
|
||||
|
||||
/// Go's `allowedCurvePreferencesFIPS` as rustls 0.23 has them and Go enables
|
||||
/// by default, in Go's preference order. rustls has no SecP384r1MLKEM1024 and
|
||||
/// no P-521; it has MLKEM1024, which Go allows but enables only when
|
||||
/// configured, so it is left out as Go leaves it out of its defaults.
|
||||
fn fips_kx_groups() -> Vec<&'static dyn SupportedKxGroup> {
|
||||
vec![
|
||||
aws_lc_rs::kx_group::X25519MLKEM768,
|
||||
aws_lc_rs::kx_group::SECP256R1MLKEM768,
|
||||
aws_lc_rs::kx_group::SECP256R1,
|
||||
aws_lc_rs::kx_group::SECP384R1,
|
||||
]
|
||||
}
|
||||
|
||||
/// Go's `allowedSignatureAlgorithmsFIPS`.
|
||||
pub const FIPS_SIGNATURE_SCHEMES: &[SignatureScheme] = &[
|
||||
SignatureScheme::RSA_PSS_SHA256,
|
||||
SignatureScheme::ECDSA_NISTP256_SHA256,
|
||||
SignatureScheme::ED25519,
|
||||
SignatureScheme::ML_DSA_44,
|
||||
SignatureScheme::ML_DSA_65,
|
||||
SignatureScheme::ML_DSA_87,
|
||||
SignatureScheme::RSA_PSS_SHA384,
|
||||
SignatureScheme::RSA_PSS_SHA512,
|
||||
SignatureScheme::RSA_PKCS1_SHA256,
|
||||
SignatureScheme::RSA_PKCS1_SHA384,
|
||||
SignatureScheme::RSA_PKCS1_SHA512,
|
||||
SignatureScheme::ECDSA_NISTP384_SHA384,
|
||||
SignatureScheme::ECDSA_NISTP521_SHA512,
|
||||
];
|
||||
|
||||
/// The certificate key types Go's `isCertificateAllowedFIPS` accepts: RSA,
|
||||
/// ECDSA on P-256, P-384 or P-521, Ed25519, and ML-DSA (Go allows ML-DSA for
|
||||
/// its native module only). The RSA algorithms rustls verifies with take keys
|
||||
/// of 2048 to 8192 bits, so Go's 2048-bit floor holds.
|
||||
const FIPS_CERTIFICATE_KEYS: &[rustls::pki_types::AlgorithmIdentifier] = &[
|
||||
alg_id::RSA_ENCRYPTION,
|
||||
alg_id::ECDSA_P256,
|
||||
alg_id::ECDSA_P384,
|
||||
alg_id::ECDSA_P521,
|
||||
alg_id::ED25519,
|
||||
alg_id::ML_DSA_44,
|
||||
alg_id::ML_DSA_65,
|
||||
alg_id::ML_DSA_87,
|
||||
];
|
||||
|
||||
/// The aws-lc-rs verification algorithms limited to Go's FIPS signature
|
||||
/// schemes and certificate keys. With aws-lc-rs's current set that removes
|
||||
/// nothing; the filter keeps an algorithm a later rustls adds out of FIPS
|
||||
/// mode until Go allows it. Built once, since rustls needs `'static` slices.
|
||||
fn fips_signature_verification_algorithms() -> WebPkiSupportedAlgorithms {
|
||||
static ALGORITHMS: OnceLock<WebPkiSupportedAlgorithms> = OnceLock::new();
|
||||
*ALGORITHMS.get_or_init(|| {
|
||||
let default = aws_lc_rs::default_provider().signature_verification_algorithms;
|
||||
let all = default
|
||||
.all
|
||||
.iter()
|
||||
.filter(|alg| FIPS_CERTIFICATE_KEYS.contains(&alg.public_key_alg_id()))
|
||||
.copied()
|
||||
.collect::<Vec<_>>();
|
||||
let mapping = default
|
||||
.mapping
|
||||
.iter()
|
||||
.filter(|(scheme, _)| FIPS_SIGNATURE_SCHEMES.contains(scheme))
|
||||
.copied()
|
||||
.collect::<Vec<_>>();
|
||||
WebPkiSupportedAlgorithms {
|
||||
all: all.leak(),
|
||||
mapping: mapping.leak(),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Loads private keys through aws-lc-rs and passes them through
|
||||
/// [`restrict_to_fips`], so a FIPS-mode listener or client signs handshakes
|
||||
/// only with Go's FIPS signature schemes.
|
||||
#[derive(Debug)]
|
||||
struct FipsKeyProvider;
|
||||
|
||||
static FIPS_KEY_PROVIDER: FipsKeyProvider = FipsKeyProvider;
|
||||
|
||||
impl KeyProvider for FipsKeyProvider {
|
||||
fn load_private_key(
|
||||
&self,
|
||||
key_der: PrivateKeyDer<'static>,
|
||||
) -> Result<Arc<dyn SigningKey>, rustls::Error> {
|
||||
let key = aws_lc_rs::default_provider()
|
||||
.key_provider
|
||||
.load_private_key(key_der)?;
|
||||
restrict_to_fips(key)
|
||||
}
|
||||
|
||||
fn fips(&self) -> bool {
|
||||
aws_lc_rs::default_provider().key_provider.fips()
|
||||
}
|
||||
}
|
||||
|
||||
/// Wraps `key` so it offers only [`FIPS_SIGNATURE_SCHEMES`], refusing a key
|
||||
/// that can sign none of them, such as Ed448, with an error naming its type.
|
||||
fn restrict_to_fips(key: Arc<dyn SigningKey>) -> Result<Arc<dyn SigningKey>, rustls::Error> {
|
||||
if key.choose_scheme(FIPS_SIGNATURE_SCHEMES).is_none() {
|
||||
return Err(rustls::Error::General(format!(
|
||||
"{} private key is not allowed in FIPS mode, which accepts RSA, ECDSA P-256/P-384/P-521, Ed25519 and ML-DSA keys",
|
||||
key_kind(key.algorithm())
|
||||
)));
|
||||
}
|
||||
Ok(Arc::new(FipsSigningKey(key)))
|
||||
}
|
||||
|
||||
/// How a refused key is named.
|
||||
fn key_kind(algorithm: SignatureAlgorithm) -> String {
|
||||
match algorithm {
|
||||
SignatureAlgorithm::ED448 => "an Ed448".to_string(),
|
||||
other => format!("a {other:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// A signing key that offers only [`FIPS_SIGNATURE_SCHEMES`].
|
||||
#[derive(Debug)]
|
||||
struct FipsSigningKey(Arc<dyn SigningKey>);
|
||||
|
||||
impl SigningKey for FipsSigningKey {
|
||||
fn choose_scheme(&self, offered: &[SignatureScheme]) -> Option<Box<dyn Signer>> {
|
||||
let allowed = offered
|
||||
.iter()
|
||||
.copied()
|
||||
.filter(|scheme| FIPS_SIGNATURE_SCHEMES.contains(scheme))
|
||||
.collect::<Vec<_>>();
|
||||
self.0.choose_scheme(&allowed)
|
||||
}
|
||||
|
||||
fn public_key(&self) -> Option<SubjectPublicKeyInfoDer<'_>> {
|
||||
self.0.public_key()
|
||||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
self.0.algorithm()
|
||||
}
|
||||
}
|
||||
|
||||
/// The aws-lc-rs provider with Go's FIPS-mode TLS lists applied. It still
|
||||
/// runs on the non-validated aws-lc-rs build, so `CryptoProvider::fips()` is
|
||||
/// false.
|
||||
pub fn fips_provider() -> CryptoProvider {
|
||||
let default = aws_lc_rs::default_provider();
|
||||
CryptoProvider {
|
||||
cipher_suites: default
|
||||
.cipher_suites
|
||||
.into_iter()
|
||||
.filter(|suite| FIPS_CIPHER_SUITES.contains(&suite.suite()))
|
||||
.collect(),
|
||||
kx_groups: fips_kx_groups(),
|
||||
signature_verification_algorithms: fips_signature_verification_algorithms(),
|
||||
key_provider: &FIPS_KEY_PROVIDER,
|
||||
..default
|
||||
}
|
||||
}
|
||||
|
||||
/// The provider for `mode`: aws-lc-rs's default under [`FipsMode::Off`],
|
||||
/// [`fips_provider`] otherwise.
|
||||
pub fn provider_for(mode: FipsMode) -> CryptoProvider {
|
||||
if mode.is_fips() {
|
||||
fips_provider()
|
||||
} else {
|
||||
aws_lc_rs::default_provider()
|
||||
}
|
||||
}
|
||||
|
||||
/// The provider for this process's mode ([`fips::process_mode`]).
|
||||
pub fn crypto_provider() -> CryptoProvider {
|
||||
provider_for(fips::process_mode())
|
||||
}
|
||||
|
||||
/// Pin rustls's process-wide default provider to [`crypto_provider`]:
|
||||
/// aws-lc-rs, filtered to the FIPS lists when the process mode asks for it.
|
||||
/// Idempotent: the first call wins and every later one is a no-op, so callers
|
||||
/// do not have to coordinate.
|
||||
/// Pin rustls's process-wide default provider to aws-lc-rs, matching the
|
||||
/// volume server's TLS config. Idempotent: the first call wins and every
|
||||
/// later one is a no-op, so callers do not have to coordinate.
|
||||
pub fn install_default_crypto_provider() {
|
||||
let _ = crypto_provider().install_default();
|
||||
}
|
||||
|
||||
/// Whether TLS 1.2 connections must use the Extended Master Secret, as Go
|
||||
/// requires in FIPS mode. rustls requires it only of a validated provider,
|
||||
/// so configurations SeaweedFS builds itself set `require_ems` from this.
|
||||
pub fn require_ems() -> bool {
|
||||
fips::process_mode().is_fips()
|
||||
}
|
||||
|
||||
/// Why [`install_process_provider`] failed.
|
||||
#[derive(Debug)]
|
||||
pub enum InstallError {
|
||||
Mode(FipsModeError),
|
||||
/// A provider other than this mode's was installed first.
|
||||
OtherProvider(FipsMode),
|
||||
}
|
||||
|
||||
impl std::fmt::Display for InstallError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::Mode(e) => e.fmt(f),
|
||||
Self::OtherProvider(mode) => write!(
|
||||
f,
|
||||
"a rustls crypto provider other than the one for FIPS mode {mode} is already installed"
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for InstallError {}
|
||||
|
||||
/// Records `mode` as this process's FIPS mode and installs its provider as the
|
||||
/// rustls process default. Call it once at startup, before anything builds a
|
||||
/// TLS configuration; it fails if a different provider got there first, so a
|
||||
/// FIPS-mode process never runs on the unfiltered one.
|
||||
pub fn install_process_provider(mode: FipsMode) -> Result<(), InstallError> {
|
||||
fips::set_process_mode(mode).map_err(InstallError::Mode)?;
|
||||
install_default_crypto_provider();
|
||||
let installed = CryptoProvider::get_default().ok_or(InstallError::OtherProvider(mode))?;
|
||||
if !same_lists(installed, &provider_for(mode)) {
|
||||
return Err(InstallError::OtherProvider(mode));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Whether two providers offer the same suites, groups and signature schemes.
|
||||
fn same_lists(a: &CryptoProvider, b: &CryptoProvider) -> bool {
|
||||
let suites = |p: &CryptoProvider| {
|
||||
p.cipher_suites
|
||||
.iter()
|
||||
.map(|s| s.suite())
|
||||
.collect::<Vec<_>>()
|
||||
};
|
||||
let groups = |p: &CryptoProvider| {
|
||||
p.kx_groups
|
||||
.iter()
|
||||
.map(|g| g.name())
|
||||
.collect::<Vec<NamedGroup>>()
|
||||
};
|
||||
suites(a) == suites(b)
|
||||
&& groups(a) == groups(b)
|
||||
&& a.signature_verification_algorithms.supported_schemes()
|
||||
== b.signature_verification_algorithms.supported_schemes()
|
||||
&& a.signature_verification_algorithms.all.len()
|
||||
== b.signature_verification_algorithms.all.len()
|
||||
let _ = aws_lc_rs::default_provider().install_default();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use super::install_default_crypto_provider;
|
||||
|
||||
#[test]
|
||||
fn installing_is_idempotent_and_leaves_a_default_behind() {
|
||||
@@ -291,151 +25,4 @@ mod tests {
|
||||
install_default_crypto_provider();
|
||||
assert!(rustls::crypto::CryptoProvider::get_default().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn off_is_the_unfiltered_default() {
|
||||
assert!(same_lists(
|
||||
&provider_for(FipsMode::Off),
|
||||
&aws_lc_rs::default_provider()
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fips_mode_drops_chacha20_and_plain_x25519() {
|
||||
for mode in [FipsMode::On, FipsMode::Strict] {
|
||||
let provider = provider_for(mode);
|
||||
let suites = provider
|
||||
.cipher_suites
|
||||
.iter()
|
||||
.map(|s| s.suite())
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(
|
||||
suites,
|
||||
vec![
|
||||
CipherSuite::TLS13_AES_256_GCM_SHA384,
|
||||
CipherSuite::TLS13_AES_128_GCM_SHA256,
|
||||
CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
|
||||
CipherSuite::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
|
||||
CipherSuite::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
|
||||
CipherSuite::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
||||
]
|
||||
);
|
||||
let groups = provider
|
||||
.kx_groups
|
||||
.iter()
|
||||
.map(|g| g.name())
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(
|
||||
groups,
|
||||
vec![
|
||||
NamedGroup::X25519MLKEM768,
|
||||
NamedGroup::secp256r1MLKEM768,
|
||||
NamedGroup::secp256r1,
|
||||
NamedGroup::secp384r1,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn load(provider: &CryptoProvider, pem: &str) -> Result<Arc<dyn SigningKey>, rustls::Error> {
|
||||
use rustls::pki_types::pem::PemObject;
|
||||
provider
|
||||
.key_provider
|
||||
.load_private_key(PrivateKeyDer::from_pem_slice(pem.as_bytes()).unwrap())
|
||||
}
|
||||
|
||||
const ML_DSA_44_KEY: &str = include_str!("testdata/mldsa44.pem");
|
||||
const ED448_KEY: &str = include_str!("testdata/ed448.pem");
|
||||
const P256_KEY: &str = include_str!("testdata/p256.pem");
|
||||
const ED25519_KEY: &str = include_str!("testdata/ed25519.pem");
|
||||
|
||||
/// A key that signs only Ed448, which aws-lc-rs cannot load, to drive the
|
||||
/// refusal.
|
||||
#[derive(Debug)]
|
||||
struct Ed448Only;
|
||||
|
||||
impl SigningKey for Ed448Only {
|
||||
fn choose_scheme(&self, _offered: &[SignatureScheme]) -> Option<Box<dyn Signer>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn algorithm(&self) -> SignatureAlgorithm {
|
||||
SignatureAlgorithm::ED448
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fips_mode_refuses_keys_outside_go_s_list() {
|
||||
let err = restrict_to_fips(Arc::new(Ed448Only)).unwrap_err();
|
||||
assert!(err.to_string().contains("an Ed448 private key"), "{err}");
|
||||
assert!(
|
||||
err.to_string().contains("not allowed in FIPS mode"),
|
||||
"{err}"
|
||||
);
|
||||
assert!(load(&provider_for(FipsMode::On), ED448_KEY).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fips_mode_allows_ml_dsa_as_go_1_27_does() {
|
||||
let fips = provider_for(FipsMode::On);
|
||||
let ml_dsa = load(&fips, ML_DSA_44_KEY).unwrap();
|
||||
assert!(
|
||||
ml_dsa
|
||||
.choose_scheme(&[SignatureScheme::ML_DSA_44])
|
||||
.is_some()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fips_mode_keys_sign_with_fips_schemes_only() {
|
||||
let fips = provider_for(FipsMode::Strict);
|
||||
let p256 = load(&fips, P256_KEY).unwrap();
|
||||
let signer = p256
|
||||
.choose_scheme(&[SignatureScheme::ECDSA_NISTP256_SHA256])
|
||||
.unwrap();
|
||||
assert_eq!(signer.scheme(), SignatureScheme::ECDSA_NISTP256_SHA256);
|
||||
assert!(
|
||||
p256.choose_scheme(&[SignatureScheme::ECDSA_SHA1_Legacy])
|
||||
.is_none()
|
||||
);
|
||||
assert!(p256.public_key().is_some());
|
||||
let ed25519 = load(&fips, ED25519_KEY).unwrap();
|
||||
assert!(ed25519.choose_scheme(&[SignatureScheme::ED25519]).is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn off_keeps_the_default_key_provider() {
|
||||
let off = provider_for(FipsMode::Off);
|
||||
let ml_dsa = load(&off, ML_DSA_44_KEY).unwrap();
|
||||
assert!(
|
||||
ml_dsa
|
||||
.choose_scheme(&[SignatureScheme::ML_DSA_44])
|
||||
.is_some()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fips_mode_verifies_go_s_signature_schemes_only() {
|
||||
let provider = fips_provider();
|
||||
let mut schemes = provider
|
||||
.signature_verification_algorithms
|
||||
.supported_schemes();
|
||||
let mut want = FIPS_SIGNATURE_SCHEMES.to_vec();
|
||||
schemes.sort_by_key(|s| u16::from(*s));
|
||||
want.sort_by_key(|s| u16::from(*s));
|
||||
assert_eq!(schemes, want);
|
||||
assert!(
|
||||
provider
|
||||
.signature_verification_algorithms
|
||||
.all
|
||||
.iter()
|
||||
.all(|alg| FIPS_CERTIFICATE_KEYS.contains(&alg.public_key_alg_id()))
|
||||
);
|
||||
let default = aws_lc_rs::default_provider();
|
||||
assert_eq!(
|
||||
default.signature_verification_algorithms.all.len(),
|
||||
provider.signature_verification_algorithms.all.len(),
|
||||
"Go 1.27 allows every key type aws-lc-rs verifies"
|
||||
);
|
||||
}
|
||||
}
|
||||
Generated
-7
@@ -6338,7 +6338,6 @@ dependencies = [
|
||||
"protoc-bin-vendored",
|
||||
"reqwest 0.12.28",
|
||||
"rustls",
|
||||
"seaweed-common",
|
||||
"thiserror 2.0.21",
|
||||
"tokio",
|
||||
"tonic",
|
||||
@@ -7144,10 +7143,8 @@ dependencies = [
|
||||
"aes",
|
||||
"aes-gcm",
|
||||
"anyhow",
|
||||
"arrow-array",
|
||||
"arrow-cast",
|
||||
"arrow-schema",
|
||||
"arrow-select",
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
@@ -7161,7 +7158,6 @@ dependencies = [
|
||||
"hmac 0.12.1",
|
||||
"http",
|
||||
"hyper-util",
|
||||
"jsonb",
|
||||
"jsonwebtoken",
|
||||
"lance",
|
||||
"lance-datafusion",
|
||||
@@ -7194,7 +7190,6 @@ dependencies = [
|
||||
"tower",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
"x509-parser",
|
||||
"zstd",
|
||||
]
|
||||
@@ -7213,7 +7208,6 @@ dependencies = [
|
||||
"lance",
|
||||
"lance-index",
|
||||
"lance-linalg",
|
||||
"lance-select",
|
||||
"lance-table",
|
||||
"object_store",
|
||||
"roaring",
|
||||
@@ -7242,7 +7236,6 @@ dependencies = [
|
||||
"futures",
|
||||
"lance",
|
||||
"lance-arrow",
|
||||
"lance-index",
|
||||
"lance-linalg",
|
||||
"moka",
|
||||
"object_store",
|
||||
|
||||
@@ -15,12 +15,12 @@ Point an AWS S3 Vectors client at the S3 endpoint, normally `http://localhost:83
|
||||
| `--masters` | Required | Comma-separated master addresses |
|
||||
| `--listen` | `127.0.0.1:8090` | gRPC listener and registered address |
|
||||
| `--filer-group` | Empty | Filer group used for table storage |
|
||||
| `--read-cache-mb` | `512` | Immutable data/index read cache; zero disables it |
|
||||
| `--nprobes` | Automatic | ANN partitions searched per query |
|
||||
| `--metrics-port` | `0` | HTTP metrics and health listener; zero disables it |
|
||||
| `--metrics-ip` | `127.0.0.1` | HTTP listener address |
|
||||
| `--security-toml` | Discovered | Cluster certificates, signing keys and encryption keys |
|
||||
|
||||
The engine caches a quarter of the memory it may use (its cgroup limit, else the machine's), split 2:4:1 between file reads, loaded indexes and table metadata, and logs the sizes at startup. Each query probes a tenth of the index's partitions, at least 8, and more under a filter.
|
||||
|
||||
The HTTP listener provides `/health`, `/ready`, and `/metrics`. Readiness requires an active registration with the master. The gRPC listener also implements the standard health service for `vector_pb.VectorService` and the whole server. These health statuses follow master registration.
|
||||
|
||||
Metrics use the `SeaweedFS_vector_` prefix:
|
||||
@@ -35,49 +35,6 @@ The S3 gateway separately publishes `SeaweedFS_s3_` request metrics with `type="
|
||||
|
||||
For mutual TLS, configure `[grpc.vector]` for the engine's server certificate, `[grpc.client]` for its master/filer connections, and the cluster CA. HTTPS volume reads also use `[https.client]`. The engine follows the same signing and encryption configuration as the other cluster clients.
|
||||
|
||||
Run the Lance maintenance worker against the cluster's admin to build and update ANN indexes. Queries can scan data that has not been indexed yet. See the [maintenance worker documentation](../seaweed-worker/README.md) and [Helm chart](../k8s/charts/seaweedfs/README.md) for deployment settings.
|
||||
Run the Lance maintenance worker against the same masters and Lance namespace to build and update ANN indexes. Queries can scan data that has not been indexed yet. See the [maintenance worker documentation](../seaweed-worker/README.md) and [Helm chart](../k8s/charts/seaweedfs/README.md) for deployment settings.
|
||||
|
||||
The integration suite at `test/s3vectors` runs the same API and observability checks against both Go and Rust volume servers, including mutual TLS, signed volume reads, and encrypted volume data.
|
||||
|
||||
## Search indexed data only
|
||||
|
||||
The default search includes recent writes by scanning data that indexes do not
|
||||
cover yet. To exclude that data, send `x-seaweedfs-vector-search-mode: indexed-only`
|
||||
on `QueryVectors`. Omit the header, or set it to `all`, for the default behavior.
|
||||
This is a SeaweedFS extension. With SigV4, the header must be signed.
|
||||
|
||||
For example, inject it before boto3 signs the request:
|
||||
|
||||
```python
|
||||
def indexed_only(request, **kwargs):
|
||||
request.headers["x-seaweedfs-vector-search-mode"] = "indexed-only"
|
||||
|
||||
client.meta.events.register("before-sign.s3vectors.QueryVectors", indexed_only)
|
||||
try:
|
||||
result = client.query_vectors(
|
||||
vectorBucketName="embeddings", indexName="articles",
|
||||
queryVector={"float32": embedding}, topK=10,
|
||||
)
|
||||
finally:
|
||||
client.meta.events.unregister("before-sign.s3vectors.QueryVectors", indexed_only)
|
||||
```
|
||||
|
||||
Indexed-only searches use the intersection of vector index coverage and the
|
||||
coverage of each metadata index the filter requires, at one table version. Filters
|
||||
must be conjunctions of string equality or `$in` predicates on ready indexed
|
||||
metadata keys. An unavailable index or unsupported filter returns
|
||||
`ValidationException`. A valid index with no eligible data returns an empty list.
|
||||
A vector engine predating this extension returns `ServiceUnavailableException`;
|
||||
the gateway never falls back to a full search.
|
||||
|
||||
The response includes `x-seaweedfs-vector-search-mode: indexed-only`,
|
||||
`x-seaweedfs-vector-data-excluded: true|false`, and
|
||||
`x-seaweedfs-vector-excluded-fragments`. The exclusion count describes coverage,
|
||||
not the number of matching vectors. New writes, updates, and rewritten fragments
|
||||
from compaction can be omitted until indexing catches up. Current deletions still
|
||||
apply. Exact-search fallbacks stay within the eligible data; this option does not
|
||||
guarantee a fixed latency.
|
||||
|
||||
Enterprise gateways send this mode to the shared single-engine backend using
|
||||
`QueryIndexedVectors`; ordinary searches retain distributed routing. The shared
|
||||
`Query` structure and existing query request/response messages are unchanged.
|
||||
@@ -22,7 +22,6 @@ object_store = "0.13"
|
||||
lance-index = "10"
|
||||
lance-linalg = "10"
|
||||
lance-table = "10"
|
||||
lance-select = "10"
|
||||
arrow-array = "58"
|
||||
arrow-cast = "58"
|
||||
arrow-schema = "58"
|
||||
|
||||
@@ -139,7 +139,6 @@ mod tests {
|
||||
nprobes: Some(4),
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
@@ -149,52 +148,6 @@ mod tests {
|
||||
assert!(hits[0].distance < 1e-6);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn indexed_only_skips_new_rows_until_indexed_and_honors_deletes() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let mut dataset = indexed_dataset(&dir, &["a"; 64]).await;
|
||||
append_dataset(&mut dataset, &[vec![9.0; DIM]], &["b"]).await;
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
let query = Query {
|
||||
vector: vec![9.0; DIM],
|
||||
k: 100,
|
||||
filter: None,
|
||||
postfilter: false,
|
||||
distance: DistanceType::L2,
|
||||
nprobes: Some(4),
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let (hits, excluded) = crate::query::indexed_only(&dataset, &table, &query)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(excluded, 1);
|
||||
assert_eq!(hits.len(), 64);
|
||||
assert!(hits.iter().all(|h| h.key != "k64"));
|
||||
dataset
|
||||
.optimize_indices(&lance_index::optimize::OptimizeOptions::append())
|
||||
.await
|
||||
.unwrap();
|
||||
let (hits, excluded) = crate::query::indexed_only(&dataset, &table, &query)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(excluded, 0);
|
||||
assert_eq!(hits[0].key, "k64");
|
||||
dataset.delete("key = 'k64'").await.unwrap();
|
||||
let (hits, _) = crate::query::indexed_only(&dataset, &table, &query)
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(hits.iter().all(|h| h.key != "k64"));
|
||||
let missing = write_dataset(&TempDir::new().unwrap(), &vectors(4, DIM), &["a"; 4]).await;
|
||||
assert!(
|
||||
crate::query::indexed_only(&missing, &table, &query)
|
||||
.await
|
||||
.unwrap_err()
|
||||
.is::<crate::query::IndexedOnlyError>()
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn prefiltered_ann_matches_filtered_flat() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
@@ -214,7 +167,6 @@ mod tests {
|
||||
nprobes: Some(4),
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let filtered = ann(&dataset, &table, &query).await.unwrap();
|
||||
let exact = flat(&dataset, &table, &query).await.unwrap();
|
||||
@@ -252,7 +204,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
//! compares the elements as typed JSON values: Lance's compares their text, so
|
||||
//! 1 would match "1".
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use arrow_array::builder::{BooleanBuilder, StringBuilder};
|
||||
@@ -20,21 +19,13 @@ use lance::deps::datafusion::logical_expr::{
|
||||
ColumnarValue, Expr, ScalarFunctionArgs, ScalarUDF, ScalarUDFImpl, Signature, Volatility,
|
||||
};
|
||||
|
||||
/// Set `filter` on the scanner with the JSONPath functions swapped and the
|
||||
/// conjuncts on `ready` indexed keys answered by their columns, which it
|
||||
/// returns.
|
||||
pub(crate) fn apply(
|
||||
scanner: &mut Scanner,
|
||||
filter: &str,
|
||||
ready: &HashMap<String, String>,
|
||||
) -> anyhow::Result<Vec<crate::indexed_filter::Indexed>> {
|
||||
/// Set `filter` on the scanner with the JSONPath functions swapped.
|
||||
pub(crate) fn apply(scanner: &mut Scanner, filter: &str) -> anyhow::Result<()> {
|
||||
scanner.filter(filter)?;
|
||||
let Some(expr) = scanner.get_expr_filter()? else {
|
||||
return Ok(Vec::new());
|
||||
};
|
||||
let (expr, indexed) = crate::indexed_filter::rewrite(expr, ready);
|
||||
scanner.filter_expr(swap(expr)?);
|
||||
Ok(indexed)
|
||||
if let Some(expr) = scanner.get_expr_filter()? {
|
||||
scanner.filter_expr(swap(expr)?);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn swap(expr: Expr) -> Result<Expr> {
|
||||
@@ -277,7 +268,7 @@ mod tests {
|
||||
async fn keys(dataset: &Dataset, filter: &str, swapped: bool) -> anyhow::Result<Vec<String>> {
|
||||
let mut scanner = dataset.scan();
|
||||
if swapped {
|
||||
apply(&mut scanner, filter, &HashMap::new())?;
|
||||
apply(&mut scanner, filter)?;
|
||||
} else {
|
||||
scanner.filter(filter)?;
|
||||
}
|
||||
@@ -404,7 +395,6 @@ mod tests {
|
||||
apply(
|
||||
&mut scanner,
|
||||
r#"json_extract(`metadata`, '$["k"]') = '"v"' AND json_exists(`metadata`, '$["k"]') AND json_get_string(`metadata`, 'k') = 'v' AND json_array_contains(`metadata`, '$["k"]', '"v"') AND NOT json_array_contains(`metadata`, '$["k"]', key)"#,
|
||||
&HashMap::new(),
|
||||
)
|
||||
.unwrap();
|
||||
let mut swapped = Vec::new();
|
||||
|
||||
@@ -104,7 +104,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,83 +198,6 @@ mod tests {
|
||||
assert_eq!(filtered.len(), 10);
|
||||
}
|
||||
|
||||
/// A filtered query through the index returns every eligible row when
|
||||
/// fewer than k match, though the probed partitions cannot hold them all:
|
||||
/// 400 of 4000 rows match, the index has 63 partitions and probes at most
|
||||
/// 32 of them.
|
||||
#[tokio::test]
|
||||
async fn filtered_ann_returns_every_match_below_k() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let rows = scattered(4000, 8, 0x9E3779B97F4A7C15);
|
||||
let tags: Vec<&str> = (0..4000)
|
||||
.map(|i| if i % 10 == 0 { "rare" } else { "common" })
|
||||
.collect();
|
||||
let mut dataset = testing::write_dataset(&dir, &rows, &tags).await;
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
build(
|
||||
&mut dataset,
|
||||
&table.vector_column,
|
||||
INDEX_NAME,
|
||||
partitions_for(4000),
|
||||
false,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(partitions_for(4000), 63);
|
||||
for vector in &scattered(3, 8, 0xD1B54A32D192ED03) {
|
||||
let q = Query {
|
||||
filter: Some("tag = 'rare'".to_string()),
|
||||
..exact(vector, 500)
|
||||
};
|
||||
let flat = query::flat(&dataset, &table, &q).await.unwrap();
|
||||
assert_eq!(flat.len(), 400);
|
||||
let ann = query::ann(&dataset, &table, &q).await.unwrap();
|
||||
assert_eq!(ann.len(), 400, "the index path dropped eligible rows");
|
||||
for (f, a) in flat.iter().zip(ann.iter()) {
|
||||
assert!((f.distance - a.distance).abs() < 1e-5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// When no more than k rows match, every match comes back with its own
|
||||
/// distance, nearest first — not the rows the probes missed with an
|
||||
/// infinite distance. Ten fragments of 400 rows, 5 of them matching.
|
||||
#[tokio::test]
|
||||
async fn filtered_ann_scores_every_match_at_or_below_k() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let rows = scattered(4000, 8, 0x9E3779B97F4A7C15);
|
||||
let tags: Vec<&str> = (0..4000)
|
||||
.map(|i| if i % 800 == 0 { "rare" } else { "common" })
|
||||
.collect();
|
||||
let mut dataset = testing::write_dataset(&dir, &rows[..400], &tags[..400]).await;
|
||||
for chunk in 1..10 {
|
||||
let r = chunk * 400..(chunk + 1) * 400;
|
||||
testing::append_dataset(&mut dataset, &rows[r.clone()], &tags[r]).await;
|
||||
}
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
build(&mut dataset, &table.vector_column, INDEX_NAME, 63, false)
|
||||
.await
|
||||
.unwrap();
|
||||
for vector in &scattered(3, 8, 0xD1B54A32D192ED03) {
|
||||
for k in [5, 10] {
|
||||
let q = Query {
|
||||
filter: Some("tag = 'rare'".to_string()),
|
||||
..exact(vector, k)
|
||||
};
|
||||
let flat = query::flat(&dataset, &table, &q).await.unwrap();
|
||||
assert_eq!(flat.len(), 5);
|
||||
let ann = query::ann(&dataset, &table, &q).await.unwrap();
|
||||
assert_eq!(ann.len(), 5);
|
||||
for (f, a) in flat.iter().zip(ann.iter()) {
|
||||
assert!(
|
||||
(f.distance - a.distance).abs() < 1e-5,
|
||||
"k={k}: {flat:?} vs {ann:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn default_probes_take_the_largest_index() {
|
||||
use lance::index::DatasetIndexExt;
|
||||
|
||||
@@ -1,846 +0,0 @@
|
||||
//! Filters on indexed metadata keys (see `weed_lance_worker::metadata_index`).
|
||||
//!
|
||||
//! The gateway renders a string `$eq` or `$in` on a key as an OR of
|
||||
//! `json_extract(metadata, P) = '"v"'` (or `IN`) and
|
||||
//! `json_array_contains(metadata, P, '"v"')` over the same values. In the
|
||||
//! parsed filter, such a top-level conjunct on a ready key is replaced by
|
||||
//! `array_has` / `array_has_any` on the key's column, which its LABEL_LIST
|
||||
//! index answers. Everything else, including `$ne` and `$nin`, stays on the
|
||||
//! JSON path.
|
||||
|
||||
use std::collections::{BTreeMap, BTreeSet, HashMap};
|
||||
|
||||
use anyhow::Result;
|
||||
use jsonb::OwnedJsonb;
|
||||
use lance::Dataset;
|
||||
use lance::deps::datafusion::common::{Column, ScalarValue};
|
||||
use lance::deps::datafusion::functions_nested::expr_fn::{array_has, array_has_any};
|
||||
use lance::deps::datafusion::logical_expr::utils::split_conjunction_owned;
|
||||
use lance::deps::datafusion::logical_expr::{BinaryExpr, Expr, Operator};
|
||||
use lance::deps::datafusion::prelude::lit;
|
||||
use weed_lance_worker::metadata_index::{self, State};
|
||||
|
||||
const METADATA_COLUMN: &str = "metadata";
|
||||
|
||||
/// The column of each ready indexed key of `dataset`, by metadata key.
|
||||
pub(crate) fn ready_columns(dataset: &Dataset) -> HashMap<String, String> {
|
||||
let schema: arrow_schema::Schema = dataset.schema().into();
|
||||
metadata_index::indexed_keys(&schema)
|
||||
.into_iter()
|
||||
.filter(|k| k.state == Some(State::Ready))
|
||||
.map(|k| (k.key, k.column))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// A conjunct a key's column answers: rows whose `column` holds one of
|
||||
/// `values`.
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct Indexed {
|
||||
pub column: String,
|
||||
pub values: Vec<String>,
|
||||
pub expr: Expr,
|
||||
}
|
||||
|
||||
/// `filter` with each top-level conjunct that is a string `$eq` or `$in` on
|
||||
/// a key in `ready` answered by the key's column instead, and those
|
||||
/// replacements.
|
||||
pub(crate) fn rewrite(filter: Expr, ready: &HashMap<String, String>) -> (Expr, Vec<Indexed>) {
|
||||
if ready.is_empty() {
|
||||
return (filter, Vec::new());
|
||||
}
|
||||
let mut indexed: Vec<Indexed> = Vec::new();
|
||||
let mut rewritten: Option<Expr> = None;
|
||||
for conjunct in split_conjunction_owned(filter) {
|
||||
let replacement = string_membership(&conjunct).and_then(|(key, values)| {
|
||||
let name = ready.get(&key)?;
|
||||
let column = Expr::Column(Column::from_name(name));
|
||||
let expr = match values.as_slice() {
|
||||
[one] => array_has(column, lit(one.as_str())),
|
||||
_ => {
|
||||
let values: Vec<ScalarValue> = values
|
||||
.iter()
|
||||
.map(|v| ScalarValue::Utf8(Some(v.clone())))
|
||||
.collect();
|
||||
let list = ScalarValue::new_list(&values, &arrow_schema::DataType::Utf8, true);
|
||||
array_has_any(column, Expr::Literal(ScalarValue::List(list), None))
|
||||
}
|
||||
};
|
||||
Some(Indexed {
|
||||
column: name.clone(),
|
||||
values,
|
||||
expr,
|
||||
})
|
||||
});
|
||||
let part = match replacement {
|
||||
Some(found) => {
|
||||
let expr = found.expr.clone();
|
||||
indexed.push(found);
|
||||
expr
|
||||
}
|
||||
None => conjunct,
|
||||
};
|
||||
rewritten = Some(and(rewritten, part));
|
||||
}
|
||||
(rewritten.unwrap_or(lit(true)), indexed)
|
||||
}
|
||||
|
||||
pub(crate) fn columns(dataset: &Dataset, filter: &str) -> Result<Vec<String>> {
|
||||
let mut scanner = dataset.scan();
|
||||
scanner.filter(filter)?;
|
||||
let expr = scanner.get_expr_filter()?.ok_or_else(|| {
|
||||
crate::query::IndexedOnlyError("indexed-only requires an indexed metadata filter".into())
|
||||
})?;
|
||||
let count = split_conjunction_owned(expr.clone()).len();
|
||||
let (_, indexed) = rewrite(expr, &ready_columns(dataset));
|
||||
if indexed.len() != count {
|
||||
return Err(crate::query::IndexedOnlyError("indexed-only supports conjunctions of string $eq/$in filters on ready metadata indexes".into()).into());
|
||||
}
|
||||
Ok(indexed.into_iter().map(|i| i.column).collect())
|
||||
}
|
||||
|
||||
fn and(left: Option<Expr>, right: Expr) -> Expr {
|
||||
match left {
|
||||
Some(left) => Expr::BinaryExpr(BinaryExpr::new(
|
||||
Box::new(left),
|
||||
Operator::And,
|
||||
Box::new(right),
|
||||
)),
|
||||
None => right,
|
||||
}
|
||||
}
|
||||
|
||||
/// The key and string values of a conjunct meaning "the key holds one of
|
||||
/// these strings, or an array with one of them": the OR of scalar matches
|
||||
/// and array-member matches over the same values and key.
|
||||
fn string_membership(expr: &Expr) -> Option<(String, Vec<String>)> {
|
||||
let mut disjuncts = Vec::new();
|
||||
split_or(expr, &mut disjuncts);
|
||||
let mut path: Option<&str> = None;
|
||||
let mut scalars = BTreeSet::new();
|
||||
let mut elements = BTreeSet::new();
|
||||
for disjunct in disjuncts {
|
||||
let (p, kind) = match unwrap_false_coalesce(disjunct) {
|
||||
Expr::BinaryExpr(BinaryExpr {
|
||||
left,
|
||||
op: Operator::Eq,
|
||||
right,
|
||||
}) => (
|
||||
json_function(left, "json_extract")?,
|
||||
Member::Scalar(vec![utf8(right)?]),
|
||||
),
|
||||
Expr::InList(list) if !list.negated => (
|
||||
json_function(&list.expr, "json_extract")?,
|
||||
Member::Scalar(list.list.iter().map(utf8).collect::<Option<_>>()?),
|
||||
),
|
||||
Expr::ScalarFunction(f) if f.func.name() == "json_array_contains" => {
|
||||
let [data, p, value] = f.args.as_slice() else {
|
||||
return None;
|
||||
};
|
||||
if !is_metadata(data) {
|
||||
return None;
|
||||
}
|
||||
let element: serde_json::Value = serde_json::from_str(utf8(value)?).ok()?;
|
||||
(utf8(p)?, Member::Element(element.as_str()?.to_string()))
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
if path.is_some_and(|q| q != p) {
|
||||
return None;
|
||||
}
|
||||
path = Some(p);
|
||||
match kind {
|
||||
Member::Scalar(values) => scalars.extend(values.into_iter().map(str::to_string)),
|
||||
Member::Element(value) => {
|
||||
elements.insert(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
let key = json_path_key(path?)?;
|
||||
let rendered: BTreeSet<String> = elements
|
||||
.iter()
|
||||
.map(|s| jsonb_text(s))
|
||||
.collect::<Option<_>>()?;
|
||||
(!elements.is_empty() && rendered == scalars).then(|| (key, elements.into_iter().collect()))
|
||||
}
|
||||
|
||||
enum Member<'a> {
|
||||
Scalar(Vec<&'a str>),
|
||||
Element(String),
|
||||
}
|
||||
|
||||
fn split_or<'a>(expr: &'a Expr, out: &mut Vec<&'a Expr>) {
|
||||
match expr {
|
||||
Expr::BinaryExpr(BinaryExpr {
|
||||
left,
|
||||
op: Operator::Or,
|
||||
right,
|
||||
}) => {
|
||||
split_or(left, out);
|
||||
split_or(right, out);
|
||||
}
|
||||
Expr::Alias(alias) => split_or(&alias.expr, out),
|
||||
other => out.push(other),
|
||||
}
|
||||
}
|
||||
|
||||
/// `x` for `COALESCE(x, false)` or its simplified `x IS NOT NULL AND x`;
|
||||
/// either is false where `x` is null, which a top-level conjunct treats alike.
|
||||
fn unwrap_false_coalesce(expr: &Expr) -> &Expr {
|
||||
match expr {
|
||||
Expr::ScalarFunction(f) if f.func.name() == "coalesce" => match f.args.as_slice() {
|
||||
[x, Expr::Literal(ScalarValue::Boolean(Some(false)), _)] => x,
|
||||
_ => expr,
|
||||
},
|
||||
Expr::BinaryExpr(BinaryExpr {
|
||||
left,
|
||||
op: Operator::And,
|
||||
right,
|
||||
}) => match left.as_ref() {
|
||||
Expr::IsNotNull(x) if x == right => right,
|
||||
_ => expr,
|
||||
},
|
||||
_ => expr,
|
||||
}
|
||||
}
|
||||
|
||||
fn utf8(expr: &Expr) -> Option<&str> {
|
||||
match expr {
|
||||
Expr::Literal(ScalarValue::Utf8(Some(s)) | ScalarValue::LargeUtf8(Some(s)), _) => {
|
||||
Some(s.as_str())
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn is_metadata(expr: &Expr) -> bool {
|
||||
matches!(expr, Expr::Column(c) if c.name == METADATA_COLUMN)
|
||||
}
|
||||
|
||||
/// The JSONPath literal of `name(metadata, path)`.
|
||||
fn json_function<'a>(expr: &'a Expr, name: &str) -> Option<&'a str> {
|
||||
match expr {
|
||||
Expr::ScalarFunction(f) if f.func.name() == name => match f.args.as_slice() {
|
||||
[data, path] if is_metadata(data) => utf8(path),
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// The key of a `$["key"]` path, with `\\` and `\"` unescaped.
|
||||
fn json_path_key(path: &str) -> Option<String> {
|
||||
let inner = path.strip_prefix("$[\"")?.strip_suffix("\"]")?;
|
||||
let mut key = String::with_capacity(inner.len());
|
||||
let mut chars = inner.chars();
|
||||
while let Some(c) = chars.next() {
|
||||
match c {
|
||||
'\\' => match chars.next()? {
|
||||
c @ ('\\' | '"') => key.push(c),
|
||||
_ => return None,
|
||||
},
|
||||
'"' => return None,
|
||||
c => key.push(c),
|
||||
}
|
||||
}
|
||||
Some(key)
|
||||
}
|
||||
|
||||
/// What json_extract returns for a stored string `s`.
|
||||
fn jsonb_text(s: &str) -> Option<String> {
|
||||
let value: OwnedJsonb = serde_json::to_string(s).ok()?.parse().ok()?;
|
||||
Some(value.to_string())
|
||||
}
|
||||
|
||||
/// Segments searched at once when counting.
|
||||
const PARALLEL_SEGMENTS: usize = 8;
|
||||
|
||||
/// The rows of `scope` (every fragment when None) whose column matches
|
||||
/// `indexed`, or None once there are more than `limit`. Segments are
|
||||
/// searched newest first, several at once, and counting stops as soon as
|
||||
/// the total passes the limit. Rows the index has not reached are counted
|
||||
/// by a read of the column. Deleted rows an index segment still lists
|
||||
/// count too: the total is an upper bound, which only ever sends a query
|
||||
/// to the vector index instead of an exact scan.
|
||||
pub(crate) async fn count_indexed(
|
||||
dataset: &Dataset,
|
||||
indexed: &Indexed,
|
||||
scope: Option<&[u64]>,
|
||||
limit: u64,
|
||||
) -> Result<Option<u64>> {
|
||||
use futures::{StreamExt, TryStreamExt};
|
||||
use lance::index::DatasetIndexInternalExt;
|
||||
use lance_index::metrics::NoOpMetricsCollector;
|
||||
use lance_index::scalar::{LabelListQuery, SearchResult};
|
||||
use lance_select::RowSetOps;
|
||||
|
||||
let scope: Option<roaring::RoaringBitmap> =
|
||||
scope.map(|ids| ids.iter().map(|id| *id as u32).collect());
|
||||
let segments = metadata_index::segments(dataset, &indexed.column).await?;
|
||||
let query = LabelListQuery::HasAnyLabel(
|
||||
indexed
|
||||
.values
|
||||
.iter()
|
||||
.map(|v| ScalarValue::Utf8(Some(v.clone())))
|
||||
.collect(),
|
||||
);
|
||||
let mut searches: Vec<futures::future::BoxFuture<'_, Result<u64>>> = Vec::new();
|
||||
for segment in segments.iter().rev() {
|
||||
let fragments = match &scope {
|
||||
Some(scope) => &segment.fragments & scope,
|
||||
None => segment.fragments.clone(),
|
||||
};
|
||||
if fragments.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let uuid = segment.uuid;
|
||||
let query = &query;
|
||||
searches.push(Box::pin(async move {
|
||||
let index = dataset
|
||||
.open_scalar_index(&indexed.column, &uuid, &NoOpMetricsCollector)
|
||||
.await?;
|
||||
let mut found = match index.search(query, &NoOpMetricsCollector).await? {
|
||||
SearchResult::Exact(rows) | SearchResult::AtMost(rows) => rows.true_rows(),
|
||||
SearchResult::AtLeast(_) => anyhow::bail!("a LABEL_LIST index answered AtLeast"),
|
||||
};
|
||||
found.retain_fragments(fragments.iter());
|
||||
Ok(found.len().unwrap_or(u64::MAX))
|
||||
}));
|
||||
}
|
||||
let mut counts = futures::stream::iter(searches).buffered(PARALLEL_SEGMENTS);
|
||||
let mut total = 0u64;
|
||||
while let Some(count) = counts.try_next().await? {
|
||||
total = total.saturating_add(count);
|
||||
if total > limit {
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
let unindexed: Vec<lance_table::format::Fragment> = dataset
|
||||
.fragments()
|
||||
.iter()
|
||||
.filter(|f| !segments.iter().any(|s| s.fragments.contains(f.id as u32)))
|
||||
.filter(|f| scope.as_ref().is_none_or(|s| s.contains(f.id as u32)))
|
||||
.cloned()
|
||||
.collect();
|
||||
if !unindexed.is_empty() {
|
||||
let mut scanner = dataset.scan();
|
||||
scanner
|
||||
.filter_expr(indexed.expr.clone())
|
||||
.with_fragments(unindexed);
|
||||
total = total.saturating_add(scanner.count_rows().await?);
|
||||
}
|
||||
Ok((total <= limit).then_some(total))
|
||||
}
|
||||
|
||||
/// How a filter compares a key.
|
||||
pub mod operand {
|
||||
pub const STRING: u8 = 1;
|
||||
pub const NUMBER: u8 = 2;
|
||||
pub const BOOL: u8 = 4;
|
||||
pub const EXISTS: u8 = 8;
|
||||
}
|
||||
|
||||
/// The metadata keys `filter` reads, each with the [`operand`] kinds it is
|
||||
/// compared with.
|
||||
pub fn filter_keys(dataset: &Dataset, filter: &str) -> Result<BTreeMap<String, u8>> {
|
||||
let mut scanner = dataset.scan();
|
||||
scanner.filter(filter)?;
|
||||
let mut keys = BTreeMap::new();
|
||||
if let Some(expr) = scanner.get_expr_filter()? {
|
||||
collect_keys(&expr, &mut keys);
|
||||
}
|
||||
Ok(keys)
|
||||
}
|
||||
|
||||
fn literal_kind(text: &str) -> u8 {
|
||||
match serde_json::from_str::<serde_json::Value>(text) {
|
||||
Ok(serde_json::Value::String(_)) => operand::STRING,
|
||||
Ok(serde_json::Value::Number(_)) => operand::NUMBER,
|
||||
Ok(serde_json::Value::Bool(_)) => operand::BOOL,
|
||||
// json_extract's text of a string with control characters is not
|
||||
// JSON, but it is quoted.
|
||||
_ if text.starts_with('"') => operand::STRING,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
|
||||
fn collect_keys(expr: &Expr, keys: &mut BTreeMap<String, u8>) {
|
||||
let mut note = |path: &str, kind: u8| {
|
||||
if let Some(key) = json_path_key(path) {
|
||||
*keys.entry(key).or_default() |= kind;
|
||||
}
|
||||
};
|
||||
match expr {
|
||||
Expr::TryCast(cast) if extract(&cast.expr).is_some() => {
|
||||
note(extract(&cast.expr).unwrap_or_default(), operand::NUMBER);
|
||||
return;
|
||||
}
|
||||
Expr::BinaryExpr(BinaryExpr { left, right, .. }) => {
|
||||
if let (Some(path), Some(value)) = (extract(left), utf8(right)) {
|
||||
note(path, literal_kind(value));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Expr::InList(list) => {
|
||||
if let Some(path) = extract(&list.expr) {
|
||||
let kind = list
|
||||
.list
|
||||
.iter()
|
||||
.filter_map(utf8)
|
||||
.fold(0, |k, v| k | literal_kind(v));
|
||||
note(path, kind);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Expr::ScalarFunction(f) if is_json_function(f.func.name()) => {
|
||||
if let [data, path, rest @ ..] = f.args.as_slice()
|
||||
&& is_metadata(data)
|
||||
&& let Some(path) = utf8(path)
|
||||
{
|
||||
let kind = match (f.func.name(), rest) {
|
||||
("json_exists", _) => operand::EXISTS,
|
||||
(_, [value]) => utf8(value).map_or(0, literal_kind),
|
||||
_ => 0,
|
||||
};
|
||||
note(path, kind);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
for child in children(expr) {
|
||||
collect_keys(child, keys);
|
||||
}
|
||||
}
|
||||
|
||||
fn extract(expr: &Expr) -> Option<&str> {
|
||||
json_function(expr, "json_extract")
|
||||
}
|
||||
|
||||
fn is_json_function(name: &str) -> bool {
|
||||
matches!(name, "json_extract" | "json_exists" | "json_array_contains")
|
||||
}
|
||||
|
||||
fn children(expr: &Expr) -> Vec<&Expr> {
|
||||
use lance::deps::datafusion::common::tree_node::TreeNode;
|
||||
let mut out = Vec::new();
|
||||
let _ = expr.apply_children(|child| {
|
||||
out.push(child);
|
||||
Ok(lance::deps::datafusion::common::tree_node::TreeNodeRecursion::Continue)
|
||||
});
|
||||
out
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::query::{self, Query};
|
||||
use crate::table::VectorTable;
|
||||
use arrow_array::{FixedSizeListArray, RecordBatch, RecordBatchIterator, StringArray};
|
||||
use arrow_schema::{DataType, Field, Schema};
|
||||
use lance::index::DatasetIndexExt;
|
||||
use lance_index::IndexType;
|
||||
use lance_index::scalar::{BuiltinIndexType, ScalarIndexParams};
|
||||
use lance_linalg::distance::DistanceType;
|
||||
use std::sync::Arc;
|
||||
use tempfile::TempDir;
|
||||
|
||||
const DIM: usize = 4;
|
||||
|
||||
/// The gateway's text for `{"author": "<v>"}`.
|
||||
fn eq(field: &str, json: &str) -> String {
|
||||
let json = json.replace('\'', "''");
|
||||
format!(
|
||||
"(COALESCE(json_extract(`metadata`, '$[\"{field}\"]') = '{json}', false) OR COALESCE(json_array_contains(`metadata`, '$[\"{field}\"]', '{json}'), false))"
|
||||
)
|
||||
}
|
||||
|
||||
/// The gateway's text for `{"author": {"$in": [<strings>]}}`.
|
||||
fn among(values: &[&str]) -> String {
|
||||
let scalars: Vec<String> = values.iter().map(|v| format!("'\"{v}\"'")).collect();
|
||||
let mut groups = vec![format!(
|
||||
"COALESCE(json_extract(`metadata`, '$[\"author\"]') in ({}), false)",
|
||||
scalars.join(", ")
|
||||
)];
|
||||
for v in values {
|
||||
groups.push(format!(
|
||||
"COALESCE(json_array_contains(`metadata`, '$[\"author\"]', '\"{v}\"'), false)"
|
||||
));
|
||||
}
|
||||
format!("({})", groups.join(" OR "))
|
||||
}
|
||||
|
||||
/// Rows `u0..u<n>` by author, plus a few others, in fragments of 100,
|
||||
/// with the author column ready and indexed and a vector index.
|
||||
async fn dataset(dir: &TempDir, rows: usize) -> Dataset {
|
||||
let metadata = Field::new("metadata", DataType::Utf8, true)
|
||||
.with_metadata([("ARROW:extension:name".to_string(), "arrow.json".to_string())].into());
|
||||
let schema = Arc::new(Schema::new(vec![
|
||||
Field::new("key", DataType::Utf8, false),
|
||||
Field::new(
|
||||
"vector",
|
||||
DataType::FixedSizeList(
|
||||
Arc::new(Field::new("item", DataType::Float32, true)),
|
||||
DIM as i32,
|
||||
),
|
||||
false,
|
||||
),
|
||||
metadata,
|
||||
metadata_index::field("_mk_0", "author", State::Ready),
|
||||
]));
|
||||
let metas: Vec<serde_json::Value> = (0..rows)
|
||||
.map(|i| match i % 10 {
|
||||
0 => serde_json::json!({"author": "rare"}),
|
||||
1 => serde_json::json!({"author": ["many", "rare2"]}),
|
||||
_ => serde_json::json!({"author": "many", "n": i}),
|
||||
})
|
||||
.collect();
|
||||
let batches: Vec<RecordBatch> = (0..rows)
|
||||
.step_by(100)
|
||||
.map(|start| {
|
||||
let range = start..(start + 100).min(rows);
|
||||
RecordBatch::try_new(
|
||||
schema.clone(),
|
||||
vec![
|
||||
Arc::new(StringArray::from(
|
||||
range.clone().map(|i| format!("k{i}")).collect::<Vec<_>>(),
|
||||
)),
|
||||
Arc::new(FixedSizeListArray::from_iter_primitive::<
|
||||
arrow_array::types::Float32Type,
|
||||
_,
|
||||
_,
|
||||
>(
|
||||
range.clone().map(|i| {
|
||||
Some((0..DIM).map(move |j| Some(((i * 31 + j * 17) % 97) as f32)))
|
||||
}),
|
||||
DIM as i32,
|
||||
)),
|
||||
Arc::new(StringArray::from(
|
||||
range
|
||||
.clone()
|
||||
.map(|i| Some(metas[i].to_string()))
|
||||
.collect::<Vec<_>>(),
|
||||
)),
|
||||
metadata_index::column_from_json(range.map(|i| Some(&metas[i])), "author"),
|
||||
],
|
||||
)
|
||||
.unwrap()
|
||||
})
|
||||
.collect();
|
||||
let uri = dir.path().to_str().unwrap();
|
||||
let mut dataset = None::<Dataset>;
|
||||
for batch in batches {
|
||||
let reader = RecordBatchIterator::new(vec![Ok(batch)], schema.clone());
|
||||
dataset = Some(match dataset {
|
||||
None => Dataset::write(reader, uri, None).await.unwrap(),
|
||||
Some(mut d) => {
|
||||
d.append(reader, None).await.unwrap();
|
||||
d
|
||||
}
|
||||
});
|
||||
}
|
||||
let mut dataset = dataset.unwrap();
|
||||
dataset
|
||||
.create_index(
|
||||
&["_mk_0"],
|
||||
IndexType::LabelList,
|
||||
None,
|
||||
&ScalarIndexParams::for_builtin(BuiltinIndexType::LabelList),
|
||||
true,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
crate::index::build(&mut dataset, "vector", crate::index::INDEX_NAME, 4, false)
|
||||
.await
|
||||
.unwrap();
|
||||
dataset
|
||||
}
|
||||
|
||||
fn rewritten(dataset: &Dataset, filter: &str) -> (String, Option<String>) {
|
||||
let mut scanner = dataset.scan();
|
||||
let indexed = crate::filter::apply(&mut scanner, filter, &ready_columns(dataset)).unwrap();
|
||||
(
|
||||
scanner.get_expr_filter().unwrap().unwrap().to_string(),
|
||||
indexed.first().map(|i| i.expr.to_string()),
|
||||
)
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn string_eq_and_in_on_a_ready_key_use_its_column() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset = dataset(&dir, 200).await;
|
||||
assert_eq!(
|
||||
ready_columns(&dataset),
|
||||
HashMap::from([("author".to_string(), "_mk_0".to_string())])
|
||||
);
|
||||
for (filter, want) in [
|
||||
(eq("author", "\"rare\""), Some("array_has(_mk_0, Utf8(\"rare\"))")),
|
||||
(
|
||||
among(&["rare", "many"]),
|
||||
Some("array_has_any(_mk_0, List([many, rare]))"),
|
||||
),
|
||||
(
|
||||
format!("{} AND TRY_CAST(json_extract(`metadata`, '$[\"n\"]') AS DOUBLE) > 3", eq("author", "\"rare\"")),
|
||||
Some("array_has(_mk_0, Utf8(\"rare\"))"),
|
||||
),
|
||||
(eq("author", "\"o'neil \\\"q\\\"\""), Some("array_has(_mk_0, Utf8(\"o'neil \"q\"\"))")),
|
||||
(
|
||||
"(COALESCE(json_extract(`metadata`, '$[\"author\"]') = '\"c\\u0001d\\n\"', false) OR COALESCE(json_array_contains(`metadata`, '$[\"author\"]', '\"c\\u0001d\\n\"'), false))".to_string(),
|
||||
Some("array_has(_mk_0, Utf8(\"c\u{1}d\n\"))"),
|
||||
),
|
||||
// The scalar half's text is not what json_extract returns for
|
||||
// the array half's string, so the two do not agree.
|
||||
(
|
||||
"(COALESCE(json_extract(`metadata`, '$[\"author\"]') = '\"c\\u{1}d\\n\"', false) OR COALESCE(json_array_contains(`metadata`, '$[\"author\"]', '\"c\\u0001d\\n\"'), false))".to_string(),
|
||||
None,
|
||||
),
|
||||
// Not a string, not this key, or not every value on both sides.
|
||||
(eq("author", "true"), None),
|
||||
(eq("other", "\"rare\""), None),
|
||||
(format!("NOT {}", eq("author", "\"rare\"")), None),
|
||||
(format!("NOT {}", among(&["rare", "many"])), None),
|
||||
(
|
||||
"COALESCE(json_extract(`metadata`, '$[\"author\"]') = '\"rare\"', false)".to_string(),
|
||||
None,
|
||||
),
|
||||
(
|
||||
among(&["rare", "many"]).replace("'\"many\"'), false))", "'\"other\"'), false))"),
|
||||
None,
|
||||
),
|
||||
("json_exists(`metadata`, '$[\"author\"]')".to_string(), None),
|
||||
(format!("({} OR json_exists(`metadata`, '$[\"n\"]'))", eq("author", "\"rare\"")), None),
|
||||
] {
|
||||
let (expr, indexed) = rewritten(&dataset, &filter);
|
||||
assert_eq!(indexed.as_deref(), want, "{filter}");
|
||||
assert_eq!(expr.contains("json_"), want.is_none() || filter.contains(" AND "), "{filter}: {expr}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The planner scores few matches exactly and leaves many to the vector
|
||||
/// index, per scope.
|
||||
#[tokio::test]
|
||||
async fn few_indexed_matches_are_scored_exactly() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset = dataset(&dir, 1000).await;
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
let query = |filter: &str, fragments: Option<Vec<u64>>| Query {
|
||||
vector: vec![1.0, 2.0, 3.0, 4.0],
|
||||
k: 10,
|
||||
filter: Some(filter.to_string()),
|
||||
postfilter: false,
|
||||
distance: DistanceType::L2,
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let rare = eq("author", "\"rare\"");
|
||||
let many = eq("author", "\"many\"");
|
||||
let few = |q: Query| {
|
||||
let (dataset, table) = (&dataset, &table);
|
||||
async move {
|
||||
query::few_indexed_matches(dataset, table, &q, None)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
};
|
||||
// 100 and 900 matches, and 90 in the first two fragments.
|
||||
assert!(few(query(&rare, None)).await);
|
||||
assert!(!few(query(&many, None)).await);
|
||||
let first = Some(vec![0, 1]);
|
||||
assert!(few(query(&many, first.clone())).await);
|
||||
assert!(
|
||||
!few(Query {
|
||||
exact_match_limit: Some(0),
|
||||
..query(&rare, None)
|
||||
})
|
||||
.await
|
||||
);
|
||||
// A JSON-only filter is not counted.
|
||||
assert!(!few(query("json_exists(`metadata`, '$[\"n\"]')", None)).await);
|
||||
for (filter, fragments) in [(&rare, None), (&many, first)] {
|
||||
let q = query(filter, fragments);
|
||||
let exact = query::flat(&dataset, &table, &q).await.unwrap();
|
||||
let got = query::ann(&dataset, &table, &q).await.unwrap();
|
||||
assert_eq!(got.len(), 10);
|
||||
for (g, e) in got.iter().zip(&exact) {
|
||||
assert!(
|
||||
(g.distance - e.distance).abs() < 1e-4,
|
||||
"{got:?} vs {exact:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn indexed_only_intersects_metadata_and_vector_coverage() {
|
||||
use futures::TryStreamExt;
|
||||
let dir = TempDir::new().unwrap();
|
||||
let mut dataset = dataset(&dir, 300).await;
|
||||
let batches = dataset
|
||||
.scan()
|
||||
.try_into_stream()
|
||||
.await
|
||||
.unwrap()
|
||||
.try_collect::<Vec<_>>()
|
||||
.await
|
||||
.unwrap();
|
||||
let batch = &batches[0];
|
||||
let mut columns = batch.columns().to_vec();
|
||||
let key = batch.schema().index_of("key").unwrap();
|
||||
columns[key] = Arc::new(StringArray::from(
|
||||
(0..batch.num_rows())
|
||||
.map(|i| format!("new{i}"))
|
||||
.collect::<Vec<_>>(),
|
||||
));
|
||||
let batch = RecordBatch::try_new(batch.schema(), columns).unwrap();
|
||||
let reader = RecordBatchIterator::new(vec![Ok(batch.clone())], batch.schema());
|
||||
dataset.append(reader, None).await.unwrap();
|
||||
dataset
|
||||
.optimize_indices(&lance_index::optimize::OptimizeOptions::append())
|
||||
.await
|
||||
.unwrap();
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
let query = Query {
|
||||
vector: vec![1.0, 2.0, 3.0, 4.0],
|
||||
k: 1000,
|
||||
filter: Some(eq("author", "\"rare\"")),
|
||||
postfilter: false,
|
||||
distance: DistanceType::L2,
|
||||
nprobes: Some(4),
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let reader = RecordBatchIterator::new(vec![Ok(batch.clone())], batch.schema());
|
||||
dataset.append(reader, None).await.unwrap();
|
||||
crate::index::build(&mut dataset, "vector", crate::index::INDEX_NAME, 4, true)
|
||||
.await
|
||||
.unwrap();
|
||||
let tail = Query {
|
||||
fragments: Some(vec![dataset.fragments().last().unwrap().id]),
|
||||
..query.clone()
|
||||
};
|
||||
let (hits, excluded) = query::indexed_only(&dataset, &table, &tail).await.unwrap();
|
||||
assert!(hits.is_empty());
|
||||
assert_eq!(excluded, 1);
|
||||
for limit in [None, Some(0)] {
|
||||
let query = Query {
|
||||
exact_match_limit: limit,
|
||||
..query.clone()
|
||||
};
|
||||
let all = query::ann(&dataset, &table, &query).await.unwrap();
|
||||
let (indexed, excluded) = query::indexed_only(&dataset, &table, &query).await.unwrap();
|
||||
assert_eq!(excluded, 1);
|
||||
assert!(all.len() > indexed.len());
|
||||
assert!(indexed.len() >= 30);
|
||||
}
|
||||
for file in &dataset.fragments().last().unwrap().files {
|
||||
std::fs::remove_file(dir.path().join("data").join(&file.path)).unwrap();
|
||||
}
|
||||
let dataset = Dataset::open(dir.path().to_str().unwrap()).await.unwrap();
|
||||
assert!(query::ann(&dataset, &table, &query).await.is_err());
|
||||
for limit in [None, Some(0)] {
|
||||
let query = Query {
|
||||
exact_match_limit: limit,
|
||||
..query.clone()
|
||||
};
|
||||
assert!(query::indexed_only(&dataset, &table, &query).await.is_ok());
|
||||
}
|
||||
for filter in [
|
||||
eq("other", "\"rare\""),
|
||||
eq("author", "true"),
|
||||
format!("NOT {}", eq("author", "\"rare\"")),
|
||||
] {
|
||||
let query = Query {
|
||||
filter: Some(filter),
|
||||
..query.clone()
|
||||
};
|
||||
assert!(
|
||||
query::indexed_only(&dataset, &table, &query)
|
||||
.await
|
||||
.unwrap_err()
|
||||
.is::<query::IndexedOnlyError>()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn the_plan_reads_the_scalar_index() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset = dataset(&dir, 300).await;
|
||||
let mut scanner = dataset.scan();
|
||||
crate::filter::apply(
|
||||
&mut scanner,
|
||||
&eq("author", "\"rare\""),
|
||||
&ready_columns(&dataset),
|
||||
)
|
||||
.unwrap();
|
||||
let plan = scanner.explain_plan(true).await.unwrap();
|
||||
assert!(plan.contains("LabelList"), "{plan}");
|
||||
assert!(!plan.contains("json_"), "{plan}");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn filter_keys_note_how_each_key_is_compared() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let dataset = dataset(&dir, 100).await;
|
||||
let filter = format!(
|
||||
"{} AND TRY_CAST(json_extract(`metadata`, '$[\"n\"]') AS DOUBLE) > 3 AND NOT json_exists(`metadata`, '$[\"a.b\\\"c\"]') AND COALESCE(json_extract(`metadata`, '$[\"f\"]') = 'true', false)",
|
||||
eq("author", "\"rare\"")
|
||||
);
|
||||
let keys = filter_keys(&dataset, &filter).unwrap();
|
||||
assert_eq!(
|
||||
keys,
|
||||
BTreeMap::from([
|
||||
("a.b\"c".to_string(), operand::EXISTS),
|
||||
("author".to_string(), operand::STRING),
|
||||
("f".to_string(), operand::BOOL),
|
||||
("n".to_string(), operand::NUMBER),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
/// Counting walks the segments, keeps to the scope and stops once over
|
||||
/// the limit.
|
||||
#[tokio::test]
|
||||
async fn counts_follow_segments_and_scope() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let mut dataset = dataset(&dir, 1000).await;
|
||||
dataset.drop_index("_mk_0_idx").await.unwrap();
|
||||
// Ten fragments of 100 rows: four segments of up to 300 rows.
|
||||
let ids: Vec<u64> = dataset.fragments().iter().map(|f| f.id).collect();
|
||||
metadata_index::index_fragments(&mut dataset, "_mk_0", 300, 0)
|
||||
.await
|
||||
.unwrap();
|
||||
let segments = metadata_index::segments(&dataset, "_mk_0").await.unwrap();
|
||||
assert_eq!(segments.len(), 4);
|
||||
let ready = ready_columns(&dataset);
|
||||
let indexed =
|
||||
crate::filter::apply(&mut dataset.scan(), &eq("author", "\"rare\""), &ready).unwrap();
|
||||
let rare = &indexed[0];
|
||||
// "rare" in rows i % 10 == 0, "rare2" never matches it.
|
||||
assert_eq!(
|
||||
count_indexed(&dataset, rare, None, 1_000).await.unwrap(),
|
||||
Some(100)
|
||||
);
|
||||
assert_eq!(count_indexed(&dataset, rare, None, 99).await.unwrap(), None);
|
||||
assert_eq!(
|
||||
count_indexed(&dataset, rare, Some(&ids[..2]), 1_000)
|
||||
.await
|
||||
.unwrap(),
|
||||
Some(20)
|
||||
);
|
||||
assert_eq!(
|
||||
count_indexed(&dataset, rare, Some(&ids[9..]), 1_000)
|
||||
.await
|
||||
.unwrap(),
|
||||
Some(10)
|
||||
);
|
||||
assert_eq!(
|
||||
count_indexed(&dataset, rare, Some(&[]), 1_000)
|
||||
.await
|
||||
.unwrap(),
|
||||
Some(0)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
pub mod coverage;
|
||||
mod filter;
|
||||
pub mod index;
|
||||
pub mod indexed_filter;
|
||||
pub mod maintenance;
|
||||
pub mod query;
|
||||
pub mod segments;
|
||||
|
||||
@@ -2,27 +2,35 @@ use anyhow::{Context, Result, bail};
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
use weed_lance_worker::catalog::{NamespaceClient, SigningKey, TableDescription, parse_id};
|
||||
use weed_lance_worker::cluster::Cluster;
|
||||
use weed_lance_worker::dataset::{self, Storage};
|
||||
use weed_vector_core::coverage;
|
||||
use weed_vector_core::index;
|
||||
use weed_vector_core::query::{self, Query};
|
||||
use weed_vector_core::table::VectorTable;
|
||||
|
||||
/// Finds everything through the masters: the S3 gateway whose Lance Namespace
|
||||
/// says where a table is, and the filers that hold it.
|
||||
/// Mirrors `weed-worker`'s flags where the two touch the same thing: the
|
||||
/// namespace that says where a table is, and the masters whose filers hold
|
||||
/// it.
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(
|
||||
name = "weed-vector",
|
||||
about = "Describe, query and index S3 Vectors tables"
|
||||
)]
|
||||
struct Args {
|
||||
/// Comma-separated master addresses. A table named by a local path needs
|
||||
/// none.
|
||||
/// Lance namespace the tables live in.
|
||||
#[arg(
|
||||
long,
|
||||
default_value = "http://localhost:9101",
|
||||
env = "WEED_LANCE_NAMESPACE"
|
||||
)]
|
||||
namespace: String,
|
||||
|
||||
/// Comma-separated master addresses, whose filers the tables are kept
|
||||
/// through. A table named by a local URI needs none.
|
||||
#[arg(long, alias = "master", env = "WEED_MASTERS")]
|
||||
masters: Option<String>,
|
||||
|
||||
/// The filer group whose gateways and filers hold the tables.
|
||||
/// The filer group whose filers hold the tables.
|
||||
#[arg(
|
||||
long,
|
||||
alias = "filer.group",
|
||||
@@ -37,7 +45,7 @@ struct Args {
|
||||
filer_signing_key: Option<String>,
|
||||
|
||||
/// The cluster's security.toml; by default the file weed processes find
|
||||
/// in ., ~/.seaweedfs and /etc/seaweedfs.
|
||||
/// in -config_dir, ., ~/.seaweedfs and /etc/seaweedfs.
|
||||
#[arg(long, env = "WEED_VECTOR_SECURITY_TOML")]
|
||||
security_toml: Option<std::path::PathBuf>,
|
||||
|
||||
@@ -138,48 +146,39 @@ enum IndexAction {
|
||||
},
|
||||
}
|
||||
|
||||
/// Where tables are found: through the cluster the masters name, or, for a
|
||||
/// local path, nowhere in particular.
|
||||
struct Tables {
|
||||
cluster: Option<Cluster>,
|
||||
storage: Storage,
|
||||
signing_key: Option<SigningKey>,
|
||||
}
|
||||
|
||||
impl Tables {
|
||||
/// `id` is a delimiter-joined table id, looked up in the namespace of a
|
||||
/// gateway the masters name; when it looks like a URI the dataset is
|
||||
/// opened directly: an `s3://` URI on the cluster's storage, a local path
|
||||
/// (`/path/...`, `file://...`) as it is.
|
||||
async fn open(&self, id: &str) -> Result<lance::Dataset> {
|
||||
let on_cluster = id.starts_with("s3://");
|
||||
if !on_cluster && (id.contains("://") || id.starts_with('/')) {
|
||||
return lance::dataset::builder::DatasetBuilder::from_uri(id)
|
||||
.load()
|
||||
.await
|
||||
.with_context(|| format!("open {id}"));
|
||||
}
|
||||
let Some(cluster) = &self.cluster else {
|
||||
bail!("{id} is kept on the cluster and needs --masters");
|
||||
};
|
||||
if on_cluster {
|
||||
let description = TableDescription {
|
||||
location: id.to_string(),
|
||||
storage_options: Default::default(),
|
||||
managed_versioning: false,
|
||||
};
|
||||
return dataset::open_at(&description, self.storage.wrapper(id).await?, None).await;
|
||||
}
|
||||
let client = NamespaceClient::new(cluster.lance_namespace().await?)
|
||||
.with_signing_key(self.signing_key.as_ref());
|
||||
Ok(dataset::open(&client, &parse_id(id), &self.storage)
|
||||
.await?
|
||||
.dataset)
|
||||
/// `id` is a delimiter-joined table id; when it looks like a URI the dataset
|
||||
/// is opened directly, skipping the namespace: an `s3://` URI on the
|
||||
/// cluster's storage, a local path (`/path/...`, `file://...`) as it is.
|
||||
async fn open_dataset(
|
||||
client: &NamespaceClient,
|
||||
id: &str,
|
||||
storage: &Storage,
|
||||
) -> Result<lance::Dataset> {
|
||||
let on_cluster = id.starts_with("s3://");
|
||||
if !on_cluster && (id.contains("://") || id.starts_with('/')) {
|
||||
return lance::dataset::builder::DatasetBuilder::from_uri(id)
|
||||
.load()
|
||||
.await
|
||||
.with_context(|| format!("open {id}"));
|
||||
}
|
||||
if storage.0.is_none() {
|
||||
bail!("{id} is kept on the cluster and needs --masters");
|
||||
}
|
||||
if on_cluster {
|
||||
let description = TableDescription {
|
||||
location: id.to_string(),
|
||||
storage_options: Default::default(),
|
||||
managed_versioning: false,
|
||||
};
|
||||
return dataset::open_at(&description, storage.wrapper(id).await?, None).await;
|
||||
}
|
||||
let table = dataset::open(client, &parse_id(id), storage).await?;
|
||||
Ok(table.dataset)
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
weed_lance_worker::tls::install_default_crypto_provider();
|
||||
tracing_subscriber::fmt()
|
||||
.with_writer(std::io::stderr)
|
||||
.with_env_filter(
|
||||
@@ -189,27 +188,20 @@ async fn main() -> Result<()> {
|
||||
.init();
|
||||
let args = Args::parse();
|
||||
|
||||
let security = weed_lance_worker::security::Security::load(args.security_toml.as_deref())?;
|
||||
weed_lance_worker::tls::install_for_fips_mode(&security)?;
|
||||
let security =
|
||||
weed_lance_worker::security::Security::load(args.security_toml.as_deref(), None)?;
|
||||
let signing_key = SigningKey::new(
|
||||
args.filer_signing_key
|
||||
.or_else(|| security.get("jwt.filer_signing.key")),
|
||||
);
|
||||
let tables = match &args.masters {
|
||||
let client = NamespaceClient::new(args.namespace).with_signing_key(signing_key.as_ref());
|
||||
let storage = match &args.masters {
|
||||
Some(masters) => {
|
||||
let cluster = Cluster::new(masters, &args.filer_group, &security)?;
|
||||
let storage = Storage(Some(cluster.storage(&security).await?));
|
||||
Tables {
|
||||
cluster: Some(cluster),
|
||||
storage,
|
||||
signing_key,
|
||||
}
|
||||
let cluster =
|
||||
weed_lance_worker::cluster::Cluster::new(masters, &args.filer_group, &security)?;
|
||||
Storage(Some(cluster.storage(&security).await?))
|
||||
}
|
||||
None => Tables {
|
||||
cluster: None,
|
||||
storage: Storage::default(),
|
||||
signing_key,
|
||||
},
|
||||
None => Storage::default(),
|
||||
};
|
||||
|
||||
match args.command {
|
||||
@@ -218,7 +210,7 @@ async fn main() -> Result<()> {
|
||||
vector_column,
|
||||
key_column,
|
||||
} => {
|
||||
let dataset = tables.open(&id).await?;
|
||||
let dataset = open_dataset(&client, &id, &storage).await?;
|
||||
let schema: arrow_schema::Schema = dataset.schema().into();
|
||||
let resolved =
|
||||
VectorTable::resolve(&dataset, vector_column.as_deref(), key_column.as_deref());
|
||||
@@ -258,7 +250,7 @@ async fn main() -> Result<()> {
|
||||
vector_column,
|
||||
key_column,
|
||||
} => {
|
||||
let dataset = tables.open(&id).await?;
|
||||
let dataset = open_dataset(&client, &id, &storage).await?;
|
||||
let vector =
|
||||
VectorTable::resolve(&dataset, vector_column.as_deref(), key_column.as_deref())?;
|
||||
let coverages = coverage::coverage(&dataset, &vector.vector_column).await?;
|
||||
@@ -270,7 +262,7 @@ async fn main() -> Result<()> {
|
||||
vector_column,
|
||||
key_column,
|
||||
} => {
|
||||
let dataset = tables.open(&id).await?;
|
||||
let dataset = open_dataset(&client, &id, &storage).await?;
|
||||
let vector =
|
||||
VectorTable::resolve(&dataset, vector_column.as_deref(), key_column.as_deref())?;
|
||||
for batch in query::get(&dataset, &vector, &keys, None).await? {
|
||||
@@ -290,7 +282,7 @@ async fn main() -> Result<()> {
|
||||
key_column,
|
||||
nprobes,
|
||||
} => {
|
||||
let opened = tables.open(&id).await?;
|
||||
let opened = open_dataset(&client, &id, &storage).await?;
|
||||
let dataset = match version {
|
||||
Some(v) => opened.checkout_version(v).await?,
|
||||
None => opened,
|
||||
@@ -317,7 +309,6 @@ async fn main() -> Result<()> {
|
||||
nprobes,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let hits = if flat {
|
||||
query::flat(&dataset, &vector_table, &query).await?
|
||||
@@ -335,7 +326,7 @@ async fn main() -> Result<()> {
|
||||
id, vector_column, ..
|
||||
} => (id.clone(), vector_column.clone()),
|
||||
};
|
||||
let mut dataset = tables.open(&id).await?;
|
||||
let mut dataset = open_dataset(&client, &id, &storage).await?;
|
||||
let table = VectorTable::resolve(&dataset, vector_column.as_deref(), None)?;
|
||||
let started = std::time::Instant::now();
|
||||
match action {
|
||||
@@ -412,17 +403,6 @@ mod tests {
|
||||
.unwrap();
|
||||
assert_eq!(args.masters.as_deref(), Some("m:9333"));
|
||||
assert_eq!(args.filer_group, "eu");
|
||||
assert!(
|
||||
Args::try_parse_from([
|
||||
"weed-vector",
|
||||
"--namespace",
|
||||
"http://s3:9101",
|
||||
"describe",
|
||||
"t"
|
||||
])
|
||||
.is_err(),
|
||||
"the namespace comes from the masters"
|
||||
);
|
||||
assert!(
|
||||
Args::try_parse_from(["weed-vector", "--encryptVolumeData", "describe", "t"]).is_err(),
|
||||
"volume encryption follows the filer"
|
||||
|
||||
@@ -312,7 +312,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let mut ids: Vec<u64> = query::flat(&pinned, &resolved, &q)
|
||||
.await
|
||||
@@ -735,7 +734,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
assert!(query::flat(&dataset, &resolved, &q).await.is_err());
|
||||
}
|
||||
|
||||
@@ -6,11 +6,8 @@ use arrow_array::{Array, Float32Array, RecordBatch, StringArray, UInt64Array};
|
||||
use futures::TryStreamExt;
|
||||
use lance::Dataset;
|
||||
use lance::dataset::scanner::Scanner;
|
||||
use lance::index::DatasetIndexExt;
|
||||
use lance_linalg::distance::DistanceType;
|
||||
use lance_table::format::Fragment;
|
||||
use roaring::RoaringBitmap;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::table::VectorTable;
|
||||
|
||||
@@ -42,15 +39,8 @@ pub struct Query {
|
||||
/// a worker the unindexed-fragment sweep. Listed ids that no longer exist
|
||||
/// scan nothing.
|
||||
pub fragments: Option<Vec<u64>>,
|
||||
/// Score the matches exactly instead of searching the vector index when
|
||||
/// the filter's indexed metadata keys match at most this many rows of the
|
||||
/// scope; 0 never does. None takes [`DEFAULT_EXACT_MATCH_LIMIT`].
|
||||
pub exact_match_limit: Option<usize>,
|
||||
}
|
||||
|
||||
/// Up to this many matches of an indexed metadata key are scored exactly.
|
||||
pub const DEFAULT_EXACT_MATCH_LIMIT: usize = 256;
|
||||
|
||||
/// One row of a top-K answer.
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
pub struct Hit {
|
||||
@@ -63,236 +53,14 @@ pub struct Hit {
|
||||
|
||||
/// Exact top-K over every fragment, ignoring any index.
|
||||
pub async fn flat(dataset: &Dataset, table: &VectorTable, query: &Query) -> Result<Vec<Hit>> {
|
||||
run(scanner(dataset, table, query, false, None).await?.0, table).await
|
||||
run(scanner(dataset, table, query, false).await?, table).await
|
||||
}
|
||||
|
||||
/// Top-K with the ANN index where it covers the fragment and a flat pass over
|
||||
/// the rest. Whether the index is used is Lance's decision per fragment, so
|
||||
/// rows written after the last index build are always candidates.
|
||||
///
|
||||
/// A prefiltered search sees only the probed partitions: it can come back
|
||||
/// short of k, or with unscored rows (infinite distance) when at most k rows
|
||||
/// match. Either way it is answered again by an exact scan of the same scope.
|
||||
///
|
||||
/// When the filter's indexed metadata keys match few rows of that scope,
|
||||
/// they are scored exactly to begin with. The decision is per scope, so
|
||||
/// exact answers of several scopes merge into the exact answer.
|
||||
pub async fn ann(dataset: &Dataset, table: &VectorTable, query: &Query) -> Result<Vec<Hit>> {
|
||||
ann_with_scope(dataset, table, query, None).await
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct IndexedOnlyError(pub String);
|
||||
|
||||
impl std::fmt::Display for IndexedOnlyError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(&self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for IndexedOnlyError {}
|
||||
|
||||
pub async fn indexed_only(
|
||||
dataset: &Dataset,
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
) -> Result<(Vec<Hit>, usize)> {
|
||||
if query.postfilter {
|
||||
return Err(IndexedOnlyError("indexed-only requires prefiltering".into()).into());
|
||||
}
|
||||
let mut eligible = indexed_fragments(
|
||||
dataset,
|
||||
&table.vector_column,
|
||||
query.index_segments.as_deref(),
|
||||
)
|
||||
.await?;
|
||||
if let Some(filter) = &query.filter {
|
||||
for column in crate::indexed_filter::columns(dataset, filter)? {
|
||||
eligible &= indexed_fragments(dataset, &column, None).await?;
|
||||
}
|
||||
}
|
||||
let original = scope(dataset, table, query, None).await?;
|
||||
let live: RoaringBitmap = dataset.fragments().iter().map(|f| f.id as u32).collect();
|
||||
let original = original
|
||||
.map(|ids| {
|
||||
ids.into_iter()
|
||||
.map(|id| id as u32)
|
||||
.collect::<RoaringBitmap>()
|
||||
})
|
||||
.unwrap_or(live.clone())
|
||||
& live;
|
||||
eligible &= &original;
|
||||
let excluded = (&original - &eligible).len() as usize;
|
||||
if eligible.is_empty() {
|
||||
return Ok((Vec::new(), excluded));
|
||||
}
|
||||
if excluded == 0
|
||||
&& query.filter.is_none()
|
||||
&& query.index_segments.is_none()
|
||||
&& query.fragments.is_none()
|
||||
{
|
||||
let hits = ann(dataset, table, query).await?;
|
||||
return if hits.len() < query.k {
|
||||
Ok((exact_in_scope(dataset, table, query, None).await?, 0))
|
||||
} else {
|
||||
Ok((hits, 0))
|
||||
};
|
||||
}
|
||||
let eligible: Vec<u64> = eligible.iter().map(u64::from).collect();
|
||||
let hits = ann_with_scope(dataset, table, query, Some(&eligible)).await?;
|
||||
Ok((hits, excluded))
|
||||
}
|
||||
|
||||
async fn indexed_fragments(
|
||||
dataset: &Dataset,
|
||||
column: &str,
|
||||
selected: Option<&[uuid::Uuid]>,
|
||||
) -> Result<RoaringBitmap> {
|
||||
if selected.is_some_and(|ids| ids.is_empty()) {
|
||||
return Ok(RoaringBitmap::new());
|
||||
}
|
||||
let field = dataset
|
||||
.schema()
|
||||
.field(column)
|
||||
.with_context(|| format!("no such field {column}"))?;
|
||||
let mut covered = RoaringBitmap::new();
|
||||
let mut found = Vec::new();
|
||||
for index in dataset
|
||||
.load_indices()
|
||||
.await?
|
||||
.iter()
|
||||
.filter(|i| i.fields == [field.id])
|
||||
{
|
||||
if selected.is_some_and(|ids| !ids.contains(&index.uuid)) {
|
||||
continue;
|
||||
}
|
||||
let bitmap = index
|
||||
.fragment_bitmap
|
||||
.as_ref()
|
||||
.ok_or_else(|| IndexedOnlyError(format!("index coverage is unknown for {column}")))?;
|
||||
covered |= bitmap;
|
||||
found.push(index.uuid);
|
||||
}
|
||||
if found.is_empty() || selected.is_some_and(|ids| ids.iter().any(|id| !found.contains(id))) {
|
||||
return Err(IndexedOnlyError(format!("no usable index for {column}")).into());
|
||||
}
|
||||
Ok(covered)
|
||||
}
|
||||
|
||||
/// ANN and exact fallbacks restricted to the supplied fragments.
|
||||
pub async fn ann_with_scope(
|
||||
dataset: &Dataset,
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
restriction: Option<&[u64]>,
|
||||
) -> Result<Vec<Hit>> {
|
||||
if few_indexed_matches(dataset, table, query, restriction).await? {
|
||||
return exact_in_scope(dataset, table, query, restriction).await;
|
||||
}
|
||||
let (scanner, indexed) = scanner(dataset, table, query, true, restriction).await?;
|
||||
let hits = run(scanner, table).await?;
|
||||
let short_prefilter = (query.filter.is_some() || restriction.is_some())
|
||||
&& !query.postfilter
|
||||
&& hits.len() < query.k;
|
||||
if indexed && (short_prefilter || hits.iter().any(|h| !h.distance.is_finite())) {
|
||||
return exact_in_scope(dataset, table, query, restriction).await;
|
||||
}
|
||||
Ok(hits)
|
||||
}
|
||||
|
||||
/// [`flat`] over what [`ann`] searches for `query`: the listed fragments plus
|
||||
/// the live coverage of the listed index segments, or the whole table.
|
||||
async fn exact_in_scope(
|
||||
dataset: &Dataset,
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
restriction: Option<&[u64]>,
|
||||
) -> Result<Vec<Hit>> {
|
||||
let exact = Query {
|
||||
index_segments: None,
|
||||
fragments: scope(dataset, table, query, restriction).await?,
|
||||
..query.clone()
|
||||
};
|
||||
run(scanner(dataset, table, &exact, false, None).await?.0, table).await
|
||||
}
|
||||
|
||||
/// The fragments [`ann`] searches for `query`, or None for the whole table.
|
||||
async fn scope(
|
||||
dataset: &Dataset,
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
restriction: Option<&[u64]>,
|
||||
) -> Result<Option<Vec<u64>>> {
|
||||
let scope = match &query.index_segments {
|
||||
Some(segments) if !segments.is_empty() => {
|
||||
let mut ids = query.fragments.clone().unwrap_or_default();
|
||||
ids.extend(
|
||||
crate::segments::covered_fragments(dataset, &table.vector_column, segments).await?,
|
||||
);
|
||||
Some(ids)
|
||||
}
|
||||
Some(_) => Some(query.fragments.clone().unwrap_or_default()),
|
||||
None => query.fragments.clone(),
|
||||
};
|
||||
Ok(restrict(scope, restriction))
|
||||
}
|
||||
|
||||
fn restrict(scope: Option<Vec<u64>>, restriction: Option<&[u64]>) -> Option<Vec<u64>> {
|
||||
match restriction {
|
||||
Some(ids) => {
|
||||
let scope = scope.map(|ids| ids.into_iter().collect::<HashSet<_>>());
|
||||
Some(
|
||||
ids.iter()
|
||||
.copied()
|
||||
.filter(|id| scope.as_ref().is_none_or(|scope| scope.contains(id)))
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
None => scope,
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the rows of [`ann`]'s scope matching the filter's indexed
|
||||
/// metadata keys, counted through their scalar indexes, are at most the
|
||||
/// query's limit. Only a search through the vector index asks.
|
||||
pub(crate) async fn few_indexed_matches(
|
||||
dataset: &Dataset,
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
restriction: Option<&[u64]>,
|
||||
) -> Result<bool> {
|
||||
let limit = query.exact_match_limit.unwrap_or(DEFAULT_EXACT_MATCH_LIMIT);
|
||||
let Some(filter) = &query.filter else {
|
||||
return Ok(false);
|
||||
};
|
||||
if limit == 0 || query.postfilter || query.index_segments.as_ref().is_some_and(|s| s.is_empty())
|
||||
{
|
||||
return Ok(false);
|
||||
}
|
||||
let ready = crate::indexed_filter::ready_columns(dataset);
|
||||
if ready.is_empty()
|
||||
|| crate::index::index_names(dataset, &table.vector_column)
|
||||
.await?
|
||||
.is_empty()
|
||||
{
|
||||
return Ok(false);
|
||||
}
|
||||
let indexed = crate::filter::apply(&mut dataset.scan(), filter, &ready)?;
|
||||
if indexed.is_empty() {
|
||||
return Ok(false);
|
||||
}
|
||||
let scope = scope(dataset, table, query, restriction).await?;
|
||||
// An AND matches at most what its most selective indexed conjunct does.
|
||||
for conjunct in &indexed {
|
||||
let count =
|
||||
crate::indexed_filter::count_indexed(dataset, conjunct, scope.as_deref(), limit as u64)
|
||||
.await?;
|
||||
tracing::debug!(column = %conjunct.column, ?count, limit, "indexed metadata filter");
|
||||
if count.is_some() {
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
Ok(false)
|
||||
run(scanner(dataset, table, query, true).await?, table).await
|
||||
}
|
||||
|
||||
/// Fetch rows by key, projected to `columns` (all of them when None).
|
||||
@@ -333,8 +101,7 @@ async fn scanner(
|
||||
table: &VectorTable,
|
||||
query: &Query,
|
||||
use_index: bool,
|
||||
restriction: Option<&[u64]>,
|
||||
) -> Result<(Scanner, bool)> {
|
||||
) -> Result<Scanner> {
|
||||
if query.vector.len() != table.dimension {
|
||||
bail!(
|
||||
"query dim({}) does not match the table's dim({})",
|
||||
@@ -350,24 +117,18 @@ async fn scanner(
|
||||
.use_index(use_index)
|
||||
.with_row_id();
|
||||
if let Some(filter) = &query.filter {
|
||||
let ready = crate::indexed_filter::ready_columns(dataset);
|
||||
crate::filter::apply(&mut scanner, filter, &ready)?;
|
||||
crate::filter::apply(&mut scanner, filter)?;
|
||||
scanner.prefilter(!query.postfilter);
|
||||
}
|
||||
// An explicitly empty segment list searches no index, so there is
|
||||
// nothing to size probes for.
|
||||
let no_segments = query.index_segments.as_ref().is_some_and(|s| s.is_empty());
|
||||
let mut indexed = false;
|
||||
if use_index && !no_segments {
|
||||
let probes = match query.nprobes {
|
||||
Some(n) => crate::index::index_names(dataset, &table.vector_column)
|
||||
.await?
|
||||
.first()
|
||||
.map(|_| crate::index::Probes { min: n, max: n }),
|
||||
Some(n) => Some(crate::index::Probes { min: n, max: n }),
|
||||
None => crate::index::default_probes(dataset, &table.vector_column).await?,
|
||||
};
|
||||
if let Some(probes) = probes {
|
||||
indexed = true;
|
||||
// Lance searches `min` partitions, and under a prefilter keeps
|
||||
// going up to `max` until it has k rows. An open bound would
|
||||
// make it prepare every partition for that, which costs as much
|
||||
@@ -386,13 +147,22 @@ async fn scanner(
|
||||
if use_index && !segments.is_empty() {
|
||||
scanner.with_index_segments(segments.to_vec())?;
|
||||
}
|
||||
let fragments = if use_index {
|
||||
scope(dataset, table, query, restriction).await?
|
||||
} else {
|
||||
restrict(query.fragments.clone(), restriction)
|
||||
};
|
||||
if let Some(ids) = fragments {
|
||||
let ids: HashSet<_> = ids.into_iter().collect();
|
||||
// Lance intersects the fragment list with the selected segments, so a
|
||||
// scoped scan must name the segment-covered fragments itself: the universe
|
||||
// is the listed ids plus the live coverage of the selected segments. An
|
||||
// empty universe (or an empty-segment, fragment-less assignment) scopes to
|
||||
// nothing — `with_fragments` with an empty list scans nothing.
|
||||
let mut wanted: Option<Vec<u64>> = query.fragments.clone();
|
||||
if let Some(ids) = &mut wanted {
|
||||
if use_index && !segments.is_empty() {
|
||||
ids.extend(
|
||||
crate::segments::covered_fragments(dataset, &table.vector_column, segments).await?,
|
||||
);
|
||||
}
|
||||
} else if use_index && query.index_segments.as_ref().is_some_and(|s| s.is_empty()) {
|
||||
wanted = Some(Vec::new());
|
||||
}
|
||||
if let Some(ids) = wanted {
|
||||
let frags: Vec<Fragment> = dataset
|
||||
.fragments()
|
||||
.iter()
|
||||
@@ -408,7 +178,7 @@ async fn scanner(
|
||||
columns.push(DISTANCE_COLUMN.to_string());
|
||||
columns.push(ROW_ID_COLUMN.to_string());
|
||||
scanner.project(&columns)?;
|
||||
Ok((scanner, indexed))
|
||||
Ok(scanner)
|
||||
}
|
||||
|
||||
async fn run(scanner: Scanner, table: &VectorTable) -> Result<Vec<Hit>> {
|
||||
@@ -470,65 +240,6 @@ mod tests {
|
||||
a.iter().zip(b).map(|(x, y)| (x - y) * (x - y)).sum()
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn indexed_only_scores_all_returned_distances() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let vectors: Vec<_> = (0..1024)
|
||||
.map(|i| {
|
||||
vec![
|
||||
(i / 64) as f32 * 100.0 + (i % 64) as f32 * 0.01,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
]
|
||||
})
|
||||
.collect();
|
||||
let mut dataset = write_dataset(&dir, &vectors, &vec!["a"; vectors.len()]).await;
|
||||
dataset
|
||||
.create_index(
|
||||
&["vector"],
|
||||
lance_index::IndexType::Vector,
|
||||
Some("vidx".into()),
|
||||
&lance::index::vector::VectorIndexParams::ivf_flat(16, DistanceType::L2),
|
||||
true,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
crate::testing::append_dataset(&mut dataset, &[vec![0.0; DIM]], &["late"]).await;
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
let mut query = Query {
|
||||
vector: vec![0.0; DIM],
|
||||
k: vectors.len(),
|
||||
filter: None,
|
||||
postfilter: false,
|
||||
distance: DistanceType::L2,
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
for nprobes in [None, Some(1)] {
|
||||
query.nprobes = nprobes;
|
||||
let (hits, excluded) = indexed_only(&dataset, &table, &query).await.unwrap();
|
||||
assert_eq!(excluded, 1);
|
||||
assert_eq!(hits.len(), vectors.len());
|
||||
for hit in hits {
|
||||
let index: usize = hit.key[1..].parse().unwrap();
|
||||
assert_eq!(hit.distance, l2(&query.vector, &vectors[index]));
|
||||
}
|
||||
}
|
||||
|
||||
dataset
|
||||
.optimize_indices(&lance_index::optimize::OptimizeOptions::append())
|
||||
.await
|
||||
.unwrap();
|
||||
query.k += 1;
|
||||
let (hits, excluded) = indexed_only(&dataset, &table, &query).await.unwrap();
|
||||
assert_eq!(excluded, 0);
|
||||
assert_eq!(hits.len(), query.k);
|
||||
assert!(hits.iter().all(|hit| hit.distance.is_finite()));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn flat_returns_exact_top_k() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
@@ -550,7 +261,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let hits = flat(&dataset, &table, &query).await.unwrap();
|
||||
assert_eq!(hits.len(), 2);
|
||||
@@ -592,7 +302,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
@@ -672,7 +381,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
@@ -776,7 +484,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
assert!(flat(&dataset, &table, &query).await.is_err());
|
||||
}
|
||||
@@ -800,7 +507,6 @@ mod tests {
|
||||
nprobes: None,
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
let indexed = ann(&dataset, &table, &query).await.unwrap();
|
||||
let exact = flat(&dataset, &table, &query).await.unwrap();
|
||||
@@ -809,46 +515,4 @@ mod tests {
|
||||
exact.iter().map(|h| &h.key).collect::<Vec<_>>()
|
||||
);
|
||||
}
|
||||
|
||||
/// An explicit probe count does not make an unindexed table's scan count
|
||||
/// as indexed, so a short filtered answer is not scanned a second time.
|
||||
#[tokio::test]
|
||||
async fn explicit_probes_need_an_index() {
|
||||
let dir = TempDir::new().unwrap();
|
||||
let rows = crate::testing::vectors(300, DIM);
|
||||
let mut dataset = write_dataset(&dir, &rows, &["a"; 300]).await;
|
||||
let table = VectorTable::resolve(&dataset, None, None).unwrap();
|
||||
let query = Query {
|
||||
vector: rows[0].clone(),
|
||||
k: 10,
|
||||
filter: Some("tag = 'a'".to_string()),
|
||||
postfilter: false,
|
||||
distance: DistanceType::L2,
|
||||
nprobes: Some(4),
|
||||
index_segments: None,
|
||||
fragments: None,
|
||||
exact_match_limit: None,
|
||||
};
|
||||
assert!(
|
||||
!scanner(&dataset, &table, &query, true, None)
|
||||
.await
|
||||
.unwrap()
|
||||
.1
|
||||
);
|
||||
crate::index::build(
|
||||
&mut dataset,
|
||||
&table.vector_column,
|
||||
crate::index::INDEX_NAME,
|
||||
4,
|
||||
false,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(
|
||||
scanner(&dataset, &table, &query, true, None)
|
||||
.await
|
||||
.unwrap()
|
||||
.1
|
||||
);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 1186 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user