-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathconfig.yml
190 lines (176 loc) · 5.37 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1
setup: true
orbs:
continuation: circleci/[email protected]
parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""
DEPS_Tag:
type: string
default: ""
executors:
linux_x64_executor: # declares a reusable executor
docker:
- image: secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/kuscia-ci:0.6
resource_class: 2xlarge
shell: /bin/bash --login -eo pipefail
linux_aarch64_executor:
docker:
- image: secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/kuscia-ci:0.6
resource_class: arm.2xlarge
shell: /bin/bash --login -eo pipefail
linux_amd:
machine:
image: ubuntu-2404:2024.11.1
shell: /bin/bash --login -eo pipefail
linux_arm:
machine:
image: ubuntu-2204:2024.11.1
resource_class: arm.medium
shell: /bin/bash --login -eo pipefail
commands:
test:
steps:
- checkout
- run:
name: "kuscia test"
command: make test
build_kuscia:
steps:
- checkout
- run:
name: "make build"
command: |
git config --global --add safe.directory ./
make build
DIR="/tmp/build/linux"
mkdir -p $DIR
cp -rf ./build/linux/* $DIR
- persist_to_workspace:
root: /tmp/build
paths:
- linux
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/configuration-reference/#jobs
jobs:
unit-test:
parameters:
executor:
type: string
executor: <<parameters.executor>>
steps:
- checkout
- test
linux_build_kuscia:
parameters:
executor:
type: string
executor: <<parameters.executor>>
steps:
- checkout
- build_kuscia
image_publish:
docker:
- image: cimg/deploy:2023.06.1
shell: /bin/bash --login -eo pipefail
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: /tmp/build
- run:
name: Build image and publish
command: |
set -ex
mv /tmp/build/linux ./build/
IMAGE="secretflow/kuscia"
ALIYUN_IMAGE="secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/kuscia"
if [[ ! -z "${CIRCLE_TAG}" ]]; then
CIRCLETAG=$(echo ${CIRCLE_TAG} | sed 's/v//')
elif [[ "${CIRCLE_BRANCH}" =~ ^release.* ]]; then
CIRCLETAG="latest"
fi
# login kuscia dockerhub registry
docker login -u secretflow -p ${DOCKER_DEPLOY_TOKEN}
docker buildx create --name kuscia --platform linux/arm64,linux/amd64 --use
docker buildx build -t ${IMAGE}:${CIRCLETAG} --platform linux/arm64,linux/amd64 -f ./build/dockerfile/kuscia-anolis.Dockerfile . --push
#docker buildx build -t ${IMAGE}:latest --platform linux/arm64,linux/amd64 -f ./build/dockerfile/kuscia-anolis.Dockerfile . --push
# login kuscia aliyun registry
docker login -u ${ALIYUN_DOCKER_USERNAME} -p ${ALIYUN_DOCKER_PASSWORD} secretflow-registry.cn-hangzhou.cr.aliyuncs.com
#docker buildx build -t ${ALIYUN_IMAGE}:latest --platform linux/arm64,linux/amd64 -f ./build/dockerfile/kuscia-anolis.Dockerfile . --push
docker buildx build -t ${ALIYUN_IMAGE}:${CIRCLETAG} --platform linux/arm64,linux/amd64 -f ./build/dockerfile/kuscia-anolis.Dockerfile . --push
integration_test:
parameters:
executor:
type: executor
executor: << parameters.executor >>
steps:
- checkout
- run:
name: Build image and integration test
command: |
set -ex
make integration_test
# Orchestrate jobs using workflows
# See: https://circleci.com/docs/configuration-reference/#workflows
workflows:
kuscia-workflow:
when:
and:
- not: << pipeline.parameters.GHA_Action >>
- not: << pipeline.parameters.GHA_Meta >>
jobs:
- unit-test:
matrix:
parameters:
executor: [ "linux_x64_executor", "linux_aarch64_executor" ]
- linux_build_kuscia:
matrix:
parameters:
executor: [ "linux_x64_executor", "linux_aarch64_executor" ]
filters:
branches:
only: /^release.*/
tags:
only: /^v.*/
- image_publish:
requires:
- linux_build_kuscia
filters:
branches:
only: /^release.*/
tags:
only: /^v.*/
- integration_test:
matrix:
parameters:
executor: [ "linux_amd", "linux_arm" ]
filters:
branches:
only: /.*/
tags:
only: /.*/
build-kuscia-deps-workflow:
when:
equal: [ "publish_kuscia_deps", << pipeline.parameters.GHA_Meta >> ]
jobs:
- continuation/continue:
configuration_path: .circleci/deps-config.yml
publish-workflow:
when:
equal: [ "publish_pypi", << pipeline.parameters.GHA_Meta >> ]
jobs:
- continuation/continue:
configuration_path: .circleci/release-config.yml