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
exec_experiment_resources_parsed_content = ExperimentSpecification.read( exec_experiment_resources_content) exec_experiment_resources_parsed_content.parse_data() tensorboard_spec_content = """--- version: 1 kind: tensorboard tags: [fixtures] build: image: my_image """ tensorboard_spec_parsed_content = TensorboardSpecification.read( tensorboard_spec_content) tensorboard_spec_parsed_content.parse_data() notebook_spec_content = """--- version: 1 kind: notebook tags: [fixtures] build: image: my_image """ notebook_spec_parsed_content = NotebookSpecification.read( notebook_spec_content)
def specification(self) -> 'TensorboardSpecification': return TensorboardSpecification( values=self.content) if self.content else None
def _get_default_tensorboard_config(): specification = TensorboardSpecification.create_specification( {'image': conf.get(TENSORBOARDS_DOCKER_IMAGE)}, to_dict=False) return {'content': specification.raw_data}