mirror of
https://github.com/hanzoai/s3.git
synced 2026-11-03 03:07:41 +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.
184 lines
5.3 KiB
Bash
Executable File
184 lines
5.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Setup Soft-RoCE (RXE) for RDMA simulation
|
|
# This script enables RDMA over Ethernet using the RXE kernel module
|
|
|
|
set -e
|
|
|
|
echo "๐ง Setting up Soft-RoCE (RXE) RDMA simulation..."
|
|
|
|
# Function to check if running with required privileges
|
|
check_privileges() {
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "โ This script requires root privileges"
|
|
echo "Run with: sudo $0 or inside a privileged container"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Function to load RXE kernel module
|
|
load_rxe_module() {
|
|
echo "๐ฆ Loading RXE kernel module..."
|
|
|
|
# Try to load the rdma_rxe module
|
|
if modprobe rdma_rxe 2>/dev/null; then
|
|
echo "โ
rdma_rxe module loaded successfully"
|
|
else
|
|
echo "โ ๏ธ Failed to load rdma_rxe module, trying alternative approach..."
|
|
|
|
# Alternative: Try loading rxe_net (older kernels)
|
|
if modprobe rxe_net 2>/dev/null; then
|
|
echo "โ
rxe_net module loaded successfully"
|
|
else
|
|
echo "โ Failed to load RXE modules. Possible causes:"
|
|
echo " - Kernel doesn't support RXE (needs CONFIG_RDMA_RXE=m)"
|
|
echo " - Running in unprivileged container"
|
|
echo " - Missing kernel modules"
|
|
echo ""
|
|
echo "๐ง Workaround: Run container with --privileged flag"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Verify module is loaded
|
|
if lsmod | grep -q "rdma_rxe\|rxe_net"; then
|
|
echo "โ
RXE module verification successful"
|
|
else
|
|
echo "โ RXE module verification failed"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Function to setup virtual RDMA device
|
|
setup_rxe_device() {
|
|
echo "๐ Setting up RXE device over Ethernet interface..."
|
|
|
|
# Find available network interface (prefer eth0, fallback to others)
|
|
local interface=""
|
|
for iface in eth0 enp0s3 enp0s8 lo; do
|
|
if ip link show "$iface" >/dev/null 2>&1; then
|
|
interface="$iface"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -z "$interface" ]; then
|
|
echo "โ No suitable network interface found"
|
|
echo "Available interfaces:"
|
|
ip link show | grep "^[0-9]" | cut -d':' -f2 | tr -d ' '
|
|
exit 1
|
|
fi
|
|
|
|
echo "๐ก Using network interface: $interface"
|
|
|
|
# Create RXE device
|
|
echo "๐จ Creating RXE device on $interface..."
|
|
|
|
# Try modern rxe_cfg approach first
|
|
if command -v rxe_cfg >/dev/null 2>&1; then
|
|
rxe_cfg add "$interface" || {
|
|
echo "โ ๏ธ rxe_cfg failed, trying manual approach..."
|
|
setup_rxe_manual "$interface"
|
|
}
|
|
else
|
|
echo "โ ๏ธ rxe_cfg not available, using manual setup..."
|
|
setup_rxe_manual "$interface"
|
|
fi
|
|
}
|
|
|
|
# Function to manually setup RXE device
|
|
setup_rxe_manual() {
|
|
local interface="$1"
|
|
|
|
# Use sysfs interface to create RXE device
|
|
if [ -d /sys/module/rdma_rxe ]; then
|
|
echo "$interface" > /sys/module/rdma_rxe/parameters/add 2>/dev/null || {
|
|
echo "โ Failed to add RXE device via sysfs"
|
|
exit 1
|
|
}
|
|
else
|
|
echo "โ RXE sysfs interface not found"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Function to verify RDMA devices
|
|
verify_rdma_devices() {
|
|
echo "๐ Verifying RDMA devices..."
|
|
|
|
# Check for RDMA devices
|
|
if [ -d /sys/class/infiniband ]; then
|
|
local devices=$(ls /sys/class/infiniband/ 2>/dev/null | wc -l)
|
|
if [ "$devices" -gt 0 ]; then
|
|
echo "โ
Found $devices RDMA device(s):"
|
|
ls /sys/class/infiniband/
|
|
|
|
# Show device details
|
|
for device in /sys/class/infiniband/*; do
|
|
if [ -d "$device" ]; then
|
|
local dev_name=$(basename "$device")
|
|
echo " ๐ Device: $dev_name"
|
|
|
|
# Try to get device info
|
|
if command -v ibv_devinfo >/dev/null 2>&1; then
|
|
ibv_devinfo -d "$dev_name" | head -10
|
|
fi
|
|
fi
|
|
done
|
|
else
|
|
echo "โ No RDMA devices found in /sys/class/infiniband/"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "โ /sys/class/infiniband directory not found"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Function to test basic RDMA functionality
|
|
test_basic_rdma() {
|
|
echo "๐งช Testing basic RDMA functionality..."
|
|
|
|
# Test libibverbs
|
|
if command -v ibv_devinfo >/dev/null 2>&1; then
|
|
echo "๐ RDMA device information:"
|
|
ibv_devinfo | head -20
|
|
else
|
|
echo "โ ๏ธ ibv_devinfo not available"
|
|
fi
|
|
|
|
# Test UCX if available
|
|
if command -v ucx_info >/dev/null 2>&1; then
|
|
echo "๐ UCX information:"
|
|
ucx_info -d | head -10
|
|
else
|
|
echo "โ ๏ธ UCX tools not available"
|
|
fi
|
|
}
|
|
|
|
# Main execution
|
|
main() {
|
|
echo "๐ Starting Soft-RoCE RDMA simulation setup..."
|
|
echo "======================================"
|
|
|
|
check_privileges
|
|
load_rxe_module
|
|
setup_rxe_device
|
|
verify_rdma_devices
|
|
test_basic_rdma
|
|
|
|
echo ""
|
|
echo "๐ Soft-RoCE setup completed successfully!"
|
|
echo "======================================"
|
|
echo "โ
RDMA simulation is ready for testing"
|
|
echo "๐ก You can now run RDMA applications"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " - Test with: /opt/rdma-sim/test-rdma.sh"
|
|
echo " - Check UCX: /opt/rdma-sim/ucx-info.sh"
|
|
echo " - Run your RDMA applications"
|
|
}
|
|
|
|
# Execute main function
|
|
main "$@"
|