Skip to content

Commit

Permalink
chore: use bazelisk (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
tongke6 authored Mar 3, 2025
1 parent a77a451 commit 866f428
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .circleci/regtest-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
- run:
name: "Build binary"
command: |
set +e
set +e
mkdir -p image
cp docker/scql-ubuntu.Dockerfile image
docker run -d -it --name scql-dev -v $(pwd):/home/admin/dev/ -w /home/admin/dev --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true --entrypoint=bash secretflow/scql-ci:latest
docker exec -it scql-dev bash -c "make && bazel build //engine/exe:scqlengine -c opt --ui_event_filters=-info,-debug,-warning"
docker exec -it scql-dev bash -c "make && bazelisk build //engine/exe:scqlengine -c opt --ui_event_filters=-info,-debug,-warning"
MACHINE_TYPE=`arch`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
cd .ci/docker-compose
python3 -m pip install -r requirements.txt
python3 setup.py
docker compose -p regtest up -d
docker compose -p regtest up -d
docker ps | grep regtest
- run:
name: "Run regtest"
Expand Down
4 changes: 2 additions & 2 deletions .circleci/unittest-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
command: |
set +e
declare -i test_status
bazel --host_jvm_args=-Xmx8g test //engine/... -c opt --jobs=32 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]}
bazelisk --host_jvm_args=-Xmx8g test //engine/... -c opt --jobs=32 --ui_event_filters=-info,-debug,-warning --test_output=errors | tee test_result.log; test_status=${PIPESTATUS[0]}
sh ../devtools/rename-junit-xml.sh
find bazel-bin/ -executable -type f -name "*_test" -print0 | xargs -0 tar -cvzf test_binary.tar.gz
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
command: |
set +e
declare -i test_status
bazel --host_jvm_args=-Xmx8g test //engine/... --jobs=32 --ui_event_filters=-info,-debug,-warning --test_output=errors| tee test_result.log; test_status=${PIPESTATUS[0]}
bazelisk --host_jvm_args=-Xmx8g test //engine/... --jobs=32 --ui_event_filters=-info,-debug,-warning --test_output=errors| tee test_result.log; test_status=${PIPESTATUS[0]}
sh ../devtools/rename-junit-xml.sh
find bazel-bin/ -perm +111 -type f -name "*_test" -print0 | xargs -0 tar -cvzf test_binary.tar.gz
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ docker exec -it scql-dev-$(whoami) bash
```sh

# build SCQL engine as release
bazel build //engine/exe:scqlengine -c opt
bazelisk build //engine/exe:scqlengine -c opt

# run unittests for SCQL engine
bazel test //engine/...
bazelisk test //engine/...

# build with address sanitizer
bazel build --config=asan //engine/exe:scqlengine
bazelisk build --config=asan //engine/exe:scqlengine

# build scdb code
make
Expand All @@ -86,4 +86,4 @@ make doc

# Build documentation in Chinese
make doc-cn
```
```
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ binary: clean prepare fmt vet gogenerate
$(eval SCQL_VERSION := $(shell bash ${PWD}/version_build.sh))
echo "Binary version: ${SCQL_VERSION}"
GOBIN=${PWD}/bin go install -ldflags "-X main.version=${SCQL_VERSION}" ./cmd/...
bazel --host_jvm_args=-Xmx8g build //engine/exe:scqlengine -c opt --jobs=32
bazelisk --host_jvm_args=-Xmx8g build //engine/exe:scqlengine -c opt --jobs=32
bash ${PWD}/version_build.sh -r

pb: clean
Expand Down Expand Up @@ -89,5 +89,3 @@ GO-package:
GOBIN=${TOOLBIN} go install github.com/mattn/goveralls@latest && \
GOBIN=${TOOLBIN} go install github.com/rakyll/gotest@latest && \
GOBIN=${TOOLBIN} go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest


2 changes: 1 addition & 1 deletion api/generate_proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#
set -e
bazel build --remote_cache="" //api:scql_go_proto //api:spu_go_proto
bazelisk build --remote_cache="" //api:scql_go_proto //api:spu_go_proto
mkdir -p pkg/proto-gen/scql
proto_gen_package=github.com/secretflow/scql/pkg/proto-gen
# copy files execpt spu.pb.go
Expand Down
2 changes: 1 addition & 1 deletion contrib/agent/proto/generate_proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# limitations under the License.
#
set -e
bazel build --remote_cache="" //contrib/agent/proto:task_config_go_proto
bazelisk build --remote_cache="" //contrib/agent/proto:task_config_go_proto
cp -f bazel-bin/contrib/agent/proto/task_config_go_proto_/github.com/secretflow/scql/contrib/agent/proto/task_config.pb.go contrib/agent/proto/task_config.pb.go
chmod -R -x+X contrib/agent/proto

0 comments on commit 866f428

Please sign in to comment.