Skip to content

Commit

Permalink
docs: update instruction of installation of Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsz Lung Chung authored and yang8621 committed Dec 20, 2023
1 parent 59f51ea commit b8e2eb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
20 changes: 7 additions & 13 deletions docs/build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome to see the build instructions for the ehsm-kms project.

## Quick start with Docker-Compose
## Quick start with Docker Compose

**Notes:** The below steps has been verified on the **Ubuntu-20.04**.

Expand Down Expand Up @@ -61,21 +61,15 @@ Welcome to see the build instructions for the ehsm-kms project.
USE_SECURE_CERT=FALSE
```

* Install docker-compose
* Install Docker Compose

``` shell
# Download the current stable release (remove the "-x $http_proxy" if you don't behind the proxy)
sudo curl -x $http_proxy -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
# docker-compose version 1.29.2, build 5becea4c
sudo apt install docker-compose-plugin
docker compose --version
# Docker Compose version v2.21.0
```

* Build and Run ehsm-kms with docker-compose
* Build and Run ehsm-kms with Docker Compose

```shell
# Download the ehsm code from github
Expand All @@ -99,7 +93,7 @@ Welcome to see the build instructions for the ehsm-kms project.
# ======== docker/.env.pccs END ========
# Start to build and run the docker images (couchdb, dkeyserver, dkeycache, ehsm_kms_service)
cd docker && docker-compose up -d
cd docker && docker compose up -d
# (Optional) If you want to start PCCS service as well, use `pccs` profile
docker compose --profile=pccs up -d
```
Expand Down
30 changes: 19 additions & 11 deletions sdk/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
It will provide the following interfaces:

---

**Key Management APIs:**

- create_key
- encrypt
- decrypt
Expand All @@ -22,9 +24,11 @@ It will provide the following interfaces:
- delete_allkey
- enable_key
- disable_key

---

**Secret Management APIs:**

- create_secret
- update_secret_desc
- put_secret_value
Expand All @@ -36,15 +40,17 @@ It will provide the following interfaces:
- restore_secret

## Start eHSM-KMS service

Notes: it need to run on a sgx capable machine.

```
```shell
# start ehsm-kms on a single machine without remote attestation
./run_with_single.sh
```

or you can build and run ehsm-kms with docker-compose:
```
or you can build and run ehsm-kms with Docker Compose:

```shell
# Download the ehsm code from github
git clone --recursive https://github.com/intel/ehsm.git ehsm && cd ehsm
vim docker/.env
Expand All @@ -57,30 +63,32 @@ KMS_PORT=9000 # (Optional) the default KMS port, modify it if yo
TAG_VERSION=main # (Optional) the default code base is using the main latest branch, modify it to specific tag if you want.

# start to build and run the docker images (couchdb, dkeyserver, dkeycache, ehsm_kms_service)
cd docker && docker-compose up -d
cd docker && docker compose up -d
```

## Run the unit-test

Notes: this can be run on non-sgx capable machine.

### Enroll to eHSM-KMS with Restful interface
```

```shell
curl -v -k -G "https://<kms_ip>:<port>/ehsm?Action=Enroll"

{"code":200,"message":"successful","result":{"apikey":"xbtXGHwBexb1pgnEz8JZWHLgaSVb1xSk","appid":"56c46c76-60e0-4722-a6ad-408cdd0c62c2"}}
```
### Export eHSM information to environment variables.

```
export EHSM_APPID=56c46c76-60e0-4722-a6ad-408cdd0c62c2
### Export eHSM information to environment variables

```shell
export EHSM_APPID=56c46c76-60e0-4722-a6ad-408cdd0c62c2
export EHSM_APIKEY=xbtXGHwBexb1pgnEz8JZWHLgaSVb1xSk
export EHSM_ADDR=https://<kms_ip>:<port>
```

### Run test

```
```shell
#cargo test

cargo test
Expand Down

0 comments on commit b8e2eb0

Please sign in to comment.