Skip to content

Conversation

phil-scale
Copy link
Contributor

@phil-scale phil-scale commented Feb 2, 2023

Summary

✨ New and improved ✨ CLI that uses a config file to store common info, like your API key and gateway endpoint

Usage guide and testing

❯ scale-launch bundles list
? Your Scale API Key? 615cc6e424ecf90020baffdd
? Is your installation of Launch self-hosted? Yes
? Your Gateway Endpoint? REDACTED
Bundles
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Bundle Id                ┃ Bundle name    ┃ Location                                                                                                         ┃ Packaging type ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ bun_ce4n1trog16g03e8re00 │ test-returns-2 │ s3://scale-ml-hosted-model-inference/model_bundles/62bc820451dbea002b1c5421/83370af2-6b57-4aa6-9669-2cddcb88959b │ cloudpickle    │
│ bun_ce4n0pk5tn1g03vq7j70 │ test-returns-1 │ s3://scale-ml-hosted-model-inference/model_bundles/615cc6e424ecf90020baffdd/e922bef6-6bdf-480b-90c7-66ec46c8ad05 │ cloudpickle    │
└──────────────────────────┴────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────┘
❯ scale-launch bundles get test-returns-2
bundle_id: bun_ce4n1trog16g03e8re00
bundle_name: test-returns-2
location: s3://scale-ml-hosted-model-inference/model_bundles/62bc820451dbea002b1c5421/83370af2-6b57-4aa6-9669-2cddcb88959b
packaging_type: cloudpickle
env_params: {'framework_type': 'pytorch', 'pytorch_image_tag': '1.7.1-cuda11.0-cudnn8-runtime', 'tensorflow_version': None, 'ecr_repo': None, 'image_tag': None}
requirements: []
app_config: {}
metadata:
load_predict_fn:
def returns_returns_2(x):
    def returns_2(y):
        return 2

    return returns_2

❯ scale-launch endpoints list
Endpoints
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Endpoint name ┃ Bundle name    ┃ Status ┃ Endpoint type ┃ Min Workers ┃ Max Workers ┃ Available Workers ┃ Unavailable Workers ┃ Metadata ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ test-endpoint │ test-returns-1 │ READY  │ async         │ 0           │ 1           │ 0                 │ 0                   │ {}       │
└───────────────┴────────────────┴────────┴───────────────┴─────────────┴─────────────┴───────────────────┴─────────────────────┴──────────┘

Shortcut Ticket

[sc-707008]

@phil-scale phil-scale requested a review from a team February 2, 2023 23:55
@phil-scale phil-scale self-assigned this Feb 2, 2023
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #707008: Improve V1 CLI usability.

Copy link
Contributor

@seanshi-scale seanshi-scale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! random qs about usability (probably in a separate pr but whatever):

  • do we want to also show endpoint_id inside the endpoints list table? (for consistency with bundle + it might be easier to go to kubectl get deployment this way)
  • I guess we probably want an endpoint get that gives details heh
  • should we show bundle id as well in endpoint get? since the bundle used might be a previous version of the bundle (although maybe this would require us to get bundles by id to be useful)

@phil-scale
Copy link
Contributor Author

lgtm! random qs about usability (probably in a separate pr but whatever):

  • do we want to also show endpoint_id inside the endpoints list table? (for consistency with bundle + it might be easier to go to kubectl get deployment this way)
  • I guess we probably want an endpoint get that gives details heh
  • should we show bundle id as well in endpoint get? since the bundle used might be a previous version of the bundle (although maybe this would require us to get bundles by id to be useful)

Ok I'll do the first two in this PR. I actually realized that adding bundle ID in endpoint get isn't possible because it's not even in the client ModelEndpoint object. Will add that in a follow-up.

@phil-scale phil-scale merged commit cce6fa3 into launch-v1 Feb 3, 2023
@syandroo
Copy link
Contributor

syandroo commented Feb 3, 2023

🤩

