Creates a container-based component.
tfx.dsl.component.experimental.container_component.create_container_component(
name: Text,
image: Text,
command: List[tfx.dsl.component.experimental.placeholders.CommandlineArgumentType
],
inputs: Dict[Text, Any] = None,
outputs: Dict[Text, Any] = None,
parameters: Dict[Text, Any] = None
) -> Callable[..., tfx.dsl.components.base.base_component.BaseComponent
]
Args |
name
|
The name of the component
|
image
|
Container image name.
|
command
|
Container entrypoint command-line. Not executed within a shell. The
command-line can use placeholder objects that will be replaced at the
compilation time. The placeholder objects can be imported from
tfx.dsl.component.experimental.placeholders. Note that Jinja templates are
not supported.
|
inputs
|
The list of component inputs
|
outputs
|
The list of component outputs
|
parameters
|
The list of component parameters
|
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'),
]
)