Skip to content

Commit

Permalink
repo sync (#236)
Browse files Browse the repository at this point in the history
* repo-sync-2025-01-14T10:53:24+0800

* repo-sync-2025-01-14T14:10:30+0800

* repo-sync-2025-01-14T14:46:56+0800

* repo-sync-2025-01-14T15:08:00+0800

* repo-sync-2025-01-14T15:12:10+0800

* repo-sync-2025-01-14T16:30:46+0800

* repo-sync-2025-01-14T19:22:17+0800
  • Loading branch information
huocun-ant authored Jan 14, 2025
1 parent 8ead92f commit e063011
Show file tree
Hide file tree
Showing 125 changed files with 14,320 additions and 1,267 deletions.
4 changes: 2 additions & 2 deletions .circleci/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
name: "Copy binary"
command: |
mkdir -p /tmp/binary/x86
cp bazel-bin/psi/main /tmp/binary/x86
cp bazel-bin/psi/apps/psi_launcher/main /tmp/binary/x86
- persist_to_workspace:
root: "/tmp/binary"
paths:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
name: "Copy binary"
command: |
mkdir -p /tmp/binary/arm
cp bazel-bin/psi/main /tmp/binary/arm
cp bazel-bin/psi/apps/psi_launcher/main /tmp/binary/arm
- persist_to_workspace:
root: "/tmp/binary"
paths:
Expand Down
8 changes: 5 additions & 3 deletions LEGAL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Legal Disclaimer
# 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.
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.

法律免责声明

关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "gflags", version = "2.2.2")
bazel_dep(name = "rapidjson", version = "1.1.0.bcr.20241007")
bazel_dep(name = "boost.math", version = "1.83.0")
bazel_dep(name = "boost.uuid", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.algorithm", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.multiprecision", version = "1.83.0")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
Expand Down
188 changes: 96 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,97 +22,96 @@ In the following example, we are going to run PSI at a single host.

2. Prepare data and config.

receiver.config:

```json
{
"psi_config": {
"protocol_config": {
"protocol": "PROTOCOL_RR22",
"role": "ROLE_RECEIVER",
"broadcast_result": true
},
"input_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/receiver/receiver_input.csv"
},
"output_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/receiver/receiver_output.csv"
},
"keys": [
"id0",
"id1"
],
"debug_options": {
"trace_path": "/root/receiver/receiver.trace"
}
},
"self_link_party": "receiver",
"link_config": {
"parties": [
{
"id": "receiver",
"host": "127.0.0.1:5300"
receiver.config:

```json
{
"psi_config": {
"protocol_config": {
"protocol": "PROTOCOL_RR22",
"role": "ROLE_RECEIVER",
"broadcast_result": true
},
{
"id": "sender",
"host": "127.0.0.1:5400"
"input_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/receiver/receiver_input.csv"
},
"output_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/receiver/receiver_output.csv"
},
"keys": [
"id0",
"id1"
],
"debug_options": {
"trace_path": "/root/receiver/receiver.trace"
}
]
},
"self_link_party": "receiver",
"link_config": {
"parties": [
{
"id": "receiver",
"host": "127.0.0.1:5300"
},
{
"id": "sender",
"host": "127.0.0.1:5400"
}
]
}
}
}
```
```

sender.config:
sender.config:

```json
{
"psi_config": {
"protocol_config": {
"protocol": "PROTOCOL_RR22",
"role": "ROLE_SENDER",
"broadcast_result": true
},
"input_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/sender/sender_input.csv"
},
"output_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/sender/sender_output.csv"
},
"keys": [
"id0",
"id1"
],
"debug_options": {
"trace_path": "/root/sender/sender.trace"
}
},
"self_link_party": "sender",
"link_config": {
"parties": [
{
"id": "receiver",
"host": "127.0.0.1:5300"
```json
{
"psi_config": {
"protocol_config": {
"protocol": "PROTOCOL_RR22",
"role": "ROLE_SENDER",
"broadcast_result": true
},
"input_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/sender/sender_input.csv"
},
{
"id": "sender",
"host": "127.0.0.1:5400"
"output_config": {
"type": "IO_TYPE_FILE_CSV",
"path": "/root/sender/sender_output.csv"
},
"keys": [
"id0",
"id1"
],
"debug_options": {
"trace_path": "/root/sender/sender.trace"
}
]
},
"self_link_party": "sender",
"link_config": {
"parties": [
{
"id": "receiver",
"host": "127.0.0.1:5300"
},
{
"id": "sender",
"host": "127.0.0.1:5400"
}
]
}
}
}
```

| File Name | Location | Description |
| :---------------- | :---------------------------------- | :------------------------------------------------------------------------- |
| receiver.config | /tmp/receiver/receiver.config | Config for receiver. |
| sender.config | /tmp/sender/sender.config | Config for sender. |
| receiver_input.csv | /tmp/receiver/receiver_input.csv | Input for receiver. Make sure the file contains two id keys - id0 and id1. |
| sender_input.csv | /tmp/sender/sender_input.csv | Input for sender. Make sure the file contains two id keys - id0 and id1. |
```

| File Name | Location | Description |
| :---------------- | :---------------------------------- | :------------------------------------------------------------------------- |
| receiver.config | /tmp/receiver/receiver.config | Config for receiver. |
| sender.config | /tmp/sender/sender.config | Config for sender. |
| receiver_input.csv | /tmp/receiver/receiver_input.csv | Input for receiver. Make sure the file contains two id keys - id0 and id1. |
| sender_input.csv | /tmp/sender/sender_input.csv | Input for sender. Make sure the file contains two id keys - id0 and id1. |

