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

[containerapp] az containerapp add-on/service : support milvus vector database service #6981

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 add-on/service' : support for add-on/service milvus create and delete commands
* 'az containerapp env workload-profile set': deprecate command
* 'az containerapp add-on': support for az containerapp add-on commands; deprecation of az containerapp service commands
* 'az containerapp env dapr-component resiliency': Add Dapr Component Resiliency commands
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 @@ -49,7 +49,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"]
DEV_SERVICE_LIST = ["kafka", "postgres", "redis", "mariadb", "qdrant", "milvus"]

DEV_KAFKA_IMAGE = 'kafka'
DEV_KAFKA_SERVICE_TYPE = 'kafka'
Expand All @@ -71,6 +71,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
30 changes: 30 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,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 @@ -245,6 +250,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 @@ -270,6 +280,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 resiliency'] = """
type: group
short-summary: Commands to manage resiliency policies for a container app.
Expand Down Expand Up @@ -367,6 +382,11 @@
short-summary: Commands to manage the qdrant 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 All @@ -392,6 +412,11 @@
short-summary: Command to create the qdrant 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 All @@ -417,6 +442,11 @@
short-summary: Command to delete the qdrant add-on.
"""

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
8 changes: 8 additions & 0 deletions src/containerapp/azext_containerapp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ 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', deprecate_info=self.deprecate(redirect='containerapp add-on milvus', hide=True)) 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 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
12 changes: 11 additions & 1 deletion src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
NAME_INVALID, NAME_ALREADY_EXISTS, ACR_IMAGE_SUFFIX, 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_SERVICE_TYPE, DEV_MILVUS_CONTAINER_NAME, 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 @@ -165,6 +165,16 @@ def create_qdrant_service(cmd, service_name, environment_name, resource_group_na
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 create_container_app_resiliency(cmd, name, resource_group_name, container_app_name,
yaml=None,
Expand Down
Loading