KatibClient(config_file=None, context=None, client_configuration=None, persist_config=True)
User can loads authentication and cluster information from kube-config file and stores them in kubernetes.client.configuration. Parameters are as following:
parameter | Description |
---|---|
config_file | Location of kube-config file. Defaults to ~/.kube/config . Note that the config_file is needed if user want to operate katib SDK in another remote cluster, user must set config_file to load kube-config file explicitly, e.g. KatibClient(config_file="~/.kube/config") . |
context | Set the active context. If is set to None, current_context from config file will be used. |
client_configuration | The kubernetes.client.Configuration to set configs to. |
persist_config | If True, config file will be updated when changed (e.g GCP token refresh). |
The APIs for KatibClient are as following:
Class | Method | Description |
---|---|---|
KatibClient | create_experiment | Create Katib Experiment |
KatibClient | get_experiment | Get or watch the specified experiment or all experiments in the namespace |
KatibClient | delete_experiment | Delete specified experiment |
KatibClient | list_experiments | List all experiments with status |
KatibClient | get_experiment_status | Get experiment status |
KatibClient | is_experiment_succeeded | Check if experiment status is Succeeded |
KatibClient | list_trials | List all trials of specified experiment with status |
KatibClient | get_optimal_hyperparmeters | Get currentOptimalTrial with paramaterAssignments of an experiment |
create_experiment(experiment, namespace=None)
Name | Type | Description | Notes |
---|---|---|---|
experiment | V1alpha3Experiment | experiment definition | Required |
namespace | str | Namespace for experiment deploying to. If the namespace is not defined, will align with experiment definition, or use current or default namespace if namespace is not specified in experiment definition. |
Optional |
object
get_experiment(name=None, namespace=None)
Get experiment in the specified namespace
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. If the name is not specified, will get all experiments in the namespace. |
Optional. |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
object
delete_experiment(name, namespace=None)
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. | Required |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
object
list_experiments(namespace=None)
List all experiment with status
Name | Type | Description | Notes |
---|---|---|---|
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
List
get_experiment_status(name, namespace=None)
Returns experiment status, such as Running, Failed or Succeeded.
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. | Required |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
Str
is_experiment_succeeded(name, namespace=None)
Returns True if Experiment succeeded; false otherwise.
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. | Required |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
Bool
list_trials(name, namespace=None)
List all trials of an experiment with status
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. | Required |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
List
get_optimal_hyperparmeters(name, namespace=None)
Get currentOptimalTrial with paramaterAssignments of an experiment
Name | Type | Description | Notes |
---|---|---|---|
name | str | Experiment name. | Required |
namespace | str | Experiment's namespace. Defaults to current or default namespace. | Optional |
Dict