Skip to content

Commit

Permalink
Fix DCAP build in docker (#1306)
Browse files Browse the repository at this point in the history
* docker: add WORKER_FEATURES_ARG needed for DCAP

* docker: fix LD_LIBRARY_PATH from aesmd service

LD_LIBRARY_PATH must NOT contain the urts library of the aesmd_service, it will override the default one, which will result in a weird SGX enclave initialization errors.

* service/main: follow-up for send_extrinsic signature changes in DCAP only methods

* fixup! docker: fix LD_LIBRARY_PATH from aesmd service
  • Loading branch information
OverOrion authored May 18, 2023
1 parent fd78d5c commit ec47c5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ ENV CARGO_NET_GIT_FETCH_WITH_CLI true
ARG SGX_MODE=SW
ENV SGX_MODE=$SGX_MODE

ARG WORKER_FEATURES_ARG
ENV WORKER_FEATURES=$WORKER_FEATURES_ARG

ENV WORKHOME=/home/ubuntu/work
ENV HOME=/home/ubuntu

Expand All @@ -57,14 +60,16 @@ WORKDIR $WORKHOME/worker
COPY . .

RUN --mount=type=cache,id=cargo-registry,target=/opt/rust/registry \
--mount=type=cache,id=cargo-git,target=/opt/rust/git/db \
--mount=type=cache,id=cargo-git,target=/opt/rust/git/db \
--mount=type=cache,id=cargo-sccache-${WORKER_MODE}${ADDITIONAL_FEATURES},target=/home/ubuntu/.cache/sccache \
echo ${FINGERPRINT} && make && cargo test --release && sccache --show-stats

### Base Runner Stage
### The runner needs the aesmd service for the `SGX_MODE=HW`.
######################################################
FROM oasisprotocol/aesmd:master AS runner
ENV SGX_SDK /opt/sgxsdk
ENV LD_LIBRARY_PATH "${SGX_SDK}/sdk_libs"

### Deployed CLI client
##################################################
Expand Down
4 changes: 2 additions & 2 deletions service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,10 @@ fn register_collateral(
let (fmspc, _tcb_info) = extract_tcb_info_from_raw_dcap_quote(&dcap_quote).unwrap();

let uxt = enclave.generate_register_quoting_enclave_extrinsic(fmspc).unwrap();
send_extrinsic(&uxt, api, accountid, is_development_mode);
send_extrinsic(uxt, api, accountid, is_development_mode);

let uxt = enclave.generate_register_tcb_info_extrinsic(fmspc).unwrap();
send_extrinsic(&uxt, api, accountid, is_development_mode);
send_extrinsic(uxt, api, accountid, is_development_mode);
}
}

Expand Down

0 comments on commit ec47c5d

Please sign in to comment.