Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
218576d
Python HelloWorld standard app can handle dataset with pretty filename
Mar 31, 2021
fd3fe34
Rebuild TEE image for v6
zguesmi Apr 2, 2021
e90f4c5
Upgrade app to v6
zguesmi Apr 7, 2021
2ff2244
Build TEE v6 images
zguesmi Apr 7, 2021
c429ecb
Merge pull request #61 from iExecBlockchainComputing/v6-tee
zguesmi Apr 12, 2021
9aff1d9
Add Go hello world app
Apr 16, 2021
c4cf54d
update protect-fs procedure
Apr 27, 2021
e018476
Refactor python code and add input files
zguesmi Apr 27, 2021
e0a5530
Add input files to run script
zguesmi Apr 27, 2021
9e382d3
Update TEE part
zguesmi Apr 27, 2021
0c7ccc5
increatse heap setting and log
Apr 28, 2021
c9d9387
Increase Go app heap size
zguesmi Apr 28, 2021
18e03f4
Change go base image
zguesmi Apr 28, 2021
7e18e76
Add standard Go app
zguesmi Apr 29, 2021
5da6f76
Refactor go sources
zguesmi Apr 29, 2021
b4c7bb4
Merge branch 'iexec-v6-with-scone-v5-go-hello-world' into feature/tee…
zguesmi Apr 29, 2021
5258269
Merge pull request #63 from iExecBlockchainComputing/feature/tee-go-h…
reckeyzhang Apr 29, 2021
29b7a78
Merge pull request #64 from iExecBlockchainComputing/iexec-v6-with-sc…
zguesmi Apr 29, 2021
b26481e
Merge branch 'v6.0' into feature/v6-tee-input-files
zguesmi Apr 29, 2021
b067332
Change scone heap size for go app
zguesmi Apr 29, 2021
6c5d14f
Merge pull request #65 from iExecBlockchainComputing/feature/go-app-s…
zguesmi Apr 29, 2021
5acb30a
Add hello message to result
zguesmi Apr 29, 2021
8ca65de
Merge pull request #66 from iExecBlockchainComputing/feature/add-mess…
zguesmi Apr 29, 2021
e32096b
Convert indentation to spaces
zguesmi May 6, 2021
a79fe1e
Update go version and refactor code
zguesmi May 7, 2021
c84f967
Clean go code
zguesmi May 10, 2021
f4af2ee
Sconify go image
zguesmi May 10, 2021
f8230c9
Add readme file
zguesmi May 10, 2021
293e754
Snapshot: sconify go app
zguesmi May 11, 2021
ee893e1
Clean
zguesmi May 11, 2021
9435599
Clean go folder
zguesmi May 12, 2021
44d267e
Clean go folder
zguesmi May 12, 2021
b4c2fda
Upgrade nodejs app to scone v5
zguesmi May 12, 2021
714cbf5
Add comment for workaround
zguesmi May 12, 2021
edf8010
Use alpine based node
zguesmi May 12, 2021
d9a3877
Update Readme
zguesmi May 12, 2021
074e90f
Update Readme
zguesmi May 12, 2021
44a0991
Update Readme
zguesmi May 12, 2021
4a5af61
Merge pull request #62 from iExecBlockchainComputing/feature/v6-tee-i…
zguesmi May 17, 2021
8ebefee
Merge branch 'v6.0' into feature/scone-v5
zguesmi May 18, 2021
1971eda
Merge pull request #67 from iExecBlockchainComputing/feature/scone-v5
zguesmi May 18, 2021
2cea857
Upgrade python hello world app to Scone v5
zguesmi May 18, 2021
468b4d7
Update sessions for testing
zguesmi May 18, 2021
be697cb
Add sgx installation instructions
zguesmi May 19, 2021
0ee9420
Merge pull request #72 from iExecBlockchainComputing/feature/scone-v5…
zguesmi May 19, 2021
b2c42ab
ajout nouveau sconify.args file
DamienMure May 26, 2021
8a5b458
reformat des arg sconify
DamienMure May 26, 2021
23471b0
variabiliser FROM/TO
DamienMure May 27, 2021
14e5040
retrait sconify.sh
DamienMure May 28, 2021
b46ea36
nouvelle config scone
DamienMure May 28, 2021
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
10 changes: 10 additions & 0 deletions cloud-computing/go-hello-world/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# same version as Scone
FROM golang:1.16.0-alpine3.13

RUN apk --update add gcc build-base gcc-go

COPY ./src /app

RUN go build -compiler=gccgo -buildmode=exe -o /app/helloworld /app/helloworld.go

ENTRYPOINT ["/app/helloworld"]
68 changes: 68 additions & 0 deletions cloud-computing/go-hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Go hello-world app

## Standard mode
By default the application is built in **Standard** mode which
does not use TEE capabilities.

