test syngcp #18
This file contains 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
name: Deploy and Monitor Vertex AI Model | |
on: | |
push: | |
branches: | |
- main | |
- citest | |
jobs: | |
deploy-and-monitor: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0.2.0 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | |
export_default_credentials: true | |
# Step : Deploy in Vertex AI | |
- name: Deploy Model to Vertex AI | |
run: | | |
echo "Deploying model to Vertex AI..." | |
gcloud ai endpoints create \ | |
--region=${{ secrets.GOOGLE_CLOUD_REGION }} \ | |
--display-name=mlops-group10-deploy | |
ENDPOINT_ID=$(gcloud ai endpoints list \ | |
--region=${{ secrets.GOOGLE_CLOUD_REGION }} \ | |
--filter="display_name=mlops-group10-deploy" \ | |
--format="value(name)") | |
echo "Endpoint ID: $ENDPOINT_ID" | |
- name: Fetch latest model ID | |
id: get-model-id | |
run: | | |
LATEST_MODEL_ID=$(gcloud ai models list --region=${{ secrets.GOOGLE_CLOUD_REGION }} --format="value(modelId)" --limit=1 --sort-by="~createTime") | |
echo "Latest model ID: $LATEST_MODEL_ID" | |
echo "::set-output name=model_id::$LATEST_MODEL_ID" | |
- name: Fetch latest endpoint ID | |
id: get-endpoint-id | |
run: | | |
LATEST_ENDPOINT_ID=$(gcloud ai endpoints list --region=${{ secrets.GOOGLE_CLOUD_REGION }} --format="value(endpointId)" --limit=1 --sort-by="~createTime") | |
echo "Latest endpoint ID: $LATEST_ENDPOINT_ID" | |
echo "::set-output name=endpoint_id::$LATEST_ENDPOINT_ID" | |
- name: Monitor model performance and data shift | |
run: | | |
echo "Monitoring model with ID ${{ steps.get-model-id.outputs.model_id }}" | |
echo "on endpoint ${{ steps.get-endpoint-id.outputs.endpoint_id }}" |