Skip to content

Commit

Permalink
[containerapp] az containerapp add-on create: Support for milvus add-…
Browse files Browse the repository at this point in the history
…on (#7196)
  • Loading branch information
bgashirabake committed Jan 24, 2024
1 parent f311e02 commit 38dec89
Show file tree
Hide file tree
Showing 7 changed files with 5,528 additions and 3,375 deletions.
3 changes: 2 additions & 1 deletion src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Release History
===============
upcoming
++++++
* [Breaking Change] 'az containerapp service': deprecate command from Azure CLI version 2.56.1
* 'az containerapp add-on' : support for add-on milvus create and delete commands
* [Breaking Change] 'az containerapp service': deprecate command from Azure CLI version 2.56.1
* 'az containerapp add-on' : support for add-on weaviate create and delete commands

0.3.46
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 @@ -51,7 +51,7 @@
DAPR_SUPPORTED_STATESTORE_DEV_SERVICE_LIST = ["postgres", "redis"]
DAPR_SUPPORTED_PUBSUB_DEV_SERVICE_LIST = ["kafka", "redis"]

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

DEV_KAFKA_IMAGE = 'kafka'
DEV_KAFKA_SERVICE_TYPE = 'kafka'
Expand All @@ -77,6 +77,10 @@
DEV_WEAVIATE_SERVICE_TYPE = 'weaviate'
DEV_WEAVIATE_CONTAINER_NAME = 'weaviate'

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 @@ -378,6 +378,11 @@
short-summary: Commands to manage the weaviate add-on for the Container Apps environment.
"""

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

helps['containerapp add-on redis create'] = """
type: command
short-summary: Command to create the redis add-on.
Expand Down Expand Up @@ -408,6 +413,11 @@
short-summary: Command to create the weaviate add-on.
"""

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

helps['containerapp add-on redis delete'] = """
type: command
short-summary: Command to delete the redis add-on.
Expand Down Expand Up @@ -438,6 +448,11 @@
short-summary: Command to delete the weaviate service.
"""

helps['containerapp add-on 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 @@ -100,6 +100,10 @@ def load_command_table(self, _):
g.custom_command('create', 'create_weaviate_service', supports_no_wait=True)
g.custom_command('delete', 'delete_weaviate_service', confirmation=True, supports_no_wait=True)

with self.command_group('containerapp add-on 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 resiliency', is_preview=True) as g:
g.custom_command('create', 'create_container_app_resiliency', supports_no_wait=True, exception_handler=ex_handler_factory())
g.custom_show_command('update', 'update_container_app_resiliency', supports_no_wait=True, exception_handler=ex_handler_factory())
Expand Down
13 changes: 12 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
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_WEAVIATE_IMAGE, DEV_WEAVIATE_CONTAINER_NAME, DEV_WEAVIATE_SERVICE_TYPE,
DEV_SERVICE_LIST, CONTAINER_APPS_SDK_MODELS, BLOB_STORAGE_TOKEN_STORE_SECRET_SETTING_NAME,
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,
DAPR_SUPPORTED_STATESTORE_DEV_SERVICE_LIST, DAPR_SUPPORTED_PUBSUB_DEV_SERVICE_LIST)

logger = get_logger(__name__)
Expand Down Expand Up @@ -178,6 +178,17 @@ def delete_weaviate_service(cmd, service_name, resource_group_name, no_wait=Fals
return DevServiceUtils.delete_service(cmd, service_name, resource_group_name, no_wait, DEV_WEAVIATE_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 create_container_app_resiliency(cmd, name, resource_group_name, container_app_name,
yaml=None,
no_wait=False,
Expand Down
Loading

0 comments on commit 38dec89

Please sign in to comment.