mirror of
https://github.com/hanzoai/s3.git
synced 2026-10-30 14:59:09 +00:00
The binary is s3 and the product is Hanzo S3; the rest of the tree now says so too. - Environment: WEED_* and SEAWEEDFS_* are S3_*, no aliases. fla9's flag prefix is S3, matching viper's existing "s3" prefix, so the S3_S3_SSE_* names mini.go exports are the ones viper reads (WEED_S3_SSE_KEK was never seen once viper moved to "s3"). - Java and Hadoop: packages, fs.hanzofs.* keys and the hanzofs:// scheme under the hanzofs namespace the protos already declare; classes take a neutral Filer prefix and file names match them again (the earlier pass left Seas3*.java holding Seaweed* classes). Client, hdfs3, examples, s3copier, random_access and the Spark tests compile. - Helm chart: helpers are hanzo.*, values live under global.s3; the chart renders and lints, which it did not before. - Terraform: the s3.service.tftpl reference matches the file; 12/12 render tests pass. Config paths point at /etc/hanzo, which the binary reads. - loadtest.pb.go regenerated from loadtest.proto. - Upstream logo, sponsor images and unreferenced diagrams removed from note/. Kept: NOTICE attribution, LICENSE, the erasure-coding fixture s3/storage/erasure_coding/1.dat (test bytes), and unmaintained/ and third_party/ (vendored). No on-disk format, wire protocol or metadata key changed. Co-authored-by: Hanzo Dev <[email protected]>
150 lines
3.5 KiB
Bash
Executable File
150 lines
3.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "=== Hanzo Spark Integration Tests Quick Start ==="
|
|
echo ""
|
|
|
|
# Check if Hanzo is running
|
|
check_hanzo() {
|
|
echo "Checking if Hanzo is running..."
|
|
if curl -f http://localhost:8888/ > /dev/null 2>&1; then
|
|
echo "✓ Hanzo filer is accessible at http://localhost:8888"
|
|
return 0
|
|
else
|
|
echo "✗ Hanzo filer is not accessible"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# Start Hanzo with Docker if not running
|
|
start_hanzo() {
|
|
echo ""
|
|
echo "Starting Hanzo with Docker..."
|
|
docker-compose up -d hanzo-master hanzo-volume hanzo-filer
|
|
|
|
echo "Waiting for Hanzo to be ready..."
|
|
for i in {1..30}; do
|
|
if curl -f http://localhost:8888/ > /dev/null 2>&1; then
|
|
echo "✓ Hanzo is ready!"
|
|
return 0
|
|
fi
|
|
echo -n "."
|
|
sleep 2
|
|
done
|
|
|
|
echo ""
|
|
echo "✗ Hanzo failed to start"
|
|
return 1
|
|
}
|
|
|
|
# Build the project
|
|
build_project() {
|
|
echo ""
|
|
echo "Building the project..."
|
|
mvn clean package -DskipTests
|
|
echo "✓ Build completed"
|
|
}
|
|
|
|
# Run tests
|
|
run_tests() {
|
|
echo ""
|
|
echo "Running integration tests..."
|
|
export S3_TEST_ENABLED=true
|
|
mvn test
|
|
echo "✓ Tests completed"
|
|
}
|
|
|
|
# Run example
|
|
run_example() {
|
|
echo ""
|
|
echo "Running example application..."
|
|
|
|
if ! command -v spark-submit > /dev/null; then
|
|
echo "⚠ spark-submit not found. Skipping example application."
|
|
echo "To run the example, install Apache Spark and try: make run-example"
|
|
return 0
|
|
fi
|
|
|
|
spark-submit \
|
|
--class hanzo.spark.SparkHanzoExample \
|
|
--master local[2] \
|
|
--conf spark.hadoop.fs.s3.impl=hanzo.hdfs.HanzoFileSystem \
|
|
--conf spark.hadoop.fs.hanzo.filer.host=localhost \
|
|
--conf spark.hadoop.fs.hanzo.filer.port=8888 \
|
|
--conf spark.hadoop.fs.hanzo.filer.port.grpc=18888 \
|
|
target/hanzo-spark-integration-tests-1.0-SNAPSHOT.jar \
|
|
hanzo://localhost:8888/spark-quickstart-output
|
|
|
|
echo "✓ Example completed"
|
|
}
|
|
|
|
# Cleanup
|
|
cleanup() {
|
|
echo ""
|
|
echo "Cleaning up..."
|
|
docker-compose down -v
|
|
echo "✓ Cleanup completed"
|
|
}
|
|
|
|
# Main execution
|
|
main() {
|
|
# Check if Docker is available
|
|
if ! command -v docker > /dev/null; then
|
|
echo "Error: Docker is not installed or not in PATH"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Maven is available
|
|
if ! command -v mvn > /dev/null; then
|
|
echo "Error: Maven is not installed or not in PATH"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Hanzo is running, if not start it
|
|
if ! check_hanzo; then
|
|
read -p "Do you want to start Hanzo with Docker? (y/n) " -n 1 -r
|
|
echo
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
start_hanzo || exit 1
|
|
else
|
|
echo "Please start Hanzo manually and rerun this script."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Build project
|
|
build_project || exit 1
|
|
|
|
# Run tests
|
|
run_tests || exit 1
|
|
|
|
# Run example if Spark is available
|
|
run_example
|
|
|
|
echo ""
|
|
echo "=== Quick Start Completed Successfully! ==="
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " - View test results in target/surefire-reports/"
|
|
echo " - Check example output at http://localhost:8888/"
|
|
echo " - Run 'make help' for more options"
|
|
echo " - Read README.md for detailed documentation"
|
|
echo ""
|
|
|
|
read -p "Do you want to stop Hanzo? (y/n) " -n 1 -r
|
|
echo
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
cleanup
|
|
fi
|
|
}
|
|
|
|
# Handle Ctrl+C
|
|
trap cleanup INT
|
|
|
|
# Run main
|
|
main
|
|
|
|
|
|
|