Beispiel #1
0
def training(ctx: click.core.Context, url: str, token: str):
    """
    Local training process.\n
    Alias for the command is train.
    """
    ctx.obj = ModelTrainingClient(url, token)
Beispiel #2
0
 def training_get_log(train_id):
     log_generator = ModelTrainingClient().log(train_id, follow=False)
     # logs_list will be list of log lines
     logs_list = list(log_generator)
     text = "\n".join(logs_list)
     return text
Beispiel #3
0
def training(ctx: click.core.Context, url: str, token: str):
    """
    Allow you to perform actions on trainings.\n
    Alias for the command is train.
    """
    ctx.obj = ModelTrainingClient(url, token)
Beispiel #4
0
 def training_delete(train_id: str):
     return ModelTrainingClient().delete(train_id)
Beispiel #5
0
 def training_post(payload_file):
     api_object = parse_resources_file_with_one_item(payload_file).resource
     return ModelTrainingClient().create(api_object)
Beispiel #6
0
 def training_get_id(train_id: str):
     return ModelTrainingClient().get(train_id)
Beispiel #7
0
 def training_get():
     return ModelTrainingClient().get_all()
Beispiel #8
0
CONNECTION = EntityTestData(
    ConnectionClient(),
    Connection(
        id=ENTITY_ID,
        spec=ConnectionSpec(
            key_secret="mock-key-secret",
            uri="mock-url",
        ),
    ),
    connection.connection,
    'Connection',
)

TRAINING = EntityTestData(
    ModelTrainingClient(),
    ModelTraining(
        id=ENTITY_ID,
        spec=ModelTrainingSpec(work_dir="/1/2/3",
                               model=ModelIdentity(name="name",
                                                   version="version")),
        status=ModelTrainingStatus(state=SUCCEEDED_STATE)), training.training,
    'ModelTraining')

TOOLCHAIN = EntityTestData(
    ToolchainIntegrationClient(),
    ToolchainIntegration(
        id=ENTITY_ID,
        spec=ToolchainIntegrationSpec(
            default_image="mock-image",
            entrypoint="default-entrypoint",