3. Run PSI

Expand All @@ -122,7 +121,7 @@ In the first terminal, run the following command
docker run -it --rm --network host --mount type=bind,source=/tmp/receiver,target=/root/receiver --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/psi-anolis8:latest --config receiver/receiver.config
```

In the other terminal, run the following command simultaneously.
In the other terminal, run the following command simultaneously.

```bash
docker run -it --rm --network host --mount type=bind,source=/tmp/sender,target=/root/sender --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/psi-anolis8:latest --config sender/sender.config
Expand All @@ -131,7 +130,8 @@ docker run -it --rm --network host --mount type=bind,source=/tmp/sender,target
You could also pass a minified JSON config directly. A minified JSON is a compact one without white space and line breaks.

e.g.
```

```bash
docker run -it --rm --network host --mount type=bind,source=/tmp/sender,target=/root/sender --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true secretflow-registry.cn-hangzhou.cr.aliyuncs.com/secretflow/psi-anolis8:latest --json '{"psi_config":{"protocol_config":{"protocol":"PROTOCOL_RR22","role":"ROLE_RECEIVER","broadcast_result":true},"input_config":{"type":"IO_TYPE_FILE_CSV","path":"/root/receiver/receiver_input.csv"},"output_config":{"type":"IO_TYPE_FILE_CSV","path":"/root/receiver/receiver_output.csv"},"keys":["id0","id1"],"debug_options":{"trace_path":"/root/receiver/receiver.trace"}},"self_link_party":"receiver","link_config":{"parties":[{"id":"receiver","host":"127.0.0.1:5300"},{"id":"sender","host":"127.0.0.1:5400"}]}}'
```

Expand Down Expand Up @@ -184,33 +184,37 @@ bazel build //... -c opt
bazel test //...
```


### Trace

We use [Perfetto](https://perfetto.dev/) from Google for tracing.

Please use debug_options.trace_path field in PsiConfig to modify trace file path. The default path is /tmp/psi.trace.

After running psi binaries, please check trace by using [Trace Viewer](https://ui.perfetto.dev/). If this is not applicable, please check [this link](https://github.com/google/perfetto/issues/170) to deploy your own website.
After running psi binaries, please check trace by using [Trace Viewer](https://ui.perfetto.dev/). If this is not applicable,
please check [this link](https://github.com/google/perfetto/issues/170) to deploy your own website.

The alternate way to visualize trace is to use **chrome://tracing**:
1. Download perfetto assets from https://github.com/google/perfetto/releases/tag/v37.0

1. Download perfetto assets from <https://github.com/google/perfetto/releases/tag/v37.0>
2. You should find traceconv binary in assets folder.
3. Transfer trace file to JSON format:

```bash
chmod +x traceconv
```bash
chmod +x traceconv

./traceconv json [trace file path] [json file path]
```

./traceconv json [trace file path] [json file path]
```
4. Open chrome://tracing in your chrome and load JSON file.





## PSI V2 Benchamrk

Please refer to [PSI V2 Benchmark](docs/user_guide/psi_v2_benchmark.md)

## APSI Benchmark

Please refer to [APSI Benchmark](docs/user_guide/apsi_benchmark.md)

18 changes: 14 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# RELEASE

> NOTE:
>
> - `[Feature]` prefix for new features.
Expand All @@ -6,46 +8,57 @@
> - `[Improvement]` prefix for implementation improvement.
## v0.5.0.dev241107

- `[API]` delete legacy ub psi function.
- `[API]` output csv null_rep can be specified.
- `[Feature]` join can be done with one receiver.
- `[Feature]` join can be done with ub psi protocol.

## v0.4.0.dev240801

- [Bugfix] Fix MacOS and arm build.

## v0.4.0.dev240731

- [Improvement] Port APSI again.
- [Feature] Add Bucketized APSI.
- [API] Remove SealPIR.

## v0.4.0.dev240521

- [API] remove BC22 protocol

## v0.4.0.dev240517

- [Improvement] upgrade yacl to 0.4.5b0.

## v0.4.0.dev240514

- [API] add entrypoint for docker file.
- [API] allow passing config JSON directly to main.
- [Bugfix] fix ic mode.
- [Bugfix] fix RR22, SealPIR and APSI.

## v0.4.0.dev240401

- [Improvement] upgrade download uri of xz.

## v0.4.0.dev240329

- [Improvement] upgrade yacl to 0.4.4b3.

## v0.3.0beta

- [Improvement] add uuid in system temp folder.
- [Improvement] use arrow csv reader in pir.
- [Bugfix] fix typo in psi config check.
- [Bugfix] fix typo in psi config check.

## v0.3.0.dev240304

- [API] expose ic_mode in RunLegacyPsi api

## v0.3.0.dev240222

- [API] expose PIR API.

## v0.3.0.dev240219
Expand All @@ -63,13 +76,11 @@
- [Bugfix] Fix flakiness in psi_test.
- [Bugfix] Fix race condition in rr22.


## v0.2.0.dev231228

- [Bugfix] Fix RR22 race condition.
- [Improvement] modify sort buffer size.


## v0.2.0.dev231221

- [API] Rename check_duplicates to skip_duplicates_check.
Expand All @@ -79,7 +90,6 @@
- [Bugfix] Fix duplicate key check.
- [Bugfix] Fix SyncWait.


## v0.1.0beta

- [API] Add PSI v2 API.
Expand Down
Loading

0 comments on commit e063011

Please sign in to comment.