Skip to content

Commit

Permalink
Add github actions (#3)
Browse files Browse the repository at this point in the history
* add github actions

* add licenserc

* python format

* format

* fix lincenserc

* add copyright header

* update template
  • Loading branch information
oeqqwq authored Aug 26, 2024
1 parent 7da1386 commit c518a71
Show file tree
Hide file tree
Showing 22 changed files with 443 additions and 85 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Python Linter
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
python-linter:
uses: secretflow/.github/.github/workflows/python-linter.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/buildifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Bazel files linter
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
bazel-formatting-check:
uses: secretflow/.github/.github/workflows/bazel-linter.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/clang-format-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Run clang-format Linter
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run-clang-format:
uses: secretflow/.github/.github/workflows/clang-format.yml@main
14 changes: 14 additions & 0 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: License Check
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
license-checker:
uses: secretflow/.github/.github/workflows/license-check.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Yaml Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
yaml-linter:
uses: secretflow/.github/.github/workflows/yaml-linter.yml@main
96 changes: 96 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 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.

header: # <1>
license:
spdx-id: Apache-2.0 # <2>
copyright-owner: Ant Group Co., Ltd. # <3>
copyright-year: '2024' # <25>
software-name: secretflow # <4>

pattern: | # <6>
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[s]?://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.
paths: # <7>
- '**'

paths-ignore: # <8>
- '.circleci'
- '.github'
- '**/*.md'
- '**/*.json'
- '**/*.yaml'
- '**/*.yml'
- '**/*.ipynb'
- '**/*.txt'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/*.po'
- '**/*.svg'
- '**/*.rst'
- '**/*.rst_t'
- '**/*.lds'
- '**/*.patch'
- '**/*.mlir'
- '**/*.csv'
- '**/*.tmpl'
- '**/*.config'
- '**/*.conf'
- '**/*.xml'
- 'LICENSE'
- 'NOTICE'
- 'Makefile'
- '.bazelversion'
- '.clang-format'
- '.clang-tidy'
- '.gitattributes'
- '.gitignore'
- '.gitmodules'
- 'pyproject.toml'
- 'setup.cfg'
- 'dataproxy-manager/src/main/java/org/secretflow/dataproxy/manager/connector/rdbms/adaptor'

comment: never # <9>

license-location-threshold: 80 # <10>

language: # <11>
Starlark: # <12>
extensions: #<13>
- ".bazel"
- ".bazelrc"
- "BUILD"
- ".bzl"
- "WORKSPACE"
comment_style_id: PythonStyle # <15>
Cpp:
extensions:
- ".cc"
- ".h"
- ".cu"
comment_style_id: DoubleSlash
Java:
extensions:
- ".java"
comment_style_id: SlashAsterisk
14 changes: 14 additions & 0 deletions build/Dockerfiles/dataproxy.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

FROM secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/secretpad-base-lite:0.3

ENV LANG=C.UTF-8
Expand Down
14 changes: 14 additions & 0 deletions config/application.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

spring:
# profiles:
# active: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

package org.secretflow.dataproxy.common.model.datasource.conn;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

package org.secretflow.dataproxy.common.model.datasource.location;

import org.secretflow.v1alpha1.common.Common;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

package org.secretflow.dataproxy.common.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

/**
* JSON 序列化工具类包
* @author yuexie
Expand Down
14 changes: 14 additions & 0 deletions dataproxy-server/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

spring:
# profiles:
# active: local
Expand Down
17 changes: 16 additions & 1 deletion dataproxy_sdk/python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# 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.


from . import dp_pb2 as proto
from .dp_file_adapter import *

__all__ = [
"DataProxyFileAdapter",
"proto",
]
]
32 changes: 28 additions & 4 deletions dataproxy_sdk/python/dp_file_adapter.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
# 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.


from . import libdataproxy
from . import dp_pb2 as proto


class DataProxyFileAdapter:
def __init__(self, config: proto.DataProxyConfig):
self.data_proxy_file = libdataproxy.DataProxyFile(config.SerializeToString())

def close(self):
self.data_proxy_file.close()

def download_file(self, info: proto.DownloadInfo, file_path: str, file_format: proto.FileFormat):
self.data_proxy_file.download_file(info.SerializeToString(), file_path, file_format)
def download_file(
self, info: proto.DownloadInfo, file_path: str, file_format: proto.FileFormat
):
self.data_proxy_file.download_file(
info.SerializeToString(), file_path, file_format
)

def upload_file(self, info: proto.UploadInfo, file_path: str, file_format: proto.FileFormat):
self.data_proxy_file.upload_file(info.SerializeToString(), file_path, file_format)
def upload_file(
self, info: proto.UploadInfo, file_path: str, file_format: proto.FileFormat
):
self.data_proxy_file.upload_file(
info.SerializeToString(), file_path, file_format
)
17 changes: 16 additions & 1 deletion dataproxy_sdk/python/dp_pb2.py
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
from dataproxy_sdk.proto.data_proxy_pb_pb2 import *
# 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.


from dataproxy_sdk.proto.data_proxy_pb_pb2 import *
Loading

0 comments on commit c518a71

Please sign in to comment.