-
Notifications
You must be signed in to change notification settings - Fork 45
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
1 parent
342226b
commit 54aaf68
Showing
3 changed files
with
28 additions
and
80 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 |
---|---|---|
|
@@ -22,97 +22,39 @@ orbs: | |
path-filtering: circleci/[email protected] | ||
|
||
parameters: | ||
run-regtest: | ||
enable_regtest: | ||
type: boolean | ||
default: false | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs | ||
jobs: | ||
linux_regtest: | ||
machine: | ||
image: ubuntu-2004:2022.07.1 | ||
resource_class: 2xlarge | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: "Restore engine cache" | ||
key: engine-regtest-build-{{ arch }}- | ||
- run: | ||
name: "Checkout devtools" | ||
command: git clone https://github.com/secretflow/devtools.git | ||
- run: | ||
name: Decompress cache | ||
command: sh devtools/decompress-build-cache.sh engine_regtest_cache | ||
- run: | ||
name: "Build binary" | ||
command: | | ||
set +e | ||
mkdir -p image | ||
cp docker/scql.Dockerfile image | ||
docker run -d -it --name scql-dev -v $(pwd):/home/admin/dev/ -v ~/.cache/engine_regtest_cache:/root/.cache/engine_regtest_cache -w /home/admin/dev --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true secretflow/release-ci:latest | ||
docker exec -it scql-dev bash -c "make && bazel build //engine/... -c opt --ui_event_filters=-info,-debug,-warning --disk_cache=~/.cache/engine_regtest_cache" | ||
docker cp scql-dev:/home/admin/dev/bazel-bin/engine/exe/scqlengine image | ||
docker cp scql-dev:/home/admin/dev/bin/scdbserver image | ||
docker cp scql-dev:/home/admin/dev/bin/scdbclient image | ||
docker stop scql-dev && docker rm scql-dev | ||
- run: | ||
name: Cleanup and compress cache | ||
command: | | ||
sh devtools/clean_disk_cache.sh ~/.cache/engine_regtest_cache | ||
sh devtools/compress-build-cache.sh engine_regtest_cache | ||
- save_cache: | ||
key: engine-regtest-build-{{ arch }}-{{ .Environment.CIRCLE_BUILD_NUM }} | ||
paths: | ||
- ~/.cache/engine_regtest_cache.tar.gz | ||
- run: | ||
name: "Build image" | ||
command: | | ||
cd image | ||
docker build -f scql.Dockerfile -t scql:latest . | ||
- run: | ||
name: "Deploy image" | ||
command: | | ||
set +e | ||
cd .ci/docker-compose | ||
docker compose -p regtest up -d | ||
docker ps | grep regtest | ||
- run: | ||
name: "Run regtest" | ||
command: | | ||
set +e | ||
sleep 1m | ||
export SKIP_CONCURRENT_TEST=true | ||
export $(grep -v '^#' .ci/docker-compose/.env | xargs) | ||
go test ./cmd/regtest/... -v -count=1 -timeout=30m | ||
# Invoke jobs via workflows | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows | ||
workflows: | ||
run_ut: | ||
when: | ||
not: << pipeline.parameters.run-regtest >> | ||
not: << pipeline.parameters.enable_regtest >> | ||
jobs: | ||
- path-filtering/filter: | ||
base-revision: main | ||
config-path: .circleci/unittest-config.yml | ||
mapping: | | ||
api/.* build-and-run true | ||
bazel/.* build-and-run true | ||
cmd/.* build-and-run true | ||
engine/.* build-and-run true | ||
pkg/.* build-and-run true | ||
.bazelrc build-and-run true | ||
api/.* run_unittest true | ||
bazel/.* run_unittest true | ||
cmd/.* run_unittest true | ||
engine/.* run_unittest true | ||
pkg/.* run_unittest true | ||
.circleci/.* run_unittest true | ||
.bazelrc run_unittest true | ||
run_regtest: | ||
when: << pipeline.parameters.run-regtest >> | ||
when: << pipeline.parameters.enable_regtest >> | ||
jobs: | ||
- path-filtering/filter: | ||
base-revision: main | ||
config-path: .circleci/regtest-config.yml | ||
mapping: | | ||
api/.* build-and-run true | ||
bazel/.* build-and-run true | ||
cmd/.* build-and-run true | ||
engine/.* build-and-run true | ||
pkg/.* build-and-run true | ||
.bazelrc build-and-run true | ||
api/.* run_regtest true | ||
bazel/.* run_regtest true | ||
cmd/.* run_regtest true | ||
engine/.* run_regtest true | ||
pkg/.* run_regtest true | ||
.circleci/.* run_regtest true | ||
.bazelrc run_regtest true |
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
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