Skip to content

Commit d22836d

Browse files
committed
WIP: sgx: add QuoteVerification demo and cleanup hostNetwork dependency
Signed-off-by: Mikko Ylinen <[email protected]>
1 parent 34eafa2 commit d22836d

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

demo/screencast-sgx.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cleanup()
2727
out 'Cleanup demo artifacts' 20
2828
out 'delete node-feature-discovery deployment:' 20
2929
command 'kubectl delete -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=main || true' 20
30-
command 'kubectl delete -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/sgx?ref=main || true' 20
30+
command 'kubectl delete -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=main || true' 20
3131
out 'delete SGX Device Plugin deployment:' 20
3232
command 'kubectl delete sgxdeviceplugin sgxdeviceplugin-sample || true' 20
3333
out 'delete Intel Device Plugin Operator deployment:' 20
@@ -69,10 +69,10 @@ screen3()
6969
clear
7070
out "2. Deploy node-feature-discovery for Kubernetes"
7171
out "It's used to label SGX capable nodes and register SGX EPC as an extended resource"
72-
command "kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/sgx?ref=main"
72+
command "kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=main"
7373
out "Check its pod is running"
7474
command "kubectl wait --for=condition=Ready pod/$(kubectl get --no-headers -l app=nfd-worker -o=jsonpath='{.items[0].metadata.name}' pods -n node-feature-discovery) -n node-feature-discovery"
75-
out "Create NodeFeatureRules for SGX specific labels"
75+
out "Create NodeFeatureRules for SGX specific labels and SGX EPC extended resource"
7676
command 'kubectl apply -k https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=main || true' 20
7777
}
7878

@@ -91,8 +91,8 @@ screen5()
9191
{
9292
clear
9393
out "4. Verify node resources"
94-
command "kubectl get nodes -o json | jq .items[].status.allocatable | grep sgx"
95-
command "kubectl get nodes -o json | jq .items[].metadata.labels | grep sgx"
94+
command "kubectl get nodes -o jsonpath='{.items[].status.allocatable}'| jq | grep sgx"
95+
command "kubectl get nodes -o jsonpath='{.items[].metadata.labels}' | jq | grep kubernetes.io\/sgx"
9696
out "Both node labels and resources for SGX are in place"
9797
}
9898

demo/sgx-sdk-demo/Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN apt-get update && \
2323
# SGX SDK is installed in /opt/intel directory.
2424
WORKDIR /opt/intel
2525

26-
ARG DCAP_VERSION=DCAP_1.17
26+
ARG DCAP_VERSION=DCAP_1.18
2727

2828
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" | \
2929
tee -a /etc/apt/sources.list.d/intel-sgx.list \
@@ -32,11 +32,12 @@ RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://d
3232
&& apt-get update \
3333
&& env DEBIAN_FRONTEND=noninteractive apt-get install -y \
3434
libsgx-dcap-ql-dev \
35+
libsgx-dcap-quote-verify-dev \
3536
libsgx-dcap-default-qpl-dev \
3637
libsgx-quote-ex-dev
3738

3839
# Install SGX SDK
39-
ARG SGX_SDK_URL=https://download.01.org/intel-sgx/sgx-linux/2.20/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.20.100.4.bin
40+
ARG SGX_SDK_URL=https://download.01.org/intel-sgx/sgx-linux/2.21/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.21.100.1.bin
4041
RUN wget ${SGX_SDK_URL} \
4142
&& export SGX_SDK_INSTALLER=$(basename $SGX_SDK_URL) \
4243
&& chmod +x $SGX_SDK_INSTALLER \
@@ -55,6 +56,12 @@ RUN cd SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample \
5556
&& make \
5657
&& cd -
5758

59+
RUN cd SGXDataCenterAttestationPrimitives/SampleCode/QuoteVerificationSample \
60+
&& . /opt/intel/sgxsdk/environment \
61+
&& make HW_RELEASE=1 \
62+
&& sgx_sign sign -key ../QuoteGenerationSample/Enclave/Enclave_private_sample.pem -enclave enclave.so -out enclave.signed.so -config Enclave/Enclave.config.xml \
63+
&& cd -
64+
5865
FROM ubuntu:22.04
5966

6067
RUN apt-get update && \
@@ -75,6 +82,7 @@ RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://d
7582
libsgx-dcap-ql \
7683
libsgx-dcap-default-qpl \
7784
&& mkdir -p /opt/intel/sgx-sample-app/ \
85+
&& mkdir -p /opt/intel/sgx-quote-verification/ \
7886
&& mkdir -p /opt/intel/sgx-quote-generation/
7987

8088
COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/app /opt/intel/sgx-sample-app/sgx-sample-app
@@ -83,4 +91,7 @@ COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/enclave.signed.so
8391
COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample/app /opt/intel/sgx-quote-generation/sgx-quote-generation
8492
COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample/enclave.signed.so /opt/intel/sgx-quote-generation/enclave.signed.so
8593

94+
COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteVerificationSample/app /opt/intel/sgx-quote-verification/sgx-quote-verification
95+
COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteVerificationSample/enclave.signed.so /opt/intel/sgx-quote-verification/enclave.signed.so
96+
8697
ENTRYPOINT /opt/intel/sgx-sample-app/sgx-sample-app

0 commit comments

Comments
 (0)