Skip to content

Commit

Permalink
fix docker file (#114)
Browse files Browse the repository at this point in the history
* fix docker file

* fix ci

* add docker ci

* update change log
  • Loading branch information
cyjseagull authored Dec 9, 2024
1 parent af06ae8 commit 435d124
Show file tree
Hide file tree
Showing 19 changed files with 382 additions and 91 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/cpp_full_node_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,25 @@ jobs:
export CXX='g++-10'
sudo bash -x cpp/tools/install_depends.sh -o ubuntu
mkdir -p cpp/build && cd cpp/build && cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
echo "Disk usage before delete files: "`df -lh`
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/*
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src/*
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/grpc/*-dbg
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/krb5/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/gsasl/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/protobuf/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/wedprcrypto/src
rm -rf ${{ env.VCPKG_ROOT }}buildtrees/openssl/src
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-dbg
echo "Disk usage after delete files: "`df -lh`
make -j3
- name: Build for macOS
if: runner.os == 'macOS'
run: |
bash -x cpp/tools/install_depends.sh -o macos
rm -rf /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl
mkdir -p cpp/build && cd cpp/build && cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
mkdir -p cpp/build && cd cpp/build
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && cmake -DBUILD_STATIC=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake ../
make -j3
- name: Publish Error
if: always()
Expand Down Expand Up @@ -108,7 +120,13 @@ jobs:
with:
name: build-x64-linux-dbg-err.log
path: /home/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-linux-dbg-err.log

- name: Publish Error macos
if: always()
uses: actions/upload-artifact@v4
with:
name: build-x64-osx-dbg-err.log
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log


build_centos:
name: build_centos full node
Expand Down Expand Up @@ -160,7 +178,7 @@ jobs:
yum update -y
yum install -y epel-release centos-release-scl centos-release-scl-rh
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y wget java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-11 libzstd-devel zlib-devel flex bison python-devel python3-devel
yum install -y wget java-11-openjdk-devel git autoconf automake make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-11 libzstd-devel zlib-devel flex bison python-devel python3-devel
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-07-28
Expand Down Expand Up @@ -190,7 +208,7 @@ jobs:
rm -rf python
mkdir -p cpp/build
cd cpp/build
cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake ../
cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
- name: FreeDiskSpace
run: |
df -lh
Expand Down Expand Up @@ -223,3 +241,9 @@ jobs:
with:
name: ppc-gateway-service-x64
path: ./cpp/build/bin/ppc-gateway-service
- name: Publish Error macos
if: always()
uses: actions/upload-artifact@v4
with:
name: vcpkg-manifest-install.log
path: /__w/WeDPR-Component/WeDPR-Component/cpp/build/vcpkg-manifest-install.log
98 changes: 98 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: WeDPR-Component docker ci
on:
push:
paths-ignore:
- "docs/**"
- "Changelog.md"
- "README.md"
tags:
- 'v3.*.*'
pull_request:
paths-ignore:
- "docs/**"
- "python/**"
- "Changelog.md"
- "README.md"
release:
types: [prereleased]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RUST_BACKTRACE: 1
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io

jobs:
build-docker:
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch name
uses: nelonoel/[email protected]
- name: Fetch tag
run: |
git fetch --tags --force
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_FISCOPR_USER }}
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}
- name: Get git tag
uses: little-core-labs/[email protected]
id: tag_data
with:
tagRegex: (.*) # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
tagRegexGroup: 1 # Optional. Default is 1.
# the model image
- name: Build and Push model images
run: |
[[ ${{github.ref}} == */tags/* ]] && MODEL_DOCKER_TAG="${GIT_TAG_NAME}" || MODEL_DOCKER_TAG="${BRANCH_NAME}"
MODEL_DOCKER_TAG="fiscoorg/wedpr-model-service:${MODEL_DOCKER_TAG}"
echo "* Begin to build model docker: ${MODEL_DOCKER_TAG}"
cd docker-files/model/model
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} -t ${MODEL_DOCKER_TAG} .
echo "* Build model docker: ${MODEL_DOCKER_TAG} success"
docker push ${MODEL_DOCKER_TAG}
echo "* Push model docker: ${MODEL_DOCKER_TAG} success"
# the wedpr-gateway-service image
- name: Build and Push wedpr-gateway-service images
run: |
[[ ${{github.ref}} == */tags/* ]] && GW_DOCKER_TAG="${GIT_TAG_NAME}" || GW_DOCKER_TAG="${BRANCH_NAME}"
GW_DOCKER_TAG="fiscoorg/wedpr-gateway-service:${GW_DOCKER_TAG}"
echo "* Begin to build wedpr-gateway-service docker: ${GW_DOCKER_TAG}"
cd docker-files/cpp/
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
echo "* Build wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
docker push ${GW_DOCKER_TAG}
echo "* Push wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
# the wedpr-pro-node-service image
- name: Build and Push wedpr-pro-node-service images
run: |
[[ ${{github.ref}} == */tags/* ]] && NODE_DOCKER_TAG="${GIT_TAG_NAME}" || NODE_DOCKER_TAG="${BRANCH_NAME}"
NODE_DOCKER_TAG="fiscoorg/wedpr-pro-node-service:${NODE_DOCKER_TAG}"
echo "* Begin to build wedpr-pro-node-service docker: ${NODE_DOCKER_TAG}"
cd docker-files/cpp/
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-pro-node-service -t ${NODE_DOCKER_TAG} .
echo "* Build wedpr-pro-node-service docker: ${NODE_DOCKER_TAG} success"
docker push ${NODE_DOCKER_TAG}
echo "* Push wedpr-pro-node-service docker: ${NODE_DOCKER_TAG} success"
# the wedpr-mpc-service image
- name: Build and Push wedpr-mpc-service images
run: |
[[ ${{github.ref}} == */tags/* ]] && MPC_DOCKER_TAG="${GIT_TAG_NAME}" || MPC_DOCKER_TAG="${BRANCH_NAME}"
MPC_DOCKER_TAG="fiscoorg/wedpr-mpc-service:${MPC_DOCKER_TAG}"
echo "* Begin to build wedpr-mpc-service docker: ${MPC_DOCKER_TAG}"
cd docker-files/cpp/
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} --target wedpr-mpc-service -t ${MPC_DOCKER_TAG} .
echo "* Build wedpr-mpc-service docker: ${MPC_DOCKER_TAG} success"
docker push ${MPC_DOCKER_TAG}
echo "* Push wedpr-mpc-service docker: ${MPC_DOCKER_TAG} success"
40 changes: 40 additions & 0 deletions .github/workflows/model_docker_image_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Manual trigger wedpr-model-service-base-image docker image build

on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'the input tag'

jobs:
manual-build-model-base-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch name
uses: nelonoel/[email protected]
- name: Fetch tag
run: |
git fetch --tags --force
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_FISCOPR_USER }}
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}

# the model image
- name: Build and Push wedpr-model-service-base-image images
run: |
echo "* Manual build wedpr-model-service-base-image image, docker version: ${{ github.event.inputs.tags }}"
DOCKER_TAG="fiscoorg/wedpr-model-service-base-image:${{ github.event.inputs.tags }}"
echo "* Begin to build ${DOCKER_TAG}"
cd docker-files/model/base
docker build -t ${DOCKER_TAG} .
echo "* Build ${DOCKER_TAG} success"
docker push ${DOCKER_TAG}
echo "* Push ${DOCKER_TAG} success"
46 changes: 46 additions & 0 deletions .github/workflows/vcpkg_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Manual trigger vcpkg-cache docker image build

on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'the input tag'

jobs:
manual-build-vcpkg-cache-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch name
uses: nelonoel/[email protected]
- name: Fetch tag
run: |
git fetch --tags --force
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_FISCOPR_USER }}
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}

# the model image
- name: Build and Push wedpr-component-vcpkg-cache images
run: |
echo "* Manual build wedpr-component-vcpkg-cache image, docker version: ${{ github.event.inputs.tags }}"
DOCKER_TAG="fiscoorg/wedpr-component-vcpkg-cache:${{ github.event.inputs.tags }}"
echo "* Begin to build ${DOCKER_TAG}"
cd docker-files/cpp/vcpkg
docker build --build-arg SOURCE_BRANCH=${BRANCH_NAME} -t ${DOCKER_TAG} .
echo "* Build ${DOCKER_TAG} success"
docker push ${DOCKER_TAG}
echo "* Push ${DOCKER_TAG} success"
- name: Publish Error
if: always()
uses: actions/upload-artifact@v4
with:
name: autoconf-x64-linux-err.log
path: /WeDPR-Component/cpp/vcpkg/buildtrees/gsasl/autoconf-x64-linux-err.log
44 changes: 30 additions & 14 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
### 1.0.0-rc1
(2024-08-21)
# 3.0.0
(2024-12-9)

**新增**
### 新增

#### 隐私计算组件
**隐私计算组件**

- **PSI**: 实现多种类型隐私求交集算法,包括CM2020, RA2018, ECDH-PSI, ECDH-Multi-PSI等
- **MPC**: 安全多方计算相关组件
- **MPCSQL**: 基于安全多方计算协议,支持联合分析查询任务
- **PIR**: 匿踪查询组件
- PSI: 实现多种类型隐私求交集算法,包括CM2020, RA2018, ECDH-PSI, ECDH-Multi-PSI等
- MPC: 安全多方计算
- PIR: 匿踪查询核心组件

#### 隐私计算互联互通
**联合建模组件**

- ECDH PSI算法与隐语互联互通
- 2+方的多方联合XGB/LR建模组件(训练 + 离线预测)
- 2+方多方特征工程组件(特征分箱,WOE/IV计算等)
- 多方数据预处理组件

#### 隐私建模组件
**统一网关**

- 支持基于最短路径的消息路由转发
- 支持按节点ID、服务名、机构名进行路由寻址
- 支持服务注册和服务发现

**统一网关SDK**

- 提供Java/Python网关SDK,支持接入网关与其他节点、服务或者机构进行通信
- 可向网关注册服务
- 可从网关拉取服务信息

**专家模式SDK**

- `wedpr-ml-toolkit`: 可通过python sdk向WeDPR隐私计算平台发起各类任务,并获取对应的结果,扩展了WeDPR隐私计算系统功能的可扩展性,可在不侵入式修改系统的前提下,实现数据开发人员的各类数据分析需求

**密码学组件**

- 实现了各种同态算法,包括`Paillier`, `IHC`

- 2+方的多方联合XGB组件(训练 + 离线预测)
- 2+方多方特征工程组件(特征分箱,WOE/IV计算等)
- 预处理组件
4 changes: 2 additions & 2 deletions cpp/cmake/Version.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
set(VERSION "1.0.0")
set(PYTHON_TOOLKIT_VERSION "1.0.0")
set(VERSION "3.0.0")
set(PYTHON_TOOLKIT_VERSION "3.0.0")
2 changes: 1 addition & 1 deletion cpp/tools/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ install_iconv_depend()
install_macos_depends()
{
LOG_INFO "install depends for macos ..."
brew install autoconf nasm lcov
brew install autoconf nasm lcov automake
#install_gsasl_depend "macos"
#install_iconv_depend
LOG_INFO "install depends for macos success ..."
Expand Down
2 changes: 1 addition & 1 deletion cpp/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"kind": "git",
"repository": "https://github.com/FISCO-BCOS/registry",
"baseline": "535c4fc74badd509b94e8a736452fa8a76bff944",
"baseline": "d45a1d99c6b01713252bcb734c03f2c1ac0e44b8",
"packages": [
"openssl",
"bcos-utilities",
Expand Down
17 changes: 15 additions & 2 deletions cpp/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@
{
"name": "jsoncpp",
"version": "1.9.5"
},
{
"name":"gsasl",
"version": "2.2.1-no-gssapi#0"
},
{
"name": "libxml2",
"version": "2.11.5#1"
}
],
"features": {
Expand Down Expand Up @@ -116,10 +124,15 @@
"name": "bcos-boostssl",
"version>=": "3.2.3"
},
{
"name": "libxml2",
"version>=": "2.11.5#1",
"features": ["lzma", "zlib"]
},
"tarscpp",
"tbb",
"libxml2",
"libiconv"
"libiconv",
"gsasl"
]
},
"sdk": {
Expand Down
Loading

0 comments on commit 435d124

Please sign in to comment.