add build automation and HNSW implementation guide

- Create automated build script with version extraction and Aliyun registry push
- Add comprehensive HNSW implementation guide with step-by-step instructions
- Update Dockerfile to use musl target and enc binary for deployment
- Include performance optimization strategies and debugging tips
This commit is contained in:
2025-07-24 18:58:28 +08:00
parent e85eb8a9e8
commit 8b47403cc0
3 changed files with 170 additions and 1 deletions

26
build.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -e
# 获取项目版本
VERSION=$(grep '^version =' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
echo "📦 Building version: $VERSION"
# 阿里云容器镜像仓库配置
REGISTRY="crpi-2oj2gvvfz737vu2s.cn-guangzhou.personal.cr.aliyuncs.com"
NAMESPACE="sangge"
REPO_NAME="yinyu" # 原本的仓库名
IMAGE_TAG="$REGISTRY/$NAMESPACE/$REPO_NAME:$VERSION"
echo "🏗️ Building Rust project..."
# 构建 Rust 项目 (使用 musl target 用于静态链接)
cargo build --release --target x86_64-unknown-linux-musl --bin enc
echo "🐳 Building Docker image: $IMAGE_TAG"
# 构建 Docker 镜像
docker build -t "$IMAGE_TAG" .
echo "📤 Pushing Docker image to Aliyun registry..."
# 推送镜像到阿里云
docker push "$IMAGE_TAG"
echo "✅ Build and push completed!"