Skip to content

Commit fa4e166

Browse files
authored
Merge pull request #96 from NillionNetwork/feat/improved_attestation_verification
feat: Improved attestation verification flows
2 parents 607355d + f5fe0a6 commit fa4e166

File tree

109 files changed

+1712
-10513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1712
-10513
lines changed

.env.ci

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ NILAI_GUNICORN_WORKERS = 10
1414
# - Do not put "https://" or "http://" in the domain name or / at the end
1515
NILAI_SERVER_DOMAIN = "localhost"
1616

17+
# Attestation Config
18+
ATTESTATION_HOST = "attestation"
19+
ATTESTATION_PORT = 8080
20+
21+
1722

1823
# Postgres Docker Compose Config
1924
POSTGRES_HOST = "postgres"

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ NILAI_GUNICORN_WORKERS = 10
1313
# - Do not put "https://" or "http://" in the domain name or / at the end
1414
NILAI_SERVER_DOMAIN = "localhost"
1515

16+
# Attestation Config
17+
ATTESTATION_HOST = "attestation"
18+
ATTESTATION_PORT = 8080
1619

1720
# Postgres Docker Compose Config
1821
POSTGRES_HOST = "postgres"

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ jobs:
9999
- name: Build vllm
100100
run: docker build -t nillion/nilai-vllm:latest -f docker/vllm.Dockerfile .
101101

102+
- name: Build attestation
103+
run: docker build -t nillion/nilai-attestation:latest -f docker/attestation.Dockerfile .
104+
102105
- name: Build nilal API
103106
run: docker build -t nillion/nilai-api:latest -f docker/api.Dockerfile --target nilai .
104107

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ nilAI is a platform designed to run on Confidential VMs with Trusted Execution E
2626

2727
#### Development Environment
2828
```shell
29+
# Build nilai_attestation endpoint
30+
docker build -t nillion/nilai-attestation:latest -f docker/attestation.Dockerfile .
2931
# Build vLLM docker container
3032
docker build -t nillion/nilai-vllm:latest -f docker/vllm.Dockerfile .
3133
# Build nilai_api container
@@ -50,6 +52,8 @@ docker compose -f docker-compose.yml \
5052

5153
#### Production Environment
5254
```shell
55+
# Build nilai_attestation endpoint
56+
docker build -t nillion/nilai-attestation:latest -f docker/attestation.Dockerfile .
5357
# Build vLLM docker container
5458
docker build -t nillion/nilai-vllm:latest -f docker/vllm.Dockerfile .
5559
# Build nilai_api container
@@ -68,6 +72,8 @@ up -d
6872
#### Testing Without GPU
6973

7074
```shell
75+
# Build nilai_attestation endpoint
76+
docker build -t nillion/nilai-attestation:latest -f docker/attestation.Dockerfile .
7177
# Build vLLM docker container
7278
docker build -t nillion/nilai-vllm:latest -f docker/vllm.Dockerfile .
7379
# Build nilai_api container
@@ -77,7 +83,7 @@ To deploy:
7783
```shell
7884
docker compose -f docker-compose.yml \
7985
-f docker-compose.dev.yml \
80-
-f docker/compose/docker-compose.llama-1b-gpu.yml \
86+
-f docker/compose/docker-compose.llama-1b-cpu.yml \
8187
up -d
8288
```
8389

caddy/Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
}
1919

2020
handle {
21-
reverse_proxy api:8443
21+
reverse_proxy api:8080
2222
}
2323
}

docker-compose.dev.macos.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ services:
33
platform: linux/amd64
44
ports:
55
- "8080:8080"
6-
- "8443:8443"
76
volumes:
87
- ./nilai-api/:/app/nilai-api/
8+
- ./packages/:/app/packages/
9+
attestation:
10+
ports:
11+
- "8081:8080"
12+
volumes:
13+
- ./nilai-attestation/:/app/nilai-attestation/
14+
- ./packages/:/app/packages/
915
redis:
1016
ports:
1117
- "6379:6379"

docker-compose.dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ services:
22
api:
33
ports:
44
- "8080:8080"
5-
- "8443:8443"
65
volumes:
76
- ./nilai-api/:/app/nilai-api/
87
- ./packages/:/app/packages/
8+
attestation:
9+
ports:
10+
- "8081:8080"
11+
volumes:
12+
- ./nilai-attestation/:/app/nilai-attestation/
13+
- ./packages/:/app/packages/
914
redis:
1015
ports:
1116
- "6379:6379"

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
services:
2-
api:
2+
attestation:
33
deploy:
44
resources:
55
reservations:

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
environment:
55
- ALLOW_NONE_AUTHENTICATION=yes
66
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
7+
restart: unless-stopped
78
healthcheck:
89
test: ["CMD", "etcdctl", "endpoint", "health"]
910
interval: 10s
@@ -16,6 +17,7 @@ services:
1617
image: 'redis:latest'
1718
networks:
1819
- frontend_net
20+
restart: unless-stopped
1921
healthcheck:
2022
test: ["CMD", "redis-cli", "ping"]
2123
interval: 30s
@@ -126,6 +128,20 @@ services:
126128
retries: 3
127129
start_period: 15s
128130
timeout: 10s
131+
attestation:
132+
image: nillion/nilai-attestation:latest
133+
restart: unless-stopped
134+
networks:
135+
- backend_net
136+
env_file:
137+
- .env
138+
healthcheck:
139+
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
140+
interval: 30s
141+
retries: 3
142+
start_period: 15s
143+
timeout: 10s
144+
129145
caddy:
130146
image: caddy:latest
131147
container_name: caddy

docker/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ docker build -t nillion/nilai-api:latest -f docker/api.Dockerfile .
77

88
docker run -it --rm \
99
-p 8080:8080 \
10-
-p 8443:8443 \
1110
-v hugging_face_models:/root/.cache/huggingface \
1211
-v $(pwd)/db/users.sqlite:/app/db/users.sqlite \
1312
nillion/nilai-api:latest
@@ -34,4 +33,4 @@ docker run -d --name etcd-server \
3433
--env ALLOW_NONE_AUTHENTICATION=yes \
3534
--env ETCD_ADVERTISE_CLIENT_URLS=http://etcd-server:2379 \
3635
bitnami/etcd:latest
37-
```
36+
```

0 commit comments

Comments
 (0)