Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 4 additions & 11 deletions integration_tests/rest_api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@
print(f"Integration tests using gateway {BASE_PATH=}")
DEFAULT_NETWORK_TIMEOUT_SEC = 10

# Generate some fake 24-character user IDs.
# We don't want different people to get user ID collisions but at the same time we want people to
# consistently use the same user IDs so that they can clean up their extra endpoints.
USER_PREFIX = os.getenv("SERVICE_IDENTIFIER", "test")[:8]
USER_ID_0 = USER_PREFIX + "0" * (24 - len(USER_PREFIX))
USER_ID_1 = USER_PREFIX + "1" * (24 - len(USER_PREFIX))

DEFAULT_USERS: Sequence[str] = (
USER_ID_0,
USER_ID_1,
)
# Use the scale-launch-integration-tests id
USER_ID_0 = os.getenv("TEST_USER_ID", "fakeuser")

DEFAULT_USERS: Sequence[str] = (USER_ID_0,) # type: ignore


def echo_load_predict_fn(model):
Expand Down
19 changes: 9 additions & 10 deletions integration_tests/test_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
CREATE_MODEL_BUNDLE_REQUEST_RUNNABLE_IMAGE,
CREATE_MODEL_BUNDLE_REQUEST_SIMPLE,
USER_ID_0,
USER_ID_1,
create_model_bundle,
ensure_launch_gateway_healthy,
get_latest_model_bundle,
Expand All @@ -16,12 +15,12 @@
@retry(stop=stop_after_attempt(10), wait=wait_fixed(30))
def model_bundles():
ensure_launch_gateway_healthy()
for user in [USER_ID_0, USER_ID_1]:
for create_bundle_request in [
CREATE_MODEL_BUNDLE_REQUEST_SIMPLE,
CREATE_MODEL_BUNDLE_REQUEST_RUNNABLE_IMAGE,
]:
create_model_bundle(create_bundle_request, user, "v2")
bundle = get_latest_model_bundle(create_bundle_request["name"], user, "v2")
assert bundle["name"] == create_bundle_request["name"]
assert bundle["metadata"] == create_bundle_request["metadata"]
user = USER_ID_0
for create_bundle_request in [
CREATE_MODEL_BUNDLE_REQUEST_SIMPLE,
CREATE_MODEL_BUNDLE_REQUEST_RUNNABLE_IMAGE,
]:
create_model_bundle(create_bundle_request, user, "v2")
bundle = get_latest_model_bundle(create_bundle_request["name"], user, "v2")
assert bundle["name"] == create_bundle_request["name"]
assert bundle["metadata"] == create_bundle_request["metadata"]
10 changes: 5 additions & 5 deletions integration_tests/test_fine_tunes.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import pytest

from .rest_api_utils import ( # CREATE_FINE_TUNE_DI_BATCH_JOB_BUNDLE_REQUEST, CREATE_FINE_TUNE_REQUEST, USER_ID_0, cancel_fine_tune_by_id, create_docker_image_batch_job_bundle, create_fine_tune, get_fine_tune_by_id,
USER_ID_1,
USER_ID_0,
list_fine_tunes,
)


@pytest.mark.skip(reason="test doesn't currently work, needs to be implemented correctly")
def test_fine_tunes() -> None:
# TODO: get this test to work (move LLM fine tune repository to database rather than in S3)

Expand All @@ -21,11 +24,8 @@ def test_fine_tunes() -> None:
# num_jobs = len(list_response_0_before["jobs"])
# assert num_jobs >= 1

list_response_1 = list_fine_tunes(USER_ID_1)
list_response_1 = list_fine_tunes(USER_ID_0)
assert len(list_response_1["jobs"]) == 0

# cancel_response = cancel_fine_tune_by_id(fine_tune_id, USER_ID_0)
# assert cancel_response["success"]

# list_response_0_after = list_fine_tunes(USER_ID_0)
# assert len(list_response_0_after["jobs"]) == num_jobs - 1