|
28 | 28 |
|
29 | 29 |
|
30 | 30 | class TrainerClient(AbstractTrainerClient): |
| 31 | + """TrainerClient constructor. Configure logging in your application |
| 32 | + as follows to see detailed information from the TrainerClient APIs: |
| 33 | +
|
| 34 | + .. code-block:: python |
| 35 | +
|
| 36 | + import logging |
| 37 | + logging.basicConfig() |
| 38 | + log = logging.getLogger("kubeflow.trainer.api.trainer_client") |
| 39 | + log.setLevel(logging.DEBUG) |
| 40 | +
|
| 41 | + Args: |
| 42 | + config_file: Path to the kube-config file. Defaults to ~/.kube/config. |
| 43 | + context: Set the active context. Defaults to current_context from the kube-config. |
| 44 | + client_configuration: Client configuration for cluster authentication. |
| 45 | + You have to provide valid configuration with Bearer token or |
| 46 | + with username and password. You can find an example here: |
| 47 | + https://github.com/kubernetes-client/python/blob/67f9c7a97081b4526470cad53576bc3b71fa6fcc/examples/remote_cluster.py#L31 |
| 48 | + namespace: Target Kubernetes namespace. If SDK runs outside of Kubernetes cluster it |
| 49 | + takes the namespace from the kube-config context. If SDK runs inside |
| 50 | + the Kubernetes cluster it takes namespace from the |
| 51 | + `/var/run/secrets/kubernetes.io/serviceaccount/namespace` file. By default it |
| 52 | + uses the `default` namespace. |
| 53 | + """ |
| 54 | + |
31 | 55 | def __init__( |
32 | 56 | self, |
33 | 57 | config_file: Optional[str] = None, |
34 | 58 | context: Optional[str] = None, |
35 | 59 | client_configuration: Optional[client.Configuration] = None, |
36 | 60 | namespace: Optional[str] = None, |
37 | 61 | ): |
38 | | - """TrainerClient constructor. Configure logging in your application |
39 | | - as follows to see detailed information from the TrainerClient APIs: |
40 | | - .. code-block:: python |
41 | | - import logging |
42 | | - logging.basicConfig() |
43 | | - log = logging.getLogger("kubeflow.trainer.api.trainer_client") |
44 | | - log.setLevel(logging.DEBUG) |
45 | | -
|
46 | | - Args: |
47 | | - config_file: Path to the kube-config file. Defaults to ~/.kube/config. |
48 | | - context: Set the active context. Defaults to current_context from the kube-config. |
49 | | - client_configuration: Client configuration for cluster authentication. |
50 | | - You have to provide valid configuration with Bearer token or |
51 | | - with username and password. You can find an example here: |
52 | | - https://github.com/kubernetes-client/python/blob/67f9c7a97081b4526470cad53576bc3b71fa6fcc/examples/remote_cluster.py#L31 |
53 | | - namespace: Target Kubernetes namespace. If SDK runs outside of Kubernetes cluster it |
54 | | - takes the namespace from the kube-config context. If SDK runs inside |
55 | | - the Kubernetes cluster it takes namespace from the |
56 | | - `/var/run/secrets/kubernetes.io/serviceaccount/namespace` file. By default it |
57 | | - uses the `default` namespace. |
58 | | - """ |
59 | | - |
60 | 62 | if namespace is None: |
61 | 63 | namespace = utils.get_default_target_namespace(context) |
62 | 64 |
|
|
0 commit comments