prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  allow output artifact store configuration (vs hard coded)
  it seems like the output artifacts are always stored in a specific minio service, port, namespace, bucket, secrets, etc (`minio-service.kubeflow:9000`). 
  
  see: https://github.com/kubeflow/pipelines/blob/f40a22a3f4a8e06d20cf3e3f425b5058d5c87e0b/sdk/python/kfp/compiler/_op_to_template.py#L148
  
  it would be great to make it flexible, e.g. allow using S3, or change namespace or bucket names.
  i suggest making it configurable, i can do such PR if we agree its needed. 
  flexible pipeline service (host) path in client SDK 
  when creating an SDK `Client()` the path to `ml-pipeline` API service is loaded from a hard coded value (`ml-pipeline.kubeflow.svc.cluster.local:8888`) which indicate a specific k8s namespace. it can be valuable to load that default value from an env variable, i.e. changing the line in `_client.py` from:
  
  `config.host = host if host else Client.IN_CLUSTER_DNS_NAME`
  
  to:
  
  `config.host = host or os.environ.get('ML_PIPELINE_DNS_NAME',Client.IN_CLUSTER_DNS_NAME)`
  
  also note that when a user provide the `host` parameter, the ipython output points to the API server and not to the UI service (see the logic in `_get_url_prefix()`), it seems like a potential bug
  
  if its acceptable i can submit a PR for the line change above
   
  
  --- 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/aws.py`
  Content:
  ```
  1 # Copyright 2019 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 
  15 def use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY'):
  16     """An operator that configures the container to use AWS credentials.
  17 
  18     AWS doesn't create secret along with kubeflow deployment and it requires users
  19     to manually create credential secret with proper permissions.
  20 
  21     ::
  22 
  23         apiVersion: v1
  24         kind: Secret
  25         metadata:
  26           name: aws-secret
  27         type: Opaque
  28         data:
  29           AWS_ACCESS_KEY_ID: BASE64_YOUR_AWS_ACCESS_KEY_ID
  30           AWS_SECRET_ACCESS_KEY: BASE64_YOUR_AWS_SECRET_ACCESS_KEY
  31     """
  32 
  33     def _use_aws_secret(task):
  34         from kubernetes import client as k8s_client
  35         (
  36             task.container
  37                 .add_env_variable(
  38                     k8s_client.V1EnvVar(
  39                         name='AWS_ACCESS_KEY_ID',
  40                         value_from=k8s_client.V1EnvVarSource(
  41                             secret_key_ref=k8s_client.V1SecretKeySelector(
  42                                 name=secret_name,
  43                                 key=aws_access_key_id_name
  44                             )
  45                         )
  46                     )
  47                 )
  48                 .add_env_variable(
  49                     k8s_client.V1EnvVar(
  50                         name='AWS_SECRET_ACCESS_KEY',
  51                         value_from=k8s_client.V1EnvVarSource(
  52                             secret_key_ref=k8s_client.V1SecretKeySelector(
  53                                 name=secret_name,
  54                                 key=aws_secret_access_key_name
  55                             )
  56                         )
  57                     )
  58                 )
  59         )
  60         return task
  61 
  62     return _use_aws_secret
  63
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/sdk/python/kfp/aws.py b/sdk/python/kfp/aws.py
  --- a/sdk/python/kfp/aws.py
  +++ b/sdk/python/kfp/aws.py
  @@ -12,7 +12,7 @@
   # See the License for the specific language governing permissions and
   # limitations under the License.
   
  -def use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY'):
  +def use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY', aws_region=None):
       """An operator that configures the container to use AWS credentials.
   
       AWS doesn't create secret along with kubeflow deployment and it requires users
  @@ -32,31 +32,38 @@
   
       def _use_aws_secret(task):
           from kubernetes import client as k8s_client
  -        (
  -            task.container
  -                .add_env_variable(
  -                    k8s_client.V1EnvVar(
  -                        name='AWS_ACCESS_KEY_ID',
  -                        value_from=k8s_client.V1EnvVarSource(
  -                            secret_key_ref=k8s_client.V1SecretKeySelector(
  -                                name=secret_name,
  -                                key=aws_access_key_id_name
  -                            )
  +        task.container \
  +            .add_env_variable(
  +                k8s_client.V1EnvVar(
  +                    name='AWS_ACCESS_KEY_ID',
  +                    value_from=k8s_client.V1EnvVarSource(
  +                        secret_key_ref=k8s_client.V1SecretKeySelector(
  +                            name=secret_name,
  +                            key=aws_access_key_id_name
                           )
                       )
                   )
  +            ) \
  +            .add_env_variable(
  +                k8s_client.V1EnvVar(
  +                    name='AWS_SECRET_ACCESS_KEY',
  +                    value_from=k8s_client.V1EnvVarSource(
  +                        secret_key_ref=k8s_client.V1SecretKeySelector(
  +                            name=secret_name,
  +                            key=aws_secret_access_key_name
  +                        )
  +                    )
  +                )
  +            )
  +
  +        if aws_region:
  +            task.container \
                   .add_env_variable(
                       k8s_client.V1EnvVar(
  -                        name='AWS_SECRET_ACCESS_KEY',
  -                        value_from=k8s_client.V1EnvVarSource(
  -                            secret_key_ref=k8s_client.V1SecretKeySelector(
  -                                name=secret_name,
  -                                key=aws_secret_access_key_name
  -                            )
  -                        )
  +                        name='AWS_REGION',
  +                        value=aws_region
                       )
                   )
  -        )
           return task
   
       return _use_aws_secret
  
verification_info: {"golden_diff": "diff --git a/sdk/python/kfp/aws.py b/sdk/python/kfp/aws.py\n--- a/sdk/python/kfp/aws.py\n+++ b/sdk/python/kfp/aws.py\n@@ -12,7 +12,7 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n \n-def use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY'):\n+def use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY', aws_region=None):\n     \"\"\"An operator that configures the container to use AWS credentials.\n \n     AWS doesn't create secret along with kubeflow deployment and it requires users\n@@ -32,31 +32,38 @@\n \n     def _use_aws_secret(task):\n         from kubernetes import client as k8s_client\n-        (\n-            task.container\n-                .add_env_variable(\n-                    k8s_client.V1EnvVar(\n-                        name='AWS_ACCESS_KEY_ID',\n-                        value_from=k8s_client.V1EnvVarSource(\n-                            secret_key_ref=k8s_client.V1SecretKeySelector(\n-                                name=secret_name,\n-                                key=aws_access_key_id_name\n-                            )\n+        task.container \\\n+            .add_env_variable(\n+                k8s_client.V1EnvVar(\n+                    name='AWS_ACCESS_KEY_ID',\n+                    value_from=k8s_client.V1EnvVarSource(\n+                        secret_key_ref=k8s_client.V1SecretKeySelector(\n+                            name=secret_name,\n+                            key=aws_access_key_id_name\n                         )\n                     )\n                 )\n+            ) \\\n+            .add_env_variable(\n+                k8s_client.V1EnvVar(\n+                    name='AWS_SECRET_ACCESS_KEY',\n+                    value_from=k8s_client.V1EnvVarSource(\n+                        secret_key_ref=k8s_client.V1SecretKeySelector(\n+                            name=secret_name,\n+                            key=aws_secret_access_key_name\n+                        )\n+                    )\n+                )\n+            )\n+\n+        if aws_region:\n+            task.container \\\n                 .add_env_variable(\n                     k8s_client.V1EnvVar(\n-                        name='AWS_SECRET_ACCESS_KEY',\n-                        value_from=k8s_client.V1EnvVarSource(\n-                            secret_key_ref=k8s_client.V1SecretKeySelector(\n-                                name=secret_name,\n-                                key=aws_secret_access_key_name\n-                            )\n-                        )\n+                        name='AWS_REGION',\n+                        value=aws_region\n                     )\n                 )\n-        )\n         return task\n \n     return _use_aws_secret\n", "issue": "allow output artifact store configuration (vs hard coded)\nit seems like the output artifacts are always stored in a specific minio service, port, namespace, bucket, secrets, etc (`minio-service.kubeflow:9000`). \r\n\r\nsee: https://github.com/kubeflow/pipelines/blob/f40a22a3f4a8e06d20cf3e3f425b5058d5c87e0b/sdk/python/kfp/compiler/_op_to_template.py#L148\r\n\r\nit would be great to make it flexible, e.g. allow using S3, or change namespace or bucket names.\r\ni suggest making it configurable, i can do such PR if we agree its needed. \nflexible pipeline service (host) path in client SDK \nwhen creating an SDK `Client()` the path to `ml-pipeline` API service is loaded from a hard coded value (`ml-pipeline.kubeflow.svc.cluster.local:8888`) which indicate a specific k8s namespace. it can be valuable to load that default value from an env variable, i.e. changing the line in `_client.py` from:\r\n\r\n`config.host = host if host else Client.IN_CLUSTER_DNS_NAME`\r\n\r\nto:\r\n\r\n`config.host = host or os.environ.get('ML_PIPELINE_DNS_NAME',Client.IN_CLUSTER_DNS_NAME)`\r\n\r\nalso note that when a user provide the `host` parameter, the ipython output points to the API server and not to the UI service (see the logic in `_get_url_prefix()`), it seems like a potential bug\r\n\r\nif its acceptable i can submit a PR for the line change above\r\n \n", "before_files": [{"content": "# Copyright 2019 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\ndef use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY'):\n    \"\"\"An operator that configures the container to use AWS credentials.\n\n    AWS doesn't create secret along with kubeflow deployment and it requires users\n    to manually create credential secret with proper permissions.\n\n    ::\n\n        apiVersion: v1\n        kind: Secret\n        metadata:\n          name: aws-secret\n        type: Opaque\n        data:\n          AWS_ACCESS_KEY_ID: BASE64_YOUR_AWS_ACCESS_KEY_ID\n          AWS_SECRET_ACCESS_KEY: BASE64_YOUR_AWS_SECRET_ACCESS_KEY\n    \"\"\"\n\n    def _use_aws_secret(task):\n        from kubernetes import client as k8s_client\n        (\n            task.container\n                .add_env_variable(\n                    k8s_client.V1EnvVar(\n                        name='AWS_ACCESS_KEY_ID',\n                        value_from=k8s_client.V1EnvVarSource(\n                            secret_key_ref=k8s_client.V1SecretKeySelector(\n                                name=secret_name,\n                                key=aws_access_key_id_name\n                            )\n                        )\n                    )\n                )\n                .add_env_variable(\n                    k8s_client.V1EnvVar(\n                        name='AWS_SECRET_ACCESS_KEY',\n                        value_from=k8s_client.V1EnvVarSource(\n                            secret_key_ref=k8s_client.V1SecretKeySelector(\n                                name=secret_name,\n                                key=aws_secret_access_key_name\n                            )\n                        )\n                    )\n                )\n        )\n        return task\n\n    return _use_aws_secret\n", "path": "sdk/python/kfp/aws.py"}], "after_files": [{"content": "# Copyright 2019 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\ndef use_aws_secret(secret_name='aws-secret', aws_access_key_id_name='AWS_ACCESS_KEY_ID', aws_secret_access_key_name='AWS_SECRET_ACCESS_KEY', aws_region=None):\n    \"\"\"An operator that configures the container to use AWS credentials.\n\n    AWS doesn't create secret along with kubeflow deployment and it requires users\n    to manually create credential secret with proper permissions.\n\n    ::\n\n        apiVersion: v1\n        kind: Secret\n        metadata:\n          name: aws-secret\n        type: Opaque\n        data:\n          AWS_ACCESS_KEY_ID: BASE64_YOUR_AWS_ACCESS_KEY_ID\n          AWS_SECRET_ACCESS_KEY: BASE64_YOUR_AWS_SECRET_ACCESS_KEY\n    \"\"\"\n\n    def _use_aws_secret(task):\n        from kubernetes import client as k8s_client\n        task.container \\\n            .add_env_variable(\n                k8s_client.V1EnvVar(\n                    name='AWS_ACCESS_KEY_ID',\n                    value_from=k8s_client.V1EnvVarSource(\n                        secret_key_ref=k8s_client.V1SecretKeySelector(\n                            name=secret_name,\n                            key=aws_access_key_id_name\n                        )\n                    )\n                )\n            ) \\\n            .add_env_variable(\n                k8s_client.V1EnvVar(\n                    name='AWS_SECRET_ACCESS_KEY',\n                    value_from=k8s_client.V1EnvVarSource(\n                        secret_key_ref=k8s_client.V1SecretKeySelector(\n                            name=secret_name,\n                            key=aws_secret_access_key_name\n                        )\n                    )\n                )\n            )\n\n        if aws_region:\n            task.container \\\n                .add_env_variable(\n                    k8s_client.V1EnvVar(\n                        name='AWS_REGION',\n                        value=aws_region\n                    )\n                )\n        return task\n\n    return _use_aws_secret\n", "path": "sdk/python/kfp/aws.py"}]}