From 141736e80716438875bfa015d6c85c6962b21ba7 Mon Sep 17 00:00:00 2001 From: gezhengqiang Date: Mon, 18 Mar 2024 15:42:08 +0800 Subject: [PATCH] feat(sgx): add proxy local port to file --- deploy/scripts/sgx/run_trainer_worker_sgx.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/deploy/scripts/sgx/run_trainer_worker_sgx.sh b/deploy/scripts/sgx/run_trainer_worker_sgx.sh index 250100068..e3db48da7 100755 --- a/deploy/scripts/sgx/run_trainer_worker_sgx.sh +++ b/deploy/scripts/sgx/run_trainer_worker_sgx.sh @@ -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 @@ -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") @@ -91,6 +96,7 @@ 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 @@ -98,7 +104,7 @@ 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" \