Skip to content

Commit

Permalink
Merge pull request #438 from GoogleCloudPlatform/kfp-cicd-update
Browse files Browse the repository at this point in the history
Update KFP CICD
  • Loading branch information
takumiohym authored Apr 16, 2024
2 parents 0e6c7f7 + f9fb8e6 commit 4a94c24
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:
args:
- '-c'
- |
dsl-compile-v2 # TODO
kfp dsl compile # TODO
env:
- 'PIPELINE_ROOT=gs://$PROJECT_ID-kfp-artifact-store/pipeline'
- 'PROJECT_ID=$PROJECT_ID'
Expand Down
4 changes: 2 additions & 2 deletions notebooks/kubeflow_pipelines/cicd/labs/kfp_cicd_vertex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"\n",
"In the cell below, write a docker file that\n",
"* Uses `gcr.io/deeplearning-platform-release/base-cpu` as base image\n",
"* Install the python packages `kfp` with version `1.8.22 ` and `google-cloud-aiplatform` with version `1.43.0`\n",
"* Install the python packages `kfp` with version `2.4.0 `, `google-cloud-aiplatform` with version `1.43.0` and `fire`\n",
"* Starts `/bin/bash` as entrypoint"
]
},
Expand Down Expand Up @@ -184,7 +184,7 @@
" args:\n",
" - '-c'\n",
" - |\n",
" dsl-compile-v2 # TODO\n",
" kfp dsl compile # TODO\n",
" env:\n",
" - 'PIPELINE_ROOT=gs://$PROJECT_ID-kfp-artifact-store/pipeline'\n",
" - 'PROJECT_ID=$PROJECT_ID'\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""
from kfp.v2.dsl import component
from kfp.dsl import component


@component(
base_image="python:3.8",
output_component_file="covertype_kfp_train_and_deploy.yaml",
packages_to_install=["google-cloud-aiplatform"],
)
def train_and_deploy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"""Lightweight component tuning function."""
from typing import NamedTuple

from kfp.v2.dsl import component
from kfp.dsl import component


@component(
base_image="python:3.8",
output_component_file="covertype_kfp_tune_hyperparameters.yaml",
packages_to_install=["google-cloud-aiplatform"],
)
def tune_hyperparameters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ steps:
args:
- '-c'
- |
dsl-compile-v2 --py pipeline.py --output covertype_kfp_pipeline.json
kfp dsl compile --py pipeline.py --output covertype_kfp_pipeline.yaml
env:
- 'PIPELINE_ROOT=gs://$PROJECT_ID-kfp-artifact-store/pipeline'
- 'PROJECT_ID=$PROJECT_ID'
Expand All @@ -49,7 +49,7 @@ steps:
args:
- '-c'
- |
python $_PIPELINE_FOLDER/kfp-cli_vertex/run_pipeline.py --project_id=$PROJECT_ID --template_path=$_PIPELINE_FOLDER/pipeline_vertex/covertype_kfp_pipeline.json --display_name=coverype_kfp_pipeline --region=$_REGION
python $_PIPELINE_FOLDER/kfp-cli_vertex/run_pipeline.py --project_id=$PROJECT_ID --template_path=$_PIPELINE_FOLDER/pipeline_vertex/covertype_kfp_pipeline.yaml --display_name=coverype_kfp_pipeline --region=$_REGION
# Push the images to Artifact Registry
images: ['us-docker.pkg.dev/$PROJECT_ID/asl-artifact-repo/trainer_image_covertype_vertex:latest']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM gcr.io/deeplearning-platform-release/base-cpu
RUN pip install kfp==1.8.22
RUN pip install google-cloud-aiplatform==1.43.0
RUN pip install kfp==2.4.0 google-cloud-aiplatform==1.43.0 fire
ENTRYPOINT ["/bin/bash"]
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""
from kfp.v2.dsl import component
from kfp.dsl import component


@component(
base_image="python:3.8",
output_component_file="covertype_kfp_train_and_deploy.yaml",
packages_to_install=["google-cloud-aiplatform"],
)
def train_and_deploy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"""Lightweight component tuning function."""
from typing import NamedTuple

from kfp.v2.dsl import component
from kfp.dsl import component


@component(
base_image="python:3.8",
output_component_file="covertype_kfp_tune_hyperparameters.yaml",
packages_to_install=["google-cloud-aiplatform"],
)
def tune_hyperparameters(
Expand Down

0 comments on commit 4a94c24

Please sign in to comment.