def setUp(self): super(PlaceholderUtilsTest, self).setUp() examples = [standard_artifacts.Examples()] examples[0].uri = "/tmp" examples[0].split_names = artifact_utils.encode_split_names( ["train", "eval"]) self._serving_spec = infra_validator_pb2.ServingSpec() self._serving_spec.tensorflow_serving.tags.extend( ["latest", "1.15.0-gpu"]) self._resolution_context = placeholder_utils.ResolutionContext( exec_info=data_types.ExecutionInfo( input_dict={ "model": [standard_artifacts.Model()], "examples": examples, }, output_dict={"blessing": [standard_artifacts.ModelBlessing()]}, exec_properties={ "proto_property": json_format.MessageToJson(message=self._serving_spec, sort_keys=True, preserving_proto_field_name=True, indent=0) }, execution_output_uri="test_executor_output_uri", stateful_working_dir="test_stateful_working_dir", pipeline_node=pipeline_pb2.PipelineNode( node_info=pipeline_pb2.NodeInfo( type=metadata_store_pb2.ExecutionType( name="infra_validator"))), pipeline_info=pipeline_pb2.PipelineInfo( id="test_pipeline_id")), executor_spec=executable_spec_pb2.PythonClassExecutableSpec( class_path="test_class_path"), ) # Resolution context to simulate missing optional values. self._none_resolution_context = placeholder_utils.ResolutionContext( exec_info=data_types.ExecutionInfo( input_dict={ "model": [], "examples": [], }, output_dict={"blessing": []}, exec_properties={}, pipeline_node=pipeline_pb2.PipelineNode( node_info=pipeline_pb2.NodeInfo( type=metadata_store_pb2.ExecutionType( name="infra_validator"))), pipeline_info=pipeline_pb2.PipelineInfo( id="test_pipeline_id")), executor_spec=None, platform_config=None)
def _set_up_test_execution_info(self, input_dict=None, output_dict=None, exec_properties=None): return data_types.ExecutionInfo( input_dict=input_dict or {}, output_dict=output_dict or {}, exec_properties=exec_properties or {}, execution_output_uri='/testing/executor/output/', stateful_working_dir='/testing/stateful/dir', pipeline_node=pipeline_pb2.PipelineNode( node_info=pipeline_pb2.NodeInfo( type=metadata_store_pb2.ExecutionType(name='Docker_executor'))), pipeline_info=pipeline_pb2.PipelineInfo(id='test_pipeline_id'))
def _set_up_test_execution_info(self, input_dict=None, output_dict=None, exec_properties=None): return data_types.ExecutionInfo( execution_id=123, input_dict=input_dict or {}, output_dict=output_dict or {}, exec_properties=exec_properties or {}, execution_output_uri='/testing/executor/output/', stateful_working_dir='/testing/stateful/dir', pipeline_node=pipeline_pb2.PipelineNode( node_info=pipeline_pb2.NodeInfo( id='fakecomponent-fakecomponent')), pipeline_info=pipeline_pb2.PipelineInfo(id='Test'), pipeline_run_id='123')