class_docstr: A TFX component to validate the model against the serving infrastructure.
  
  An infra validation is done by loading the model to the exactly same serving
  binary that is used in production, and additionaly sending some requests to
  the model server. Such requests can be specified from Examples artifact.
  
  ## Examples
  
  Full example using TensorFlowServing binary running on local docker.
  
  ```
  infra_validator = InfraValidator(
      model=trainer.outputs['model'],
      examples=test_example_gen.outputs['examples'],
      serving_spec=ServingSpec(
          tensorflow_serving=TensorFlowServing(  # Using TF Serving.
              tags=['latest']
          ),
          local_docker=LocalDockerConfig(),  # Running on local docker.
      ),
      validation_spec=ValidationSpec(
          max_loading_time_seconds=60,
          num_tries=5,
      ),
      request_spec=RequestSpec(
          tensorflow_serving=TensorFlowServingRequestSpec(),
          num_examples=1,
      )
  )
  ```
  
  Minimal example when running on Kubernetes.
  
  ```
  infra_validator = InfraValidator(
      model=trainer.outputs['model'],
      examples=test_example_gen.outputs['examples'],
      serving_spec=ServingSpec(
          tensorflow_serving=TensorFlowServing(
              tags=['latest']
          ),
          kubernetes=KubernetesConfig(),  # Running on Kubernetes.
      ),
  )
  ```
  
  Component `outputs` contains:
   - `blessing`: Channel of type `standard_artifacts.InfraBlessing` that
                 contains the validation result.
  
  See [the InfraValidator
  guide](https://www.tensorflow.org/tfx/guide/infra_validator) for more
  details.
class_docstr_tok: ["A","TFX","component","to","validate","the","model","against","the","serving","infrastructure",".","An","infra","validation","is","done","by","loading","the","model","to","the","exactly","same","serving","binary","that","is","used","in","production",",","and","additionaly","sending","some","requests","to","the","model","server",".","Such","requests","can","be","specified","from","Examples","artifact",".","#","#","Examples","Full","example","using","TensorFlowServing","binary","running","on","local","docker",".","``","`","infra_validator","=","InfraValidator","(","model=trainer.outputs","[","'model","'","]",",","examples=test_example_gen.outputs","[","'examples","'","]",",","serving_spec=ServingSpec","(","tensorflow_serving=TensorFlowServing","(","#","Using","TF","Serving",".","tags=","[","'latest","'","]",")",",","local_docker=LocalDockerConfig","(",")",",","#","Running","on","local","docker",".",")",",","validation_spec=ValidationSpec","(","max_loading_time_seconds=60",",","num_tries=5",",",")",",","request_spec=RequestSpec","(","tensorflow_serving=TensorFlowServingRequestSpec","(",")",",","num_examples=1",",",")",")","``","`","Minimal","example","when","running","on","Kubernetes",".","``","`","infra_validator","=","InfraValidator","(","model=trainer.outputs","[","'model","'","]",",","examples=test_example_gen.outputs","[","'examples","'","]",",","serving_spec=ServingSpec","(","tensorflow_serving=TensorFlowServing","(","tags=","[","'latest","'","]",")",",","kubernetes=KubernetesConfig","(",")",",","#","Running","on","Kubernetes",".",")",",",")","``","`","Component","`","outputs","`","contains",":","-","`","blessing","`",":","Channel","of","type","`","standard_artifacts.InfraBlessing","`","that","contains","the","validation","result",".","See","[","the","InfraValidator","guide","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/infra_validator",")","for","more","details","."]
docstr: Construct a InfraValidator component.
  
  Args:
    model: A `BaseChannel` of `ModelExportPath` type, usually produced by
      [Trainer](https://www.tensorflow.org/tfx/guide/trainer) component.
        _required_
    serving_spec: A `ServingSpec` configuration about serving binary and test
      platform config to launch model server for validation. _required_
    examples: A `BaseChannel` of `ExamplesPath` type, usually produced by
      [ExampleGen](https://www.tensorflow.org/tfx/guide/examplegen) component.
        If not specified, InfraValidator does not issue requests for
        validation.
    request_spec: Optional `RequestSpec` configuration about making requests
      from `examples` input. If not specified, InfraValidator does not issue
      requests for validation.
    validation_spec: Optional `ValidationSpec` configuration.
docstr_tok: ["Construct","a","InfraValidator","component",".","Args",":","model",":","A","`","BaseChannel","`","of","`","ModelExportPath","`","type",",","usually","produced","by","[","Trainer","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/trainer",")","component",".","_required_","serving_spec",":","A","`","ServingSpec","`","configuration","about","serving","binary","and","test","platform","config","to","launch","model","server","for","validation",".","_required_","examples",":","A","`","BaseChannel","`","of","`","ExamplesPath","`","type",",","usually","produced","by","[","ExampleGen","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/examplegen",")","component",".","If","not","specified",",","InfraValidator","does","not","issue","requests","for","validation",".","request_spec",":","Optional","`","RequestSpec","`","configuration","about","making","requests","from","`","examples","`","input",".","If","not","specified",",","InfraValidator","does","not","issue","requests","for","validation",".","validation_spec",":","Optional","`","ValidationSpec","`","configuration","."]
code: def __init__(
      self,
      model: types.BaseChannel,
      serving_spec: infra_validator_pb2.ServingSpec,
      examples: Optional[types.BaseChannel] = None,
      request_spec: Optional[infra_validator_pb2.RequestSpec] = None,
      validation_spec: Optional[
          infra_validator_pb2.ValidationSpec
      ] = None,
  ):
      """Construct a InfraValidator component.
  
      Args:
        model: A `BaseChannel` of `ModelExportPath` type, usually produced by
          [Trainer](https://www.tensorflow.org/tfx/guide/trainer) component.
            _required_
        serving_spec: A `ServingSpec` configuration about serving binary and test
          platform config to launch model server for validation. _required_
        examples: A `BaseChannel` of `ExamplesPath` type, usually produced by
          [ExampleGen](https://www.tensorflow.org/tfx/guide/examplegen) component.
            If not specified, InfraValidator does not issue requests for
            validation.
        request_spec: Optional `RequestSpec` configuration about making requests
          from `examples` input. If not specified, InfraValidator does not issue
          requests for validation.
        validation_spec: Optional `ValidationSpec` configuration.
      """
      blessing = types.Channel(type=standard_artifacts.InfraBlessing)
      spec = standard_component_specs.InfraValidatorSpec(
          model=model,
          examples=examples,
          blessing=blessing,
          serving_spec=serving_spec,
          validation_spec=validation_spec,
          request_spec=request_spec,
      )
      super().__init__(spec=spec)
  
file_path: tfx/tfx/components/infra_validator/component.py
imports: from typing import Optional
  from tfx import types
  from tfx.components.infra_validator import executor
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import executor_spec
  from tfx.proto import infra_validator_pb2
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
label_desc: Use image node_id 1 to create a new InfraValidator object from inherited base classes: base_component with example: obj = InfraValidator(model, serving_spec, examples, request_spec, validation_spec)