Skip to content

Run Vertex AI kfp Pipeline #5

Run Vertex AI kfp Pipeline

Run Vertex AI kfp Pipeline #5

Workflow file for this run

# Copyright 2023 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.
name: Run Vertex AI kfp Pipeline
on:
workflow_dispatch:
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
env:
ENVIRONMENT: dev
PROJECT_ID: mlops-helloworld
# SA used to authenticate in GCP through Workload Identity Federation
SERVICE_ACCOUNT: [email protected]
REGION: us-central1
DOCKER_REPO: us-central1-docker.pkg.dev/mlops-helloworld/docker-repo
WORKLOAD_ID_PROVIDER: projects/899116504370/locations/global/workloadIdentityPools/gh-pool/providers/gh-provider
jobs:
run-pipeline:
name: 'Run Vertex AI kfp pipeline'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v3'
with:
token: ${{ github.token }}
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
create_credentials_file: 'true'
workload_identity_provider: ${{ env.WORKLOAD_ID_PROVIDER }}
service_account: ${{ env.SERVICE_ACCOUNT }}
access_token_lifetime: 7200s
- name: 'Run Vertex Pipeline'
run: gcloud builds submit --no-source --config build/${{ env.ENVIRONMENT }}/pipeline-run-kfp.yaml --project ${{ env.PROJECT_ID }} --region ${{ env.REGION }} --machine-type=e2-highcpu-8 --suppress-logs