MCPcopy
hub / github.com/PaddlePaddle/PARL / download_log

Function download_log

parl/remote/log_server.py:68–88  ·  view source on GitHub ↗

args: job_id: the id of the remote job response: log: log file

()

Source from the content-addressed store, hash-verified

66 'GET',
67 ])
68def download_log():
69 '''
70 args:
71 job_id: the id of the remote job
72 response:
73 log: log file
74 '''
75 try:
76 job_id = request.args['job_id']
77 except:
78 return make_response(
79 jsonify(message="No job_id provided, please check your request."),
80 400)
81 log_dir = current_app.config.get('LOG_DIR')
82 log_dir = os.path.expanduser(log_dir)
83 log_file_path = os.path.join(log_dir, job_id, 'stdout.log')
84 if not os.path.isfile(log_file_path):
85 return make_response(
86 jsonify(message="Log not exsits, please check your job_id"), 400)
87 else:
88 return send_file(log_file_path, as_attachment=True)
89
90
91def send_heartbeat_addr_to_worker(worker_addr, heartbeat_server_addr):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected