anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: tensorflow/tfx
Issue: ImportExampleGen on Kubeflow not working

After building tfx image on latest master, I just discovered using ImportExampleGen on Kubeflow results in:
```
usage: container_entrypoint.py [-h] --exec_properties EXEC_PROPERTIES
                               --outputs OUTPUTS --executor_class_path
                               EXECUTOR_CLASS_PATH
                               {CsvExampleGen,BigQueryExampleGen,StatisticsGen,SchemaGen,ExampleValidator,Transform,Trainer,Evaluator,ModelValidator,Pusher}
                               ...
container_entrypoint.py: error: argument executor: invalid choice: 'ImportExampleGen' (choose from 'CsvExampleGen', 'BigQueryExampleGen', 'StatisticsGen', 'SchemaGen', 'ExampleValidator', 'Transform', 'Trainer', 'Evaluator', 'ModelValidator', 'Pusher')
```

Changed files:
tfx/orchestration/kubeflow/container_entrypoint.py, tfx/orchestration/kubeflow/executor_wrappers.py

diff --git a/tfx/orchestration/kubeflow/container_entrypoint.py b/tfx/orchestration/kubeflow/container_entrypoint.py
index 4d41e5ee..635c1cc3 100644
--- a/tfx/orchestration/kubeflow/container_entrypoint.py
+++ b/tfx/orchestration/kubeflow/container_entrypoint.py
@@ -51,6 +51,10 @@ def main():
   subparser.add_argument('--input_base', type=str, required=True)
   subparser.set_defaults(executor=wrappers.CsvExampleGenWrapper)
 
+  subparser = subparsers.add_parser('ImportExampleGen')
+  subparser.add_argument('--input_base', type=str, required=True)
+  subparser.set_defaults(executor=wrappers.ImportExampleGenWrapper)
+
   subparser = subparsers.add_parser('BigQueryExampleGen')
   subparser.set_defaults(executor=wrappers.BigQueryExampleGenWrapper)
 
diff --git a/tfx/orchestration/kubeflow/executor_wrappers.py b/tfx/orchestration/kubeflow/executor_wrappers.py
index ffad9492..c4f8589d 100644
--- a/tfx/orchestration/kubeflow/executor_wrappers.py
+++ b/tfx/orchestration/kubeflow/executor_wrappers.py
@@ -158,6 +158,29 @@ class CsvExampleGenWrapper(KubeflowExecutorWrapper):
       input_artifact.span = span
 
 
+class ImportExampleGenWrapper(KubeflowExecutorWrapper):
+  """Wrapper for ImportExampleGen component."""
+
+  def __init__(self, args: argparse.Namespace):
+    super(ImportExampleGenWrapper, self).__init__(
+        executor_class_path=args.executor_class_path,
+        name='ImportExampleGen',
+        input_dict={
+            'input_base': parse_tfx_type(args.input_base),
+        },
+        outputs=args.outputs,
+        exec_properties=json.loads(args.exec_properties),
+    )
+    self._set_input_artifact_span()
+    self._set_outputs()
+
+  def _set_input_artifact_span(self):
+    for input_artifact in self._input_dict['input_base']:
+      matched = re.match(r'span_([0-9]+)', input_artifact.uri)
+      span = matched.group(1) if matched else 1
+      input_artifact.span = span
+
+
 class BigQueryExampleGenWrapper(KubeflowExecutorWrapper):
   """Wrapper for BigQueryExampleGen component."""
Repository: tensorflow/tfx
Issue: Issue when using exit_handler with Kubeflow orchestrator

Environment:

Python 3.7.7
tfx==1.8.1
kfp==1.8.13
kfp-pipeline-spec==0.1.16
kfp-server-api==1.8.1

Issue description:


I have a tfx pipeline orchestrated by kubeflow pipeline. I upgraded tfx to version 1.8.1 in order to try to use the exit_handler support which was introduced in tfx 1.8.0.
I manage to build and compile my tfx pipeline in a kubeflow pipeline, but it looks like when we use the exit_handler, tfx orchestrator has a special behavior as we can see in `tfx/orchestration/kubeflow/utils.py`.

```python
# Key of dag for all TFX components when compiling pipeline with exit handler.
TFX_DAG_NAME = '_tfx_dag'
````

It seems like this result in an invalid argo workflow generated as when I try to use kfp API to create a run from the pipeline compiled file I get the following error from kubeflow API


```
Failed to create a new run.
(...)
"error_details":"Internal error: spec.templates[0].name: '_tfx_dag' is invalid: name must consist of alpha-numeric characters or '-', and must start with an alpha-numeric character (e.g. My-name1-2, 123-NAME)
(...)
```

Any idea if I am doing something wrong with how I use exit_handler ?

Do you think it is safe to update `TFX_DAG_NAME` to an argo complient name ?

Thank you for your time.




Changed files:
tfx/orchestration/kubeflow/utils.py

diff --git a/tfx/orchestration/kubeflow/utils.py b/tfx/orchestration/kubeflow/utils.py
index ef4631a3..b6f668df 100644
--- a/tfx/orchestration/kubeflow/utils.py
+++ b/tfx/orchestration/kubeflow/utils.py
@@ -18,7 +18,7 @@ from tfx.dsl.components.base import base_node
 from tfx.orchestration.kubeflow.decorators import FinalStatusStr
 
 # Key of dag for all TFX components when compiling pipeline with exit handler.
-TFX_DAG_NAME = '_tfx_dag'
+TFX_DAG_NAME = 'tfx-dag'
 
 
 def replace_exec_properties(component: base_node.BaseNode) -> None:
Repository: apache/libcloud
Issue: Rackspace Cloud Files use_internal_url setting causes exception

## Summary

Attempting to use Rackspace Cloud Files with `use_internal_url=True` option results in `LibcloudError("Could not find specified endpoint")`

## Detailed Information

python version: 3.9.2  
libcloud version: 3.7.0

Example code:

```
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
driver_cls = get_driver(Provider.CLOUDFILES)
cloudfiles = driver_cls("USERNAME", "API_KEY", use_internal_url=True)
# Throws LibcloudError("Could not find specified endpoint"):
cloudfiles.list_containers()
```

(Pull request incoming.) 

Changed files:
libcloud/storage/drivers/cloudfiles.py

diff --git a/libcloud/storage/drivers/cloudfiles.py b/libcloud/storage/drivers/cloudfiles.py
index 9f749b446..c126c11b0 100644
--- a/libcloud/storage/drivers/cloudfiles.py
+++ b/libcloud/storage/drivers/cloudfiles.py
@@ -192,23 +192,19 @@ class CloudFilesConnection(OpenStackSwiftConnection):
     def get_endpoint(self):
         region = self._ex_force_service_region.upper()
 
-        if self.use_internal_url:
-            endpoint_type = "internal"
-        else:
-            endpoint_type = "external"
-
         if "2.0" in self._auth_version:
             ep = self.service_catalog.get_endpoint(
                 service_type="object-store",
                 name="cloudFiles",
                 region=region,
-                endpoint_type=endpoint_type,
+                endpoint_type="internal" if self.use_internal_url else "external",
             )
             cdn_ep = self.service_catalog.get_endpoint(
                 service_type="rax:object-cdn",
                 name="cloudFilesCDN",
                 region=region,
-                endpoint_type=endpoint_type,
+                # Cloud Files has no concept of an "internal" CDN.
+                endpoint_type="external",
             )
         else:
             raise LibcloudError('Auth version "%s" not supported' % (self._auth_version))