Skip to content

Commit 8929966

Browse files
committed
add docker ci
1 parent 9692afc commit 8929966

File tree

9 files changed

+203
-14
lines changed

9 files changed

+203
-14
lines changed

.github/workflows/cpp_full_node_workflow.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,18 @@ jobs:
6969
export CXX='g++-10'
7070
sudo bash -x cpp/tools/install_depends.sh -o ubuntu
7171
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 ../
72-
df -lh
72+
echo "Disk usage before delete files: "`df -lh`
7373
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/*
7474
du -sch ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src/*
7575
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/grpc/src
7676
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/grpc/*-dbg
77+
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/krb5/src
78+
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/gsasl/src
79+
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/protobuf/src
80+
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/wedprcrypto/src
7781
rm -rf ${{ env.VCPKG_ROOT }}buildtrees/openssl/src
78-
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/openssl/*-dbg
7982
rm -rf ${{ env.VCPKG_ROOT }}/buildtrees/*/*-dbg
80-
df -lh
83+
echo "Disk usage after delete files: "`df -lh`
8184
make -j3
8285
- name: Build for macOS
8386
if: runner.os == 'macOS'
@@ -120,8 +123,8 @@ jobs:
120123
if: always()
121124
uses: actions/upload-artifact@v4
122125
with:
123-
name: autoconf-x64-osx-err.log
124-
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/autoconf-x64-osx-err.log
126+
name: build-x64-osx-dbg-err.log
127+
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
125128

126129

127130
build_centos:
@@ -179,6 +182,10 @@ jobs:
179182
with:
180183
toolchain: nightly-2022-07-28
181184
override: true
185+
- name: Prepare vcpkg
186+
if: runner.os != 'Windows'
187+
uses: friendlyanon/setup-vcpkg@v1
188+
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
182189
- name: Check disk space
183190
run: df . -h
184191
- name: Free disk space
@@ -200,7 +207,7 @@ jobs:
200207
rm -rf python
201208
mkdir -p cpp/build
202209
cd cpp/build
203-
cmake3 -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
210+
cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
204211
- name: FreeDiskSpace
205212
run: |
206213
df -lh
@@ -233,3 +240,9 @@ jobs:
233240
with:
234241
name: ppc-gateway-service-x64
235242
path: ./cpp/build/bin/ppc-gateway-service
243+
- name: Publish Error macos
244+
if: always()
245+
uses: actions/upload-artifact@v4
246+
with:
247+
name: vcpkg-manifest-install.log
248+
path: /__w/WeDPR-Component/WeDPR-Component/cpp/build/vcpkg-manifest-install.log

