예제 #1
0
    def test_plugin_specification_raises_for_invalid_run_section(self):
        with self.assertRaises(PolyaxonConfigurationError):
            PluginSpecification.read(os.path.abspath(
                'tests/fixtures/plugin_missing_run_exec.yml'))

        with self.assertRaises(PolyaxonConfigurationError):
            PluginSpecification.read(os.path.abspath(
                'tests/fixtures/plugin_run_exec_simple_file_with_cmd.yml'))
예제 #2
0
def validate_plugin_spec_config(config):
    try:
        spec = PluginSpecification.read(config)
    except (PolyaxonfileError, PolyaxonConfigurationError):
        raise ValidationError(
            'Received non valid tensorboard specification config.')

    return spec
예제 #3
0
def validate_tensorboard_spec_content(content):
    try:
        spec = PluginSpecification.read(content)
    except (PolyaxonfileError, PolyaxonConfigurationError):
        raise ValidationError(
            'Received non valid tensorboard specification content.')

    validate_run_type(spec)

    return spec
예제 #4
0
def validate_plugin_spec_config(config, raise_for_rest=False):
    try:
        spec = PluginSpecification.read(config)
    except (PolyaxonfileError, PolyaxonConfigurationError) as e:
        message_error = 'Received non valid plugin specification config. %s' % e
        if raise_for_rest:
            raise ValidationError(message_error)
        else:
            raise DjangoValidationError(message_error)

    return spec
예제 #5
0
          - Dense:
              units: 10
              activation: softmax

    train:
      data_pipeline:
        TFRecordImagePipeline:
          batch_size: 64
          num_epochs: 1
          shuffle: true
          dynamic_pad: false
          data_files: ["../data/mnist/mnist_train.tfrecord"]
          meta_data_file: "../data/mnist/meta_data.json"
"""
exec_experiment_resources_parsed_content = ExperimentSpecification.read(exec_experiment_resources_content)


plugin_spec_content = """---
    version: 1
    
    kind: plugin

    project:
      name: project1

    run:
      image: my_image
"""

plugin_spec_parsed_content = PluginSpecification.read(plugin_spec_content)
예제 #6
0
 def compiled_spec(self):
     return PluginSpecification(values=self.config)
예제 #7
0
 def specification(self):
     return PluginSpecification(values=self.config)
예제 #8
0
 def _get_default_tensorboard_config():
     specification = PluginSpecification.create_specification(
         {'image': settings.TENSORBOARD_DOCKER_IMAGE})
     return {'config': specification}