* Introduce ServiceAccountTokenVolumeCredentials
Part of kubeflow/pipelines#5138
This is a subclass of TokenCredentials and implements the logic of
retrieving a service account token provided via a ProjectedVolume.
The 'get_token()' method reads and doesn't store the token as the
kubelet is refreshing it quite often.
Relevant docs:
https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection
* Attemp to use credentials when in-cluster
If the KFP client detects it's running inside a pod and the user hasn't
provided any credentials, it now attempts to set up credentials based on
a projected service account token.
* Move credentials to kfp.auth module
Also change some names and values to avoid "ml-pipeline" references.
* Import kfp.auth lazily during the Client init
* Have credentials handle errors internally
* Let ServiceAccountTokenVolumeCredentials handle OSErrors internally
* Have the default-creds-setter only check if credentials provide a
valid value
* Use Configuration's 'refresh_api_key_hook' instead of having duplicate
code
* Remove dead code
* Add kfp.auth in the setup.py
* Move abstraction to the 'refresh_api_key_hook' method
* Introduce TokenCredentials abstract class
As presented in kubeflow/pipelines#4683, in this commit we introduce a
TokenCredentials abstract class which encapsulates the retrieval and
refresh of token credentials.
The reason we are using a class for the credentials is the fact that
usually tokens are short-lived and the client needs to refresh them.
All subclasses should define a 'get_token()' method responsible for
fetching and refreshing (if needed) a token for authentication.
* Configure credentials when initializing KFP client
* add local runner which will run ops in docker or locally
* use str.format rather than f-string
* add some brief doc string in local client
* comment the unittest about running op in docker, which is not supported in CI env for now
* Add some brief docstring about DAG used in local client
* make graph/reverse_graph of DAG as property to keep them in sync
* make some methods of LocalClient static
* remove circular reference in local client
* Incapsulate artifact storage root in the constuctor of LocalClient
* Add Alpha notice for kfp.run_pipeline_func_locally
* Support list of local images in kfp.run_pipeline_func_locally
* make staticmethod to module level private method
* Trivial modification according to code review, some renaming or docstring
* local runner support components without '--' as argument prefix
* make output file of op in loop unique
* Local runner decides whether run component in docker or in local process base on ExecutionMode
* Use pipeline_spec proto from kfp-pipeline-spec package
* update imports
* use pre-released kfp-pipeline-spec (temporarily)
* Revert "use pre-released kfp-pipeline-spec (temporarily)"
This reverts commit 77f2e9a39c.
* test_requires
* version
* make kfp a namespace package
* move to the top
* version rc0