diff --git a/core/engine/cluster/cloud/cluster.sh b/core/engine/cluster/cloud/cluster.sh index 5e79a35b7bcfd48264d4f956688b82a4046e1e6c..c2e984b85c1210fb7dccdad1eb3b2f6b3101fc71 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 a299372bf316453baf0cb1d3d8050e1934c1f52e..1b6440e11b74acc5d38c457025d143b30cbe0155 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 27caafa2b7df5681f4e5a187886bc83fda0436a1..2a773076a3a1936c413d4f043161c05e07a938e6 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"' }