예제 #1
0
def validate_tensorboard_spec_config(config, raise_for_rest: bool = False):
    try:
        spec = TensorboardSpecification.read(config)
    except (MarshmallowValidationError, PolyaxonfileError,
            PolyaxonConfigurationError) as e:
        message_error = 'Received non valid tensorboard specification config. %s' % e
        if raise_for_rest:
            raise ValidationError(message_error)
        else:
            raise DjangoValidationError(message_error)

    return spec
예제 #2
0
"""
exec_experiment_resources_parsed_content = ExperimentSpecification.read(
    exec_experiment_resources_content)

tensorboard_spec_content = """---
    version: 1
    
    kind: tensorboard
    
    tags: [fixtures]

    build:
      image: my_image
"""

tensorboard_spec_parsed_content = TensorboardSpecification.read(
    tensorboard_spec_content)

notebook_spec_content = """---
    version: 1

    kind: notebook
    
    tags: [fixtures]

    build:
      image: my_image
"""

notebook_spec_parsed_content = NotebookSpecification.read(
    notebook_spec_content)