mirror of
https://github.com/hanzoai/s3.git
synced 2026-10-30 14:59:09 +00:00
hanzoai/s3 was an AGPL-3.0 MinIO fork whose network-copyleft blocks embedding
and reselling as a managed service. Replace it wholesale with a fork of
SeaweedFS (github.com/seaweedfs/seaweedfs, Apache-2.0, Go) which ships a
built-in S3 gateway + Filer.
- License: AGPL-3.0 -> Apache-2.0 (upstream LICENSE kept verbatim, incl.
"Copyright 2025 Chris Lu"); NOTICE added crediting SeaweedFS. No AGPL/BUSL/
SSPL/GPL or enterprise ("ee") files remain.
- Module: go.mod path set to github.com/hanzoai/s3 with a self-replace
(replace github.com/seaweedfs/seaweedfs => ./) so the ~1800 internal Go files
keep their upstream import paths with zero churn. Internal identifiers and
import paths are intentionally NOT renamed.
- CLI rebrand: the binary is built as `s3` (was `weed`); root usage, per-command
help/usage/flag strings, shell autocomplete program name, and the product name
in CLI output now read "Hanzo S3" / `s3`. Users never see `weed`.
(e.g. `s3 server`, `s3 filer`, `s3 master`, `s3 volume`, `s3 s3`, `s3 mount`.)
- Build: `make` (or `go build -o s3 ./weed`) builds the `s3` binary green;
`cmd/weed-db` and `cmd/weed-sql` also build; `go vet ./weed/command/` clean.
- README/LLM.md rewritten for Hanzo S3; AGENTS.md/CLAUDE.md symlinks preserved.
- Dropped a 33MB prebuilt Mach-O `stress` binary upstream had committed; `.gitignore`
updated to ignore the `s3` build output.
49 lines
2.1 KiB
Python
49 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
|
# MySQL performance probe via the mysql CLI (no driver needed). Times each phase
|
|
# in Python. Prints TSV: METRIC<TAB>secs<TAB>rate
|
|
# LOAD : bulk-load <rows> rows (4096B incompressible AES payload), <batch>-row txns
|
|
# OLTP : <oltp> single-row autocommit INSERTs (each fsyncs redo, trx_commit=1) -> tx/s
|
|
# SCAN : SUM(CRC32(payload)) over the table (reads every payload) -> MB/s
|
|
import os, re, sys, subprocess, time
|
|
|
|
sock = sys.argv[1]
|
|
db = sys.argv[2]
|
|
rows = int(sys.argv[3])
|
|
batch = int(sys.argv[4])
|
|
oltp = int(sys.argv[5])
|
|
MYSQL = os.environ.get("MYSQL_BIN", "mysql") # lib.sh exports MYSQL_BIN; else use PATH
|
|
|
|
if not re.fullmatch(r"[A-Za-z0-9_]+", db): # db is interpolated into SQL
|
|
raise SystemExit(f"invalid database name: {db!r}")
|
|
|
|
def run(sql):
|
|
r = subprocess.run([MYSQL, "--socket", sock, "-uroot"], input=sql.encode(),
|
|
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, timeout=1800)
|
|
if r.returncode != 0:
|
|
sys.stderr.write(r.stderr.decode()[:500]); raise SystemExit("mysql failed")
|
|
|
|
run(f"DROP DATABASE IF EXISTS {db}; CREATE DATABASE {db};"
|
|
f"CREATE TABLE {db}.t(id INT PRIMARY KEY,payload BLOB,chk BIGINT) ENGINE=InnoDB;"
|
|
f"CREATE TABLE {db}.o(id INT AUTO_INCREMENT PRIMARY KEY,v INT) ENGINE=InnoDB;")
|
|
|
|
mb = rows * 4096 / 1048576
|
|
stmts = ["SET SESSION cte_max_recursion_depth=1000000;"]
|
|
o = 0
|
|
while o < rows:
|
|
b = min(batch, rows - o)
|
|
stmts.append(
|
|
f"INSERT INTO {db}.t(id,payload,chk) "
|
|
f"WITH RECURSIVE seq(n) AS (SELECT 0 UNION ALL SELECT n+1 FROM seq WHERE n<{b-1}) "
|
|
f"SELECT n+{o},AES_ENCRYPT(REPEAT('a',4080),SHA2(n+{o},256)),"
|
|
f"CRC32(AES_ENCRYPT(REPEAT('a',4080),SHA2(n+{o},256))) FROM seq;")
|
|
o += b
|
|
t = time.time(); run("\n".join(stmts)); dt = time.time() - t
|
|
print(f"LOAD\t{dt:.1f}\t{mb/dt:.0f} MB/s")
|
|
|
|
sql = "\n".join(f"INSERT INTO {db}.o(v) VALUES({i});" for i in range(oltp))
|
|
t = time.time(); run(sql); dt = time.time() - t
|
|
print(f"OLTP\t{dt:.2f}\t{oltp/dt:.0f} tx/s")
|
|
|
|
t = time.time(); run(f"SELECT SUM(CRC32(payload)) FROM {db}.t;"); dt = time.time() - t
|
|
print(f"SCAN\t{dt:.1f}\t{mb/dt:.0f} MB/s")
|