Skip to content

Commit

Permalink
[containerapp] az containerapp service milvus: Add support for milvus…
Browse files Browse the repository at this point in the history
… dev service (#6863)
  • Loading branch information
bgashirabake authored Oct 23, 2023
1 parent 7aeeb00 commit d6d11c9
Show file tree
Hide file tree
Showing 7 changed files with 22,006 additions and 7,454 deletions.
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release History
===============
upcoming
++++++
* 'az containerapp service': add support for creation and deletion of milvus vector database as a dev service
* 'az containerapp job create': Fix AttributeError when --trigger-type is None
* 'az containerapp update': fix bug for mounting secret volumes using --secret-volume-mount
* 'az containerapp compose create': fixed an issue where the environment's resource group was not resolved from --environment when the input value was a resource id.
Expand Down
6 changes: 5 additions & 1 deletion src/containerapp/azext_containerapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
MANAGED_CERTIFICATE_RT = "managedCertificates"
PRIVATE_CERTIFICATE_RT = "certificates"

DEV_SERVICE_LIST = ["kafka", "postgres", "redis", "mariadb", "qdrant"]
DEV_SERVICE_LIST = ["kafka", "postgres", "redis", "mariadb", "qdrant", "milvus"]

DEV_KAFKA_IMAGE = 'kafka'
DEV_KAFKA_SERVICE_TYPE = 'kafka'
Expand All @@ -49,6 +49,10 @@
DEV_QDRANT_SERVICE_TYPE = 'qdrant'
DEV_QDRANT_CONTAINER_NAME = 'qdrant'

DEV_MILVUS_IMAGE = 'milvus'
DEV_MILVUS_SERVICE_TYPE = 'milvus'
DEV_MILVUS_CONTAINER_NAME = 'milvus'

PENDING_STATUS = "Pending"
SUCCEEDED_STATUS = "Succeeded"
UPDATING_STATUS = "Updating"
Expand Down
15 changes: 15 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@
short-summary: Commands to manage the qdrant service for the Container Apps environment.
"""

helps['containerapp service milvus'] = """
type: group
short-summary: Commands to manage the milvus service for the Container Apps environment.
"""

helps['containerapp service redis create'] = """
type: command
short-summary: Command to create the redis service.
Expand All @@ -487,6 +492,11 @@
short-summary: Command to create the qdrant service.
"""

helps['containerapp service milvus create'] = """
type: command
short-summary: Command to create the milvus service.
"""

helps['containerapp service redis delete'] = """
type: command
short-summary: Command to delete the redis service.
Expand All @@ -512,6 +522,11 @@
short-summary: Command to delete the qdrant service.
"""

helps['containerapp service milvus delete'] = """
type: command
short-summary: Command to delete the milvus service.
"""

helps['containerapp env update'] = """
type: command
short-summary: Update a Container Apps environment.
Expand Down
4 changes: 4 additions & 0 deletions src/containerapp/azext_containerapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def load_command_table(self, _):
g.custom_command('create', 'create_qdrant_service', supports_no_wait=True)
g.custom_command('delete', 'delete_qdrant_service', confirmation=True, supports_no_wait=True)

with self.command_group('containerapp service milvus') as g:
g.custom_command('create', 'create_milvus_service', supports_no_wait=True)
g.custom_command('delete', 'delete_milvus_service', confirmation=True, supports_no_wait=True)

with self.command_group('containerapp identity') as g:
g.custom_command('assign', 'assign_managed_identity', supports_no_wait=True, exception_handler=ex_handler_factory())
g.custom_command('remove', 'remove_managed_identity', supports_no_wait=True, exception_handler=ex_handler_factory())
Expand Down
14 changes: 13 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
MANAGED_CERTIFICATE_RT, PRIVATE_CERTIFICATE_RT, PENDING_STATUS, SUCCEEDED_STATUS, DEV_POSTGRES_IMAGE, DEV_POSTGRES_SERVICE_TYPE,
DEV_POSTGRES_CONTAINER_NAME, DEV_REDIS_IMAGE, DEV_REDIS_SERVICE_TYPE, DEV_REDIS_CONTAINER_NAME, DEV_KAFKA_CONTAINER_NAME,
DEV_KAFKA_IMAGE, DEV_KAFKA_SERVICE_TYPE, DEV_MARIADB_CONTAINER_NAME, DEV_MARIADB_IMAGE, DEV_MARIADB_SERVICE_TYPE, DEV_QDRANT_IMAGE,
DEV_QDRANT_CONTAINER_NAME, DEV_QDRANT_SERVICE_TYPE, DEV_SERVICE_LIST, CONTAINER_APPS_SDK_MODELS, BLOB_STORAGE_TOKEN_STORE_SECRET_SETTING_NAME)
DEV_QDRANT_CONTAINER_NAME, DEV_QDRANT_SERVICE_TYPE, DEV_MILVUS_IMAGE, DEV_MILVUS_CONTAINER_NAME, DEV_MILVUS_SERVICE_TYPE,
DEV_SERVICE_LIST, CONTAINER_APPS_SDK_MODELS, BLOB_STORAGE_TOKEN_STORE_SECRET_SETTING_NAME)

logger = get_logger(__name__)

Expand Down Expand Up @@ -249,6 +250,17 @@ def delete_qdrant_service(cmd, service_name, resource_group_name, no_wait=False)
return DevServiceUtils.delete_service(cmd, service_name, resource_group_name, no_wait, DEV_QDRANT_SERVICE_TYPE)


def create_milvus_service(cmd, service_name, environment_name, resource_group_name, no_wait=False,
disable_warnings=True):
return DevServiceUtils.create_service(cmd, service_name, environment_name, resource_group_name, no_wait,
disable_warnings, DEV_MILVUS_IMAGE, DEV_MILVUS_SERVICE_TYPE,
DEV_MILVUS_CONTAINER_NAME)


def delete_milvus_service(cmd, service_name, resource_group_name, no_wait=False):
return DevServiceUtils.delete_service(cmd, service_name, resource_group_name, no_wait, DEV_MILVUS_SERVICE_TYPE)


def update_containerapp_yaml(cmd, name, resource_group_name, file_name, from_revision=None, no_wait=False):
yaml_containerapp = process_loaded_yaml(load_yaml_file(file_name))

Expand Down
Loading

0 comments on commit d6d11c9

Please sign in to comment.