Python Sample

Cluster scheduling components are deployed on the Kubernetes platform, and various information required for scheduling jobs comes from Kubernetes. Therefore, you only need to send job-related information to Kubernetes.

Based on the official third-party Python library of Kubernetes, cluster scheduling components provide Code Example for delivering training and inference jobs. To run the Python samples provided by cluster scheduling components, you need to install the third-party Python library.

pip3.7 install jinja2;
pip3.7 install kubernetes==11.0.0;

The sample contains the following content:

  • Creating, querying, and deleting a ConfigMap
  • Creating, querying, and deleting a training job
  • Creating, querying, and deleting a training job of the Deployment type
  • Creating, querying, and deleting an inference job

For details about how to access Kubernetes in other programming languages, see official samples of Kubernetes.