Skip to content

Commit

Permalink
Adding logging
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasm-ttd committed Jun 7, 2024
1 parent 9184259 commit dacaae5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/aws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN apt update -y \
&& apt-get install /app/dep/syslog-ng-core_4.6.0-1_amd64.deb \
&& rm -rf /var/lib/apt/lists/* \
&& apt-key del 6694369F
RUN pip3 install boto3==1.16.9
RUN pip3 install boto3

COPY ./target/${JAR_NAME}-${JAR_VERSION}-jar-with-dependencies.jar /app/${JAR_NAME}-${JAR_VERSION}.jar
COPY ./static /app/static
Expand Down
2 changes: 1 addition & 1 deletion scripts/aws/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ifconfig lo 127.0.0.1

# -- start vsock proxy
echo "Starting vsock proxy..."
/app/vsockpx --config /app/proxies.nitro.yaml --daemon --workers $(( $(nproc) * 2 )) --log-level 3
/app/vsockpx --config /app/proxies.nitro.yaml --daemon --workers $(( $(nproc) * 2 )) --log-level 0

# -- setup syslog-ng
echo "Starting syslog-ng..."
Expand Down
15 changes: 14 additions & 1 deletion scripts/aws/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function update_allocation() {
}

function setup_vsockproxy() {
if [[ "$1" == "debug" ]]; then
VSOCK_LOG_LEVEL=0
fi

VSOCK_PROXY=${VSOCK_PROXY:-/usr/bin/vsockpx}
VSOCK_CONFIG=${VSOCK_CONFIG:-/etc/uid2operator/proxy.yaml}
VSOCK_THREADS=${VSOCK_THREADS:-$(( $(nproc) * 2 )) }
Expand Down Expand Up @@ -99,13 +103,22 @@ function run_enclave() {
nitro-cli run-enclave --eif-path $EIF_PATH --memory $MEMORY_MB --cpu-count $CPU_COUNT --enclave-cid $CID --enclave-name uid2operator
}

function run_enclave_debug() {
echo "starting enclave..."
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
}

terminate_old_enclave
config_aws
read_allocation
# update_allocation
setup_vsockproxy
setup_aws_proxy
setup_dante
run_enclave
if [[ "$1" == "debug" ]]; then
run_enclave_debug
else
run_enclave
fi

echo "Done!"

0 comments on commit dacaae5

Please sign in to comment.