Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lai, Weijian <laiweijian4@huawei.com> Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
7.4 KiB
Querying the Logs of a Specified Task in a Given Training Job (Preview)
Function
This API is used to query the logs of a specified task in a given training job (preview).
Debugging
You can debug this API through automatic authentication in or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/training-jobs/{training_job_id}/tasks/{task_id}/logs/preview
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
training_job_id |
Yes |
String |
ID of a training job. |
task_id |
Yes |
String |
Name of a training job. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
content |
String |
Log content. If the size of a log file does not exceed the upper limit (n MB), all the log content will be returned. Otherwise, only the latest log content in n MB will be returned. After March 1, 2022, 00:00:00 (GMT+08:00), the parameter name is changed from context to content. |
current_size |
Integer |
Size of the returned log content, in bytes. The maximum size is 5 MB. |
full_size |
Integer |
Size of complete log content, in bytes |
Example Requests
The following shows how to query the work-0 tasks of the training job whose UUID is 2cd88daa-31a4-40a8-a58f-d186b0e93e4f.
GET https://endpoint/v2/{project_id}/training-jobs/2cd88daa-31a4-40a8-a58f-d186b0e93e4f/tasks/worker-0/logs/preview
Example Responses
Status code: 200
ok
{ "content" : "[Modelarts Service Log]collect and upload ascend logs end at 2021-05-18-14:28:13\n[Modelarts Service Log]exiting..: \n [Modelarts Service Log]exiting...\n[Modelarts Service Log]exiting..: \n [Modelarts Service Log]exiting...\n[Modelarts Service Log]exit with : \n [Modelarts Service Log]exit with 0\n[Modelarts Service Log]exit with : \n [Modelarts Service Log]exit with 0\n[ModelArts Service Log][INFO][2021/05/18 14:28:14,207]:\n output-handler finalizing due to: [training finished]\n[ModelArts Service Log][INFO][2021/05/18 14:28:14,207]:\n output-handler finalized\n[Modelarts Service Log][sidecar] exiting at 2021-05-18-14:28:14\n[Modelarts Service Log][sidecar] wait python processes exit..: \n [Modelarts Service Log][sidecar] wait python processes exit...\n[Modelarts Service Log][sidecar] exit with :\n [Modelarts Service Log][sidecar] exit with 0", "current_size" : 126548, "full_size" : 5242880 }
Status Codes
Status Code |
Description |
---|---|
200 |
ok |
Error Codes
See Error Codes.