1 Star 0 Fork 39

src-oepkgs-oE-rv/secGear

forked from src-openEuler/secGear 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0026-example-add-Dockerfile-to-build-lrt-example-image.patch 5.57 KB
一键复制 编辑 原始数据 按行查看 历史
chenmaodong 提交于 2021-05-20 19:43 +08:00 . 内容可能含有违规信息
From 2f5b3b98d7c4705ef761e9898116b2206b7c6729 Mon Sep 17 00:00:00 2001
From: Li Feng <lifeng68@huawei.com>
Date: Tue, 13 Apr 2021 07:59:54 +0000
Subject: [PATCH 09/14] example: add Dockerfile to build lrt example image
Signed-off-by: Li Feng <lifeng68@huawei.com>
---
examples/lrt/Dockerfile | 33 +++++++++++++++++++
examples/lrt/device_plugin.yaml | 57 +++++++++++++++++++++++++++++++++
examples/lrt/enclave.yaml | 46 ++++++++++++++++++++++++++
3 files changed, 136 insertions(+)
create mode 100644 examples/lrt/Dockerfile
create mode 100644 examples/lrt/device_plugin.yaml
create mode 100644 examples/lrt/enclave.yaml
diff --git a/examples/lrt/Dockerfile b/examples/lrt/Dockerfile
new file mode 100644
index 0000000..dadf2b7
--- /dev/null
+++ b/examples/lrt/Dockerfile
@@ -0,0 +1,33 @@
+# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
+# secGear is licensed under the Mulan PSL v2.
+# You can use this software according to the terms and conditions of the Mulan PSL v2.
+# You may obtain a copy of Mulan PSL v2 at:
+# http://license.coscl.org.cn/MulanPSL2
+# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
+# PURPOSE.
+# See the Mulan PSL v2 for more details.
+
+# steps to build example image:
+# 1. build the secGear project at host
+# # cd secGear/
+# # source environment
+# # source /opt/intel/sgxsdk/environment
+# # mkdir debug && cd debug
+# # cmake -DCMAKE_BUILD_TYPE=Debug -DCC_SGX=ON -DSGXSDK=/opt/intel/sgxsdk ..
+# # make
+# 2. build the example image
+# # cd ../examples/lrt/
+# # docker build -t secgear_hello -f ./Dockerfile ../../
+
+
+FROM hub.oepkgs.net/lifeng2221dd1/sgx_base_hw:latest
+
+COPY debug/lib/sgx/libsgx_0.so /lib64/
+COPY debug/lib/libsecgear.so /usr/lib/
+COPY debug/examples/lrt/host/secgear_lrt /home/
+COPY debug/examples/lrt/enclave/enclave.signed.so /home/
+
+WORKDIR /home
+
+ENTRYPOINT ["/home/secgear_lrt"]
diff --git a/examples/lrt/device_plugin.yaml b/examples/lrt/device_plugin.yaml
new file mode 100644
index 0000000..9a470da
--- /dev/null
+++ b/examples/lrt/device_plugin.yaml
@@ -0,0 +1,57 @@
+# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
+# secGear is licensed under the Mulan PSL v2.
+# You can use this software according to the terms and conditions of the Mulan PSL v2.
+# You may obtain a copy of Mulan PSL v2 at:
+# http://license.coscl.org.cn/MulanPSL2
+# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
+# PURPOSE.
+# See the Mulan PSL v2 for more details.
+# steps to deploy device plugin:
+# # cd secGear/
+# # cd ./examples/lrt/
+# # kubectl apply -f ./device_plugin.yaml
+
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+ name: sgx-device-plugin-ds
+ namespace: kube-system
+spec:
+ selector:
+ matchLabels:
+ k8s-app: sgx-device-plugin
+ template:
+ metadata:
+ annotations:
+ scheduler.alpha.kubernetes.io/critical-pod: ""
+ labels:
+ k8s-app: sgx-device-plugin
+ spec:
+ containers:
+ - image: hub.oepkgs.net/lifeng2221dd1/hw-ali-device-plugin:devel
+ imagePullPolicy: IfNotPresent
+ name: sgx-device-plugin
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ volumeMounts:
+ - mountPath: /var/lib/kubelet/device-plugins
+ name: device-plugin
+ - mountPath: /dev
+ name: dev
+ tolerations:
+ - effect: NoSchedule
+ key: alibabacloud.com/sgx_epc_MiB
+ operator: Exists
+ volumes:
+ - hostPath:
+ path: /var/lib/kubelet/device-plugins
+ type: DirectoryOrCreate
+ name: device-plugin
+ - hostPath:
+ path: /dev
+ type: Directory
+ name: dev
diff --git a/examples/lrt/enclave.yaml b/examples/lrt/enclave.yaml
new file mode 100644
index 0000000..8efdada
--- /dev/null
+++ b/examples/lrt/enclave.yaml
@@ -0,0 +1,46 @@
+# Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
+# secGear is licensed under the Mulan PSL v2.
+# You can use this software according to the terms and conditions of the Mulan PSL v2.
+# You may obtain a copy of Mulan PSL v2 at:
+# http://license.coscl.org.cn/MulanPSL2
+# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
+# PURPOSE.
+# See the Mulan PSL v2 for more details.
+# steps to deploy device plugin:
+# # cd secGear/
+# # cd ./examples/lrt/
+# # kubectl apply -f ./enclave.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: helloworld
+ namespace: default
+spec:
+ replicas: 2
+ selector:
+ matchLabels:
+ app: helloworld
+ template:
+ metadata:
+ labels:
+ app: helloworld
+ spec:
+ containers:
+ - name: hell_lifeng
+ image: secgear_hello
+ imagePullPolicy: IfNotPresent
+ name: helloworld
+ resources:
+ limits:
+ cpu: 250m
+ memory: 512Mi
+ alibabacloud.com/sgx_epc_MiB: 2
+ volumeMounts:
+ - mountPath: /var/run/aesmd/aesm.socket
+ name: aesmsocket
+ volumes:
+ - hostPath:
+ path: /var/run/aesmd/aesm.socket
+ type: Socket
+ name: aesmsocket
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs-oe-rv/secGear.git
git@gitee.com:src-oepkgs-oe-rv/secGear.git
src-oepkgs-oe-rv
secGear
secGear
master

搜索帮助