-
Notifications
You must be signed in to change notification settings - Fork 16
/
start.sh
executable file
·45 lines (37 loc) · 1.38 KB
/
start.sh
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
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# This script launches a single CCF node in sandbox mode.
# It is not secure and must not be used in production.
set -ex
PLATFORM=${PLATFORM:-sgx}
CCF_DIR=${CCF_DIR:-/opt/ccf_$PLATFORM}
# TODO: Don't use /tmp
SCITT_DIR=/tmp/scitt
CONSTITUTION_DIR=$SCITT_DIR/share/scitt/constitution
# SNP attestation config
SNP_ATTESTATION_CONFIG=${SNP_ATTESTATION_CONFIG:-}
if [ "$PLATFORM" != "sgx" ] && [ "$PLATFORM" != "virtual" ] && [ "$PLATFORM" != "snp" ]; then
echo "Invalid platform: $PLATFORM"
exit 1
fi
echo "Setting up python virtual environment."
if [ ! -f "venv/bin/activate" ]; then
python3.8 -m venv "venv"
fi
source venv/bin/activate
pip install --disable-pip-version-check -q -e ./pyscitt
pip install --disable-pip-version-check -q wheel
pip install --disable-pip-version-check -q -r test/requirements.txt
exec python3.8 -m test.infra.cchost \
--port 8000 \
--cchost $CCF_DIR/bin/cchost \
--package $SCITT_DIR/lib/libscitt \
--constitution-file $CONSTITUTION_DIR/validate.js \
--constitution-file $CONSTITUTION_DIR/apply.js \
--constitution-file $CONSTITUTION_DIR/resolve.js \
--constitution-file $CONSTITUTION_DIR/actions.js \
--constitution-file $CONSTITUTION_DIR/scitt.js \
--platform "$PLATFORM" \
--snp-attestation-config "$SNP_ATTESTATION_CONFIG" \
"$@"