@@ -22,97 +22,96 @@ In the following example, we are going to run PSI at a single host.
22
22
23
23
2 . Prepare data and config.
24
24
25
- receiver.config:
26
-
27
- ``` json
28
- {
29
- "psi_config" : {
30
- "protocol_config" : {
31
- "protocol" : " PROTOCOL_RR22" ,
32
- "role" : " ROLE_RECEIVER" ,
33
- "broadcast_result" : true
34
- },
35
- "input_config" : {
36
- "type" : " IO_TYPE_FILE_CSV" ,
37
- "path" : " /root/receiver/receiver_input.csv"
38
- },
39
- "output_config" : {
40
- "type" : " IO_TYPE_FILE_CSV" ,
41
- "path" : " /root/receiver/receiver_output.csv"
42
- },
43
- "keys" : [
44
- " id0" ,
45
- " id1"
46
- ],
47
- "debug_options" : {
48
- "trace_path" : " /root/receiver/receiver.trace"
49
- }
50
- },
51
- "self_link_party" : " receiver" ,
52
- "link_config" : {
53
- "parties" : [
54
- {
55
- "id" : " receiver" ,
56
- "host" : " 127.0.0.1:5300"
25
+ receiver.config:
26
+
27
+ ``` json
28
+ {
29
+ "psi_config" : {
30
+ "protocol_config" : {
31
+ "protocol" : " PROTOCOL_RR22" ,
32
+ "role" : " ROLE_RECEIVER" ,
33
+ "broadcast_result" : true
57
34
},
58
- {
59
- "id" : " sender" ,
60
- "host" : " 127.0.0.1:5400"
35
+ "input_config" : {
36
+ "type" : " IO_TYPE_FILE_CSV" ,
37
+ "path" : " /root/receiver/receiver_input.csv"
38
+ },
39
+ "output_config" : {
40
+ "type" : " IO_TYPE_FILE_CSV" ,
41
+ "path" : " /root/receiver/receiver_output.csv"
42
+ },
43
+ "keys" : [
44
+ " id0" ,
45
+ " id1"
46
+ ],
47
+ "debug_options" : {
48
+ "trace_path" : " /root/receiver/receiver.trace"
61
49
}
62
- ]
50
+ },
51
+ "self_link_party" : " receiver" ,
52
+ "link_config" : {
53
+ "parties" : [
54
+ {
55
+ "id" : " receiver" ,
56
+ "host" : " 127.0.0.1:5300"
57
+ },
58
+ {
59
+ "id" : " sender" ,
60
+ "host" : " 127.0.0.1:5400"
61
+ }
62
+ ]
63
+ }
63
64
}
64
- }
65
- ```
65
+ ```
66
66
67
- sender.config:
67
+ sender.config:
68
68
69
- ``` json
70
- {
71
- "psi_config" : {
72
- "protocol_config" : {
73
- "protocol" : " PROTOCOL_RR22" ,
74
- "role" : " ROLE_SENDER" ,
75
- "broadcast_result" : true
76
- },
77
- "input_config" : {
78
- "type" : " IO_TYPE_FILE_CSV" ,
79
- "path" : " /root/sender/sender_input.csv"
80
- },
81
- "output_config" : {
82
- "type" : " IO_TYPE_FILE_CSV" ,
83
- "path" : " /root/sender/sender_output.csv"
84
- },
85
- "keys" : [
86
- " id0" ,
87
- " id1"
88
- ],
89
- "debug_options" : {
90
- "trace_path" : " /root/sender/sender.trace"
91
- }
92
- },
93
- "self_link_party" : " sender" ,
94
- "link_config" : {
95
- "parties" : [
96
- {
97
- "id" : " receiver" ,
98
- "host" : " 127.0.0.1:5300"
69
+ ```json
70
+ {
71
+ "psi_config" : {
72
+ "protocol_config" : {
73
+ "protocol" : " PROTOCOL_RR22" ,
74
+ "role" : " ROLE_SENDER" ,
75
+ "broadcast_result" : true
76
+ },
77
+ "input_config" : {
78
+ "type" : " IO_TYPE_FILE_CSV" ,
79
+ "path" : " /root/sender/sender_input.csv"
99
80
},
100
- {
101
- "id" : " sender" ,
102
- "host" : " 127.0.0.1:5400"
81
+ "output_config" : {
82
+ "type" : " IO_TYPE_FILE_CSV" ,
83
+ "path" : " /root/sender/sender_output.csv"
84
+ },
85
+ "keys" : [
86
+ " id0" ,
87
+ " id1"
88
+ ],
89
+ "debug_options" : {
90
+ "trace_path" : " /root/sender/sender.trace"
103
91
}
104
- ]
92
+ },
93
+ "self_link_party" : " sender" ,
94
+ "link_config" : {
95
+ "parties" : [
96
+ {
97
+ "id" : " receiver" ,
98
+ "host" : " 127.0.0.1:5300"
99
+ },
100
+ {
101
+ "id" : " sender" ,
102
+ "host" : " 127.0.0.1:5400"
103
+ }
104
+ ]
105
+ }
105
106
}
106
- }
107
- ```
108
-
109
- | File Name | Location | Description |
110
- | :---------------- | :---------------------------------- | :------------------------------------------------------------------------- |
111
- | receiver.config | /tmp/receiver/receiver.config | Config for receiver. |
112
- | sender.config | /tmp/sender/sender.config | Config for sender. |
113
- | receiver_input.csv | /tmp/receiver/receiver_input.csv | Input for receiver. Make sure the file contains two id keys - id0 and id1. |
114
- | sender_input.csv | /tmp/sender/sender_input.csv | Input for sender. Make sure the file contains two id keys - id0 and id1. |
107
+ ```
115
108
109
+ | File Name | Location | Description |
110
+ | :---------------- | :---------------------------------- | :------------------------------------------------------------------------- |
111
+ | receiver.config | /tmp/receiver/receiver.config | Config for receiver. |
112
+ | sender.config | /tmp/sender/sender.config | Config for sender. |
113
+ | receiver_input.csv | /tmp/receiver/receiver_input.csv | Input for receiver. Make sure the file contains two id keys - id0 and id1. |
114
+ | sender_input.csv | /tmp/sender/sender_input.csv | Input for sender. Make sure the file contains two id keys - id0 and id1. |
116
115
117
116
3 . Run PSI
118
117
@@ -122,7 +121,7 @@ In the first terminal, run the following command
122
121
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
123
122
```
124
123
125
- In the other terminal, run the following command simultaneously.
124
+ In the other terminal, run the following command simultaneously.
126
125
127
126
``` bash
128
127
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
@@ -131,7 +130,8 @@ docker run -it --rm --network host --mount type=bind,source=/tmp/sender,target
131
130
You could also pass a minified JSON config directly. A minified JSON is a compact one without white space and line breaks.
132
131
133
132
e.g.
134
- ```
133
+
134
+ ``` bash
135
135
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"}]}}'
136
136
```
137
137
@@ -184,33 +184,37 @@ bazel build //... -c opt
184
184
bazel test //...
185
185
```
186
186
187
-
188
187
### Trace
189
188
190
189
We use [ Perfetto] ( https://perfetto.dev/ ) from Google for tracing.
191
190
192
191
Please use debug_options.trace_path field in PsiConfig to modify trace file path. The default path is /tmp/psi.trace.
193
192
194
- 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.
193
+ After running psi binaries, please check trace by using [ Trace Viewer] ( https://ui.perfetto.dev/ ) . If this is not applicable,
194
+ please check [ this link] ( https://github.com/google/perfetto/issues/170 ) to deploy your own website.
195
195
196
196
The alternate way to visualize trace is to use ** chrome://tracing** :
197
- 1 . Download perfetto assets from https://github.com/google/perfetto/releases/tag/v37.0
197
+
198
+ 1 . Download perfetto assets from < https://github.com/google/perfetto/releases/tag/v37.0 >
198
199
2 . You should find traceconv binary in assets folder.
199
200
3 . Transfer trace file to JSON format:
200
201
201
- ``` bash
202
- chmod +x traceconv
202
+ ``` bash
203
+ chmod +x traceconv
204
+
205
+ ./traceconv json [trace file path] [json file path]
206
+ ```
203
207
204
- ./traceconv json [trace file path] [json file path]
205
- ```
206
208
4. Open chrome://tracing in your chrome and load JSON file.
207
209
208
210
211
+
212
+
213
+
209
214
# # PSI V2 Benchamrk
210
215
211
216
Please refer to [PSI V2 Benchmark](docs/user_guide/psi_v2_benchmark.md)
212
217
213
218
# # APSI Benchmark
214
219
215
220
Please refer to [APSI Benchmark](docs/user_guide/apsi_benchmark.md)
216
-
0 commit comments