Skip to content
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

fix: update system test_model_upload to use BUILD_SPECIFIC_GCP_PROJECT #1043

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions tests/system/aiplatform/test_model_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,28 @@

import pytest

from google import auth as google_auth
from google.cloud import aiplatform
from google.cloud import storage

from tests.system.aiplatform import e2e_base

# TODO(vinnys): Replace with env var `BUILD_SPECIFIC_GCP_PROJECT` once supported
_, _TEST_PROJECT = google_auth.default()
_TEST_LOCATION = "us-central1"

_XGBOOST_MODEL_URI = "gs://cloud-samples-data-us-central1/vertex-ai/google-cloud-aiplatform-ci-artifacts/models/iris_xgboost/model.bst"


@pytest.mark.usefixtures("delete_staging_bucket")
class TestModel(e2e_base.TestEndToEnd):
_temp_prefix = f"{_TEST_PROJECT}-vertex-staging-{_TEST_LOCATION}"

_temp_prefix = "temp_vertex_sdk_e2e_model_upload_test"

def test_upload_and_deploy_xgboost_model(self, shared_state):
"""Upload XGBoost model from local file and deploy it for prediction. Additionally, update model name, description and labels"""

aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
aiplatform.init(
project=e2e_base._PROJECT, location=e2e_base._LOCATION,
)

storage_client = storage.Client(project=_TEST_PROJECT)
storage_client = storage.Client(project=e2e_base._PROJECT)
model_blob = storage.Blob.from_string(
uri=_XGBOOST_MODEL_URI, client=storage_client
)
Expand Down