Skip to content

Commit

Permalink
feat(sgx): add proxy local port to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gezq committed Mar 18, 2024
1 parent 1733328 commit 141736e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions deploy/scripts/sgx/run_trainer_worker_sgx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ LISTEN_PORT=50051
if [[ -n "${PORT0}" ]]; then
LISTEN_PORT=${PORT0}
fi

echo $LISTEN_PORT > /pod-data/listen_port

PROXY_LOCAL_PORT=50053
if [[ -n "${PORT2}" ]]; then
PROXY_LOCAL_PORT=${PORT2}
fi
echo $PROXY_LOCAL_PORT > /pod-data/proxy_local_port

cp /app/sgx/gramine/CI-Examples/tensorflow_io.py ./
source /app/deploy/scripts/hdfs_common.sh || true
source /app/deploy/scripts/pre_start_hook.sh || true
Expand All @@ -39,10 +44,10 @@ else
pull_code ${CODE_TAR} $PWD
fi

cd ${ROLE}
cp /app/sgx/gramine/CI-Examples/tensorflow_io.py ./
cp /app/sgx/gramine/CI-Examples/tensorflow_io.py /gramine/follower/
cp /app/sgx/gramine/CI-Examples/tensorflow_io.py /gramine/leader/
source /app/deploy/scripts/sgx/enclave_env.sh
cp /app/sgx/token/* ./

unset HTTPS_PROXY https_proxy http_proxy ftp_proxy

mode=$(normalize_env_to_args "--mode" "$MODE")
Expand Down Expand Up @@ -91,14 +96,15 @@ source /root/start_aesm_service.sh

server_port=$(normalize_env_to_args "--server-port" "$PORT1")

cd $EXEC_DIR
if [[ -z "${START_CPU_SN}" ]]; then
START_CPU_SN=0
fi
if [[ -z "${END_CPU_SN}" ]]; then
END_CPU_SN=3
fi

taskset -c $START_CPU_SN-$END_CPU_SN stdbuf -o0 gramine-sgx python main.py --worker \
taskset -c $START_CPU_SN-$END_CPU_SN stdbuf -o0 gramine-sgx python /gramine/$ROLE/main.py --worker \
--application-id="$APPLICATION_ID" \
--master-addr="$MASTER_HOST:50051" \
--cluster-spec="$CLUSTER_SPEC" \
Expand Down

0 comments on commit 141736e

Please sign in to comment.