Skip to content

Commit e86c280

Browse files
RodgerZhuxhuan28shui1
authored
Support lr he grpc under Azure (#174)
* secure logistic regression inference based on HE and SGX (#151) * inital commit Signed-off-by: Xiaojun Huang <xiaojun.huang@intel.com> * first commit of lr_sgx_he solution Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * infer client and infer server communicate via grpc Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * add dockerfile and build scripts Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * update dockerfile and build scripts Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * Create README.md * Update README.md * update license wording in each file Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * update the license date of gflags.cmake Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> * add the doc of lr_infer_he_sgx Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> Signed-off-by: Xiaojun Huang <xiaojun.huang@intel.com> Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> Co-authored-by: Zhu Yunge <yunge.zhu@intel.com> * update readme and document (#165) * Update README.md * Update index.md Signed-off-by: Xiaojun Huang <xiaojun.huang@intel.com> * Add Secure Logistic Regression Inference with HE and Intel SGX solution support for Azure deployments (#170) Signed-off-by: Xiaojun Huang <xiaojun.huang@intel.com> Signed-off-by: Huang, Xiaojun <xiaojun.huang@intel.com> Co-authored-by: Xiaojun Huang <xiaojun.huang@intel.com> Co-authored-by: shui1 <sammy.hui@intel.com>
1 parent 428d7c2 commit e86c280

File tree

7 files changed

+93
-14
lines changed

7 files changed

+93
-14
lines changed

README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ document section that explains the corresponding details and then guides you to
147147
<p>
148148
<span class="md-plain"><a href="https://cczoo.readthedocs.io/en/main/Solutions/horizontal-federated-learning/hfl.html#aliyun-ecs"><span>Alibaba Cloud</span></a>, <br />
149149
<a href="https://cczoo.readthedocs.io/en/main/Solutions/horizontal-federated-learning/hfl.html#tencent-cloud">Tencent Cloud</a>, <br />
150-
<a href="https://cczoo.readthedocs.io/en/main/Solutions/horizontal-federated-learning/hfl.html" target="_blank"><span>ByteDance Cloud</span></a></span>
150+
<a href="https://cczoo.readthedocs.io/en/main/Solutions/horizontal-federated-learning/hfl.html" target="_blank"><span>ByteDance Cloud</span></a>, <br />
151+
<a href="https://cczoo.readthedocs.io/en/main/Solutions/horizontal-federated-learning/hfl.html#microsoft-azure">Microsoft Azure</a></span>
151152
</p>
152153
</td>
153154
<td>
@@ -199,7 +200,8 @@ document section that explains the corresponding details and then guides you to
199200
<p>
200201
<span class="md-plain"><span><a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">Alibaba Cloud</a></span>, <br />
201202
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">Tencent Cloud</a>, <br />
202-
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">ByteDance Cloud</a></span>
203+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">ByteDance Cloud</a>, <br />
204+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">Microsoft Azure</a></span>
203205
</p>
204206
</td>
205207
<td>
@@ -347,7 +349,8 @@ Cluster PPML</strong></span></a> <br />
347349
<p>
348350
<span class="md-plain"><a href="https://cczoo.readthedocs.io/en/main/Solutions/tensorflow-serving-cluster/index.html#alibaba-cloud"><span>Alibaba Cloud</span></a>, <br />
349351
<a href="https://cczoo.readthedocs.io/en/main/Solutions/tensorflow-serving-cluster/index.html#tencent-cloud">Tencent Cloud</a>, <br />
350-
<a href="https://cczoo.readthedocs.io/en/main/Solutions/tensorflow-serving-cluster/index.html#bytedance-cloud" target="_blank"><span>ByteDance Cloud</span></a></span>
352+
<a href="https://cczoo.readthedocs.io/en/main/Solutions/tensorflow-serving-cluster/index.html#bytedance-cloud" target="_blank"><span>ByteDance Cloud</span></a>, <br />
353+
<a href="https://cczoo.readthedocs.io/en/main/Solutions/tensorflow-serving-cluster/index.html#microsoft-azure" target="_blank"><span>Microsoft Azure</span></a></span>
351354
</p>
352355
</td>
353356
<td>
@@ -359,7 +362,7 @@ Cluster PPML</strong></span></a> <br />
359362
<span style="color:#333333;font-family:Arial;"><a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank"><strong>Secure Logistic Logical Regression Inference with HE and SGX</strong></a></span>
360363
</td>
361364
<td>
362-
-
365+
Yes
363366
</td>
364367
<td>
365368
-
@@ -392,10 +395,15 @@ Cluster PPML</strong></span></a> <br />
392395
-
393396
</td>
394397
<td>
395-
-
398+
<p>
399+
<span class="md-plain"><a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html"><span>Alibaba Cloud</span></a>, <br />
400+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html">Tencent Cloud</a>, <br />
401+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank"><span>ByteDance Cloud</span></a>, <br />
402+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank"><span>Microsoft Azure</span></a></span>
403+
</p>
396404
</td>
397405
<td>
398-
In Progress
406+
Published
399407
</td>
400408
</tr>
401409
<tr>
@@ -910,6 +918,9 @@ Below table shows solutions and component projects validated in public clouds. A
910918
</li>
911919
</ul>
912920
<ul>
921+
<li>
922+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank">Secure Logistic Logical Regression Inference with HE and SGX</a>
923+
</li>
913924
<li>
914925
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/grpc-ra-tls/index.html">RA-TLS Enhanced gRPC</a>
915926
</li>
@@ -938,6 +949,9 @@ Below table shows solutions and component projects validated in public clouds. A
938949
<li>
939950
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">Vertical Federated Learning</a>
940951
</li>
952+
<li>
953+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank">Secure Logistic Logical Regression Inference with HE and SGX</a>
954+
</li>
941955
<li>
942956
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/psi/PSI.html" target="_blank">Private
943957
Set Intersection (PSI)</a><br />
@@ -955,6 +969,12 @@ Set Intersection (PSI)</a><br />
955969
<li>
956970
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/horizontal-federated-learning/hfl.html">Horizontal Federated Learning</a>
957971
</li>
972+
<li>
973+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/vertical-federated-learning/vfl.html" target="_blank">Vertical Federated Learning</a>
974+
</li>
975+
<li>
976+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank">Secure Logistic Logical Regression Inference with HE and SGX</a>
977+
</li>
958978
</ul>
959979
<p>
960980
<br />
@@ -983,6 +1003,9 @@ Set Intersection (PSI)</a><br />
9831003
<li>
9841004
<span></span><a href="https://cczoo.readthedocs.io/en/latest/Solutions/psi/PSI.html" target="_blank">Private Set Intersection (PSI)</a><br />
9851005
</li>
1006+
<li>
1007+
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html" target="_blank">Secure Logistic Logical Regression Inference with HE and SGX</a>
1008+
</li>
9861009
</ul>
9871010
<p>
9881011
<br />

cczoo/lr_infer_he_sgx/Dockerfile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
FROM ubuntu:20.04
1919

20+
# Optional build argument to select a build for Azure
21+
ARG AZURE
22+
2023
ENV DEBIAN_FRONTEND=noninteractive
2124
ENV INSTALL_PREFIX=/usr/local
2225
ENV LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${INSTALL_PREFIX}/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}
@@ -46,8 +49,30 @@ RUN wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.k
4649
# Install SGX-PSW
4750
RUN apt-get install -y libsgx-pce-logic libsgx-ae-qve libsgx-quote-ex libsgx-quote-ex-dev libsgx-qe3-logic sgx-aesm-service
4851

49-
# Install SGX-DCAP
50-
RUN apt-get install -y libsgx-dcap-ql-dev libsgx-dcap-default-qpl libsgx-dcap-quote-verify-dev libsgx-dcap-default-qpl-dev
52+
# Install SGX DCAP
53+
RUN apt-get install -y libsgx-dcap-ql-dev libsgx-dcap-quote-verify-dev
54+
55+
# Install SGX-DCAP quote provider library
56+
RUN if [ -z "$AZURE" ]; then \
57+
# Not a build for Azure, so install the default quote provider library \
58+
apt-get install -y libsgx-dcap-default-qpl; \
59+
else \
60+
# Build for Azure, so install the Azure DCAP Client (Release 1.10.0) \
61+
AZUREDIR=/azure \
62+
&& apt-get install -y libssl-dev libcurl4-openssl-dev pkg-config software-properties-common \
63+
&& add-apt-repository ppa:team-xbmc/ppa -y \
64+
&& apt-get update \
65+
&& apt-get install -y nlohmann-json3-dev \
66+
&& git clone https://github.com/microsoft/Azure-DCAP-Client ${AZUREDIR} \
67+
&& cd ${AZUREDIR} \
68+
&& git checkout 1.10.0 \
69+
&& git submodule update --recursive --init \
70+
&& cd src/Linux \
71+
&& ./configure \
72+
&& make DEBUG=1 \
73+
&& make install \
74+
&& cp libdcap_quoteprov.so /usr/lib/x86_64-linux-gnu/; \
75+
fi
5176

5277
# Gramine
5378
ENV GRAMINEDIR=/gramine

cczoo/lr_infer_he_sgx/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,21 @@ After the inference is completed, the encrypted result is sent back to the user
2121
## Build and Run
2222
### Prerequisite
2323
- A server with Intel SGX enabled
24-
- Docker
24+
- Docker Engine. Docker Engine is an open source containerization technology for
25+
building and containerizing your applications.
26+
Please follow [this guide](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script)
27+
to install Docker engine.
2528
### Build Docker Image
2629
```
2730
git clone https://github.com/intel/confidential-computing-zoo
2831
cd confidential-computing-zoo/cczoo/lr_infer_he_sgx
32+
```
33+
For deployments on Microsoft Azure:
34+
```shell
35+
AZURE=1 ./build_docker_image.sh
36+
```
37+
For other cloud deployments:
38+
```shell
2939
./build_docker_image.sh
3040
```
3141
### Execution

cczoo/lr_infer_he_sgx/build_docker_image.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# Copyright (c) 2022 Intel Corporation
34
# SPDX-License-Identifier: Apache-2.0
@@ -13,9 +14,14 @@
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
1516

16-
#!/bin/bash
1717
set -e
1818

19+
if [ -z "$AZURE" ] ; then
20+
azure=
21+
else
22+
azure=1
23+
fi
24+
1925
# You can remove no_proxy and proxy_server if your network doesn't need it
2026
no_proxy="localhost,127.0.0.1"
2127
proxy_server="" # your http proxy server
@@ -26,6 +32,7 @@ DOCKER_BUILDKIT=0 docker build \
2632
--build-arg no_proxy=${no_proxy} \
2733
--build-arg http_proxy=${proxy_server} \
2834
--build-arg https_proxy=${proxy_server} \
35+
--build-arg AZURE=${azure} \
2936
-f Dockerfile \
3037
-t lr_infer_he_sgx:latest \
3138
.

cczoo/lr_infer_he_sgx/start_container.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# Copyright (c) 2022 Intel Corporation
34
# SPDX-License-Identifier: Apache-2.0
@@ -13,7 +14,6 @@
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
1516

16-
#!/bin/bash
1717
set -e
1818

1919
function Usage() {
@@ -61,7 +61,7 @@ elif [ $1 = "server" ]; then
6161
-e http_proxy=${proxy_server} \
6262
-e https_proxy=${proxy_server} \
6363
lr_infer_he_sgx:latest \
64-
bash
64+
/lr_infer_he_sgx/infer_server
6565
else
6666
Usage
6767
exit 1

documents/readthedoc/docs/source/Cloud/cloudDeployment.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ The configuration of the M6ce instance as below:
279279

280280
---
281281

282+
282283
## Microsoft Azure
283284

284285
Microsoft Azure [DCsv3-series](https://docs.microsoft.com/en-us/azure/virtual-machines/dcv3-series) instances support Intel® SGX encrypted computing technology.
@@ -319,7 +320,7 @@ The following is the configuration of the DCsv3-series instance used:
319320
</td>
320321
<td>
321322
<div>
322-
<span><span>5.13.0-1031-azure</span> </span>
323+
<span><span>5.15.0-1022-azure</span> </span>
323324
</div>
324325
</td>
325326
</tr>
@@ -365,6 +366,9 @@ Validated Solution&nbsp; </span>
365366
<li>
366367
<span><a href="https://cczoo.readthedocs.io/en/latest/Solutions/horizontal-federated-learning/hfl.html">Horizontal Federated Learning&nbsp;</a></span>
367368
</li>
369+
<li>
370+
<span><a href="https://cczoo.readthedocs.io/en/latest/Solutions/logistic-regression-inference-HE-SGX/index.html">Secure Logistic Regression Inference with HE and Intel SGX&nbsp;</a></span>
371+
</li>
368372
<li>
369373
<a href="https://cczoo.readthedocs.io/en/latest/Solutions/grpc-ra-tls/index.html" target="_blank">RA-TLS Enhanced gRPC</a>
370374
</li>

documents/readthedoc/docs/source/Solutions/logistic-regression-inference-HE-SGX/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,21 @@ After the inference is completed, the encrypted result is sent back to the user
2121
## Build and Run
2222
### Prerequisite
2323
- A server with Intel SGX enabled
24-
- Docker
24+
- Docker Engine. Docker Engine is an open source containerization technology for
25+
building and containerizing your applications.
26+
Please follow [this guide](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script)
27+
to install Docker engine.
2528
### Build Docker Image
2629
```
2730
git clone https://github.com/intel/confidential-computing-zoo
2831
cd confidential-computing-zoo/cczoo/lr_infer_he_sgx
32+
```
33+
For deployments on Microsoft Azure:
34+
```shell
35+
AZURE=1 ./build_docker_image.sh
36+
```
37+
For other cloud deployments:
38+
```shell
2939
./build_docker_image.sh
3040
```
3141
### Execution

0 commit comments

Comments
 (0)