-
Notifications
You must be signed in to change notification settings - Fork 449
feat: Added the PipelineJob.from_pipeline_func method #1415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gcf-merge-on-green
merged 17 commits into
googleapis:main
from
Ark-kun:feat--Added-the-PipelineJob.submit_from_pipeline_func-method
Jul 15, 2022
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4bbe41a
feat: Added the PipelineJob.submit_from_pipeline_func method
Ark-kun 35a9375
Bumped the copyright year
Ark-kun cb2c175
Added docstring
Ark-kun 279d7f2
Raising more informative exceptions when the kfp compiler module cann…
Ark-kun 9040503
Split the submit_from_pipeline_func into from_pipeline_func and submit
Ark-kun 0c25131
Fixed the formatting
Ark-kun 5498f42
Refactored the change to only create the artifact bucket when submit …
Ark-kun b3a99c6
Renamed the arguments parameter to parameter_values for consistency w…
Ark-kun c0b95e7
Using the PipelineJob.from_pipeline_func method in tests
Ark-kun 9c1e1ac
Added a PipelineJob.from_pipeline_func integration test
Ark-kun 2f4b70e
Added artifact bucket mock to the unit tests
Ark-kun 85909e8
Fixed the PipelineJob.from_pipeline_func integration test
Ark-kun 5cbcd8b
Implemented the review feedback
Ark-kun 56247e8
Reverting the test_experiments.py changes
Ark-kun 1eb5a04
Merge branch 'main' into feat--Added-the-PipelineJob.submit_from_pipe…
Ark-kun bb04e46
Fixed the tests added after this PR was created
Ark-kun a7fd13f
Merge branch 'main' into feat--Added-the-PipelineJob.submit_from_pipe…
sasha-gitg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| # Copyright 2022 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| import pytest | ||
|
|
||
| from google.cloud import aiplatform | ||
| from tests.system.aiplatform import e2e_base | ||
|
|
||
|
|
||
| @pytest.mark.usefixtures("tear_down_resources") | ||
| class TestPipelineJob(e2e_base.TestEndToEnd): | ||
|
|
||
| _temp_prefix = "tmpvrtxsdk-e2e" | ||
|
|
||
| def test_add_pipeline_job_to_experiment(self, shared_state): | ||
| from kfp import components | ||
|
|
||
| # Components: | ||
| def train( | ||
| number_of_epochs: int, | ||
| learning_rate: float, | ||
| ): | ||
| print(f"number_of_epochs={number_of_epochs}") | ||
| print(f"learning_rate={learning_rate}") | ||
|
|
||
| train_op = components.create_component_from_func(train) | ||
|
|
||
| # Pipeline: | ||
| def training_pipeline(number_of_epochs: int = 10): | ||
| train_op( | ||
| number_of_epochs=number_of_epochs, | ||
| learning_rate="0.1", | ||
| ) | ||
|
|
||
| # Submitting the pipeline: | ||
| aiplatform.init( | ||
| project=e2e_base._PROJECT, | ||
| location=e2e_base._LOCATION, | ||
| ) | ||
| job = aiplatform.PipelineJob.from_pipeline_func( | ||
| pipeline_func=training_pipeline, | ||
| ) | ||
| job.submit() | ||
|
|
||
| shared_state.setdefault("resources", []).append(job) | ||
|
|
||
| job.wait() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.