Creates a container-based component.
tfx.v1.dsl.experimental.create_container_component(
name: str,
image: str,
command: List[placeholders.CommandlineArgumentType],
inputs: Optional[Dict[str, Any]] = None,
outputs: Optional[Dict[str, Any]] = None,
parameters: Optional[Dict[str, Any]] = None
) -> Callable[..., tfx.v1.types.BaseComponent
]
Returns | |
---|---|
Component that can be instantiated and user inside pipeline. |
Example:
component = create_container_component(
name='TrainModel',
inputs={
'training_data': Dataset,
},
outputs={
'model': Model,
},
parameters={
'num_training_steps': int,
},
image='gcr.io/my-project/my-trainer',
command=[
'python3', 'my_trainer',
'--training_data_uri', InputUriPlaceholder('training_data'),
'--model_uri', OutputUriPlaceholder('model'),
'--num_training-steps', InputValuePlaceholder('num_training_steps'),
]
)