Skip to content

Commit a181db1

Browse files
committed
Move docstring
Signed-off-by: Eoin Fennessy <efenness@redhat.com>
1 parent 86b0aa2 commit a181db1

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

python/kubeflow/trainer/api/trainer_client.py

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,37 @@
2828

2929

3030
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+
3155
def __init__(
3256
self,
3357
config_file: Optional[str] = None,
3458
context: Optional[str] = None,
3559
client_configuration: Optional[client.Configuration] = None,
3660
namespace: Optional[str] = None,
3761
):
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-
6062
if namespace is None:
6163
namespace = utils.get_default_target_namespace(context)
6264

0 commit comments

Comments
 (0)