-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
167 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,22 @@ version: 2.1 | |
setup: true | ||
|
||
orbs: | ||
path-filtering: circleci/[email protected] | ||
path-filtering: circleci/[email protected] | ||
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: "" | ||
enable_regtest: | ||
type: boolean | ||
default: false | ||
|
@@ -31,7 +44,10 @@ parameters: | |
workflows: | ||
run_ut: | ||
when: | ||
not: << pipeline.parameters.enable_regtest >> | ||
and: | ||
- not: << pipeline.parameters.enable_regtest >> | ||
- not: << pipeline.parameters.GHA_Action >> | ||
- not: << pipeline.parameters.GHA_Meta >> | ||
jobs: | ||
- path-filtering/filter: | ||
base-revision: main | ||
|
@@ -58,3 +74,9 @@ workflows: | |
pkg/.* run_regtest true | ||
.bazelrc run_regtest true | ||
.circleci/regtest-config.yml run_regtest true | ||
publish-workflow: | ||
when: | ||
equal: [ "release", << pipeline.parameters.GHA_Event >> ] | ||
jobs: | ||
- continuation/continue: | ||
configuration_path: .circleci/release-config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# Copyright 2023 Ant Group Co., Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/2.0/configuration-reference | ||
version: 2.1 | ||
parameters: | ||
GHA_Actor: | ||
type: string | ||
default: "" | ||
GHA_Action: | ||
type: string | ||
default: "" | ||
GHA_Event: | ||
type: string | ||
default: "" | ||
GHA_Meta: | ||
type: string | ||
default: "" | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs | ||
jobs: | ||
build_binary: | ||
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor | ||
docker: | ||
- image: secretflow/scql-ci:latest | ||
parameters: | ||
resource_class: | ||
type: string | ||
resource_class: << parameters.resource_class >> | ||
shell: /bin/bash --login -eo pipefail | ||
# Add steps to the job | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#steps | ||
steps: | ||
- checkout | ||
- run: | ||
name: "Checkout devtools" | ||
command: git clone https://github.com/secretflow/devtools.git ../devtools | ||
- run: | ||
name: Setup GCS | ||
command: | | ||
echo ${gcs_content} > ../gcs.data | ||
../devtools/bazel_cache_setup.py --in_file=../gcs.data --out_file=gcs.json | ||
- run: | ||
name: "Build" | ||
command: | | ||
make && bazel build //engine/exe:scqlengine -c opt --ui_event_filters=-info,-debug,-warning | ||
- run: | ||
name: "Copy binary" | ||
command: | | ||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then | ||
DIR=/tmp/binary/linux/amd64 | ||
else | ||
DIR=/tmp/binary/linux/arm64 | ||
fi | ||
mkdir -p ${DIR} | ||
cp bazel-bin/engine/exe/scqlengine ${DIR} | ||
cp bin/scdbserver ${DIR} | ||
cp bin/scdbclient ${DIR} | ||
cp bin/broker ${DIR} | ||
cp bin/brokerctl ${DIR} | ||
- persist_to_workspace: | ||
root: "/tmp/binary/linux" | ||
paths: | ||
- "amd64" | ||
- "arm64" | ||
docker_image_publish: | ||
docker: | ||
- image: cimg/deploy:2023.06.1 | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- attach_workspace: | ||
at: /tmp/binary/linux | ||
- run: | ||
name: Build Docker image | ||
command: | | ||
# login docker | ||
# docker login -u secretflow -p ${DOCKER_DEPLOY_TOKEN} | ||
# Build image | ||
cd docker | ||
cp /tmp/binary . | ||
docker buildx build --platform linux/arm64,linux/amd64 -f scql-ubuntu.Dockerfile . | ||
# Invoke jobs via workflows | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows | ||
workflows: | ||
publish: | ||
jobs: | ||
- build_binary: | ||
matrix: | ||
parameters: | ||
resource_class: ["2xlarge", "arm.2xlarge"] | ||
- docker_image_publish: | ||
requires: | ||
- build_binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2023 Ant Group Co., Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
name: "Publish Python Package" | ||
on: | ||
release: | ||
types: [published] | ||
permissions: read-all | ||
jobs: | ||
trigger-circleci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: secretflow-scql-deploy | ||
id: secretflow-scql-deploy | ||
uses: CircleCI-Public/[email protected] | ||
env: | ||
CCI_TOKEN: ${{ secrets.CCI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters