Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
210 lines (185 loc) · 4.97 KB
/
Copy pathMakefile
File metadata and controls
210 lines (185 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
include src/macros.mk
PIVOT_BIN ?= pivot_download
PIVOT_ARGS ?= []
REGISTRY := local
CARGO_WORKSPACE_FILES := Cargo.toml Cargo.lock
.DEFAULT_GOAL :=
.PHONY: default
default: \
out/qos_client/index.json \
out/qos_host/index.json \
out/qos_enclave/index.json \
out/qos_bridge/index.json \
out/qos_enclave_egress/index.json \
out/qos_bridge_egress/index.json \
out/signed_echo/index.json
.PHONY: test
test: out/.common-loaded
$(call run,make -C src test)
.PHONY: lint
lint: out/.common-loaded
$(call run,make -C src lint)
.PHONY: format
format: out/.common-loaded
$(call run,make -C src fmt)
.PHONY: docs
docs: out/.common-loaded
$(call run,cargo doc)
.PHONY: build-linux-only
build-linux-only: out/.common-loaded
$(call run,make -C src build-linux-only)
.PHONY: shell
shell: out/.common-loaded
docker run \
--interactive \
--tty \
--volume .:/home/qos \
--workdir /home/qos \
--user $(shell id -u):$(shell id -g) \
qos-local/common:latest \
/bin/bash
.PHONY: stop
stop:
-killall qemu-system-x86_64
-killall vhost-device-vsock
rm -f /tmp/vhost4.socket
/tmp/vhost4.socket:
vhost-device-vsock --vm guest-cid=4,forward-cid=1,forward-listen=3000+9001+9002,socket=/tmp/vhost4.socket &
.PHONY: host
host:
cargo run --locked -p qos_host --features qemu -- \
--host-ip 0.0.0.0 \
--host-port 3001 \
--cid 1 \
--port 9001
.PHONY: bridge
bridge: target/x86_64-unknown-linux-musl/release-panic-abort/egress
cargo run -p qos_bridge --locked --bin ingress --features egress,qemu -- \
--cid 1 \
--control-url http://127.0.0.1:3001/qos \
--vsock-to-host false \
--egress-bin-path target/x86_64-unknown-linux-musl/release-panic-abort/egress
.PHONY: boot
boot:
cd src/integration && cargo run --locked -p integration --example boot_enclave -- ../../target/x86_64-unknown-linux-musl/release/examples/$(PIVOT_BIN) $(PIVOT_ARGS)
# used for egress testing as our pivot, expects a single http url for file download
target/x86_64-unknown-linux-musl/release/examples/pivot_download: \
src/integration/examples/pivot_download.rs \
src/integration/Cargo.toml \
Cargo.toml
cargo build --release --locked --target x86_64-unknown-linux-musl -p integration --example pivot_download
# used for egress testing as our separate egress host proxy
target/x86_64-unknown-linux-musl/release-panic-abort/egress: \
src/qos_bridge/Cargo.toml \
src/qos_bridge/src/bin/egress.rs \
src/qos_bridge/src/*.rs \
Cargo.toml
cargo build --profile release-panic-abort --features egress,qemu --locked --target x86_64-unknown-linux-musl -p qos_bridge --bin egress
out/qos_enclave/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_enclave/Containerfile \
$(shell git ls-files \
src/init \
src/qos_enclave \
src/qos_core \
src/qos_bridge \
src/qos_aws \
src/qos_system \
)
$(call build,qos_enclave)
out/qos_enclave_egress/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_enclave_egress/Containerfile \
$(shell git ls-files \
src/init \
src/qos_enclave \
src/qos_core \
src/qos_aws \
src/qos_system \
)
$(call build,qos_enclave_egress)
out/qos_host/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_host/Containerfile \
$(shell git ls-files \
src/qos_host \
src/qos_core \
)
$(call build,qos_host)
out/qos_host_qemu/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_host_qemu/Containerfile \
$(shell git ls-files \
src/qos_host \
src/qos_core \
)
$(call build,qos_host_qemu)
out/qos_client/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_client/Containerfile \
$(shell git ls-files \
src/qos_client \
src/qos_p256 \
src/qos_nsm \
src/qos_hex \
src/qos_crypto \
src/qos_core \
)
$(call build,qos_client)
out/qos_bridge/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_bridge/Containerfile \
$(shell git ls-files \
src/qos_bridge \
src/qos_host \
src/qos_core \
src/qos_hex \
src/qos_nsm \
)
$(call build,qos_bridge)
out/qos_bridge_qemu/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_bridge_qemu/Containerfile \
$(shell git ls-files \
src/qos_bridge \
src/qos_host \
src/qos_core \
src/qos_hex \
src/qos_nsm \
)
$(call build,qos_bridge_qemu)
out/qos_bridge_egress/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/qos_bridge_egress/Containerfile \
$(shell git ls-files \
src/qos_bridge \
src/qos_host \
src/qos_core \
src/qos_hex \
src/qos_nsm \
)
$(call build,qos_bridge_egress)
out/signed_echo/index.json: \
out/common/index.json \
$(CARGO_WORKSPACE_FILES) \
src/images/signed_echo/Containerfile \
$(shell git ls-files \
src/signed_echo \
src/qos_p256 \
src/qos_hex \
)
$(call build,signed_echo)
out/common/index.json: \
src/images/common/Containerfile
$(call build,common)
out/.common-loaded: out/common/index.json
cd ./out/common && tar -cf - . | docker load
touch ./out/.common-loaded