* Make kfp package installable with poetry
The poetry package manager executes `setup.py` differently than pip, which means that `__file__` is initialized to just `setup.py`, which means that `where` would be set to the empty string. The proposed change has been tested with both pip and poetry.
* apply yapf formatting
* remove unused imports
* use google as isort profile
* sort imports
* format with yapf
* clean end of file new line, trailing whitespace, double quoted strings
* Allow google-auth < 3
google-auth recently published a 2.0.0 release which removed support for Python 2.7. google-auth now requires Python >=3.6. No other breaking changes were made. You can see the full list of changes [here](googleapis/google-auth-library-python@560cf1e).
I am opening PRs to expand google-auth version ranges for packages that meet either of the following criteria:
* Package has >10,000 monthly downloads as of June 2021
* Package is owned by a Google team
**Motivation:**
google-auth is a dependency of many different libraries that interact with Google APIs. Increasing the time and number of packages with compatible pins on google-auth lowers the chance end developers who use multiple libraries will see dependency conflicts.
If possible, please also retain compatibility with 1.x.x versions of google-auth until this issue is resolved
googleapis/google-cloud-python#10566, as that will further reduce the likelihood of diamond dependency conflicts.
Googlers, see [this doc](https://docs.google.com/document/d/1euAvUsia_4zf98lNvpwA3K0o2b4y5Xr9xAkyzCnIMzQ/edit) for more information.
* chore: also update requirements.in
* chore: update RELEASE.md
* Refactor and move all v2 related code to under the v2 namespace.
Most of the changes are around imports and restructuring of the
codebase. While it looks like a lot of code was added, most of the code
already existed and was simply moved or copied over to v2. The only
exceptions are:
- under kfp/v2/components/component_factory.py: some helper functions
were copied with simplification from _python_op.py
- we no longer strip the `_path` suffix in v2 components.
Note: there is still some duplication of code (particularly between
component_factory.py and _python_op.py), but it's ok for now since we
intend to replace some of this with v2 ComponentSpec + BaseComponent.
* Update setup.py.
* update tests.
* revert accidental change of gcpc
* Fix component entrypoint.
* Update goldens.
* fix tests.
* fix merge conflict.
* revert gcpc change.
* fix tests.
* fix tests.
* Add type aliases for moved files.
* merge and update goldens.
* Add a CLI command to help containerize and build v2 components.
* Flesh out the CLI for Docker.
* update comments.
* Support multiple component files in the same directory.
* address pr comments.
* Let user specify just the directory containing components.
The CLI will search for components in all Python files by default. It
can also search for a specific filepattern (as supported by
pathlib.Path objects).
Also add a bunch of tests.
* Clean up.
* fix merge error.
* Fix docker import error for tests.
* Update release notes.
* address PR comments.
* Adds URI template support for ComponentStore
* Reverts some autoformatting
* Reverts some more autoformatting
* Addresses code review comments:
* order of constructor args preserved for compatibility
* added docstrings
* added explicit uritemplate dependency
* Adds description of change
* Adds missing #
* Use `Annotated` rather than `Union` hack
* Add dependency to `setup.py`
* Add release note
Co-authored-by: Chen Sun <chensun@users.noreply.github.com>
* pydantic setup
* switch to union types
* Fix base_component tests
* switch to pydantic for python3.6 compat and fix tests
* Fix tests
* use str for type
* fix tests
* Consistent quote sign
* Address comments
* Update type
* feat(sdk): add default schema_version to pipeline
* sync api for go
* Fix tests and address comments
* Bump pipeline_spec version
* Fix v1 tests
* rebase to master
* sync api for go
* Fix tests and address comments
* Bump pipeline_spec version
* Fix v1 tests
* Refactor and move all v2 related code to under the v2 namespace.
Most of the changes are around imports and restructuring of the
codebase. While it looks like a lot of code was added, most of the code
already existed and was simply moved or copied over to v2. The only
exceptions are:
- under kfp/v2/components/component_factory.py: some helper functions
were copied with simplification from _python_op.py
- we no longer strip the `_path` suffix in v2 components.
Note: there is still some duplication of code (particularly between
component_factory.py and _python_op.py), but it's ok for now since we
intend to replace some of this with v2 ComponentSpec + BaseComponent.
* Update setup.py.
* update tests.
* revert accidental change of gcpc
* Fix component entrypoint.
* Update goldens.
* fix tests.
* fix merge conflict.
* revert gcpc change.
* fix tests.
* fix tests.
* Add type aliases for moved files.
* merge and update goldens.
* 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
* Add link and Python 3.8/3.9 classifiers to setup.py
The link should appear on PyPI: https://pypi.org/project/kfp/#description
* use "The Kubeflow Authors" in setup.py
* Include more links in Python package description