Commit Graph

117 Commits

Author SHA1 Message Date
Sune Debel 231c5079f0
fix(sdk): make sdk installable with poetry (#8263)
* 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
2022-09-14 21:08:08 +00:00
Alex Latchford 459e5358e6
chore(sdk): Bump KFP Python SDK to support Python v3.10 (#8186)
* Update upper bound for kubernetes dependency

* Bump KFP Python SDK to support Py v3.10

* Reset requirements.* changes to isolate out Python v3.10 changes

* Add in release note
2022-08-24 21:34:08 +00:00
Connor McCarthy e47a784035
docs(sdk): clean up kfp v2 cli reference docs (#8115)
* use expanded "Command Line Interface" for title

* remove alpha feature stage in help text

* hide deprecated argument

* use compile as command name
2022-08-09 18:40:39 +00:00
Connor McCarthy 13736b85b6
chore(sdk): clean up kfp code style (#8027)
* remove unused imports

* use google as isort profile

* sort imports

* format with yapf

* clean end of file new line, trailing whitespace, double quoted strings
2022-07-15 00:06:34 +00:00
Connor McCarthy 340318625c
chore(sdk): use markdown for long description content type (#7825) 2022-06-02 23:37:25 +00:00
Connor McCarthy 2c27475fbc
add README with project description (#7782) 2022-05-26 14:59:12 -06:00
Connor McCarthy e12ac39ba4
feat(sdk): use dsl noun group for compile CLI commands (#7603)
* use kfp dsl compile for compilation commands

* create and move tests
2022-04-26 15:05:31 -06:00
Connor McCarthy a5548440a3
use click for dsl-compile command (#7560) 2022-04-20 14:57:10 -06:00
Connor McCarthy b58a31b307
chore(sdk): clean up v2 CLI (#7558)
* remove linting comments

* move global variable to local

* simplify diagnose_me command

* use f-strings

* idiomatic python refactorings

* remove unused import

* add typestub library

* silence unresolvable mypy error

* update type information

* remove unused variable

* remove unused import

* use __main__.py for cli entrypoint

* expand imports
2022-04-20 10:40:38 -06:00
Connor McCarthy d46fafe4ce
feat(sdk): port cli code from v1 to v2 (#7547)
* port cli

* fix docker mock
2022-04-13 20:19:52 +00:00
Connor McCarthy 94960cf5ab
chore(sdk): use setuptools.find_packages (#7548) 2022-04-12 21:52:51 +00:00
Connor McCarthy f70413ad7c
chore(sdk): stop using pydantic for serialization (#7536)
* add ir_utils

* add ir_utils tests

* use ir_utils to write ir to file

* cast posix path to string in `kfp components build` command

* add copyright

* remove unused import

* update setup.py packages
2022-04-12 17:03:55 +00:00
Connor McCarthy 4eeb420905
feat(sdk)!: promote v2 compiler command and deprecate v1 command (#7508) 2022-04-05 18:07:37 +00:00
Chen Sun b741926bb4
feat(sdk): client to support KFP v2 API. (#7411)
* copy _client.py and _auth.py from deprecated folder

* Make kfp.Client support v2 API (IR).

* fix test golden

* address comments

* copyright year

* chore(backend): clean up pipelinespec.Value usage (#7407)

* chore(sdk): clean, dedup, reconcile, organize requirements (#7400)

* chore(sdk): clean, dedup, reconcile, organize requirements

* apply yapf formatting

* correct copyright

* chore(sdk): fix test missing tempdir cleanup (#7403)

* chore(sdk): fix test missing tempdir cleanup

* fix test path

* fix test path

* clean up setUp method

* change string placeholder from s to test_dir

* release note

Co-authored-by: Connor McCarthy <mccarthy.connor.james@gmail.com>
2022-03-15 21:45:37 +00:00
Connor McCarthy 7613cf9a1f
chore(sdk): clean, dedup, reconcile, organize requirements (#7400)
* chore(sdk): clean, dedup, reconcile, organize requirements

* apply yapf formatting

* correct copyright
2022-03-14 18:27:57 +00:00
Yaqi Ji 8bb0d0e025
feat(sdk)!: move v2 to main namespace (#7376)
* feat(sdk)!: move v2 to main namespace

* edit samples
2022-03-04 21:56:51 +00:00
Chen Sun 7f67130c6e
fix(sdk): require google-api-core>=1.31.5, >=2.3.2 (#7377)
* require google-api-core>=1.31.5, >=2.3.2

* add release note
2022-03-04 19:56:59 +00:00
Yaqi Ji b693909a08
feat(sdk)!: move v1 to deprecated folder (#7291)
* chore(sdk): move v1 to deprecated

* fix testsg

* fix testsg

* fix setup.py

* fix test

* s'

* fix tests

* fix test

* retore v2 test changes

* fix py3.6 test

* fix py3.6 test

* fix py3.6 import fallback error

* remove deprecated

* fix samples test

* sample test

* fix samples

* add readme

* restroe test

* python require

* remove path

* fix tests

* inteegration tests

* remove tfx tests for dependency with kfp v1

* fix e2e

* fix e2e

* fix integration tests

* fix sampe

* move client down

* change to kfp

* add import alias

* fix

* runid

* fix dsl

* only use kfp for function

* revert train_until_good

* tfx test

* kfp

* try import

* onprem
2022-03-04 00:52:59 +00:00
Yaqi Ji 54d5789bb4
feat(sdk)!: drop support for python 3.6 (#7303)
* chore(sdk): drop support for python 3.6

* empty

* address comments
2022-02-15 10:54:46 -08:00
Mehdi Drissi 9be1720f55
chore(sdk): Relax Typing Extensions Constraint (#7288)
* Relax Typing Extensions Constraint

* Update requirements.txt for typing extensions

Co-authored-by: Mehdi Drissi <mdrissi@snapchat.com>
2022-02-15 10:32:40 +00:00
Jiyong Jung 22a8fdfe31
fix(sdk): bumps up absl version to 1.x for compatibility with TF 2.8+. Fixes #7171 (#7172)
* Bumps up absl version to 1.x for compatibility with TF 2.8+.

* Adds a release note for absl version.
2022-01-19 22:14:52 +00:00
Bu Sun Kim 8064383cf1
chore(sdk): allow google-auth < 3 (#6939)
* 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
2021-11-23 18:47:06 +00:00
Chen Sun 7921946b07
feat(sdk.v2)!: Merge v2 experimental change back to v2 namespace (#6890)
* merge v2 experimental change back to v2 namespace

* release note

* fix tests

* fix cli

* fix py3.6 test

* skip v2 compatible mode tests

* fix tests

* skip v2 engine tests
2021-11-11 00:25:42 +00:00
Yaqi Ji b7fd47f70b
chore(sdk): Remove sdk/python/kfp/v2/google directory for v2 (#6886)
* Delete sdk/python/kfp/v2/google directory

* Update RELEASE.md

* Update MANIFEST.in

* Update requirements-test.txt

* Update requirements.in

* fix setup

* remove test
2021-11-10 01:18:04 -08:00
Chen Sun 7768f28de3
fix(sdk.v2): Fix missing experimental modules in setup.py (#6817)
* fix missing experimental modules

* fix typo

* fix test
2021-10-27 10:58:39 -07:00
Ajay Gopinathan fca4c1c2fd
Fix missing experimental type module in setup.py. (#6816) 2021-10-27 09:17:03 -07:00
Chen Sun 02b96f0a63
feat(sdk.v2): Implement v2 experimental compiler. (#6803)
* Implement v2 experimental compiler.

* add release note

* Support protobuf.Value in Condition operand
2021-10-26 14:12:37 -07:00
Ajay Gopinathan fe663772c8
feat(sdk): Enable containerizing v2 Python components (#6417)
* 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.
2021-10-12 09:33:44 -07:00
Sandeep Gupta bcb0d96861
feat(sdk): Update cloudpickle to 2.0.0 (fixes #6699) (#6703)
Co-authored-by: Chen Sun <chensun@users.noreply.github.com>
2021-10-11 11:43:43 -07:00
juliusvonkohout 30826061fa
chore(sdk): relax click version to click>=7.1.2,<9. Fixes #6651 (#6691)
* Update setup.py

* Update requirements.txt

* Update setup.py

* Update requirements.in

* Update RELEASE.md

* Update RELEASE.md

* Update RELEASE.md
2021-10-08 14:37:43 -07:00
Chen Sun 7b4f28379d
chore(sdk): relax typing-extensions version to `>=3.7.4,<4`. Fixes #6651 (#6683)
* relax typing-extension version

* add release note
2021-10-05 22:50:08 -07:00
Jack Whelpton daccc5a4b6
feat(sdk): ComponentStore - URI template support. Fixes #4708 (#5434)
* 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 #
2021-09-27 18:14:10 -07:00
Chen Sun f7838b3801
chore(sdk): Add "Source" and "Changelog" links to kfp PyPi page (#6596) 2021-09-22 22:00:35 -07:00
Judah Rand c605c51b85
chore(sdk.v2): use `Annotated` rather than `Union` hack (#6573)
* Use `Annotated` rather than `Union` hack

* Add dependency to `setup.py`

* Add release note

Co-authored-by: Chen Sun <chensun@users.noreply.github.com>
2021-09-16 10:54:55 -07:00
Alex Latchford b613ca847b
fix(sdk): Update upper bound on kubernetes constraint in Python SDK (#6532) 2021-09-08 18:46:00 -07:00
Chen Sun 29226e9178
feat(sdk.v2): Support container environment variable in v2. (#6515)
* Support `set_env_variable` in v2.

* update release note
2021-09-07 13:30:07 -07:00
Joshua Carp f43ecc223d
chore(sdk): Import mock from stdlib and drop dependency. (#6456)
* Import mock from stdlib and drop dependency.

* Drop mock from requirements.

h/t @chensun
2021-08-31 16:38:44 -07:00
Yaqi Ji 65174cdd93
feat(sdk): Add BaseModel to component_spec data classes (#6372)
* 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
2021-08-25 14:00:02 -07:00
Yaqi Ji 937cacd4ce
feat(sdk): add default schema_version to pipeline (#6366)
* 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
2021-08-24 01:04:39 -07:00
Ajay Gopinathan f3f383c2ff
chore(sdk): Refactor and move all v2 related code to under the v2 namespace. (#6358)
* 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.
2021-08-17 19:25:37 -07:00
Chen Sun 903b98654e
feat(sdk.v2): Define BaseComponent, ComponentSpec, and PipelineTask. (#6210)
* Define BaseComponent, ComponentSpec, and PipelineTask.

* fix dep

* disable positional arguments

* address feedback

* address feedback
2021-08-06 08:54:43 -07:00
Ilias Katsakioris 52b0792e9f
feat(sdk): Add credentials to authenticate with ServiceAccountTokens. Part of #5138 (#5676)
* 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
2021-07-08 16:48:22 -07:00
john li 5dcbd35b71
chore: add link and Python 3.8/3.9 classifiers to setup.py (#5715)
* 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
2021-06-04 12:47:48 -07:00
Chen Sun 6b87155a33
feat(sdk.v2): Support Exit handler in v2 compiler. (#5784) 2021-06-03 12:58:36 -07:00
Alexey Volkov 4e5d724fef
feat(sdk): Dropped support for Python 3.5. Fixes #4584 (#4611)
Fixes https://github.com/kubeflow/pipelines/issues/4584
2021-05-28 17:20:00 -07:00
Chen Sun bf8681b7e3
feat(sdk.v2): Add Google AIPlatformClient (#5677)
* ai platform client

* fix test

* update URL
2021-05-18 13:33:34 -07:00
Chen Sun f20d20c41d
feat(sdk.v2): Experimental custom job support. (#5604)
* custom job

* simple vs. advanced setting (user specified raw workerpoolspecs)

* fix typo
2021-05-11 18:33:25 -07:00
Alexey Volkov cc83e1089b
Assigned copyright to the project authors (#5587) 2021-05-05 13:53:22 +08:00
Chen Sun 85cb99173d
feat(sdk.v2): fix loop implementation and add subvar support (#5461)
* fix loop dag and add subvar support

* Bump kfp-pipeline-spec min version to 0.1.7
2021-04-12 16:59:03 -07:00
Chen Sun 6603e8ba1f
feat(sdk): relax kubernetes upper constraint from <12 to <13 (#5349) 2021-03-22 18:41:50 -07:00