diff --git a/api/client/api_alert.go b/api/client/api_alert.go index a502ad15a..6713182aa 100644 --- a/api/client/api_alert.go +++ b/api/client/api_alert.go @@ -28,8 +28,7 @@ type AlertApiService service /* AlertApiService Lists teams for alert notification channel. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return []string */ func (a *AlertApiService) AlertsTeamsGet(ctx context.Context) ([]string, *http.Response, error) { @@ -125,9 +124,8 @@ func (a *AlertApiService) AlertsTeamsGet(ctx context.Context) ([]string, *http.R /* AlertApiService Lists alerts for given model. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId @return []ModelEndpointAlert */ func (a *AlertApiService) ModelsModelIdAlertsGet(ctx context.Context, modelId int32) ([]ModelEndpointAlert, *http.Response, error) { @@ -224,10 +222,9 @@ func (a *AlertApiService) ModelsModelIdAlertsGet(ctx context.Context, modelId in /* AlertApiService Gets alert for given model endpoint. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param modelEndpointId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param modelEndpointId @return ModelEndpointAlert */ func (a *AlertApiService) ModelsModelIdEndpointsModelEndpointIdAlertGet(ctx context.Context, modelId int32, modelEndpointId string) (ModelEndpointAlert, *http.Response, error) { diff --git a/api/client/api_endpoint.go b/api/client/api_endpoint.go index dc7c9f960..d44aa698c 100644 --- a/api/client/api_endpoint.go +++ b/api/client/api_endpoint.go @@ -28,11 +28,10 @@ type EndpointApiService service /* EndpointApiService Get all container belong to a version endpoint - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param endpointId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param endpointId @return Container */ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdContainersGet(ctx context.Context, modelId int32, versionId int32, endpointId string) (Container, *http.Response, error) { @@ -131,10 +130,11 @@ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdCon /* EndpointApiService Undeploy the specified model version deployment - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param endpointId + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param endpointId + */ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdDelete(ctx context.Context, modelId int32, versionId int32, endpointId string) (*http.Response, error) { var ( @@ -213,11 +213,10 @@ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdDel /* EndpointApiService Get version endpoint resource - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param endpointId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param endpointId @return VersionEndpoint */ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdGet(ctx context.Context, modelId int32, versionId int32, endpointId string) (VersionEndpoint, *http.Response, error) { @@ -431,10 +430,9 @@ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointEndpointIdPut /* EndpointApiService List all endpoint of a model version - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId @return []VersionEndpoint */ func (a *EndpointApiService) ModelsModelIdVersionsVersionIdEndpointGet(ctx context.Context, modelId int32, versionId int32) ([]VersionEndpoint, *http.Response, error) { diff --git a/api/client/api_model_endpoints.go b/api/client/api_model_endpoints.go index 806d38b2d..bec7f9a2f 100644 --- a/api/client/api_model_endpoints.go +++ b/api/client/api_model_endpoints.go @@ -28,9 +28,8 @@ type ModelEndpointsApiService service /* ModelEndpointsApiService List model endpoint - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId @return []ModelEndpoint */ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsGet(ctx context.Context, modelId int32) ([]ModelEndpoint, *http.Response, error) { @@ -127,9 +126,10 @@ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsGet(ctx context.Context /* ModelEndpointsApiService Stop serving traffic to the model endpoint, then delete it. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param modelEndpointId + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param modelEndpointId + */ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsModelEndpointIdDelete(ctx context.Context, modelId int32, modelEndpointId string) (*http.Response, error) { var ( @@ -207,10 +207,9 @@ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsModelEndpointIdDelete(c /* ModelEndpointsApiService Get a model endpoint - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param modelEndpointId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param modelEndpointId @return ModelEndpoint */ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsModelEndpointIdGet(ctx context.Context, modelId int32, modelEndpointId string) (ModelEndpoint, *http.Response, error) { @@ -421,10 +420,9 @@ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsModelEndpointIdPut(ctx /* ModelEndpointsApiService Create a model endpoint - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param body Model endpoint object that has to be added - - @param modelId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Model endpoint object that has to be added + * @param modelId @return ModelEndpoint */ func (a *ModelEndpointsApiService) ModelsModelIdEndpointsPost(ctx context.Context, body ModelEndpoint, modelId int32) (ModelEndpoint, *http.Response, error) { diff --git a/api/client/api_models.go b/api/client/api_models.go index 4fdff2279..31b00206a 100644 --- a/api/client/api_models.go +++ b/api/client/api_models.go @@ -28,8 +28,7 @@ type ModelsApiService service /* ModelsApiService Lists teams for alert notification channel. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return []string */ func (a *ModelsApiService) AlertsTeamsGet(ctx context.Context) ([]string, *http.Response, error) { @@ -125,9 +124,8 @@ func (a *ModelsApiService) AlertsTeamsGet(ctx context.Context) ([]string, *http. /* ModelsApiService Lists alerts for given model. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId @return []ModelEndpointAlert */ func (a *ModelsApiService) ModelsModelIdAlertsGet(ctx context.Context, modelId int32) ([]ModelEndpointAlert, *http.Response, error) { @@ -224,10 +222,9 @@ func (a *ModelsApiService) ModelsModelIdAlertsGet(ctx context.Context, modelId i /* ModelsApiService Gets alert for given model endpoint. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param modelEndpointId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param modelEndpointId @return ModelEndpointAlert */ func (a *ModelsApiService) ModelsModelIdEndpointsModelEndpointIdAlertGet(ctx context.Context, modelId int32, modelEndpointId string) (ModelEndpointAlert, *http.Response, error) { @@ -621,10 +618,9 @@ func (a *ModelsApiService) ProjectsProjectIdModelsGet(ctx context.Context, proje /* ModelsApiService Delete model - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param projectId project id of the project to be deleted - - @param modelId model id of the model to be deleted - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId project id of the project to be deleted + * @param modelId model id of the model to be deleted @return int32 */ func (a *ModelsApiService) ProjectsProjectIdModelsModelIdDelete(ctx context.Context, projectId int32, modelId int32) (int32, *http.Response, error) { @@ -722,10 +718,9 @@ func (a *ModelsApiService) ProjectsProjectIdModelsModelIdDelete(ctx context.Cont /* ModelsApiService Get model - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param projectId project id of the project to be retrieved - - @param modelId model id of the model to be retrieved - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId project id of the project to be retrieved + * @param modelId model id of the model to be retrieved @return []Model */ func (a *ModelsApiService) ProjectsProjectIdModelsModelIdGet(ctx context.Context, projectId int32, modelId int32) ([]Model, *http.Response, error) { diff --git a/api/client/api_prediction_jobs.go b/api/client/api_prediction_jobs.go index 8412b0a27..4b5ebff93 100644 --- a/api/client/api_prediction_jobs.go +++ b/api/client/api_prediction_jobs.go @@ -28,10 +28,9 @@ type PredictionJobsApiService service /* PredictionJobsApiService List all prediction jobs of a model version - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId @return []PredictionJob */ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsGet(ctx context.Context, modelId int32, versionId int32) ([]PredictionJob, *http.Response, error) { @@ -129,11 +128,10 @@ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsGet(ctx con /* PredictionJobsApiService Get all container belong to a prediction job - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param jobId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param jobId @return Container */ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsJobIdContainersGet(ctx context.Context, modelId int32, versionId int32, jobId string) (Container, *http.Response, error) { @@ -232,11 +230,10 @@ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsJobIdContai /* PredictionJobsApiService Get prediction jobs with given id - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param jobId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param jobId @return PredictionJob */ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsJobIdGet(ctx context.Context, modelId int32, versionId int32, jobId int32) (PredictionJob, *http.Response, error) { @@ -335,10 +332,11 @@ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsJobIdGet(ct /* PredictionJobsApiService Stop prediction jobs with given id - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - - @param jobId + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId + * @param jobId + */ func (a *PredictionJobsApiService) ModelsModelIdVersionsVersionIdJobsJobIdStopPut(ctx context.Context, modelId int32, versionId int32, jobId int32) (*http.Response, error) { var ( diff --git a/api/client/api_project.go b/api/client/api_project.go index 48a2a5d54..0ac40dcb4 100644 --- a/api/client/api_project.go +++ b/api/client/api_project.go @@ -135,9 +135,8 @@ func (a *ProjectApiService) ProjectsGet(ctx context.Context, localVarOptionals * /* ProjectApiService Create new project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param body Project object that has to be added - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Project object that has to be added @return Project */ func (a *ProjectApiService) ProjectsPost(ctx context.Context, body Project) (Project, *http.Response, error) { @@ -235,9 +234,8 @@ func (a *ProjectApiService) ProjectsPost(ctx context.Context, body Project) (Pro /* ProjectApiService Get project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param projectId project id of the project to be retrieved - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId project id of the project to be retrieved @return Project */ func (a *ProjectApiService) ProjectsProjectIdGet(ctx context.Context, projectId int32) (Project, *http.Response, error) { @@ -334,10 +332,9 @@ func (a *ProjectApiService) ProjectsProjectIdGet(ctx context.Context, projectId /* ProjectApiService Update project - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param body Project object that has to be updated - - @param projectId project id of the project to be updated - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body Project object that has to be updated + * @param projectId project id of the project to be updated @return Project */ func (a *ProjectApiService) ProjectsProjectIdPut(ctx context.Context, body Project, projectId int32) (Project, *http.Response, error) { diff --git a/api/client/api_secret.go b/api/client/api_secret.go index 84bd941d4..13d00b91e 100644 --- a/api/client/api_secret.go +++ b/api/client/api_secret.go @@ -28,9 +28,8 @@ type SecretApiService service /* SecretApiService List secret - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param projectId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId @return []Secret */ func (a *SecretApiService) ProjectsProjectIdSecretsGet(ctx context.Context, projectId int32) ([]Secret, *http.Response, error) { @@ -238,9 +237,10 @@ func (a *SecretApiService) ProjectsProjectIdSecretsPost(ctx context.Context, pro /* SecretApiService Delete secret - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param projectId - - @param secretId + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param projectId + * @param secretId + */ func (a *SecretApiService) ProjectsProjectIdSecretsSecretIdDelete(ctx context.Context, projectId int32, secretId int32) (*http.Response, error) { var ( diff --git a/api/client/api_version.go b/api/client/api_version.go index 7b5deceea..2a010cd6a 100644 --- a/api/client/api_version.go +++ b/api/client/api_version.go @@ -257,10 +257,9 @@ func (a *VersionApiService) ModelsModelIdVersionsPost(ctx context.Context, model /* VersionApiService Delete version by ID from model - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId @return int32 */ func (a *VersionApiService) ModelsModelIdVersionsVersionIdDelete(ctx context.Context, modelId int32, versionId int32) (int32, *http.Response, error) { @@ -358,10 +357,9 @@ func (a *VersionApiService) ModelsModelIdVersionsVersionIdDelete(ctx context.Con /* VersionApiService Get version by ID from model - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param modelId - - @param versionId - + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param modelId + * @param versionId @return Version */ func (a *VersionApiService) ModelsModelIdVersionsVersionIdGet(ctx context.Context, modelId int32, versionId int32) (Version, *http.Response, error) { diff --git a/api/client/model_transformer.go b/api/client/model_transformer.go index 4004aa3b8..9aec9069f 100644 --- a/api/client/model_transformer.go +++ b/api/client/model_transformer.go @@ -13,6 +13,7 @@ import ( ) type Transformer struct { + Id string `json:"id,omitempty"` Enabled bool `json:"enabled,omitempty"` TransformerType string `json:"transformer_type,omitempty"` Image string `json:"image,omitempty"` diff --git a/python/sdk/client/api/standard_transformer_api.py b/python/sdk/client/api/standard_transformer_api.py index 996909ea2..50acfec33 100644 --- a/python/sdk/client/api/standard_transformer_api.py +++ b/python/sdk/client/api/standard_transformer_api.py @@ -46,15 +46,11 @@ def standard_transformer_simulate_post(self, **kwargs): # noqa: E501 If the method is called asynchronously, returns the request thread. """ - kwargs["_return_http_data_only"] = True - if kwargs.get("async_req"): - return self.standard_transformer_simulate_post_with_http_info( - **kwargs - ) # noqa: E501 + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.standard_transformer_simulate_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.standard_transformer_simulate_post_with_http_info( - **kwargs - ) # noqa: E501 + (data) = self.standard_transformer_simulate_post_with_http_info(**kwargs) # noqa: E501 return data def standard_transformer_simulate_post_with_http_info(self, **kwargs): # noqa: E501 @@ -72,21 +68,21 @@ def standard_transformer_simulate_post_with_http_info(self, **kwargs): # noqa: returns the request thread. """ - all_params = ["body"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') params = locals() - for key, val in six.iteritems(params["kwargs"]): + for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method standard_transformer_simulate_post" % key ) params[key] = val - del params["kwargs"] + del params['kwargs'] collection_formats = {} @@ -100,37 +96,31 @@ def standard_transformer_simulate_post_with_http_info(self, **kwargs): # noqa: local_var_files = {} body_params = None - if "body" in params: - body_params = params["body"] + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept( - ["*/*"] - ) # noqa: E501 + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 # HTTP header `Content-Type` - header_params[ - "Content-Type" - ] = self.api_client.select_header_content_type( # noqa: E501 - ["*/*"] - ) # noqa: E501 + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 # Authentication setting - auth_settings = ["Bearer"] # noqa: E501 + auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( - "/standard_transformer/simulate", - "POST", + '/standard_transformer/simulate', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type="StandardTransformerSimulationResponse", # noqa: E501 + response_type='StandardTransformerSimulationResponse', # noqa: E501 auth_settings=auth_settings, - async_req=params.get("async_req"), - _return_http_data_only=params.get("_return_http_data_only"), - _preload_content=params.get("_preload_content", True), - _request_timeout=params.get("_request_timeout"), - collection_formats=collection_formats, - ) + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/python/sdk/client/models/free_form_object.py b/python/sdk/client/models/free_form_object.py index 10facfa85..cd8258ec2 100644 --- a/python/sdk/client/models/free_form_object.py +++ b/python/sdk/client/models/free_form_object.py @@ -30,12 +30,12 @@ class FreeFormObject(dict): swagger_types = { } if hasattr(dict, "swagger_types"): - swagger_types.update(dict.swagger_types) # type: ignore[attr-defined] + swagger_types.update(dict.swagger_types) # type: ignore[attr-defined] attribute_map = { } if hasattr(dict, "attribute_map"): - attribute_map.update(dict.attribute_map) # type: ignore[attr-defined] + attribute_map.update(dict.attribute_map) # type: ignore[attr-defined] def __init__(self, *args, **kwargs): # noqa: E501 """FreeFormObject - a model defined in Swagger""" # noqa: E501 diff --git a/python/sdk/client/models/standard_transformer_simulation_request.py b/python/sdk/client/models/standard_transformer_simulation_request.py index 1324cc5db..f97520259 100644 --- a/python/sdk/client/models/standard_transformer_simulation_request.py +++ b/python/sdk/client/models/standard_transformer_simulation_request.py @@ -15,13 +15,11 @@ import six - class StandardTransformerSimulationRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -30,29 +28,22 @@ class StandardTransformerSimulationRequest(object): and the value is json key in definition. """ swagger_types = { - "payload": "FreeFormObject", - "headers": "FreeFormObject", - "config": "FreeFormObject", - "model_prediction_config": "ModelPredictionConfig", - "protocol": "Protocol", + 'payload': 'FreeFormObject', + 'headers': 'FreeFormObject', + 'config': 'FreeFormObject', + 'model_prediction_config': 'ModelPredictionConfig', + 'protocol': 'Protocol' } attribute_map = { - "payload": "payload", - "headers": "headers", - "config": "config", - "model_prediction_config": "model_prediction_config", - "protocol": "protocol", + 'payload': 'payload', + 'headers': 'headers', + 'config': 'config', + 'model_prediction_config': 'model_prediction_config', + 'protocol': 'protocol' } - def __init__( - self, - payload=None, - headers=None, - config=None, - model_prediction_config=None, - protocol=None, - ): # noqa: E501 + def __init__(self, payload=None, headers=None, config=None, model_prediction_config=None, protocol=None): # noqa: E501 """StandardTransformerSimulationRequest - a model defined in Swagger""" # noqa: E501 self._payload = None self._headers = None @@ -183,20 +174,18 @@ def to_dict(self): for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list( - map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) - ) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") - else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value if issubclass(StandardTransformerSimulationRequest, dict): diff --git a/python/sdk/client/models/transformer.py b/python/sdk/client/models/transformer.py index 03ec91c3a..2763fa140 100644 --- a/python/sdk/client/models/transformer.py +++ b/python/sdk/client/models/transformer.py @@ -28,6 +28,7 @@ class Transformer(object): and the value is json key in definition. """ swagger_types = { + 'id': 'str', 'enabled': 'bool', 'transformer_type': 'str', 'image': 'str', @@ -40,6 +41,7 @@ class Transformer(object): } attribute_map = { + 'id': 'id', 'enabled': 'enabled', 'transformer_type': 'transformer_type', 'image': 'image', @@ -51,8 +53,9 @@ class Transformer(object): 'updated_at': 'updated_at' } - def __init__(self, enabled=None, transformer_type=None, image=None, command=None, args=None, resource_request=None, env_vars=None, created_at=None, updated_at=None): # noqa: E501 + def __init__(self, id=None, enabled=None, transformer_type=None, image=None, command=None, args=None, resource_request=None, env_vars=None, created_at=None, updated_at=None): # noqa: E501 """Transformer - a model defined in Swagger""" # noqa: E501 + self._id = None self._enabled = None self._transformer_type = None self._image = None @@ -63,6 +66,8 @@ def __init__(self, enabled=None, transformer_type=None, image=None, command=None self._created_at = None self._updated_at = None self.discriminator = None + if id is not None: + self.id = id if enabled is not None: self.enabled = enabled if transformer_type is not None: @@ -82,6 +87,27 @@ def __init__(self, enabled=None, transformer_type=None, image=None, command=None if updated_at is not None: self.updated_at = updated_at + @property + def id(self): + """Gets the id of this Transformer. # noqa: E501 + + + :return: The id of this Transformer. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Transformer. + + + :param id: The id of this Transformer. # noqa: E501 + :type: str + """ + + self._id = id + @property def enabled(self): """Gets the enabled of this Transformer. # noqa: E501 diff --git a/python/sdk/merlin/endpoint.py b/python/sdk/merlin/endpoint.py index 599e57941..2113e62f5 100644 --- a/python/sdk/merlin/endpoint.py +++ b/python/sdk/merlin/endpoint.py @@ -25,6 +25,7 @@ from merlin.protocol import Protocol from merlin.util import autostr, get_url from merlin.resource_request import ResourceRequest +from merlin.transformer import Transformer class Status(Enum): @@ -65,6 +66,14 @@ def __init__(self, endpoint: client.VersionEndpoint, log_url: str = None): self._autoscaling_policy = AutoscalingPolicy(metrics_type=MetricsType(endpoint.autoscaling_policy.metrics_type), target_value=endpoint.autoscaling_policy.target_value) + if endpoint.transformer is not None: + self._transformer = Transformer( + endpoint.transformer.image, id=endpoint.transformer.id, + enabled=endpoint.transformer.enabled, command=endpoint.transformer.command, + args=endpoint.transformer.args, transformer_type=endpoint.transformer.transformer_type, + resource_request=endpoint.transformer.resource_request, env_vars=endpoint.transformer.env_vars, + ) + if log_url is not None: self._log_url = log_url @@ -119,6 +128,10 @@ def protocol(self) -> Protocol: @property def resource_request(self) -> ResourceRequest: return self._resource_request + + @property + def transformer(self) -> Transformer: + return self._transformer def _repr_html_(self): return f"""{self._url}""" diff --git a/python/sdk/merlin/model.py b/python/sdk/merlin/model.py index dbffeb4b0..7e413f573 100644 --- a/python/sdk/merlin/model.py +++ b/python/sdk/merlin/model.py @@ -1150,6 +1150,8 @@ def deploy( if transformer is not None: target_transformer = ModelVersion._create_transformer_spec(transformer, target_env_name, env_list) + if current_endpoint is not None and current_endpoint.transformer is not None: + target_transformer.id = current_endpoint.transformer.id if logger is not None: target_logger = logger.to_logger_spec() @@ -1189,12 +1191,16 @@ def deploy( title=f"Deploying model {model.name} version " f"{self.id}", ) - while endpoint.status == "pending": + while True: + # Emulate a do-while loop. Re-get the endpoint so that the API server would have + # started acting after the deployment job has been submitted. endpoint = endpoint_api.models_model_id_versions_version_id_endpoint_endpoint_id_get( model_id=int(model.id), version_id=int(self.id), endpoint_id=endpoint.id ) - bar.update() + if endpoint.status != "pending": + break sleep(5) + bar.update() bar.stop() if endpoint.status != "running" and endpoint.status != "serving": @@ -1635,9 +1641,10 @@ def _create_transformer_spec(transformer: Transformer, target_env_name: str, env target_env_vars = ModelVersion._add_env_vars(target_env_vars, transformer.env_vars) return client.Transformer( - transformer.enabled, transformer.transformer_type.value, - transformer.image, transformer.command, transformer.args, - target_resource_request, target_env_vars) + id=transformer.id, enabled=transformer.enabled, + transformer_type=transformer.transformer_type.value, image=transformer.image, + command=transformer.command, args=transformer.args, + resource_request=target_resource_request, env_vars=target_env_vars) def delete_model_version(self) -> int: """ diff --git a/python/sdk/merlin/transformer.py b/python/sdk/merlin/transformer.py index 28bd36bac..d6ffa43f6 100644 --- a/python/sdk/merlin/transformer.py +++ b/python/sdk/merlin/transformer.py @@ -38,6 +38,7 @@ class Transformer: def __init__( self, image: str, + id: str = "", enabled: bool = True, command: str = None, args: str = None, @@ -45,6 +46,7 @@ def __init__( env_vars: Dict[str, str] = None, transformer_type: TransformerType = TransformerType.CUSTOM_TRANSFORMER, ): + self._id = id self._image = image self._enabled = enabled self._command = command @@ -57,6 +59,10 @@ def __init__( def image(self) -> str: return self._image + @property + def id(self) -> str: + return self._id + @property def enabled(self) -> bool: return self._enabled diff --git a/python/sdk/test/integration_test.py b/python/sdk/test/integration_test.py index 8c3a14756..49203cdd8 100644 --- a/python/sdk/test/integration_test.py +++ b/python/sdk/test/integration_test.py @@ -1056,14 +1056,13 @@ def test_redeploy_model(integration_test_url, project_name, use_google_oauth, re merlin.set_url(integration_test_url, use_google_oauth=use_google_oauth) merlin.set_project(project_name) - merlin.set_model("model-sdk-redeploy", ModelType.TENSORFLOW) - model_dir = "test/tensorflow-model" + merlin.set_model("model-sdk-redeploy", ModelType.CUSTOM) undeploy_all_version() # Upload new model version: v1 with merlin.new_model_version() as v1: - merlin.log_model(model_dir=model_dir) + v1.log_custom_model(image="ealen/echo-server:0.5.1", args="--port 8080") # Deploy using raw_deployment with CPU autoscaling policy endpoint = merlin.deploy( @@ -1074,13 +1073,15 @@ def test_redeploy_model(integration_test_url, project_name, use_google_oauth, re metrics_type=merlin.MetricsType.CPU_UTILIZATION, target_value=50 ), deployment_mode=DeploymentMode.RAW_DEPLOYMENT, + transformer = Transformer(image="gcr.io/kubeflow-ci/kfserving/image-transformer:latest"), ) - resp = requests.post(f"{endpoint.url}", json=tensorflow_request_json) - + with open(os.path.join("test/transformer", "input.json"), "r") as f: + req = json.load(f) + + resp = requests.post(f"{endpoint.url}", json=req) assert resp.status_code == 200 assert resp.json() is not None - assert len(resp.json()["predictions"]) == len(tensorflow_request_json["instances"]) # Check the deployment configs of v1 assert endpoint.resource_request.cpu_request == "123m" @@ -1092,22 +1093,25 @@ def test_redeploy_model(integration_test_url, project_name, use_google_oauth, re assert endpoint.autoscaling_policy.metrics_type == MetricsType.CPU_UTILIZATION assert endpoint.autoscaling_policy.target_value == 50 + # Check that the transformer id is set + assert endpoint.transformer.id != "" + sleep(10) - # Deploy v2 using raw_deployment with CPU autoscaling policy + # Deploy v2 using raw_deployment with CPU autoscaling policy; update transformer specs. new_endpoint = merlin.deploy( v1, autoscaling_policy=merlin.AutoscalingPolicy( metrics_type=merlin.MetricsType.CPU_UTILIZATION, target_value=90 ), deployment_mode=DeploymentMode.RAW_DEPLOYMENT, + transformer = Transformer(image="gcr.io/kubeflow-ci/kfserving/image-transformer:latest", + resource_request=merlin.ResourceRequest(0, 1, "100m", "250Mi")), ) - resp = requests.post(f"{new_endpoint.url}", json=tensorflow_request_json) - + resp = requests.post(f"{new_endpoint.url}", json=req) assert resp.status_code == 200 assert resp.json() is not None - assert len(resp.json()["predictions"]) == len(tensorflow_request_json["instances"]) # Check that the endpoint remains the same assert endpoint.url == new_endpoint.url @@ -1122,6 +1126,9 @@ def test_redeploy_model(integration_test_url, project_name, use_google_oauth, re assert new_endpoint.autoscaling_policy.metrics_type == MetricsType.CPU_UTILIZATION assert new_endpoint.autoscaling_policy.target_value == 90 + # Check that the transformer id remains the same + assert endpoint.transformer.id == new_endpoint.transformer.id + undeploy_all_version() diff --git a/python/sdk/test/model_test.py b/python/sdk/test/model_test.py index a7f07407a..eb0753c5c 100644 --- a/python/sdk/test/model_test.py +++ b/python/sdk/test/model_test.py @@ -361,6 +361,13 @@ def test_deploy(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(ep1.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -404,6 +411,13 @@ def test_deploy_upiv1(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(upi_ep.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -447,6 +461,13 @@ def test_deploy_using_raw_deployment_mode(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(ep3.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -490,6 +511,13 @@ def test_deploy_with_autoscaling_policy(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(ep4.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -559,6 +587,13 @@ def test_deploy_default_env(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(ep1.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -599,6 +634,13 @@ def test_redeploy_model(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/1234", + body=json.dumps(ep4.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", @@ -645,6 +687,13 @@ def test_deploy_with_gpu(self, version): status=200, content_type="application/json", ) + responses.add( + "GET", + "/v1/models/1/versions/1/endpoint/789", + body=json.dumps(ep5.to_dict()), + status=200, + content_type="application/json", + ) responses.add( "GET", "/v1/models/1/versions/1/endpoint", diff --git a/swagger.yaml b/swagger.yaml index 346039576..3d92b364a 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -1370,6 +1370,8 @@ definitions: Transformer: type: "object" properties: + id: + type: "string" enabled: type: "boolean" transformer_type: