We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[v2 sample test] kaniko build times out / OOM
We've observed significantly high build time outs and OOMs with Kaniko recently.
I've tried several combinations:
1. 1.3.0-debug with/without --snapshotMode=redo + 4GB memory
2. 1.6.0-debug with/without --snapshotMode=redo + 8GB memory https://github.com/kubeflow/pipelines/pull/6226

but none of them run stably in reasonable amount of time.

The memory and timeout issues can be found upstream:
* https://github.com/GoogleContainerTools/kaniko/issues/1680
* https://github.com/GoogleContainerTools/kaniko/issues/1333

but they are both long standing, and no one still maintains the repo actively.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sdk/python/kfp/compiler/v2_compat.py`
Content:
```
1 # Copyright 2021 The Kubeflow Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Utility functions for enabling v2-compatible pipelines in v1."""
15 import collections
16 import json
17 from typing import Optional
18 
19 from kfp import dsl
20 from kfp.compiler import _default_transformers
21 from kfp.pipeline_spec import pipeline_spec_pb2
22 from kfp.v2 import compiler
23 
24 from kubernetes import client as k8s_client
25 
26 _DEFAULT_LAUNCHER_IMAGE = "gcr.io/ml-pipeline/kfp-launcher:1.6.6"
27 
28 
29 def update_op(op: dsl.ContainerOp,
30               pipeline_name: dsl.PipelineParam,
31               pipeline_root: dsl.PipelineParam,
32               launcher_image: Optional[str] = None) -> None:
33   """Updates the passed in Op for running in v2-compatible mode.
34 
35     Args:
36       op: The Op to update.
37       pipeline_spec: The PipelineSpec for the pipeline under which `op`
38         runs.
39       pipeline_root: The root output directory for pipeline artifacts.
40       launcher_image: An optional launcher image. Useful for tests.
41     """
42   op.is_v2 = True
43   # Inject the launcher binary and overwrite the entrypoint.
44   image_name = launcher_image or _DEFAULT_LAUNCHER_IMAGE
45   launcher_container = dsl.UserContainer(name="kfp-launcher",
46                                          image=image_name,
47                                          command="/bin/mount_launcher.sh",
48                                          mirror_volume_mounts=True)
49 
50   op.add_init_container(launcher_container)
51   op.add_volume(k8s_client.V1Volume(name='kfp-launcher'))
52   op.add_volume_mount(
53       k8s_client.V1VolumeMount(name='kfp-launcher', mount_path='/kfp-launcher'))
54 
55   # op.command + op.args will have the following sections:
56   # 1. args passed to kfp-launcher
57   # 2. a separator "--"
58   # 3. parameters in format "key1=value1", "key2=value2", ...
59   # 4. a separator "--" as end of arguments passed to launcher
60   # 5. (start of op.args) arguments of the original user program command + args
61   #
62   # example:
63   # - command:
64   # - /kfp-launcher/launch
65   # - '--mlmd_server_address'
66   # - $(METADATA_GRPC_SERVICE_HOST)
67   # - '--mlmd_server_port'
68   # - $(METADATA_GRPC_SERVICE_PORT)
69   # - ... # more launcher params
70   # - '--pipeline_task_id'
71   # - $(KFP_POD_NAME)
72   # - '--pipeline_root'
73   # - ''
74   # - '--' # start of parameter values
75   # - first=first
76   # - second=second
77   # - '--' # start of user command and args
78   # args:
79   # - sh
80   # - '-ec'
81   # - |
82   #     program_path=$(mktemp)
83   #     printf "%s" "$0" > "$program_path"
84   #     python3 -u "$program_path" "$@"
85   # - >
86   #     import json
87   #     import xxx
88   #     ...
89   op.command = [
90       "/kfp-launcher/launch",
91       "--mlmd_server_address",
92       "$(METADATA_GRPC_SERVICE_HOST)",
93       "--mlmd_server_port",
94       "$(METADATA_GRPC_SERVICE_PORT)",
95       "--runtime_info_json",
96       "$(KFP_V2_RUNTIME_INFO)",
97       "--container_image",
98       "$(KFP_V2_IMAGE)",
99       "--task_name",
100       op.name,
101       "--pipeline_name",
102       pipeline_name,
103       "--run_id",
104       "$(KFP_RUN_ID)",
105       "--run_resource",
106       "workflows.argoproj.io/$(WORKFLOW_ID)",
107       "--namespace",
108       "$(KFP_NAMESPACE)",
109       "--pod_name",
110       "$(KFP_POD_NAME)",
111       "--pod_uid",
112       "$(KFP_POD_UID)",
113       "--pipeline_root",
114       pipeline_root,
115       "--enable_caching",
116       "$(ENABLE_CACHING)",
117   ]
118 
119   # Mount necessary environment variables.
120   op.apply(_default_transformers.add_kfp_pod_env)
121   op.container.add_env_variable(
122       k8s_client.V1EnvVar(name="KFP_V2_IMAGE", value=op.container.image))
123 
124   config_map_ref = k8s_client.V1ConfigMapEnvSource(
125       name='metadata-grpc-configmap', optional=True)
126   op.container.add_env_from(
127       k8s_client.V1EnvFromSource(config_map_ref=config_map_ref))
128 
129   op.arguments = list(op.container_spec.command) + list(op.container_spec.args)
130 
131   runtime_info = {
132       "inputParameters": collections.OrderedDict(),
133       "inputArtifacts": collections.OrderedDict(),
134       "outputParameters": collections.OrderedDict(),
135       "outputArtifacts": collections.OrderedDict(),
136   }
137 
138   op.command += ["--"]
139   component_spec = op.component_spec
140   for parameter, spec in sorted(
141       component_spec.input_definitions.parameters.items()):
142     parameter_info = {
143         "type":
144             pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),
145     }
146     op.command += [f"{parameter}={op._parameter_arguments[parameter]}"]
147     runtime_info["inputParameters"][parameter] = parameter_info
148   op.command += ["--"]
149 
150   for artifact_name, spec in sorted(
151       component_spec.input_definitions.artifacts.items()):
152     artifact_info = {
153         "metadataPath": op.input_artifact_paths[artifact_name],
154         "schemaTitle": spec.artifact_type.schema_title,
155         "instanceSchema": spec.artifact_type.instance_schema,
156     }
157     runtime_info["inputArtifacts"][artifact_name] = artifact_info
158 
159   for parameter, spec in sorted(
160       component_spec.output_definitions.parameters.items()):
161     parameter_info = {
162         "type":
163             pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),
164         "path":
165             op.file_outputs[parameter],
166     }
167     runtime_info["outputParameters"][parameter] = parameter_info
168 
169   for artifact_name, spec in sorted(
170       component_spec.output_definitions.artifacts.items()):
171     # TODO: Assert instance_schema.
172     artifact_info = {
173         # Type used to register output artifacts.
174         "schemaTitle": spec.artifact_type.schema_title,
175         "instanceSchema": spec.artifact_type.instance_schema,
176         # File used to write out the registered artifact ID.
177         "metadataPath": op.file_outputs[artifact_name],
178     }
179     runtime_info["outputArtifacts"][artifact_name] = artifact_info
180 
181   op.container.add_env_variable(
182       k8s_client.V1EnvVar(name="KFP_V2_RUNTIME_INFO",
183                           value=json.dumps(runtime_info)))
184 
185   op.pod_annotations['pipelines.kubeflow.org/v2_component'] = "true"
186   op.pod_labels['pipelines.kubeflow.org/v2_component']= "true"
187
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sdk/python/kfp/compiler/v2_compat.py b/sdk/python/kfp/compiler/v2_compat.py
--- a/sdk/python/kfp/compiler/v2_compat.py
+++ b/sdk/python/kfp/compiler/v2_compat.py
@@ -44,7 +44,7 @@
   image_name = launcher_image or _DEFAULT_LAUNCHER_IMAGE
   launcher_container = dsl.UserContainer(name="kfp-launcher",
                                          image=image_name,
-                                         command="/bin/mount_launcher.sh",
+                                         command=["launcher", "--copy", "/kfp-launcher/launch"],
                                          mirror_volume_mounts=True)
 
   op.add_init_container(launcher_container)

