Given a defined R function export a YAML file for Kubeflow to consume.
kf_make_component(rfunction, name, description, image, file)
| rfunction | Name of target function. |
|---|---|
| name | Name of component. |
| description | Description of component. |
| image | Location of Docker image. |
| file | Location to write yaml. Optional. |
Component YAML
Names of metrics and ui metadata arguments are renamed to required
specifications. Kubeflow likes arguments to be typed, which R doesn't handle
naturally. This function looks for a slug at the end of each argument to
determine the type. For example, table_name_string would be considered an
input String. Output paths are identified by ending in _out. Supported
translations are:
Inputs
_string = String
_int = Integer
_bool = Bool
_float = Float
Outputs
_out = outputPath
_metrics = Metrics
_uimeta = UI_metadata
tfun <- function(table_string, pred_count_int, path_metrics) 2 * 2 kf_make_component("tfun", "Test Component", "Test out the component", "gcr.io/test/test")#> Error in get(fun, mode = "function", envir = envir): object 'tfun' of mode 'function' was not found