Skip to content

Commit

Permalink
Merge pull request #1 from YanZhuangz/feat/sync-main-0815
Browse files Browse the repository at this point in the history
repo-sync-2024-08-15T14:19:42+0800
  • Loading branch information
UniqueMarvin authored Aug 16, 2024
2 parents 2606ace + 24ec7b7 commit e38d723
Show file tree
Hide file tree
Showing 231 changed files with 20,042 additions and 26 deletions.
53 changes: 53 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2024 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.

common --experimental_repo_remote_exec
common --experimental_remote_download_regex='.*\/dataproxy_sdk$|.*\/arrow$'


build --incompatible_new_actions_api=false
build --copt=-fdiagnostics-color=always
build --enable_platform_specific_config

build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17

build:avx --copt=-mavx
build:avx --host_copt=-mavx
build:avx --copt=-DCHECK_AVX
build:avx --host_copt=-DCHECK_AVX

# Binary safety flags
build --copt=-fPIC
build --copt=-fstack-protector-strong
build:linux --copt=-Wl,-z,noexecstack
build:macos --copt=-Wa,--noexecstack

test --keep_going
test --test_output=errors
test --test_timeout=1800

# static link runtime libraries on Linux
build:linux --action_env=BAZEL_LINKOPTS=-static-libstdc++:-static-libgcc
build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-l%:libgcc.a

# platform specific config
# Bazel will automatic pick platform config since we have enable_platform_specific_config set
build:linux --copt=-fopenmp
build:linux --linkopt=-fopenmp
build:macos --copt="-Xpreprocessor -fopenmp"
build:macos --copt=-Wno-unused-command-line-argument
build:macos --features=-supports_dynamic_linker
build:macos --macos_minimum_os=12.0
build:macos --host_macos_minimum_os=12.0
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.5.0
103 changes: 103 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright 2024 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.

version: 2.1

parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""

executors:
openjdk-executor-17:
docker:
- image: cimg/openjdk:17.0

jobs:
build-and-push:
executor: openjdk-executor-17
steps:
- checkout
- setup_remote_docker
- run:
name: Build Jar
command: make build
- run:
name: Push to Docker Hub
command: |
# login dataproxy dockerhub registry
docker login -u ${DOCKER_DEPLOY_USERNAME} -p ${DOCKER_DEPLOY_TOKEN}
# login dataproxy aliyun registry
docker login -u ${ALIYUN_DOCKER_USERNAME} -p ${ALIYUN_DOCKER_PASSWORD} secretflow-registry.cn-hangzhou.cr.aliyuncs.com
CIRCLETAG=$(echo ${CIRCLE_TAG} | sed 's/v//')
BUILDER_EXISTS=$(
docker buildx inspect dataproxy_image_buildx >/dev/null 2>&1
echo $?
)
if [ "$BUILDER_EXISTS" -eq 0 ]; then
echo "existing buildx builder: dataproxy_image_buildx"
docker buildx use dataproxy_image_buildx
else
echo "creating new buildx builder: dataproxy_image_buildx"
docker buildx create --name dataproxy_image_buildx --use
fi
remote_image="secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/dataproxy:latest"
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag "${remote_image}" \
-f ./build/Dockerfiles/dataproxy.Dockerfile . \
--push
remote_image="secretflow/dataproxy:latest"
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag "${remote_image}" \
-f ./build/Dockerfiles/dataproxy.Dockerfile . \
--push
remote_image="secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/dataproxy:${CIRCLETAG}"
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag "${remote_image}" \
-f ./build/Dockerfiles/dataproxy.Dockerfile . \
--push
remote_image="secretflow/dataproxy:${CIRCLETAG}"
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag "${remote_image}" \
-f ./build/Dockerfiles/dataproxy.Dockerfile . \
--push
workflows:
build-deploy:
jobs:
- build-and-push:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use the Google style in this project.
BasedOnStyle: Google

IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: "^<.*"
Priority: 2
- Regex: '.*\.pb\.h"$'
Priority: 5
- Regex: '^"secretflow_serving.*'
Priority: 4
- Regex: '^".*'
Priority: 3
78 changes: 78 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Checks: "abseil-cleanup-ctad,
abseil-faster-strsplit-delimiter,
abseil-duration-*,
abseil-no-namespace,
abseil-redundant-strcat-calls,
abseil-str-cat-append,
abseil-string-find-startswith,
abseil-upgrade-duration-conversions
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions, # too many false positives around `std::size_t` vs. `*::difference_type`.
google-build-using-namespace,
google-explicit-constructor,
google-global-names-in-headers,
google-readability-casting,
google-runtime-int,
google-runtime-operator,
misc-unused-using-decls,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-return-braced-init-list, # can hurt readability
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-else-after-return,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-readability-magic-numbers,
-readability-named-parameter"

CheckOptions:
- key: bugprone-argument-comment.StrictMode
value: 1

- key: bugprone-dangling-handle.HandleClasses
value: "std::basic_string_view;std::experimental::basic_string_view;absl::string_view"

- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: 1

# Ignore GoogleTest function macros.
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: "(TEST|TEST_F|TEST_P|INSTANTIATE_TEST_SUITE_P|MOCK_METHOD|TYPED_TEST)"

- key: readability-identifier-naming.ClassCase
value: "CamelCase"

- key: readability-identifier-naming.EnumCase
value: "CamelCase"

- key: readability-identifier-naming.EnumConstantCase
value: "CamelCase"

- key: readability-identifier-naming.ParameterCase
value: "lower_case"

- key: readability-identifier-naming.PrivateMemberCase
value: "lower_case"

- key: readability-identifier-naming.PrivateMemberSuffix
value: "_"

- key: readability-identifier-naming.StructCase
value: "CamelCase"

- key: readability-identifier-naming.TypeAliasCase
value: "CamelCase"

- key: readability-identifier-naming.UnionCase
value: "CamelCase"

- key: readability-identifier-naming.FunctionCase
value: "CamelBack"

- key: performance-unnecessary-value-param.AllowedTypes
value: PtBufferView
11 changes: 11 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: CLA Assistant
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
jobs:
CLAssistant:
uses: secretflow/.github/.github/workflows/cla.yml@main
secrets: inherit
84 changes: 60 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,60 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
**/.DS_Store

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
!**/src/main/**/build/
!**/src/test/**/build/
dataproxy-api/**/kusciaapi/
dataproxy-api/**/common/

### VS Code ###
.vscode/

tmp/
db/
log/
build/**/settings.xml
docs/_build

.java-version
dataproxy_sdk/MODULE.bazel
dataproxy_sdk/MODULE.bazel.lock

# clangd cache
.cache
external

# cmake related
abseil-cpp
bld
bld.install
CMakeCache.txt
cmake_install.cmake
CTestTestfile.cmake

# bazel
bazel-*
13 changes: 13 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 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.
7 changes: 7 additions & 0 deletions LEGAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Legal Disclaimer

Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail.

法律免责声明

关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
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.
limitations under the License.
Loading

0 comments on commit e38d723

Please sign in to comment.