Skip to content
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

Support for Private Endpoint on Model Deployment and AQUA MD #979

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

lu-ohai
Copy link
Member

@lu-ohai lu-ohai commented Oct 24, 2024

Support for Private Endpoint on Model Deployment and AQUA MD

  • Added with_private_endpoint_id on ModelDeploymentInfrastructure class to enable configure private endpoint for model deployment

Notebook

  • Create model deployment with PE on non-GA oci sdk
Screenshot 2024-10-24 at 10 19 50 AM
  • Create model deployment with PE on oci preview sdk
Screenshot 2024-10-23 at 8 57 59 PM Screenshot 2024-10-23 at 8 58 08 PM
  • Create AQUA model deployment with PE
Screenshot 2024-10-23 at 8 57 30 PM
  • Create Model Deployment with PE through GenericModel
Screenshot 2024-10-24 at 10 00 48 AM

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 24, 2024
@lu-ohai lu-ohai changed the title [Draft] Support for PE on AQUA MD [Draft] Support for Private Endpoint on Model Deployment and AQUA MD Oct 24, 2024
Copy link

📌 Cov diff with main:

Coverage-50%

📌 Overall coverage:

Coverage-20.16%

1 similar comment
Copy link

📌 Cov diff with main:

Coverage-50%

📌 Overall coverage:

Coverage-20.16%

Copy link

📌 Cov diff with main:

Coverage-50%

📌 Overall coverage:

Coverage-20.16%

Copy link

📌 Cov diff with main:

Coverage-78%

📌 Overall coverage:

Coverage-58.96%

@lu-ohai lu-ohai marked this pull request as ready for review October 24, 2024 19:27
@lu-ohai lu-ohai changed the title [Draft] Support for Private Endpoint on Model Deployment and AQUA MD Support for Private Endpoint on Model Deployment and AQUA MD Oct 24, 2024
Copy link
Member

@VipulMascarenhas VipulMascarenhas left a comment

Choose a reason for hiding this comment

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

changes look good, added minor comments.

@@ -98,6 +99,9 @@ def from_oci_model_deployment(
freeform_tags = oci_model_deployment.freeform_tags or UNKNOWN_DICT
aqua_service_model_tag = freeform_tags.get(Tags.AQUA_SERVICE_MODEL_TAG, None)
aqua_model_name = freeform_tags.get(Tags.AQUA_MODEL_NAME_TAG, UNKNOWN)
private_endpoint_id = (
getattr(oci_model_deployment.model_deployment_configuration_details.model_configuration_details.instance_configuration, "private_endpoint_id", UNKNOWN)
Copy link
Member

Choose a reason for hiding this comment

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

nit: create a "private_endpoint_id" const.

ads/model/generic_model.py Show resolved Hide resolved
ads/model/generic_model.py Show resolved Hide resolved
@@ -98,6 +99,9 @@ def from_oci_model_deployment(
freeform_tags = oci_model_deployment.freeform_tags or UNKNOWN_DICT
aqua_service_model_tag = freeform_tags.get(Tags.AQUA_SERVICE_MODEL_TAG, None)
aqua_model_name = freeform_tags.get(Tags.AQUA_MODEL_NAME_TAG, UNKNOWN)
private_endpoint_id = (
getattr(oci_model_deployment.model_deployment_configuration_details.model_configuration_details.instance_configuration, "private_endpoint_id", UNKNOWN)
Copy link
Member

Choose a reason for hiding this comment

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

Do you have pre-commit installed? Looks like a wrong formatting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just updated the format.

@@ -47,6 +47,7 @@ class AquaDeployment(DataClassSerializable):
created_on: str = None
created_by: str = None
endpoint: str = None
private_endpoint_id: str = None
console_link: str = None
lifecycle_details: str = None
shape_info: field(default_factory=ShapeInfo) = None
Copy link
Member

Choose a reason for hiding this comment

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

This
shape_info: field(default_factory=ShapeInfo) = None

Should be changed on
shape_info: ShapeInfo = field(default_factory=ShapeInfo)

@@ -98,6 +99,9 @@ def from_oci_model_deployment(
freeform_tags = oci_model_deployment.freeform_tags or UNKNOWN_DICT
aqua_service_model_tag = freeform_tags.get(Tags.AQUA_SERVICE_MODEL_TAG, None)
aqua_model_name = freeform_tags.get(Tags.AQUA_MODEL_NAME_TAG, UNKNOWN)
private_endpoint_id = (
getattr(oci_model_deployment.model_deployment_configuration_details.model_configuration_details.instance_configuration, "private_endpoint_id", UNKNOWN)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we use model_configuration_details multiple times inside this method. I would suggest to do something like this:

model_configuration_details = oci_model_deployment.model_deployment_configuration_details.model_configuration_details
environment_configuration_details = oci_model_deployment.model_deployment_configuration_details.environment_configuration_details

and then everywhere

getattr(model_configuration_details.instance_configuration, "private_endpoint_id", UNKNOWN)
....

Copy link
Member Author

Choose a reason for hiding this comment

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

Just updated it.

oci.data_science.models.InstanceConfiguration, "private_endpoint_id"
):
raise EnvironmentError(
"Private endpoint is not supported in the current OCI SDK installed."
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to tell, which minimum version of the SDK can be used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added theTODO in the comments.

mrDzurb
mrDzurb previously approved these changes Oct 24, 2024
Copy link

📌 Cov diff with main:

Coverage-46%

📌 Overall coverage:

Coverage-20.16%

@lu-ohai lu-ohai dismissed stale reviews from VipulMascarenhas and mrDzurb via 30b8bcf October 24, 2024 21:29
Copy link

📌 Cov diff with main:

Coverage-81%

📌 Overall coverage:

Coverage-58.95%

@lu-ohai lu-ohai enabled auto-merge October 24, 2024 22:56
@lu-ohai lu-ohai merged commit 611b9d4 into main Oct 25, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants