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

Fix fluid start entry #633

Merged
merged 1 commit into from
Mar 6, 2018
Merged
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
13 changes: 8 additions & 5 deletions docker/paddle_k8s
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,23 @@ start_fluid_process() {
task_index=""

stdbuf -oL python /root/k8s_tools.py wait_pods_running ${pserver_label} ${PSERVERS}
stdbuf -oL python /root/k8s_tools.py wait_pods_running ${trainer_label} ${TRAINERS}

ps_hosts=$(python /root/k8s_tools.py fetch_endpoints ${pserver_label} ${PADDLE_INIT_PORT})
trainer_hosts=$(python /root/k8s_tools.py fetch_endpoints ${trainer_label} ${PADDLE_INIT_PORT})
if [ "${TRAINING_ROLE}" == "TRAINER" ]; then
stdbuf -oL python /root/k8s_tools.py wait_pods_running ${trainer_label} ${TRAINERS}
fi

export PADDLE_INIT_PSERVERS=$(python /root/k8s_tools.py fetch_ips ${pserver_label} ${PADDLE_INIT_PORT})

if [ "${TRAINING_ROLE}" == "TRAINER" ]; then
check_failed_cnt ${TRAINERS}
task_index=$(python /root/k8s_tools.py fetch_id ${trainer_label})
else
task_index=$(python /root/k8s_tools.py fetch_id ${pserver_label})
fi

export PADDLE_INIT_TRAINER_ID=${task_index}

stdbuf -oL sh -c "${ENTRY} --ps_hosts=${ps_hosts} --trainer_hosts=${trainer_hosts} \
--task_index=${task_index}"
stdbuf -oL sh -c "${ENTRY}"
Copy link
Collaborator

@gongweibao gongweibao Mar 5, 2018

Choose a reason for hiding this comment

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

Should add task_index environment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PADDLE_INIT_TRAINER_ID does the job.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

how can the users print all env variables if not using the command line

using python os.envs

check_trainer_ret $?
}

Expand Down