Thomas Furmston
12/15/2021, 10:39 AMMPIJob
(from the https://github.com/kubeflow/mpi-operator library) given in the body of the task. Is that roughly correct?Anna Geller
CustomResourceDefinition
kind - so I would suspect that RunNamespacedJob wouldn’t work. But perhaps you can wrap this operator into a deployment and use CreateNamedspacedDeployment? just an ideaThomas Furmston
12/15/2021, 10:59 AMThomas Furmston
12/15/2021, 10:59 AMThomas Furmston
12/15/2021, 11:00 AMAnna Geller
kind: MPIJob
Thomas Furmston
12/15/2021, 11:03 AMThomas Furmston
12/15/2021, 11:04 AMAnna Geller
RunNamespacedJob
does is connecting to the “job” client API and creating a namespaced job.
api_client_job = cast(
client.BatchV1Api, get_kubernetes_client("job", kubernetes_api_key_secret)
)
...
api_client_job.create_namespaced_job(
namespace=namespace, body=body, **kube_kwargs
)
But MPIJob is not a normal job so not sure if this task will work but you can try and report back.Thomas Furmston
12/15/2021, 11:10 AMAnna Geller
Thomas Furmston
12/15/2021, 11:13 AMThomas Furmston
12/15/2021, 11:13 AMThomas Furmston
12/15/2021, 3:13 PMThomas Furmston
12/15/2021, 3:14 PMMPIJob
results inThomas Furmston
12/15/2021, 3:14 PMHTTP response headers: HTTPHeaderDict({'Audit-Id': '6510c974-e9b3-4808-86df-ae627a4e3a9b', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '78f8cc9e-4703-43f5-a87d-fdddab35f617', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'e8404112-029b-4412-aa5c-3b75d0022519', 'Date': 'Wed, 15 Dec 2021 15:12:07 GMT', 'Content-Length': '291'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"MPIJob in version \"v1\" cannot be handled as a Job: no kind \"MPIJob\" is registered for version \"batch/v1\" in scheme \"<http://k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30\|k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30\>"","reason":"BadRequest","code":400}
Thomas Furmston
12/15/2021, 3:14 PMThomas Furmston
12/15/2021, 3:15 PMThomas Furmston
12/15/2021, 3:15 PMThomas Furmston
12/15/2021, 3:20 PMkubernetes.client.exceptions.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Audit-Id': '3c22aa77-2d6e-4524-94d1-1b5e418f5388', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '78f8cc9e-4703-43f5-a87d-fdddab35f617', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'e8404112-029b-4412-aa5c-3b75d0022519', 'Date': 'Wed, 15 Dec 2021 15:18:40 GMT', 'Content-Length': '308'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"MPIJob in version \"v2beta1\" cannot be handled as a Job: no kind \"MPIJob\" is registered for version \"<http://kubeflow.org/v2beta1\|kubeflow.org/v2beta1\>" in scheme \"<http://k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30\|k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:30\>"","reason":"BadRequest","code":400}
Thomas Furmston
12/15/2021, 3:20 PMAnna Geller