Files
ssw-mpc/demo/tools/run.sh
T
admin 4ec4147122 feat(demo): 新增 Rust 版算子集市,23 个模块对齐 Python 版 API 契约
- 新 workspace 成员 demo/(mpc-demo 二进制):HTTP/1.1 与 JSON 全部手写,
  零外部依赖,静态页 include_str! 编进二进制,仍是单文件交付
- 前端 23 个页面与 CSS 从 ssw-mvp/demo 原样复制,一行未改;--assets 可改磁盘读
- 20 个模块真调 mpc-* crate 计算(psi/he/sql/ml/fl/vault/zkp/runtime/tee/orch),
  核心结果非写死;security_audit、secure_scenario 原为 LLM 驱动,改本地规则+模板,
  响应带 mode/note/engine 如实标注;k8s_two_party 映射本仓 deploy/ray
- 两处能力差异已在 README 声明:secure_mlp 为明文 MLP、secure_stats 统计层明文
- 修 aggregator_chain 前端 SecureSum 行按列求和的笔误(原整行 NaN)
- handler 错误统一返 400 对齐 Python 版;.gitignore 的 /refs/nax 去尾斜杠,
  否则匹配不到本机的 Finder 别名文件
2026-11-05 20:12:11 +08:00

39 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
#
# 启动 Rust 版算子集市。
#
# 用法:
# demo/tools/run.sh 默认 127.0.0.1:18851,带 secure
# demo/tools/run.sh --port 18860 换端口
# demo/tools/run.sh --assets demo/assets 改前端后免重编译
# demo/tools/run.sh --release 跑优化版(页面重计算明显更快)
#
# 与 Python 版同时开:Python 默认 18850,这边默认 18851,互不冲突。
set -euo pipefail
cd "$(dirname "$0")/../.."
MODE="run"
FEATURES="secure"
CARGO_ARGS=()
PASSTHRU=()
for a in "$@"; do
case "$a" in
--release) MODE="build"; CARGO_ARGS+=(--release) ;;
-h|--help) sed -n '2,11p' "$0"; exit 0 ;;
*) PASSTHRU+=("$a") ;;
esac
done
echo "编译 mpc-demo(features: ${FEATURES})…"
cargo build -p mpc-demo --features "$FEATURES" "${CARGO_ARGS[@]}"
BIN="target/debug/mpc-demo"
if printf '%s\n' "${CARGO_ARGS[@]+"${CARGO_ARGS[@]}"}" | grep -q -- '--release'; then
BIN="target/release/mpc-demo"
fi
exec "$BIN" "${PASSTHRU[@]+"${PASSTHRU[@]}"}"