Repository: kubeflow/pipelines

Issue:
kfp component ml_engine deploy version param is incorrectly typed
### What steps did you take:

I tried to specify the `version` param to the gcp ml_engine deploy component via:

```
 mlengine_deploy_op = comp.load_component_from_url('https://raw.githubusercontent.com/kubeflow/pipelines/1.0.0/components/gcp/ml_engine/deploy/component.yaml')

. . .

 upload_task = mlengine_deploy_op(
    model_id=model_id,
    project_id=project_id,
    python_version=python_version,
    runtime_version=runtime_version,
    version_id=version_id,
    model_uri=model_uri,
    model={
        'onlinePredictionLogging': True,
        'onlinePredictionConsoleLogging': True,
    },
    version={
        'packageUris': package_uris,
        'predictionClass': prediction_class,
    },
)
```

### What happened:

Received a type error that str object (version) does not support assignment
```
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/ml/kfp_component/launcher/__main__.py", line 34, in <module>
    main()
  File "/ml/kfp_component/launcher/__main__.py", line 31, in main
    launch(args.file_or_module, args.args)
  File "kfp_component/launcher/launcher.py", line 45, in launch
    return fire.Fire(module, command=args, name=module.__name__)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/usr/local/lib/python2.7/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "kfp_component/google/ml_engine/_deploy.py", line 68, in deploy
    wait_interval)
  File "kfp_component/google/ml_engine/_create_version.py", line 55, in create_version
    version['deploymentUri'] = deployemnt_uri
TypeError: 'str' object does not support item assignment
```

### What did you expect to happen:

I expected to be able to pass additional version parameters as a dictionary as described in https://cloud.google.com/ml-engine/reference/rest/v1/projects.models.versions and https://github.com/kubeflow/pipelines/blob/master/components/gcp/ml_engine/deploy/component.yaml#L64:L69

However, this type is being declared as a str when it should be a dict: https://github.com/kubeflow/pipelines/blob/master/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py#L47

This is ultimately based on the assumption that fire is using the docstring to do type hinting.

### Environment:
How did you deploy Kubeflow Pipelines (KFP)?
Deployed via AI-Platform Pipelines

KFP version:
```
Build commit: 9c16e12
``` 

KFP SDK version: 
```
kfp                      0.5.1
kfp-server-api           0.5.0
```

/kind bug
/area sdk
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
 


Discussion:

>it can be valuable to load that default value from an env variable

I'm not sure about the user scenarios, but I guess it might be useful for some cases.

>ML_PIPELINE_DNS_NAME

Maybe, `KF_PIPELINES_ENDPOINT`?

>it seems like a potential bug

It probably is. The Client class can definitely use some improvements, especially for out-of-cluster usage.

> if its acceptable i can submit a PR

We always appreciate PRs.
Fixed in https://github.com/kubeflow/pipelines/pull/1293

Resolving patch:
diff --git a/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py b/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py
--- a/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py
+++ b/components/gcp/container/component_sdk/python/kfp_component/google/ml_engine/_create_version.py
@@ -44,7 +44,7 @@ def create_version(model_name, deployemnt_uri=None, version_id=None,
             If not set, the default version is '2.7'. Python '3.5' is available
             when runtimeVersion is set to '1.4' and above. Python '2.7' works 
             with all supported runtime versions.
-        version (str): optional, the payload of the new version.
+        version (dict): optional, the payload of the new version.
         replace_existing (boolean): boolean flag indicates whether to replace 
             existing version in case of conflict.
         wait_interval (int): the interval to wait for a long running operation.
@@ -199,4 +199,4 @@ def _is_dup_version(self, existing_version):
             ['description', 'deploymentUri', 
                 'runtimeVersion', 'machineType', 'labels',
                 'framework', 'pythonVersion', 'autoScaling',
-                'manualScaling'])
\ No newline at end of file
+                'manualScaling'])


Test patch: