Skip to content

Commit 3ae0734

Browse files
committed
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
1 parent 5e437cd commit 3ae0734

File tree

12 files changed

+597
-1034
lines changed

12 files changed

+597
-1034
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
name: Pylint Lint Check # Uses .pylintrc for configuration
4848
command: |
4949
poetry run pylint launch --ignore=clientlib,api_client
50-
- run :
50+
- run:
5151
name: MyPy typing check
5252
command: |
5353
poetry run mypy --ignore-missing-imports launch --exclude launch/clientlib --exclude launch/api_client
54-
- run :
54+
- run:
5555
name: Isort Import Formatting Check # Only validation, without re-formatting
5656
command: |
5757
poetry run isort --check-only launch

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ max-line-length=79
2727

2828
[MASTER]
2929
# Ignore anything inside launch/clientlib (since it's documentation)
30-
ignore=clientlib
30+
ignore=clientlib,api_client

launch/api_client/api/default_api.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def __init__(self, api_client=None):
8686
self.create_async_inference_task_v1_async_tasks_post_endpoint = _Endpoint(
8787
settings={
8888
"response_type": (CreateAsyncTaskResponse,),
89-
"auth": ["APIKeyHeader"],
90-
"endpoint_path": "/async-tasks",
89+
"auth": ["HTTPBasic"],
90+
"endpoint_path": "/v1/async-tasks",
9191
"operation_id": "create_async_inference_task_v1_async_tasks_post",
9292
"http_method": "POST",
9393
"servers": None,
@@ -134,8 +134,8 @@ def __init__(self, api_client=None):
134134
self.create_model_bundle_v1_model_bundles_post_endpoint = _Endpoint(
135135
settings={
136136
"response_type": (CreateModelBundleResponse,),
137-
"auth": ["APIKeyHeader"],
138-
"endpoint_path": "/model-bundles",
137+
"auth": ["HTTPBasic"],
138+
"endpoint_path": "/v1/model-bundles",
139139
"operation_id": "create_model_bundle_v1_model_bundles_post",
140140
"http_method": "POST",
141141
"servers": None,
@@ -177,8 +177,8 @@ def __init__(self, api_client=None):
177177
self.create_model_endpoint_v1_model_endpoints_post_endpoint = _Endpoint(
178178
settings={
179179
"response_type": (CreateModelEndpointResponse,),
180-
"auth": ["APIKeyHeader"],
181-
"endpoint_path": "/model-endpoints",
180+
"auth": ["HTTPBasic"],
181+
"endpoint_path": "/v1/model-endpoints",
182182
"operation_id": "create_model_endpoint_v1_model_endpoints_post",
183183
"http_method": "POST",
184184
"servers": None,
@@ -222,8 +222,8 @@ def __init__(self, api_client=None):
222222
self.create_sync_inference_task_v1_sync_tasks_post_endpoint = _Endpoint(
223223
settings={
224224
"response_type": (SyncEndpointPredictResponse,),
225-
"auth": ["APIKeyHeader"],
226-
"endpoint_path": "/sync-tasks",
225+
"auth": ["HTTPBasic"],
226+
"endpoint_path": "/v1/sync-tasks",
227227
"operation_id": "create_sync_inference_task_v1_sync_tasks_post",
228228
"http_method": "POST",
229229
"servers": None,
@@ -270,8 +270,8 @@ def __init__(self, api_client=None):
270270
self.delete_model_endpoint_v1_model_endpoints_model_endpoint_id_delete_endpoint = _Endpoint(
271271
settings={
272272
"response_type": (DeleteModelEndpointResponse,),
273-
"auth": ["APIKeyHeader"],
274-
"endpoint_path": "/model-endpoints/{model_endpoint_id}",
273+
"auth": ["HTTPBasic"],
274+
"endpoint_path": "/v1/model-endpoints/{model_endpoint_id}",
275275
"operation_id": "delete_model_endpoint_v1_model_endpoints_model_endpoint_id_delete",
276276
"http_method": "DELETE",
277277
"servers": None,
@@ -314,8 +314,8 @@ def __init__(self, api_client=None):
314314
self.get_async_inference_task_v1_async_tasks_task_id_get_endpoint = _Endpoint(
315315
settings={
316316
"response_type": (GetAsyncTaskResponse,),
317-
"auth": ["APIKeyHeader"],
318-
"endpoint_path": "/async-tasks/{task_id}",
317+
"auth": ["HTTPBasic"],
318+
"endpoint_path": "/v1/async-tasks/{task_id}",
319319
"operation_id": "get_async_inference_task_v1_async_tasks_task_id_get",
320320
"http_method": "GET",
321321
"servers": None,
@@ -358,8 +358,8 @@ def __init__(self, api_client=None):
358358
self.get_latest_model_bundle_v1_model_bundles_latest_get_endpoint = _Endpoint(
359359
settings={
360360
"response_type": (ModelBundleResponse,),
361-
"auth": ["APIKeyHeader"],
362-
"endpoint_path": "/model-bundles/latest",
361+
"auth": ["HTTPBasic"],
362+
"endpoint_path": "/v1/model-bundles/latest",
363363
"operation_id": "get_latest_model_bundle_v1_model_bundles_latest_get",
364364
"http_method": "GET",
365365
"servers": None,
@@ -402,8 +402,8 @@ def __init__(self, api_client=None):
402402
self.get_model_bundle_v1_model_bundles_model_bundle_id_get_endpoint = _Endpoint(
403403
settings={
404404
"response_type": (ModelBundleResponse,),
405-
"auth": ["APIKeyHeader"],
406-
"endpoint_path": "/model-bundles/{model_bundle_id}",
405+
"auth": ["HTTPBasic"],
406+
"endpoint_path": "/v1/model-bundles/{model_bundle_id}",
407407
"operation_id": "get_model_bundle_v1_model_bundles_model_bundle_id_get",
408408
"http_method": "GET",
409409
"servers": None,
@@ -446,8 +446,8 @@ def __init__(self, api_client=None):
446446
self.get_model_endpoint_v1_model_endpoints_model_endpoint_id_get_endpoint = _Endpoint(
447447
settings={
448448
"response_type": (GetModelEndpointResponse,),
449-
"auth": ["APIKeyHeader"],
450-
"endpoint_path": "/model-endpoints/{model_endpoint_id}",
449+
"auth": ["HTTPBasic"],
450+
"endpoint_path": "/v1/model-endpoints/{model_endpoint_id}",
451451
"operation_id": "get_model_endpoint_v1_model_endpoints_model_endpoint_id_get",
452452
"http_method": "GET",
453453
"servers": None,
@@ -610,8 +610,8 @@ def __init__(self, api_client=None):
610610
self.list_model_bundles_v1_model_bundles_get_endpoint = _Endpoint(
611611
settings={
612612
"response_type": (ListModelBundlesResponse,),
613-
"auth": ["APIKeyHeader"],
614-
"endpoint_path": "/model-bundles",
613+
"auth": ["HTTPBasic"],
614+
"endpoint_path": "/v1/model-bundles",
615615
"operation_id": "list_model_bundles_v1_model_bundles_get",
616616
"http_method": "GET",
617617
"servers": None,
@@ -656,8 +656,8 @@ def __init__(self, api_client=None):
656656
self.list_model_endpoints_v1_model_endpoints_get_endpoint = _Endpoint(
657657
settings={
658658
"response_type": (ListModelEndpointsResponse,),
659-
"auth": ["APIKeyHeader"],
660-
"endpoint_path": "/model-endpoints",
659+
"auth": ["HTTPBasic"],
660+
"endpoint_path": "/v1/model-endpoints",
661661
"operation_id": "list_model_endpoints_v1_model_endpoints_get",
662662
"http_method": "GET",
663663
"servers": None,
@@ -702,8 +702,8 @@ def __init__(self, api_client=None):
702702
self.update_model_endpoint_v1_model_endpoints_model_endpoint_id_put_endpoint = _Endpoint(
703703
settings={
704704
"response_type": (UpdateModelEndpointResponse,),
705-
"auth": ["APIKeyHeader"],
706-
"endpoint_path": "/model-endpoints/{model_endpoint_id}",
705+
"auth": ["HTTPBasic"],
706+
"endpoint_path": "/v1/model-endpoints/{model_endpoint_id}",
707707
"operation_id": "update_model_endpoint_v1_model_endpoints_model_endpoint_id_put",
708708
"http_method": "PUT",
709709
"servers": None,

launch/api_client/configuration.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,21 @@ class Configuration(object):
8686
8787
:Example:
8888
89-
API Key Authentication Example.
89+
HTTP Basic Authentication Example.
9090
Given the following security scheme in the OpenAPI specification:
9191
components:
9292
securitySchemes:
93-
cookieAuth: # name for the security scheme
94-
type: apiKey
95-
in: cookie
96-
name: JSESSIONID # cookie name
93+
http_basic_auth:
94+
type: http
95+
scheme: basic
9796
98-
You can programmatically set the cookie:
97+
Configure API client with HTTP basic authentication:
9998
10099
conf = launch.api_client.Configuration(
101-
api_key={'cookieAuth': 'abc123'}
102-
api_key_prefix={'cookieAuth': 'JSESSIONID'}
100+
username='the-user',
101+
password='the-password',
103102
)
104103
105-
The following cookie will be added to the HTTP request:
106-
Cookie: JSESSIONID abc123
107104
"""
108105

109106
_default = None
@@ -409,14 +406,12 @@ def auth_settings(self):
409406
:return: The Auth Settings information dict.
410407
"""
411408
auth = {}
412-
if "APIKeyHeader" in self.api_key:
413-
auth["APIKeyHeader"] = {
414-
"type": "api_key",
409+
if self.username is not None and self.password is not None:
410+
auth["HTTPBasic"] = {
411+
"type": "basic",
415412
"in": "header",
416-
"key": "X-API-Key",
417-
"value": self.get_api_key_with_prefix(
418-
"APIKeyHeader",
419-
),
413+
"key": "Authorization",
414+
"value": self.get_basic_auth_token(),
420415
}
421416
return auth
422417

launch/api_client/model/update_model_endpoint_request.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def openapi_types():
112112
"""
113113
lazy_import()
114114
return {
115-
"aws_role": (str,), # noqa: E501
116115
"billing_tags": (
117116
{
118117
str: (
@@ -154,7 +153,6 @@ def openapi_types():
154153
"per_worker": (int,), # noqa: E501
155154
"post_inference_hooks": ([str],), # noqa: E501
156155
"prewarm": (bool,), # noqa: E501
157-
"results_s3_bucket": (str,), # noqa: E501
158156
"storage": (Storage,), # noqa: E501
159157
}
160158

@@ -163,7 +161,6 @@ def discriminator():
163161
return None
164162

165163
attribute_map = {
166-
"aws_role": "aws_role", # noqa: E501
167164
"billing_tags": "billing_tags", # noqa: E501
168165
"cpus": "cpus", # noqa: E501
169166
"gpu_type": "gpu_type", # noqa: E501
@@ -177,7 +174,6 @@ def discriminator():
177174
"per_worker": "per_worker", # noqa: E501
178175
"post_inference_hooks": "post_inference_hooks", # noqa: E501
179176
"prewarm": "prewarm", # noqa: E501
180-
"results_s3_bucket": "results_s3_bucket", # noqa: E501
181177
"storage": "storage", # noqa: E501
182178
}
183179

@@ -221,7 +217,6 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
221217
Animal class but this time we won't travel
222218
through its discriminator because we passed in
223219
_visited_composed_classes = (Animal,)
224-
aws_role (str): [optional] # noqa: E501
225220
billing_tags ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
226221
cpus (Cpus): [optional] # noqa: E501
227222
gpu_type (GpuType): [optional] # noqa: E501
@@ -235,7 +230,6 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
235230
per_worker (int): [optional] # noqa: E501
236231
post_inference_hooks ([str]): [optional] # noqa: E501
237232
prewarm (bool): [optional] # noqa: E501
238-
results_s3_bucket (str): [optional] # noqa: E501
239233
storage (Storage): [optional] # noqa: E501
240234
"""
241235

@@ -329,7 +323,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
329323
Animal class but this time we won't travel
330324
through its discriminator because we passed in
331325
_visited_composed_classes = (Animal,)
332-
aws_role (str): [optional] # noqa: E501
333326
billing_tags ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
334327
cpus (Cpus): [optional] # noqa: E501
335328
gpu_type (GpuType): [optional] # noqa: E501
@@ -343,7 +336,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
343336
per_worker (int): [optional] # noqa: E501
344337
post_inference_hooks ([str]): [optional] # noqa: E501
345338
prewarm (bool): [optional] # noqa: E501
346-
results_s3_bucket (str): [optional] # noqa: E501
347339
storage (Storage): [optional] # noqa: E501
348340
"""
349341

0 commit comments

Comments
 (0)