# trusted-ai-platform **Repository Path**: mtxd-cmd/trusted-ai-platform ## Basic Information - **Project Name**: trusted-ai-platform - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-17 - **Last Updated**: 2025-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Trusted ai platform ## Code style * 优先使用: https://gist.github.com/Muffo/91c6b2c95cca4cc510fe * 适当参考: * https://www.kernel.org/doc/html/v4.10/process/coding-style.html * http://gmssl.org/docs/gmssl-coding-style.html ## For Ubuntu 20.04 (Other distro not tested) Install dependent packages: ``` ./script/install-deps.sh ``` PS: Uninstall other wsl distro by: ``` wsl -l -v wsl --unregister ``` ### Instructions for command line build 如果代码更新了 `default-config` 目录,可以考虑 ``` rm -rf ~/.trusted-ai-platform ``` 之后重新 CMake 构建 CMake 构建步骤如下: 1. 命令行: ``` # 跳过单元测试 export SKIP_UT=true cmake -S . -B build cmake --build build --target all -j $(nproc) ``` 2. Clion: 右键 CMakeLists.txt => Reload CMake project Run application: ``` cd bin ./ai_ca_server ``` Run unit test suite: ``` # todo cd cmake/test ctest ``` ### Instructions for CLion + WSL 2 ![](./assets/clion1.jpg) ![](./assets/clion2.jpg) ![](./assets/clion3.jpg) ![](./assets/clion4.jpg) ![](./assets/clion5.jpg) ### Instructions for VS Code + SSH [doc/vscode.md](./doc/vscode.md) ## 构建闭源项目 Release 包 确认开发环境是 Ubuntu 20.04。 ### 开发机 Ubuntu 上执行 考虑代码脱敏问题,构建需要借助开发机的构建环境,保证 bin 和 build 目录非空,请清除 Clion、VSCode 构建产物,并使用如下命令构建: ``` ./script/build-release-bin-on-ubuntu.sh ``` 打包 tag.gz ``` ./script/release-closed-source-on-ubuntu.sh ``` 终端1: ``` ./script/run-ai-ca-server-pb.sh ``` 终端2: ``` ./script/run-ai-tee-worker-pb.sh ``` ### CentOS 上调试 传输 release.tag.gz 到 CentOS 机器 * 例如 Ubuntu 上可以运行 ``` http-server ``` CentOS 下载压缩包 ``` curl http://100.64.0.25:8080/hygon/trusted-ai-platform/release.tar.gz -o release.tar.gz ``` 接下来步骤请看 RELEASE.md ## References * [CMake: An introduction](https://www.cs.swarthmore.edu/~adanner/tips/cmake.php) * [CMake/Testing with CTest](https://cmake.org/Wiki/CMake/Testing_With_CTest) # 部署长期运行的服务端 ## supervisior 服务 暂时有问题,请用 tmux ``` ./common/script/init-supervisior.sh ``` ## tmux 安装 tmux 后,用两个快捷键 * ctrl+b f 选择窗口 * ctrl+b d detech 当前 session 配合 frpc 的 docker 容器转发到公网,etc 配置已经 ok,https://github.com/snowdreamtech/frp 需要手工启动两个 ``` ./bin/ai_ca_server-pb \ --ai-ca-server-pb-address 0.0.0.0 \ --ai-ca-server-pb-port 60051 ``` ``` ./bin/ai_tee_worker-pb \ --ai-ca-server-pb-port 60051 --ai-tee-worker-pb-address 0.0.0.0 \ --ai-tee-worker-pb-port 60052 ```