From 67869edebfaa34268122ae4c0cf0d00518ade316 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Thu, 14 May 2020 11:35:42 +0800 Subject: [PATCH] bug fix --- core/engine/cluster/cloud/cluster.sh | 37 +++++++++++----------------- example/cloud/job.sh | 2 +- example/cloud/submit.sh | 6 ++--- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/core/engine/cluster/cloud/cluster.sh b/core/engine/cluster/cloud/cluster.sh index 5e79a35b..c2e984b8 100644 --- a/core/engine/cluster/cloud/cluster.sh +++ b/core/engine/cluster/cloud/cluster.sh @@ -8,18 +8,6 @@ # ---------------------------------------------------------------------------- # # variable define # # ---------------------------------------------------------------------------- # -declare g_jobname="" -declare g_version="" -declare g_priority="" -declare g_nodes="" -declare g_run_cmd="" -declare g_groupname="" -declare g_config="" -declare g_submitfiles="" -declare g_ak="" -declare g_sk="" -declare g_user_define_script="" -# ---------------------------------------------------------------------------- # #----------------------------------------------------------------------------------------------------------------- #fun : package @@ -59,18 +47,22 @@ function _after_submit() { function _submit() { g_run_stage="submit" - paddlecloud job --ak ${g_ak} --sk ${g_sk} train --cluster-name ${g_jobname} \ - --job-version ${g_version} \ - --mpi-priority ${g_priority} \ + cd ${engine_temp_path} + + paddlecloud job --ak ${engine_submit_ak} --sk ${engine_submit_sk} train --cluster-name ${engine_submit_cluster} \ + --job-version ${engine_submit_version} \ + --mpi-priority ${engine_submit_priority} \ --mpi-wall-time 300:59:00 \ - --mpi-nodes ${g_nodes} --is-standalone 0 \ + --mpi-nodes ${engine_submit_nodes} --is-standalone 0 \ --mpi-memory 110Gi \ - --job-name ${g_jobname} \ - --start-cmd ${g_run_cmd} \ - --group-name ${g_groupname} \ - --job-conf ${g_config} \ + --job-name ${engine_submit_jobname} \ + --start-cmd "${g_run_cmd}" \ + --group-name ${engine_submit_group} \ + --job-conf ${engine_submit_config} \ --files ${g_submitfiles} \ --json + + cd - } function submit_hook() { @@ -80,9 +72,10 @@ function submit_hook() { } function main() { - source ${g_user_define_script} + source ${engine_submit_scrpit} + package_hook submit_hook } -main \ No newline at end of file +main diff --git a/example/cloud/job.sh b/example/cloud/job.sh index a299372b..1b6440e1 100644 --- a/example/cloud/job.sh +++ b/example/cloud/job.sh @@ -7,4 +7,4 @@ echo "heheda" -python -m paddlerec.run -m config.yaml -e cluster -r worker +python -m paddlerec.run -m paddle_rec_config.yaml -e cluster -r worker diff --git a/example/cloud/submit.sh b/example/cloud/submit.sh index 27caafa2..2a773076 100644 --- a/example/cloud/submit.sh +++ b/example/cloud/submit.sh @@ -36,8 +36,8 @@ function package() { cp ${engine_workspace}/job.sh ${temp} cp ${engine_workspace}/before_hook.sh ${temp} - cp ${engine_run_config} ${temp}/config.yaml + cp ${engine_run_config} ${temp}/paddle_rec_config.yaml - g_submitfiles="job.sh before_hook.sh config.yaml" - g_run_cmd="sh job.sh" + g_submitfiles="job.sh before_hook.sh paddle_rec_config.yaml" + g_run_cmd='"sh job.sh"' } -- GitLab