- Notifications
You must be signed in to change notification settings - Fork 60
[ODSC 51354] Create new Aqua deployment #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ODSC 51354] Create new Aqua deployment #551
Conversation
…ODSC-51354/create_new_deployment
| 📌 Cov diff with main: No success to gather report. 😿 📌 Overall coverage: No success to gather report. 😿 |
| 📌 Cov diff with main: No success to gather report. 😿 📌 Overall coverage: No success to gather report. 😿 |
| 📌 Cov diff with main: No success to gather report. 😿 📌 Overall coverage: No success to gather report. 😿 |
| @dataclass | ||
| class AquaDeployment: | ||
| """Represents an Aqua Model Deployment""" | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add ocid as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
during the design discussion we decided to have that in the aqua_service_model tag (ocid#model_name). We can have a separate field, but could get redundant due to the tag. Tracking this in a separate page here.
| else None | ||
| ) | ||
| if aqua_service_model: | ||
| results.append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have something like
AquaDeployment.from_oci_model(...) | | ||
| try: | ||
| model_deployment = self.client.get_model_deployment(**kwargs).data | ||
| except ServiceError as se: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we add everywhere these exception statements, probably would be better to move them into the decorator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we'll revisit this and update the code once the error handler is finalized.
| f"Target deployment {model_deployment.id} is not Aqua deployment." | ||
| ) | ||
| | ||
| return AquaDeployment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: AquaDeployment.from_oci_model()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense. will add it in a separate PR.
| raise HTTPError(400, Errors.NO_INPUT_DATA) | ||
| | ||
| # required input parameters | ||
| compartment_id = input_data.get("compartment_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For parameters it will be automatically handled, right?
| | ||
| # required input parameters | ||
| compartment_id = input_data.get("compartment_id") | ||
| if not compartment_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add some MDRequest dataclass and put all of the logic with constructing the input attributes and validation there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. will add it in a separate PR.
| aqua_service_model = f"xxx.xxx.xxx.xxx.xxx#aqua_service_model_value" | ||
| | ||
| self.finish( | ||
| AquaDeploymentApp().create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have MDRequest dataclass, then the code could be
AquaDeploymentApp().create(**md_request.to_dict())
Description
Jira ticket: ODSC-51354
The code changes in this PR an Aqua model deployment. Following changes are done:
deployment_handler.py. The handler accepts post request and there are a few required parameters that caller will have to provide (need comments on what can be optional).deployment.py, implemented create() functionality. It does not create a catalog entry right now (needs AquaModel.create implemented - either mock or otherwise), so assumes a few attributes will be available (image, model id, entrypoint) but this will be removed. (need comments on what deployment config needs to be hardcoded vs. expected from caller).ads.common.serializer.DataClassSerializablefor CLI commands.User can invoke create by calling:
It should return a json response:
or, user can use cli:
Next steps: