Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 22 additions & 47 deletions src/guides/build-iapp/advanced/create-your-first-sgx-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@

## Prepare your application

::: warning

For demo purposes, we omitted some development best practices in these examples.

Make sure to check your field's best practices before going to production.

:::

Before going further, your `<docker-hub-user>/hello-world:1.0.0` image built
previously is required.

Expand All @@ -74,28 +66,36 @@

## Build the TEE docker image

Before wrapping your iExec confidential application with Scone, you need to

Check warning on line 69 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L69

[Google.WordList] Use 'app' instead of 'application'.
Raw output
{"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 69, "column": 41}}}, "severity": "WARNING"}
generate a custom signing key. This key is used for the sconification process.

Check notice on line 70 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L70

[Google.Passive] In general, use active voice instead of passive voice ('is used').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is used').", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 70, "column": 41}}}, "severity": "INFO"}

Generate your enclave signing key with:

```bash
openssl genrsa -3 -out enclave-key.pem 3072
```

This will create an `enclave-key.pem` file in your current directory. You will

Check warning on line 78 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L78

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 78, "column": 6}}}, "severity": "WARNING"}

Check warning on line 78 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L78

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 78, "column": 75}}}, "severity": "WARNING"}
use this file in the sconify Docker command to sign your TEE image.

Check failure on line 79 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L79

[Vale.Spelling] Did you really mean 'sconify'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'sconify'?", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 79, "column": 22}}}, "severity": "ERROR"}

Check notice on line 79 in src/guides/build-iapp/advanced/create-your-first-sgx-app.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/build-iapp/advanced/create-your-first-sgx-app.md#L79

