Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable debug-mode option into AWS EC2 enclave operator startup #1151

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions scripts/aws/UID_CloudFormation.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Resources:
"enclave_cpu_count":6,
"enclave_memory_mb":24576,
"environment":"${DeployToEnvironment}"
"debug_mode":"false"
}'
WorkerRole:
Type: 'AWS::IAM::Role'
Expand Down
16 changes: 14 additions & 2 deletions scripts/aws/start.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,26 @@ function run_config_server() {
./bin/flask run --host 127.0.0.1 --port 27015 &
}

function read_debug_mode_config() {
DEBUG_MODE=$(aws secretsmanager get-secret-value --secret-id "$UID2_CONFIG_SECRET_KEY" | jq -r '.SecretString' | jq -r '.debug_mode')
echo "Secrets Manager debug_mode config is set to $DEBUG_MODE"
}


function run_enclave() {
echo "starting enclave..."
nitro-cli run-enclave --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator
if [ "$DEBUG_MODE" == "true" ]; then
echo "starting enclave... --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator --debug-mode --attach-console"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: starting enclave in debug mode ...

nitro-cli run-enclave --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator --debug-mode --attach-console
else
echo "starting enclave... --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator"
nitro-cli run-enclave --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator
fi
}

terminate_old_enclave
config_aws
read_allocation
read_debug_mode_config
# update_allocation
setup_vsockproxy
setup_dante
Expand Down