Issue calling Platform Server API

Hello,

Is there any way to notify a service/api in case job fails?

From documentation I came to know about Platform API and decided to use JobList to get list of Jobs which have failed.
https://docs.nvidia.com/clara/deploy/sdk/Platform/Api/public/docs/jobs/rpc-list.html#jobslistrequest

If I am not wrong, Platform API server listens on port 50051 in docker but this port is not mapped to host. So I used docker IP to send requests to the server.

I am able to send request but getting StatusCode.UNIMPLEMENTED error message.

Request:
header {
user_agent: “custom-client-example”
}
filter {
has_state: JOB_STATE_STOPPED
has_status: JOB_STATUS_FAULTED
}

Response:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED

Hi,

I think you are using the incorrect API to list the jobs.
You should be using the List API to get the list of the jobs.
However, as of now, the List API does not use the filters and will return the entire list of jobs.

You can also use the clara CLI to list the jobs and get their status.
https://docs.nvidia.com/clara/deploy/sdk/cli/public/docs/overview.html#commands

Also, Platform port 50051 is mapped to the host. You can get the Host Port by using the following kubectl command.

user@devbox:~$ kubectl get svc
NAME                            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
clara                           NodePort    <10.112.56.32>   <none>        50051:32279/TCP     19d

Under PORT(S), you can see the 50051:32279 mapping. Here 32279 is the HostPort.