-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·46 lines (38 loc) · 1.42 KB
/
start.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.42 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
#!/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
# 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:-}
echo "Setting up python virtual environment."
if [ ! -f "venv/bin/activate" ]; then
python3.12 -m venv "venv"
fi
source venv/bin/activate
echo "Using pip index URL: ${PIP_INDEX_URL:-default}"
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
SNP_ARGS=()
if [ -n "$SNP_ATTESTATION_CONFIG" ]; then
if [ ! -f "$SNP_ATTESTATION_CONFIG" ]; then
echo "Error: SNP_ATTESTATION_CONFIG is set to '$SNP_ATTESTATION_CONFIG' but the file does not exist."
exit 1
fi
SNP_ARGS=(--snp-attestation-config "$SNP_ATTESTATION_CONFIG")
fi
exec python3.12 -m test.infra.cchost \
--port 8000 \
--cchost $SCITT_DIR/bin/cchost \
--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 \
"${SNP_ARGS[@]}" \
"$@"