Skip to content

Commit

Permalink
feat(components): internal
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 604508859
  • Loading branch information
Googler committed Apr 18, 2024
1 parent d919ae7 commit f3f843f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from kfp import dsl


# pylint: disable=singleton-comparison
# pylint: disable=g-doc-args
@dsl.container_component
def data_converter(
Expand All @@ -31,6 +32,7 @@ def data_converter(
objective: str,
output_dir: dsl.Output[dsl.Artifact],
gcp_resources: dsl.OutputPath(str),
enable_input_validation: bool = True,
location: str = 'us-central1',
timeout: str = '604800s',
service_account: Optional[str] = None,
Expand Down Expand Up @@ -74,8 +76,6 @@ def data_converter(
'container_spec': {
'image_uri': 'us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/data-converter',
'args': [
'--enable_input_validation',
'true',
'--input_file_path',
input_file_path,
'--input_file_type',
Expand Down Expand Up @@ -108,6 +108,12 @@ def data_converter(
},
'encryption_spec': {'kms_key_name': encryption_spec_key_name},
}

if enable_input_validation == True:
payload['job_spec']['worker_pool_specs']['container_spec']['args'].append(
['--enable_input_validation', 'true']
)

return dsl.ContainerSpec(
image=_image.GCPC_IMAGE_TAG,
command=[
Expand Down

0 comments on commit f3f843f

Please sign in to comment.