phil-scale added a commit that referenced this pull request Apr 4, 2023
* Add autogenerated client into launch v1 (#63)

* add autogenerated client into launch v1

* flake8 conf

* pylint and mypy too

* isort

* Squashed commit of the following:

commit 9533e47
Author: phil-scale <[email protected]>
Date:   Mon Dec 19 23:12:49 2022 -0800

    update deps

commit 14d1f11
Author: phil-scale <[email protected]>
Date:   Mon Dec 19 23:07:38 2022 -0800

    fix pylint check

commit f6c159d
Author: phil-scale <[email protected]>
Date:   Mon Dec 19 23:05:20 2022 -0800

    fix

commit 26825f6
Author: phil-scale <[email protected]>
Date:   Mon Dec 19 22:58:44 2022 -0800

    fix tests

commit f2c0db8
Merge: 443cb0c 7bdf37b
Author: phil-scale <[email protected]>
Date:   Mon Dec 19 14:33:23 2022 -0800

    Merge remote-tracking branch 'origin/master' into phil/launch-v1

commit 443cb0c
Author: Phil Chen <[email protected]>
Date:   Wed Dec 14 21:58:33 2022 -0800

    fix

commit 7dee94f
Author: Phil Chen <[email protected]>
Date:   Wed Dec 14 18:27:13 2022 -0800

    fixes

commit 44efbf4
Author: Phil Chen <[email protected]>
Date:   Fri Dec 2 12:13:55 2022 -0800

    fix

commit 7b74884
Author: Phil Chen <[email protected]>
Date:   Fri Dec 2 11:03:45 2022 -0800

    fix

commit 451de71
Author: Phil Chen <[email protected]>
Date:   Fri Dec 2 01:05:26 2022 -0800

    basic auth and fixes

commit 607332e
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:47:43 2022 -0800

    update reqs

commit ce11dff
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:40:10 2022 -0800

    black

commit ae4e040
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:38:29 2022 -0800

    fix mypy

commit 58c62ce
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:34:14 2022 -0800

    change to deployment_state

commit a582155
Merge: ff24539 aa0c0b2
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:29:16 2022 -0800

    Merge branch 'launch-v1' into phil/launch-v1

commit aa0c0b2
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:28:48 2022 -0800

    Add autogenerated client into launch v1 (#63)

    * add autogenerated client into launch v1

    * flake8 conf

    * pylint and mypy too

    * isort

commit ff24539
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 14:28:15 2022 -0800

    address comment

commit a53c23d
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 09:25:55 2022 -0800

    black

commit b5d4787
Author: Phil Chen <[email protected]>
Date:   Thu Dec 1 09:14:52 2022 -0800

    launch v1 client updates

* fixes

* Use new autogenerated python client for v1 (#67)

* Phil/upload schemas (#68)

* update client

* try again

* fix import

* fixes

* wip

* fixes

* try fix again

* fix

* fixes

* add pydantic schema support

* add test

* fix

* fix flat schemas

* black and isort

* Launch v1 client updates for batch jobs and callbacks (#69)

* add autogen client

* update client to use new API for callbacks and batch jobs

* fix

* Update clone-bundle route (#70)

* Update clone bundle function

* Revert unnecessary change

* pr comments

* mypy

* black

* ✨ Updated v1 CLI ✨  (#71)

* updated v1 python client

* specify encoding

* use utf-8

* add ID to list endpoints and get endpoint

* Use spinner while loading in cli and edit endpoints from CLI (#72)

* clone_bundle_with_changes server route expects new_app_config, not app_config

* update reqs

* use base64 and json to encode batch job payloads (#74)

* fix base64 encoding

* Add CLI command for getting batch job status (#75)

* Use timedelta for printing batch job duration

* fix sync endpoint request

* fix sync endpoint result on error

* Add timeouts to `EndpointResponseFuture` (#77)

* Send requests to launch endpoint (#76)

Adding `send` command, ie: `launch tasks send`

* print more info in launch CLI

* Clean up unused code and use ruff instead of flake8 (#79)

* use ruff instead of flake8

* update lint cfgs

* fix typing

* rm pipeline test

* Add features to `launch endpoints list` (#80)

* add orderby, descending and num_gpus

* reverting changes

* typing_extensions for py37

* remove double print (#82)

* filter bundles and endpoints by name in CLI (#84)

* New documentation site (#81)

* Use mkdocs and write docs for launch

* updates

* add site_url

* add overview of concepts

* fix

* some more fixes

* Update CLI help string to 118 instead of 78 chars wide

* test python code in docs and docstrings

* update team tags to infra

* update literal to typing_extensions

* add some reqs

* fix

* add sleep to callbacks

* updates

* update deps

* address comments

* fix pylint

* Callback custom auth (#85)

* update clients

* Update client to support custom callback auth

* update docs

* update docs with mtls default example

* add copy extension

* Add endpoint to client

* Update docs and external client for priority API change (#87)

* new docs

* format

* format isort

* new changes

* new formatted changes

* formatting

* updated client

* changing from str to bool

* removing site

* making sure?

* update to v1

* Update autogen client with v2 bundles (#88)

* Update autogenerated python client

* fix tests

* Model bundles v2 python API (#89)

* Add model bundles v2 API

* add get list and clone routes too

* use types and make docstrings more informative

* fixes

* fix status

* Documentation for model bundles v2 (#90)

* Add documentation for model bundles

* address comments

* fix

* launch v2 bundles API (#91)

* v2 bundles api copy

* Formated with black

* isort and fix 2 mypy errors

launch/connection.py:14: error: Incompatible default for argument "endpoint" (default has type "None", argument has type "str")  [assignment]
launch/client.py:1811: error: Incompatible default for argument "urls" (default has type "None", argument has type "List[str]")  [assignment]

* Fix package import

* Added readiness_initial_delay_seconds

* updating docs

* Added create TritonEnhancedRunnableImageFlavor bundle

* fix

* fix

* fix

* rm space

* update docs

* fix index docs to new apis

---------

Co-authored-by: Phil Chen <[email protected]>

* update mkdocs readme

* use logging lib

---------

Co-authored-by: Yi Xu <[email protected]>
Co-authored-by: Adrian Lam <[email protected]>
Co-authored-by: Anirudh Jain <[email protected]>
Co-authored-by: Malcolm Greaves <[email protected]>
Sign up for free to 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.

3 participants