{"golden_diff": "diff --git a/sdk/python/kfp/compiler/v2_compat.py b/sdk/python/kfp/compiler/v2_compat.py\n--- a/sdk/python/kfp/compiler/v2_compat.py\n+++ b/sdk/python/kfp/compiler/v2_compat.py\n@@ -44,7 +44,7 @@\n   image_name = launcher_image or _DEFAULT_LAUNCHER_IMAGE\n   launcher_container = dsl.UserContainer(name=\"kfp-launcher\",\n                                          image=image_name,\n-                                         command=\"/bin/mount_launcher.sh\",\n+                                         command=[\"launcher\", \"--copy\", \"/kfp-launcher/launch\"],\n                                          mirror_volume_mounts=True)\n \n   op.add_init_container(launcher_container)\n", "issue": "[v2 sample test] kaniko build times out / OOM\nWe've observed significantly high build time outs and OOMs with Kaniko recently.\r\nI've tried several combinations:\r\n1. 1.3.0-debug with/without --snapshotMode=redo + 4GB memory\r\n2. 1.6.0-debug with/without --snapshotMode=redo + 8GB memory https://github.com/kubeflow/pipelines/pull/6226\r\n\r\nbut none of them run stably in reasonable amount of time.\r\n\r\nThe memory and timeout issues can be found upstream:\r\n* https://github.com/GoogleContainerTools/kaniko/issues/1680\r\n* https://github.com/GoogleContainerTools/kaniko/issues/1333\r\n\r\nbut they are both long standing, and no one still maintains the repo actively.\n", "before_files": [{"content": "# Copyright 2021 The Kubeflow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Utility functions for enabling v2-compatible pipelines in v1.\"\"\"\nimport collections\nimport json\nfrom typing import Optional\n\nfrom kfp import dsl\nfrom kfp.compiler import _default_transformers\nfrom kfp.pipeline_spec import pipeline_spec_pb2\nfrom kfp.v2 import compiler\n\nfrom kubernetes import client as k8s_client\n\n_DEFAULT_LAUNCHER_IMAGE = \"gcr.io/ml-pipeline/kfp-launcher:1.6.6\"\n\n\ndef update_op(op: dsl.ContainerOp,\n              pipeline_name: dsl.PipelineParam,\n              pipeline_root: dsl.PipelineParam,\n              launcher_image: Optional[str] = None) -> None:\n  \"\"\"Updates the passed in Op for running in v2-compatible mode.\n\n    Args:\n      op: The Op to update.\n      pipeline_spec: The PipelineSpec for the pipeline under which `op`\n        runs.\n      pipeline_root: The root output directory for pipeline artifacts.\n      launcher_image: An optional launcher image. Useful for tests.\n    \"\"\"\n  op.is_v2 = True\n  # Inject the launcher binary and overwrite the entrypoint.\n  image_name = launcher_image or _DEFAULT_LAUNCHER_IMAGE\n  launcher_container = dsl.UserContainer(name=\"kfp-launcher\",\n                                         image=image_name,\n                                         command=\"/bin/mount_launcher.sh\",\n                                         mirror_volume_mounts=True)\n\n  op.add_init_container(launcher_container)\n  op.add_volume(k8s_client.V1Volume(name='kfp-launcher'))\n  op.add_volume_mount(\n      k8s_client.V1VolumeMount(name='kfp-launcher', mount_path='/kfp-launcher'))\n\n  # op.command + op.args will have the following sections:\n  # 1. args passed to kfp-launcher\n  # 2. a separator \"--\"\n  # 3. parameters in format \"key1=value1\", \"key2=value2\", ...\n  # 4. a separator \"--\" as end of arguments passed to launcher\n  # 5. (start of op.args) arguments of the original user program command + args\n  #\n  # example:\n  # - command:\n  # - /kfp-launcher/launch\n  # - '--mlmd_server_address'\n  # - $(METADATA_GRPC_SERVICE_HOST)\n  # - '--mlmd_server_port'\n  # - $(METADATA_GRPC_SERVICE_PORT)\n  # - ... # more launcher params\n  # - '--pipeline_task_id'\n  # - $(KFP_POD_NAME)\n  # - '--pipeline_root'\n  # - ''\n  # - '--' # start of parameter values\n  # - first=first\n  # - second=second\n  # - '--' # start of user command and args\n  # args:\n  # - sh\n  # - '-ec'\n  # - |\n  #     program_path=$(mktemp)\n  #     printf \"%s\" \"$0\" > \"$program_path\"\n  #     python3 -u \"$program_path\" \"$@\"\n  # - >\n  #     import json\n  #     import xxx\n  #     ...\n  op.command = [\n      \"/kfp-launcher/launch\",\n      \"--mlmd_server_address\",\n      \"$(METADATA_GRPC_SERVICE_HOST)\",\n      \"--mlmd_server_port\",\n      \"$(METADATA_GRPC_SERVICE_PORT)\",\n      \"--runtime_info_json\",\n      \"$(KFP_V2_RUNTIME_INFO)\",\n      \"--container_image\",\n      \"$(KFP_V2_IMAGE)\",\n      \"--task_name\",\n      op.name,\n      \"--pipeline_name\",\n      pipeline_name,\n      \"--run_id\",\n      \"$(KFP_RUN_ID)\",\n      \"--run_resource\",\n      \"workflows.argoproj.io/$(WORKFLOW_ID)\",\n      \"--namespace\",\n      \"$(KFP_NAMESPACE)\",\n      \"--pod_name\",\n      \"$(KFP_POD_NAME)\",\n      \"--pod_uid\",\n      \"$(KFP_POD_UID)\",\n      \"--pipeline_root\",\n      pipeline_root,\n      \"--enable_caching\",\n      \"$(ENABLE_CACHING)\",\n  ]\n\n  # Mount necessary environment variables.\n  op.apply(_default_transformers.add_kfp_pod_env)\n  op.container.add_env_variable(\n      k8s_client.V1EnvVar(name=\"KFP_V2_IMAGE\", value=op.container.image))\n\n  config_map_ref = k8s_client.V1ConfigMapEnvSource(\n      name='metadata-grpc-configmap', optional=True)\n  op.container.add_env_from(\n      k8s_client.V1EnvFromSource(config_map_ref=config_map_ref))\n\n  op.arguments = list(op.container_spec.command) + list(op.container_spec.args)\n\n  runtime_info = {\n      \"inputParameters\": collections.OrderedDict(),\n      \"inputArtifacts\": collections.OrderedDict(),\n      \"outputParameters\": collections.OrderedDict(),\n      \"outputArtifacts\": collections.OrderedDict(),\n  }\n\n  op.command += [\"--\"]\n  component_spec = op.component_spec\n  for parameter, spec in sorted(\n      component_spec.input_definitions.parameters.items()):\n    parameter_info = {\n        \"type\":\n            pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),\n    }\n    op.command += [f\"{parameter}={op._parameter_arguments[parameter]}\"]\n    runtime_info[\"inputParameters\"][parameter] = parameter_info\n  op.command += [\"--\"]\n\n  for artifact_name, spec in sorted(\n      component_spec.input_definitions.artifacts.items()):\n    artifact_info = {\n        \"metadataPath\": op.input_artifact_paths[artifact_name],\n        \"schemaTitle\": spec.artifact_type.schema_title,\n        \"instanceSchema\": spec.artifact_type.instance_schema,\n    }\n    runtime_info[\"inputArtifacts\"][artifact_name] = artifact_info\n\n  for parameter, spec in sorted(\n      component_spec.output_definitions.parameters.items()):\n    parameter_info = {\n        \"type\":\n            pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),\n        \"path\":\n            op.file_outputs[parameter],\n    }\n    runtime_info[\"outputParameters\"][parameter] = parameter_info\n\n  for artifact_name, spec in sorted(\n      component_spec.output_definitions.artifacts.items()):\n    # TODO: Assert instance_schema.\n    artifact_info = {\n        # Type used to register output artifacts.\n        \"schemaTitle\": spec.artifact_type.schema_title,\n        \"instanceSchema\": spec.artifact_type.instance_schema,\n        # File used to write out the registered artifact ID.\n        \"metadataPath\": op.file_outputs[artifact_name],\n    }\n    runtime_info[\"outputArtifacts\"][artifact_name] = artifact_info\n\n  op.container.add_env_variable(\n      k8s_client.V1EnvVar(name=\"KFP_V2_RUNTIME_INFO\",\n                          value=json.dumps(runtime_info)))\n\n  op.pod_annotations['pipelines.kubeflow.org/v2_component'] = \"true\"\n  op.pod_labels['pipelines.kubeflow.org/v2_component']= \"true\"\n", "path": "sdk/python/kfp/compiler/v2_compat.py"}], "after_files": [{"content": "# Copyright 2021 The Kubeflow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Utility functions for enabling v2-compatible pipelines in v1.\"\"\"\nimport collections\nimport json\nfrom typing import Optional\n\nfrom kfp import dsl\nfrom kfp.compiler import _default_transformers\nfrom kfp.pipeline_spec import pipeline_spec_pb2\nfrom kfp.v2 import compiler\n\nfrom kubernetes import client as k8s_client\n\n_DEFAULT_LAUNCHER_IMAGE = \"gcr.io/ml-pipeline/kfp-launcher:1.6.6\"\n\n\ndef update_op(op: dsl.ContainerOp,\n              pipeline_name: dsl.PipelineParam,\n              pipeline_root: dsl.PipelineParam,\n              launcher_image: Optional[str] = None) -> None:\n  \"\"\"Updates the passed in Op for running in v2-compatible mode.\n\n    Args:\n      op: The Op to update.\n      pipeline_spec: The PipelineSpec for the pipeline under which `op`\n        runs.\n      pipeline_root: The root output directory for pipeline artifacts.\n      launcher_image: An optional launcher image. Useful for tests.\n    \"\"\"\n  op.is_v2 = True\n  # Inject the launcher binary and overwrite the entrypoint.\n  image_name = launcher_image or _DEFAULT_LAUNCHER_IMAGE\n  launcher_container = dsl.UserContainer(name=\"kfp-launcher\",\n                                         image=image_name,\n                                         command=[\"launcher\", \"--copy\", \"/kfp-launcher/launch\"],\n                                         mirror_volume_mounts=True)\n\n  op.add_init_container(launcher_container)\n  op.add_volume(k8s_client.V1Volume(name='kfp-launcher'))\n  op.add_volume_mount(\n      k8s_client.V1VolumeMount(name='kfp-launcher', mount_path='/kfp-launcher'))\n\n  # op.command + op.args will have the following sections:\n  # 1. args passed to kfp-launcher\n  # 2. a separator \"--\"\n  # 3. parameters in format \"key1=value1\", \"key2=value2\", ...\n  # 4. a separator \"--\" as end of arguments passed to launcher\n  # 5. (start of op.args) arguments of the original user program command + args\n  #\n  # example:\n  # - command:\n  # - /kfp-launcher/launch\n  # - '--mlmd_server_address'\n  # - $(METADATA_GRPC_SERVICE_HOST)\n  # - '--mlmd_server_port'\n  # - $(METADATA_GRPC_SERVICE_PORT)\n  # - ... # more launcher params\n  # - '--pipeline_task_id'\n  # - $(KFP_POD_NAME)\n  # - '--pipeline_root'\n  # - ''\n  # - '--' # start of parameter values\n  # - first=first\n  # - second=second\n  # - '--' # start of user command and args\n  # args:\n  # - sh\n  # - '-ec'\n  # - |\n  #     program_path=$(mktemp)\n  #     printf \"%s\" \"$0\" > \"$program_path\"\n  #     python3 -u \"$program_path\" \"$@\"\n  # - >\n  #     import json\n  #     import xxx\n  #     ...\n  op.command = [\n      \"/kfp-launcher/launch\",\n      \"--mlmd_server_address\",\n      \"$(METADATA_GRPC_SERVICE_HOST)\",\n      \"--mlmd_server_port\",\n      \"$(METADATA_GRPC_SERVICE_PORT)\",\n      \"--runtime_info_json\",\n      \"$(KFP_V2_RUNTIME_INFO)\",\n      \"--container_image\",\n      \"$(KFP_V2_IMAGE)\",\n      \"--task_name\",\n      op.name,\n      \"--pipeline_name\",\n      pipeline_name,\n      \"--run_id\",\n      \"$(KFP_RUN_ID)\",\n      \"--run_resource\",\n      \"workflows.argoproj.io/$(WORKFLOW_ID)\",\n      \"--namespace\",\n      \"$(KFP_NAMESPACE)\",\n      \"--pod_name\",\n      \"$(KFP_POD_NAME)\",\n      \"--pod_uid\",\n      \"$(KFP_POD_UID)\",\n      \"--pipeline_root\",\n      pipeline_root,\n      \"--enable_caching\",\n      \"$(ENABLE_CACHING)\",\n  ]\n\n  # Mount necessary environment variables.\n  op.apply(_default_transformers.add_kfp_pod_env)\n  op.container.add_env_variable(\n      k8s_client.V1EnvVar(name=\"KFP_V2_IMAGE\", value=op.container.image))\n\n  config_map_ref = k8s_client.V1ConfigMapEnvSource(\n      name='metadata-grpc-configmap', optional=True)\n  op.container.add_env_from(\n      k8s_client.V1EnvFromSource(config_map_ref=config_map_ref))\n\n  op.arguments = list(op.container_spec.command) + list(op.container_spec.args)\n\n  runtime_info = {\n      \"inputParameters\": collections.OrderedDict(),\n      \"inputArtifacts\": collections.OrderedDict(),\n      \"outputParameters\": collections.OrderedDict(),\n      \"outputArtifacts\": collections.OrderedDict(),\n  }\n\n  op.command += [\"--\"]\n  component_spec = op.component_spec\n  for parameter, spec in sorted(\n      component_spec.input_definitions.parameters.items()):\n    parameter_info = {\n        \"type\":\n            pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),\n    }\n    op.command += [f\"{parameter}={op._parameter_arguments[parameter]}\"]\n    runtime_info[\"inputParameters\"][parameter] = parameter_info\n  op.command += [\"--\"]\n\n  for artifact_name, spec in sorted(\n      component_spec.input_definitions.artifacts.items()):\n    artifact_info = {\n        \"metadataPath\": op.input_artifact_paths[artifact_name],\n        \"schemaTitle\": spec.artifact_type.schema_title,\n        \"instanceSchema\": spec.artifact_type.instance_schema,\n    }\n    runtime_info[\"inputArtifacts\"][artifact_name] = artifact_info\n\n  for parameter, spec in sorted(\n      component_spec.output_definitions.parameters.items()):\n    parameter_info = {\n        \"type\":\n            pipeline_spec_pb2.PrimitiveType.PrimitiveTypeEnum.Name(spec.type),\n        \"path\":\n            op.file_outputs[parameter],\n    }\n    runtime_info[\"outputParameters\"][parameter] = parameter_info\n\n  for artifact_name, spec in sorted(\n      component_spec.output_definitions.artifacts.items()):\n    # TODO: Assert instance_schema.\n    artifact_info = {\n        # Type used to register output artifacts.\n        \"schemaTitle\": spec.artifact_type.schema_title,\n        \"instanceSchema\": spec.artifact_type.instance_schema,\n        # File used to write out the registered artifact ID.\n        \"metadataPath\": op.file_outputs[artifact_name],\n    }\n    runtime_info[\"outputArtifacts\"][artifact_name] = artifact_info\n\n  op.container.add_env_variable(\n      k8s_client.V1EnvVar(name=\"KFP_V2_RUNTIME_INFO\",\n                          value=json.dumps(runtime_info)))\n\n  op.pod_annotations['pipelines.kubeflow.org/v2_component'] = \"true\"\n  op.pod_labels['pipelines.kubeflow.org/v2_component']= \"true\"\n", "path": "sdk/python/kfp/compiler/v2_compat.py"}]}