Skip to content

Commit f23b98f

Browse files
committed
add runai model streamer e2e test for GCS
Signed-off-by: Alexis MacAskill <[email protected]>
1 parent 2d977a7 commit f23b98f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.buildkite/test-pipeline.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ steps:
543543

544544
- label: Model Executor Test # 23min
545545
timeout_in_minutes: 35
546+
torch_nightly: true
546547
mirror_hardwares: [amdexperimental]
547548
source_file_dependencies:
549+
- vllm/engine/arg_utils.py
550+
- vllm/config/model.py
548551
- vllm/model_executor
549552
- tests/model_executor
550553
- tests/entrypoints/openai/test_tensorizer_entrypoint.py

tests/model_executor/model_loader/runai_model_streamer/test_runai_model_streamer_loader.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4+
import pytest
5+
from google.cloud import storage
6+
47
from vllm import SamplingParams
58
from vllm.config.load import LoadConfig
69
from vllm.model_executor.model_loader import get_model_loader
710

811
load_format = "runai_streamer"
912
test_model = "openai-community/gpt2"
13+
# TODO(amacaskill): Replace with a GKE owned GCS bucket.
14+
test_gcs_model = "gs://vertex-model-garden-public-us/codegemma/codegemma-2b/"
1015

1116
prompts = [
1217
"Hello, my name is",
@@ -32,3 +37,24 @@ def test_runai_model_loader_download_files(vllm_runner):
3237
with vllm_runner(test_model, load_format=load_format) as llm:
3338
deserialized_outputs = llm.generate(prompts, sampling_params)
3439
assert deserialized_outputs
40+
41+
42+
def test_runai_model_loader_download_files_gcs(
43+
vllm_runner, monkeypatch: pytest.MonkeyPatch
44+
):
45+
# Mock storage Client creation so it will return an anonymous client
46+
# instead of google.auth.default(), which requires ADC credentials.
47+
def mock_storage_client(*args, **kwargs):
48+
return storage.Client.create_anonymous_client()
49+
50+
monkeypatch.setattr(
51+
"runai_model_streamer_gcs.files.files._create_client", mock_storage_client
52+
)
53+
monkeypatch.setenv("GOOGLE_CLOUD_PROJECT", "fake-project")
54+
monkeypatch.setenv("RUNAI_STREAMER_GCS_USE_ANONYMOUS_CREDENTIALS", "true")
55+
monkeypatch.setenv(
56+
"CLOUD_STORAGE_EMULATOR_ENDPOINT", "https://storage.googleapis.com"
57+
)
58+
with vllm_runner(test_gcs_model, load_format=load_format) as llm:
59+
deserialized_outputs = llm.generate(prompts, sampling_params)
60+
assert deserialized_outputs

0 commit comments

Comments
 (0)