.github/workflows/docker.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: WeDPR-Component docker ci
2+
on:
3+
push:
4+
paths-ignore:
5+
- "docs/**"
6+
- "Changelog.md"
7+
- "README.md"
8+
tags:
9+
- 'v3.*.*'
10+
pull_request:
11+
paths-ignore:
12+
- "docs/**"
13+
- "Changelog.md"
14+
- "README.md"
15+
release:
16+
types: [prereleased]
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
22+
env:
23+
RUST_BACKTRACE: 1
24+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
25+
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
26+
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
27+
28+
jobs:
29+
build-docker:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
- name: Get branch name
35+
uses: nelonoel/[email protected]
36+
- name: Fetch tag
37+
run: |
38+
git fetch --tags --force
39+
- name: Login to Docker Hub
40+
uses: docker/login-action@v1
41+
with:
42+
username: ${{ secrets.DOCKER_FISCOPR_USER }}
43+
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}
44+
- name: Get git tag
45+
uses: little-core-labs/[email protected]
46+
id: tag_data
47+
with:
48+
tagRegex: (.*) # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
49+
tagRegexGroup: 1 # Optional. Default is 1.
50+
# the model image
51+
- name: Build and Push model images
52+
run: |
53+
[[ ${{github.ref}} == */tags/* ]] && MODEL_DOCKER_TAG="${GIT_TAG_NAME}" || MODEL_DOCKER_TAG="${BRANCH_NAME}"
54+
MODEL_DOCKER_TAG="fiscoorg/wedpr-model-service:${MODEL_DOCKER_TAG}"
55+
echo "* Begin to build model docker: ${MODEL_DOCKER_TAG}"
56+
cd WeDPR-Component/docker-files/model/model
57+
docker build -t ${MODEL_DOCKER_TAG} .
58+
echo "* Build model docker: ${MODEL_DOCKER_TAG} success"
59+
docker push ${MODEL_DOCKER_TAG}
60+
echo "* Push model docker: ${MODEL_DOCKER_TAG} success"
61+
# the wedpr-gateway-service image
62+
- name: Build and Push wedpr-gateway-service images
63+
run: |
64+
[[ ${{github.ref}} == */tags/* ]] && GW_DOCKER_TAG="${GIT_TAG_NAME}" || GW_DOCKER_TAG="${BRANCH_NAME}"
65+
GW_DOCKER_TAG="fiscoorg/wedpr-gateway-service:${GW_DOCKER_TAG}"
66+
echo "* Begin to build wedpr-gateway-service docker: ${GW_DOCKER_TAG}"
67+
cd WeDPR-Component/docker-files/cpp/
68+
docker build --target wedpr-gateway-service -t ${GW_DOCKER_TAG} .
69+
echo "* Build wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
70+
docker push ${GW_DOCKER_TAG}
71+
echo "* Push wedpr-gateway-service docker: ${GW_DOCKER_TAG} success"
72+
# the wedpr-pro-node-service image
73+
- name: Build and Push wedpr-pro-node-service images
74+
[[ ${{github.ref}} == */tags/* ]] && NODE_DOCKER_TAG="${GIT_TAG_NAME}" || NODE_DOCKER_TAG="${BRANCH_NAME}"
75+
NODE_DOCKER_TAG="fiscoorg/wedpr-pro-node-service:${NODE_DOCKER_TAG}"
76+
echo "* Begin to build wedpr-pro-node-service docker: ${NODE_DOCKER_TAG}"
77+
cd WeDPR-Component/docker-files/cpp/
78+
docker build --target wedpr-pro-node-service -t ${NODE_DOCKER_TAG} .
79+
echo "* Build wedpr-pro-node-service docker: ${NODE_DOCKER_TAG} success"
80+
docker push ${NODE_DOCKER_TAG}
81+
echo "* Push wedpr-pro-node-service docker: ${NODE_DOCKER_TAG} success"
82+
# the wedpr-mpc-service image
83+
- name: Build and Push wedpr-mpc-service images
84+
[[ ${{github.ref}} == */tags/* ]] && MPC_DOCKER_TAG="${GIT_TAG_NAME}" || MPC_DOCKER_TAG="${BRANCH_NAME}"
85+
MPC_DOCKER_TAG="fiscoorg/wedpr-mpc-service:${MPC_DOCKER_TAG}"
86+
echo "* Begin to build wedpr-mpc-service docker: ${MPC_DOCKER_TAG}"
87+
cd WeDPR-Component/docker-files/cpp/
88+
docker build --target wedpr-mpc-service -t ${MPC_DOCKER_TAG} .
89+
echo "* Build wedpr-mpc-service docker: ${MPC_DOCKER_TAG} success"
90+
docker push ${MPC_DOCKER_TAG}
91+
echo "* Push wedpr-mpc-service docker: ${MPC_DOCKER_TAG} success"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Manual trigger wedpr-model-service-base-image docker image build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
logLevel:
7+
description: 'Log level'
8+
required: true
9+
default: 'warning'
10+
tags:
11+
description: 'the input tag'
12+
13+
jobs:
14+
manual-build-model-base-docker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Get branch name
20+
uses: nelonoel/[email protected]
21+
- name: Fetch tag
22+
run: |
23+
git fetch --tags --force
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v1
26+
with:
27+
username: ${{ secrets.DOCKER_FISCOPR_USER }}
28+
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}
29+
30+
# the model image
31+
- name: Build and Push wedpr-model-service-base-image images
32+
run: |
33+
echo "* Manual build wedpr-model-service-base-image image, docker version: ${{ github.event.inputs.tags }}"
34+
DOCKER_TAG="wedpr-model-service-base-image:${{ github.event.inputs.tags }}"
35+
echo "* Begin to build ${DOCKER_TAG}"
36+
cd WeDPR-Component/docker-files/model/base
37+
docker build docker build -t ${DOCKER_TAG} .
38+
echo "* Build ${DOCKER_TAG} success"
39+
docker push ${DOCKER_TAG}
40+
echo "* Push ${DOCKER_TAG} success"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Manual trigger vcpkg-cache docker image build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
logLevel:
7+
description: 'Log level'
8+
required: true
9+
default: 'warning'
10+
tags:
11+
description: 'the input tag'
12+
13+
jobs:
14+
manual-build-vcpkg-cache-docker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Get branch name
20+
uses: nelonoel/[email protected]
21+
- name: Fetch tag
22+
run: |
23+
git fetch --tags --force
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v1
26+
with:
27+
username: ${{ secrets.DOCKER_FISCOPR_USER }}
28+
password: ${{ secrets.DOCKER_FISCOPR_TOKEN }}
29+
30+
# the model image
31+
- name: Build and Push wedpr-component-vcpkg-cache images
32+
run: |
33+
echo "* Manual build wedpr-component-vcpkg-cache image, docker version: ${{ github.event.inputs.tags }}"
34+
DOCKER_TAG=wedpr-component-vcpkg-cache:${{ github.event.inputs.tags }}
35+
echo "* Begin to build ${DOCKER_TAG}"
36+
cd WeDPR-Component/docker-files/cpp/vcpkg
37+
docker build docker build -t ${DOCKER_TAG} .
38+
echo "* Build ${DOCKER_TAG} success"
39+
docker push ${DOCKER_TAG}
40+
echo "* Push ${DOCKER_TAG} success"

cpp/vcpkg-configuration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"registries": [
33
{
44
"kind": "git",
5-
"repository": "https://github.com/FISCO-BCOS/registry",
6-
"baseline": "535c4fc74badd509b94e8a736452fa8a76bff944",
5+
"repository": "https://mirror.ghproxy.com/github.com/FISCO-BCOS/registry",
6+
"baseline": "d45a1d99c6b01713252bcb734c03f2c1ac0e44b8",
77
"packages": [
88
"openssl",
99
"bcos-utilities",

cpp/vcpkg.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
{
5252
"name": "jsoncpp",
5353
"version": "1.9.5"
54+
},
55+
{
56+
"name":"gsasl",
57+
"version": "2.2.1-no-gssapi#0"
5458
}
5559
],
5660
"features": {
@@ -119,7 +123,8 @@
119123
"tarscpp",
120124
"tbb",
121125
"libxml2",
122-
"libiconv"
126+
"libiconv",
127+
"gsasl"
123128
]
124129
},
125130
"sdk": {

docker-files/cpp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM wedpr_component_vcpkg_cache:latest as builder
1+
FROM wedpr-component-vcpkg-cache:latest as builder
22

33
LABEL maintainer [email protected]
44

docker-files/cpp/vcpkg/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04 as wedpr_component_vcpkg_cache
1+
FROM ubuntu:18.04 as wedpr-component-vcpkg-cache
22

33
LABEL maintainer [email protected]
44

docker-files/cpp/vcpkg/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
echo "* build image: wedpr_component_vcpkg_cache, branch: ${1}"
3-
docker build --build-arg SOURCE_BRANCH=${1} -t wedpr_component_vcpkg_cache .
4-
echo "* build image: wedpr_component_vcpkg_cache success, branch: ${1}"
2+
echo "* build image: wedpr-component-vcpkg-cache, branch: ${1}"
3+
docker build --build-arg SOURCE_BRANCH=${1} -t wedpr-component-vcpkg-cache .
4+
echo "* build image: wedpr-component-vcpkg-cache success, branch: ${1}"

0 commit comments

Comments
 (0)