Skip to content

Commit a792ff3

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

File tree

7 files changed

+189
-8
lines changed

7 files changed

+189
-8
lines changed

.github/workflows/cpp_full_node_workflow.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ jobs:
120120
if: always()
121121
uses: actions/upload-artifact@v4
122122
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
123+
name: build-x64-osx-dbg-err.log
124+
path: /Users/runner/work/WeDPR-Component/WeDPR-Component/vcpkg/buildtrees/gsasl/build-x64-osx-dbg-err.log
125125

126126

127127
build_centos:
@@ -179,6 +179,10 @@ jobs:
179179
with:
180180
toolchain: nightly-2022-07-28
181181
override: true
182+
- name: Prepare vcpkg
183+
if: runner.os != 'Windows'
184+
uses: friendlyanon/setup-vcpkg@v1
185+
with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 }
182186
- name: Check disk space
183187
run: df . -h
184188
- name: Free disk space
@@ -200,7 +204,7 @@ jobs:
200204
rm -rf python
201205
mkdir -p cpp/build
202206
cd cpp/build
203-
cmake3 -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
207+
cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DTESTS=ON ../
204208
- name: FreeDiskSpace
205209
run: |
206210
df -lh
@@ -233,3 +237,9 @@ jobs:
233237
with:
234238
name: ppc-gateway-service-x64
235239
path: ./cpp/build/bin/ppc-gateway-service
240+
- name: Publish Error macos
241+
if: always()
242+
uses: actions/upload-artifact@v4
243+
with:
244+
name: vcpkg-manifest-install.log
245+
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"

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)