Skip to content

Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters - #103

Draft
ghost wants to merge 1 commit into
masterfrom
update-Configuring-Model-Bundles-demo-code
Draft

Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters#103
ghost wants to merge 1 commit into
masterfrom
update-Configuring-Model-Bundles-demo-code

Conversation

@ghost

Copy link
Copy Markdown

Pull Request Summary

Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters

Test Plan and Usage Guide

Preview from

poetry shell
mkdocs serve
image

Unit test:

(launch-python-client) 🚫➜ launch-python-client git:(update-Configuring-Model-Bundles-demo-code) poetry run pytest
================================================================= test session starts =================================================================
platform darwin -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/juitse.hung/Desktop/launch-python-client, configfile: pyproject.toml
plugins: mock-3.10.0, requests-mock-1.10.0
collected 20 items tests/test_client.py::test_create_model_bundle_from_dirs_bundle_contents_correct -------------------------------------------------------------------- live log call --------------------------------------------------------------------
INFO launch.logger:connection.py:70 Make request to https://api.scale.com/v1/hosted_inference/model_bundle_upload
INFO launch.logger:connection.py:80 API request has response code 200
INFO launch.client:client.py:984 create_model_bundle_from_dirs: raw_bundle_url=s3://my-fake-bucket/path/to/bundle
PASSED [ 5%]
tests/test_client.py::test_get_non_existent_model_endpoint PASSED [ 10%]
tests/test_docs.py::test_docs_examples[docs/index.md:10-91] PASSED [ 15%]
tests/test_docs.py::test_docs_examples[docs/guides/custom_docker_images.md:28-57] SKIPPED (test='skip' on code snippet) [ 20%]
tests/test_docs.py::test_docs_examples[docs/guides/custom_docker_images.md:69-115] SKIPPED (test='skip' on code snippet) [ 25%]
tests/test_docs.py::test_docs_examples[docs/concepts/callbacks.md:23-71] PASSED [ 30%]
tests/test_docs.py::test_docs_examples[docs/concepts/callbacks.md:89-163] -------------------------------------------------------------------- live log call --------------------------------------------------------------------
INFO launch.client:client.py:1526 Editing existing endpoint
INFO launch.client:client.py:1593 Endpoint edit task id is <MagicMock name='mock.get()' id='140619063548896'>
PASSED [ 35%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_bundles.md:259-334] PASSED [ 40%]
tests/test_docs.py::test_docs_examples[docs/concepts/batch_jobs.md:13-43] -------------------------------------------------------------------- live log call --------------------------------------------------------------------
INFO launch.client:client.py:2056 Writing batch task csv to s3://<MagicMock id='140619060276144'>/<MagicMock id='140619060276144'>
INFO root:batch_jobs_13_43.py:40 the batch job is SUCCESS
INFO root:batch_jobs_13_43.py:42 {'job_id': 'test-batch-job', 'status': 'SUCCESS'}
PASSED [ 45%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:41-58] PASSED [ 50%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:67-84] PASSED [ 55%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:90-96] PASSED [ 60%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:98-107] -------------------------------------------------------------------- live log call --------------------------------------------------------------------
INFO launch.client:client.py:1526 Editing existing endpoint
INFO launch.client:client.py:1593 Endpoint edit task id is <MagicMock name='mock.get()' id='140619063755632'>
PASSED [ 65%]
tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:109-127] PASSED [ 70%]
tests/test_import_lib.py::test_dummy PASSED [ 75%]
tests/test_make_batch_file.py::test_make_batch_file PASSED [ 80%]
tests/test_model_endpoint.py::test_status_returns_updated_value PASSED [ 85%]
tests/test_pydantic_schemas.py::test_get_model_definitions PASSED [ 90%]
tests/test_pydantic_schemas.py::test_get_model_definitions_from_flat_models PASSED [ 95%]
tests/test_utils.py::test_trim_kwargs PASSED [100%]
================================================================== warnings summary ===================================================================
tests/test_client.py::test_create_model_bundle_from_dirs_bundle_contents_correct
/Users/juitse.hung/Desktop/launch-python-client/tests/test_client.py:71: DeprecatedWarning: create_model_bundle_from_dirs is deprecated as of 1.0.0. Use create_model_bundle_from_dirs_v2.
client.create_model_bundle_from_dirs(
tests/test_docs.py::test_docs_examples[docs/concepts/batch_jobs.md:13-43]
/private/var/folders/7z/mq5w4kvj0tnf5km_vkbvwprh0000gq/T/pytest-of-juitse.hung/pytest-1/test_docs_examples_docs_concep3/batch_jobs_13_43.py:37: RuntimeWarning: coroutine 'test_docs_examples.<locals>.dont_sleep' was never awaited
time.sleep(30)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================== 18 passed, 2 skipped, 2 warnings in 1.03s ======================================================
(launch-python-client) 🚫➜ launch-python-client git:(update-Configuring-Model-Bundles-demo-code) 

Shortcut Ticket

N/A

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ruizehung-scale