[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.", "location": {"path": "src/guides/build-iapp/advanced/create-your-first-sgx-app.md", "range": {"start": {"line": 79, "column": 58}}}, "severity": "INFO"}

We will use the following script to wrap the sconification process, copy the
`sconify.sh` script in the current directory:

::: code-group

```bash [for Javascript]
```bash [Javascript]
#!/bin/bash

# Declare the app entrypoint
ENTRYPOINT="node /app/app.js"

# Declare image related variables
IMG_NAME=tee-scone-hello-world
IMG_FROM=<docker-hub-user>/hello-world:1.0.0
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0-debug
IMG_TO=<docker-hub-user>/tee-scone-hello-world:1.0.0

# Run the sconifier to build the TEE image based on the non-TEE image
docker run -it --rm \
-v $PWD/enclave-key.pem:/sig/enclave-key.pem \
-v /var/run/docker.sock:/var/run/docker.sock \
registry.scontain.com/scone-production/iexec-sconify-image:5.9.1-v16\
sconify_iexec \
--name=${IMG_NAME} \
--from=${IMG_FROM} \
--to=${IMG_TO} \
--binary-fs \
Expand All @@ -105,31 +105,25 @@
--binary=/usr/local/bin/node \
--heap=1G \
--dlopen=1 \
--no-color \
--verbose \
--command=${ENTRYPOINT} \
&& echo -e "\n------------------\n" \
&& echo "successfully built TEE docker image => ${IMG_TO}" \
&& echo "application mrenclave.fingerprint is $(docker run --rm -e SCONE_HASH=1 ${IMG_TO})"
```

```bash [for Python]
```bash [Python]
#!/bin/bash

# Declare the app entrypoint
ENTRYPOINT="python3 /app/app.py"

# Declare image related variables
IMG_NAME=tee-scone-hello-world
IMG_FROM=<docker-hub-user>/hello-world:1.0.0
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0-debug
IMG_TO=<docker-hub-user>/tee-scone-hello-world:1.0.0

# Run the sconifier to build the TEE image based on the non-TEE image
docker run -it \
docker run -it --rm \
-v $PWD/enclave-key.pem:/sig/enclave-key.pem \
-v /var/run/docker.sock:/var/run/docker.sock \
registry.scontain.com/scone-production/iexec-sconify-image:5.9.1-v16\
sconify_iexec \
--name=${IMG_NAME} \
--from=${IMG_FROM} \
--to=${IMG_TO} \
--binary-fs \
Expand All @@ -139,9 +133,7 @@
--binary=/usr/local/bin/python3 \
--heap=1G \
--dlopen=1 \
--no-color \
--verbose \
--command=${ENTRYPOINT} \
&& echo -e "\n------------------\n" \
&& echo "successfully built TEE docker image => ${IMG_TO}" \
&& echo "application mrenclave.fingerprint is $(docker run --rm -e SCONE_HASH=1 ${IMG_TO})"
Expand All @@ -158,21 +150,11 @@
Push your image on DockerHub:

```bash
docker push <docker-hub-user>/tee-scone-hello-world:1.0.0-debug
docker push <docker-hub-user>/tee-scone-hello-world:1.0.0
```

Congratulations, you just built your Scone TEE application.

::: info

You may have noticed the `tee-debug` flag in the image name, the built image is
actually in TEE debug mode, this allows you to have some debug features while
developing the app.

Once you are happy with the debug app, contact us to go to production!

:::

## Test your app on iExec

At this stage, your application is ready to be tested on iExec. The process is
Expand All @@ -198,7 +180,7 @@
"owner": "<your-wallet-address>", // starts with 0x
"name": "tee-scone-hello-world", // application name
"type": "DOCKER",
"multiaddr": "docker.io/<docker-hub-user>/tee-scone-hello-world:1.0.0-debug", // app image
"multiaddr": "docker.io/<docker-hub-user>/tee-scone-hello-world:1.0.0", // app image
"checksum": "<checksum>", // starts with 0x, update it with your own image digest
"mrenclave": {
"framework": "SCONE", // TEE framework (keep default value)
Expand All @@ -225,7 +207,7 @@
(mrenclave):

```bash
docker run --rm -e SCONE_HASH=1 <docker-hub-user>/tee-scone-hello-world:1.0.0-debug
docker run --rm -e SCONE_HASH=1 <docker-hub-user>/tee-scone-hello-world:1.0.0
```

:::
Expand All @@ -251,13 +233,6 @@

::: info

You noticed we used `{{workerpoolAddress}}` instead of an ethereum address, this
is an ENS name.

:::

::: info

Remember, you can access task and app logs by following the instructions on page
[Debug your tasks](/guides/build-iapp/debugging).

Expand Down
16 changes: 12 additions & 4 deletions src/guides/build-iapp/manage-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ CLI:

::: code-group

```bash [npm]
npm install -g iexec
```sh [npm]
npm install iexec
```

```bash [yarn]
yarn global add iexec
```sh [yarn]
yarn add iexec
```

```sh [pnpm]
pnpm add iexec
```

```sh [bun]
bun add iexec
```

:::
Expand Down
8 changes: 4 additions & 4 deletions src/guides/use-iapp/run-iapp-without-ProtectedData.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ Before you begin, make sure you have the iExec SDK installed.
::: code-group

```sh [npm]
npm install -g iexec
npm install iexec
```

```sh [yarn]
yarn global add iexec
yarn add iexec
```

```sh [pnpm]
pnpm add -g iexec
pnpm add iexec
```

```sh [bun]
bun add -g iexec
bun add iexec
```

:::
Expand Down
2 changes: 1 addition & 1 deletion src/references/dataProtector/migrate-from-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
the latest npm package
---

# Migrate from V1 to V2 <span style="margin-left: 12px; position: absolute; top: -2px;"></span>
# Migrate from V1 to V2

Check warning on line 8 in src/references/dataProtector/migrate-from-v1.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/references/dataProtector/migrate-from-v1.md#L8

[Google.Headings] 'Migrate from V1 to V2' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Migrate from V1 to V2' should use sentence-style capitalization.", "location": {"path": "src/references/dataProtector/migrate-from-v1.md", "range": {"start": {"line": 8, "column": 3}}}, "severity": "WARNING"}

::: tip

Expand Down