Skip to content

Commit

Permalink
repo-sync-2024-08-05T17:15:42+0800 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongtianq authored Aug 5, 2024
1 parent 38e07f1 commit 7003b88
Show file tree
Hide file tree
Showing 58 changed files with 4,159 additions and 60 deletions.
68 changes: 60 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ parameters:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
linux_ut:
cm_ut:
# 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/trustedflow-dev-ubuntu22.04:latest
- image: secretflow/trustflow-dev-ubuntu22.04:latest
resource_class: 2xlarge+
shell: /bin/bash --login -eo pipefail
# Add steps to the job
Expand All @@ -62,7 +62,7 @@ jobs:
cargo build
cargo test
docker_image_publish:
cm_docker_image_publish:
docker:
- image: cimg/deploy:2023.06.1
resource_class: 2xlarge+
Expand Down Expand Up @@ -110,7 +110,49 @@ jobs:
exit 1
;;
esac
cm_sdk_ut:
# 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/trustflow-dev-ubuntu22.04:latest
resource_class: large
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
shell: /bin/bash --login -eo pipefail
steps:
- checkout
- run:
name: "unit test"
command: |
source /root/miniconda3/etc/profile.d/conda.sh
conda create -n test python=3.10.14 -y
conda activate test
cd capsule-manager-sdk/python
export PYTHONPATH=.:$PYTHONPATH
pip install -r dev-requirements.txt
mkdir test-results
pytest --junitxml=test-results/junit-report.xml
- store_test_results:
path: capsule-manager-sdk/python/test-results

cm_sdk_publish:
docker:
- image: secretflow/trustflow-dev-ubuntu22.04:latest
resource_class: large
shell: /bin/bash --login -eo pipefail
steps:
- checkout
- run:
name: "build package and publish"
command: |
source /root/miniconda3/etc/profile.d/conda.sh
conda create -n build python=3.10.14 -y
conda activate build
python3 -m pip install twine auditwheel patchelf
cd capsule-manager-sdk/python
python3 setup.py bdist_wheel && twine check dist/*
python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
Expand All @@ -119,12 +161,22 @@ workflows:
when:
not: << pipeline.parameters.GHA_Action >>
jobs:
- linux_ut
docker-image-publish-workflow:
- cm_ut
- cm_sdk_ut:
filters:
paths:
only:
- "capsule-manager-sdk/*"
cm-docker-image-publish-workflow:
when:
and:
- equal: ["docker_image_publish", << pipeline.parameters.GHA_Action >>]
- equal: ["cm_docker_image_publish", << pipeline.parameters.GHA_Action >>]
- exits: << pipeline.parameters.GHA_Platform >>
- exits: << pipeline.parameters.GHA_Version >>
jobs:
- docker_image_publish
- cm_docker_image_publish
cm-sdk-publish-workflow:
when:
- equal: ["cm_sdk_publish", << pipeline.parameters.GHA_Action >>]
jobs:
- cm_sdk_publish
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/issue_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: TrustedFlow Issue Template
name: TrustFlow Issue Template
description: Thank you for reporting the issue!
body:
- type: dropdown
Expand All @@ -34,7 +34,7 @@ body:
id: source
attributes:
label: Source
description: TrustedFlow installed from
description: TrustFlow installed from
options:
- binary
- source
Expand Down
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
edition = "2021"

# Line endings will be converted to \n.
newline_style = "Unix"
newline_style = "Unix"
31 changes: 22 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]

members = [
"bin/grpc-as",
members = [
"bin/grpc-as",
"bin/http-as",
"capsule-manager"
]
4 changes: 2 additions & 2 deletions bin/grpc-as/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grpc-as"
version = "0.4.0"
version = "0.1.0"
edition = "2021"

[features]
Expand All @@ -13,4 +13,4 @@ tonic = { version = "0.9.2", features = ["tls"] }
log = "0.4"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
openssl-sys = "0.9"
openssl = { version = "0.10"}
openssl = { version = "0.10"}
3 changes: 3 additions & 0 deletions bin/grpc-as/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client_ca_pem = fs::read_to_string(&path).unwrap().as_bytes().to_vec();
client_pem_vec.append(&mut client_ca_pem);
}
"read client ca pem {:?}",
std::str::from_utf8(&client_pem_vec)?
);

let client_ca_cert = tonic::transport::Certificate::from_pem(client_pem_vec);
let tls_config = tonic::transport::ServerTlsConfig::new()
Expand Down
16 changes: 16 additions & 0 deletions bin/http-as/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "http-as"
version = "0.1.0"
edition = "2021"

[features]
production = []

[dependencies]
axum = "0.7.5"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
capsule_manager = {path = "../../capsule-manager"}
sdc_apis = "0.2.1-dev20240222"
openssl-sys = "0.9"
openssl = { version = "0.10"}
log = "0.4"
Loading

0 comments on commit 7003b88

Please sign in to comment.