### Build
Standard mode application is built just like any other dockerized
application:
```
docker image build -t go-hello-world .
```

### Run
The application can be tested locally to make sure it is well setup:
```
rm -rf /tmp/iexec_out && \
docker run \
--rm \
-e IEXEC_IN=/iexec_in \
-e IEXEC_DATASET_FILENAME=Lorem-ipsum.txt \
-e IEXEC_OUT=/iexec_out \
-v /tmp/iexec_out:/iexec_out \
-v $(pwd)/resources/data:/iexec_in \
go-hello-world Alice
```
Once the execution ends, the result should be found in the folder
`/tmp/iexec_out`.
```
cat /tmp/iexec_out/result.txt
```

## TEE (protected) mode
To convert the application into **TEE** mode, first, it needs to be
build in **Standard** mode as instructed in the section above.
Then the produced image is converted using `sconify.sh` script into
a newly created TEE enabled image `tee-go-hello-world`:

### Build (conversion)
The script can edited to change parameters like **heap size**, new
image name, sources folder, ...

```
bash sconify.sh
```

### Run
(TODO test with CAS and session)

First of all, Intel® SGX driver needs to be present on the host machine.
These [instructions](https://github.com/intel/linux-sgx-driver) provide
information about how to install it.
The application can be tested locally to make sure it is well setup:
```
rm -rf /tmp/iexec_out && \
docker run \
--rm \
-e IEXEC_OUT=/iexec_out \
-e IEXEC_IN=/iexec_in \
-v /tmp/iexec_out:/iexec_out \
-v $(pwd)/resources/dataset:/iexec_in \
--device /dev/isgx \
tee-go-hello-world Alice
```
To get the MREnclave value of the TEE application:
```
docker run -it --rm -e SCONE_HASH=1 tee-go-hello-world
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
33 changes: 33 additions & 0 deletions cloud-computing/go-hello-world/resources/tee/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.2'
networks:
scone-net:
external: true

services:
las:
image: registry.scontain.com:5050/sconecuratedimages/services:las-scone5.3.0
container_name: las
devices:
- /dev/isgx
networks:
- scone-net
cas:
image: registry.scontain.com:5050/sconecuratedimages/services:cas.preprovisioned-scone5.2.1
container_name: cas
devices:
- /dev/isgx
depends_on:
- las
networks:
- scone-net
scone-cli:
image: registry.scontain.com:5050/sconecuratedimages/iexec-sconify-image:5.3.3
container_name: scone-cli
command: bash -c "sleep 5 && scone session create /session.yml --cas cas --only_for_testing-disable-attestation-verification"
volumes:
- ./session.yml:/session.yml
depends_on:
- las
- cas
networks:
- scone-net
24 changes: 24 additions & 0 deletions cloud-computing/go-hello-world/resources/tee/run-scone-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

### TODO on each build: update mrenclave in session

docker-compose down > /dev/null
docker network create scone-net > /dev/null
echo "Starting CAS & LAS:"
docker-compose up -d
sleep 5

MY_SCONE_APP=tee-go-hello-world
echo "Starting $MY_SCONE_APP"
docker run --rm \
--name=$MY_SCONE_APP \
-e SCONE_VERSION=1 \
-e SCONE_CAS_ADDR="cas" \
-e SCONE_LAS_ADDR="las" \
-e SCONE_CONFIG_ID="1/service" \
--network=scone-net \
--device=/dev/isgx \
$MY_SCONE_APP

docker-compose down
docker network rm scone-net
29 changes: 29 additions & 0 deletions cloud-computing/go-hello-world/resources/tee/session.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 1
version: "0.3"

# Access control:
# - only the data owner (CREATOR) can read or update the session
# - even the data owner cannot read the session secrets (i.e., the volume key and tag) or delete the session

access_policy:
read:
- CREATOR
update:
- CREATOR

services:
- name: service
image_name: service_image
mrenclaves: [5e0955204071b0f9d108bc7244ab25e331550046849f739f736c9536574fffb0]
command: "/app/helloworld"
environment:
IEXEC_IN: /iexec_in
IEXEC_OUT: /iexec_out

images:
- name: service_image

security:
attestation:
tolerate: [hyperthreading, software-hardening-needed, insecure-igpu, outdated-tcb, debug-mode]
ignore_advisories: ["INTEL-SA-00161", "INTEL-SA-00289", "INTEL-SA-00334", "INTEL-SA-00381", "INTEL-SA-00389"]
12 changes: 12 additions & 0 deletions cloud-computing/go-hello-world/sconify.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--name=goHelloWorld \
--from=${IMG_FROM} \
--to=${IMG_TO} \
--binary-fs \
--host-path=/etc \
--host-path=/opt \
--binary="/app/helloworld" \
--heap="1G" \
--dlopen="2" \
--no-color \
--verbose \
--command="/app/helloworld"
57 changes: 57 additions & 0 deletions cloud-computing/go-hello-world/src/helloworld.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package main

import (
"fmt"
"io/ioutil"
"log"
"os"
)

func main() {
iexecOut := os.Getenv("IEXEC_OUT")
iexecIn := os.Getenv("IEXEC_IN")
datasetFilename := os.Getenv("IEXEC_DATASET_FILENAME")
if iexecIn == "" {
panic("No value for IEXEC_IN")
}
if iexecOut == "" {
panic("No value for IEXEC_OUT")
}

result := ""

// Print a message
if (len(os.Args) > 1) {
result += "Hello, " + os.Args[1] + "!\n"
} else {
result += "Hello, World!\n"
}

// Read the content of the dataset if present
if datasetFilename != "" {
datasetFilepath := iexecIn + "/" + datasetFilename
input, err := ioutil.ReadFile(datasetFilepath)
if err != nil {
log.Fatal("Error reading dataset file", err)
} else {
result += "Dataset (" + datasetFilepath + "): " + string(input)
}
} else {
result += "No dataset was found\n"
}

fmt.Println(result)

// Save result
err := ioutil.WriteFile(iexecOut + "/result.txt", []byte(result), 0)
if err != nil {
log.Fatal(err)
}

// Create computed.json file
dataString := `{"deterministic-output-path": "` + iexecOut + `/result.txt"}`
err = ioutil.WriteFile(iexecOut + "/computed.json", []byte(dataString), 0)
if err != nil {
log.Fatal(err)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:14-alpine3.10

### install your dependencies
RUN mkdir /app && cd /app && npm install figlet@1.x
Expand Down
70 changes: 70 additions & 0 deletions cloud-computing/nodejs-hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Node hello-world app

## Standard mode
By default the application is built in **Standard** mode which
does not use TEE capabilities.

### Build
Standard mode application is built just like any other dockerized
application:
```
docker image build -t nodejs-hello-world .
```
**IMPORTANT:** /!\ Please note that the base node image should be
alpine based if it will be converted into TEE mode.

### Run
The application can be tested locally to make sure it is well setup:
```
rm -rf /tmp/iexec_out && \
docker run \
--rm \
-e IEXEC_IN=/iexec_in \
-e IEXEC_DATASET_FILENAME=Lorem-ipsum.txt \
-e IEXEC_OUT=/iexec_out \
-v /tmp/iexec_out:/iexec_out \
-v $(pwd)/resources/dataset:/iexec_in \
nodejs-hello-world Alice
```
Once the execution ends, the result should be found in the folder
`/tmp/iexec_out`.
```
cat /tmp/iexec_out/result.txt
```

## TEE (protected) mode
To convert the application into **TEE** mode, first, it needs to be
built in **Standard** mode as instructed in the section above.
Then the standard image is converted using `sconify.sh` script into
a newly created TEE enabled image `tee-nodejs-hello-world`:

### Build (conversion)
The script can edited to change parameters like **heap size**, new
image name, sources folder, ...

```
bash sconify.sh
```

### Run
(TODO test with CAS and session)

First of all, Intel® SGX driver needs to be present on the host machine.
These [instructions](https://github.com/intel/linux-sgx-driver) provide
information about how to install it.
The application can be tested locally to make sure it is well setup:
```
rm -rf /tmp/iexec_out && \
docker run \
--rm \
-e IEXEC_OUT=/iexec_out \
-e IEXEC_IN=/iexec_in \
-v /tmp/iexec_out:/iexec_out \
-v $(pwd)/resources/dataset:/iexec_in \
--device /dev/isgx \
tee-nodejs-hello-world Alice
```
To get the MREnclave value of the TEE application:
```
docker run -it --rm -e SCONE_HASH=1 tee-nodejs-hello-world
```
20 changes: 0 additions & 20 deletions cloud-computing/nodejs-hello-world/Readme.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.2'
networks:
scone-net:
external: true

services:
las:
image: registry.scontain.com:5050/sconecuratedimages/services:las-scone5.3.0
container_name: las
devices:
- /dev/isgx
networks:
- scone-net
cas:
image: registry.scontain.com:5050/sconecuratedimages/services:cas.preprovisioned-scone5.2.1
container_name: cas
devices:
- /dev/isgx
depends_on:
- las
networks:
- scone-net
scone-cli:
image: registry.scontain.com:5050/sconecuratedimages/iexec-sconify-image:5.3.3
container_name: scone-cli
command: bash -c "sleep 5 && scone session create /session.yml --cas cas --only_for_testing-disable-attestation-verification"
volumes:
- ./session.yml:/session.yml
depends_on:
- las
- cas
networks:
- scone-net
Loading