Skip to content

Conversation

@VipulMascarenhas
Copy link
Member

@VipulMascarenhas VipulMascarenhas commented Feb 1, 2024

Description

This PR covers the following:

  1. Use oc.OCIClientFactory to instantiate clients
  2. Add LoggingManagementClient to oci_client.py
  3. Adds 3 additional APIs to list_log_groups, list_logs and list_compartments
  4. Update deployment handler to accommodate 3 additional APIs

Local Usage

These APIs can be tested from a local jupyter lab instance:

Get Log Groups

GET http://localhost:8888/aqua/logging/?compartment_id=<ocid> 

Get Log ids

GET http://localhost:8888/aqua/logging/<loggroup_ocid> 

Get compartments

GET http://localhost:8888/aqua/compartments 

To Do

Unit Tests

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 1, 2024
id=oci_model_deployment.id,
display_name=oci_model_deployment.display_name,
aqua_service_model=oci_model_deployment.freeform_tags.get(AQUA_SERVICE_MODEL),
aqua_service_model=oci_model_deployment.freeform_tags.get(
Copy link
Member

Choose a reason for hiding this comment

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

This should be boolean? aqua_service_model=oci_model_deployment.freeform_tags.get(AQUA_SERVICE_MODEL) is not None

Copy link
Member Author

Choose a reason for hiding this comment

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

we're currently treating aqua_service_model as a string field (something like key=aqua_service_model val=llama2), which is also passed along when deployment is created. This is due to an absence of a tag field in AquaModelSummary. Would it be better to treat this as boolean and have something like tags: Dict[str, str] in the dataclass?

@github-actions
Copy link

github-actions bot commented Feb 1, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.26%

@github-actions
Copy link

github-actions bot commented Feb 1, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.26%

@github-actions
Copy link

github-actions bot commented Feb 2, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.25%

@github-actions
Copy link

github-actions bot commented Feb 2, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.25%

@github-actions
Copy link

github-actions bot commented Feb 2, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.21%

@github-actions
Copy link

github-actions bot commented Feb 2, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.21%

AquaDeployment:
The instance of the Aqua model deployment.
"""
# add error handler
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be cleaned up?

Copy link
Member Author

Choose a reason for hiding this comment

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

keeping for now, we have an action item to clean all this up once exception handler PR is finalized.

# if not self._if_show(oci_model):
# raise AquaClientError(f"Target model {oci_model.id} is not Aqua model.")
if not self._if_show(oci_model):
raise AquaClientError(f"Target model {oci_model.id} is not Aqua model.")
Copy link
Member

Choose a reason for hiding this comment

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

Probably will not be able to use the AQUA name. I would suggest to have a custom error, something like NotAquaCompatibleError.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, we'll update this once exception handler PR is finalized.

@VipulMascarenhas VipulMascarenhas merged commit 8f2dc7c into feature/aqua Feb 3, 2024
@VipulMascarenhas VipulMascarenhas deleted the ODSC-52446_52447_get_loggroup_compartment_list branch February 3, 2024 01:47
@github-actions
Copy link

github-actions bot commented Feb 3, 2024

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-23.20%

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.

4 participants