Get tonic-rs to run inside SGX
This commit is contained in:
parent
665e7571bf
commit
c15d67fe71
4 changed files with 18 additions and 2 deletions
|
@ -1,12 +1,13 @@
|
|||
FROM gramineproject/gramine:v1.5
|
||||
|
||||
RUN apt-get update && apt-get install -y jq build-essential
|
||||
RUN apt-get update && apt-get install -y jq build-essential protobuf-compiler libprotobuf-dev
|
||||
|
||||
WORKDIR /workdir
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
RUN rustup toolchain install 1.72.0
|
||||
#ENV RUST_BACKTRACE=1
|
||||
|
||||
RUN gramine-sgx-gen-private-key
|
||||
|
||||
|
|
|
@ -1 +1,13 @@
|
|||
## Quartz enclave
|
||||
|
||||
```bash
|
||||
docker build . --tag quartz
|
||||
docker run -it \
|
||||
--device /dev/sgx_enclave \
|
||||
--device /dev/sgx_provision \
|
||||
-v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket \
|
||||
-v ./data:/workdir/data \
|
||||
quartz bash
|
||||
is-sgx-available
|
||||
gramine-sgx ./quartz
|
||||
```
|
||||
|
|
|
@ -28,6 +28,7 @@ fs.mounts = [
|
|||
{ uri = "file:{{ quartz_dir }}", path = "{{ quartz_dir }}" },
|
||||
]
|
||||
|
||||
# sgx.debug = true
|
||||
sgx.enclave_size = "512M"
|
||||
sgx.max_threads = 4
|
||||
sgx.edmm_enable = {{ 'true' if env.get('EDMM', '0') == '1' else 'false' }}
|
||||
|
@ -48,3 +49,5 @@ sgx.allowed_files = [
|
|||
"file:{{ quartz_dir }}/exchange.sk",
|
||||
"file:{{ quartz_dir }}/request.json",
|
||||
]
|
||||
|
||||
sys.insecure__allow_eventfd = true
|
||||
|
|
|
@ -23,7 +23,7 @@ use crate::{proto::quartz::core_server::CoreServer, server::CoreService};
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let addr = "[::1]:50051".parse()?;
|
||||
let addr = "127.0.0.1:9090".parse()?;
|
||||
let core_service = CoreService::default();
|
||||
|
||||
Server::builder()
|
||||
|
|
Loading…
Reference in a new issue