Example #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
Example #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)
Example #3
0
 def specification(self) -> 'TensorboardSpecification':
     return TensorboardSpecification(values=self.config)
Example #4
0
 def _get_default_tensorboard_config():
     specification = TensorboardSpecification.create_specification(
         {'image': settings.TENSORBOARD_DOCKER_IMAGE})
     return {'config': specification}