CloudNativeGame / aigc-gateway

A user gateway that provides serverless AIGC experience.
Apache License 2.0
41 stars 8 forks source link

[Feature] Design Proposal for aigc-gateway #1

Open chrisliu1995 opened 1 year ago

chrisliu1995 commented 1 year ago

Introduction(介绍)

This project aims to address the resource management issues of AIGC instances by providing an AIGC serverless gateway based on the auto-scaling feature of cloud-native architecture.

The gateway has the following features:

本项目着眼于AIGC实例资源管理问题,基于云原生架构下自动伸缩特性,提供一个AIGC serverless网关。

该网关具备如下特点:

Design(设计)

User Usage Flow(用户使用链路)

As shown in the figure below, AIGC-Gateway supports managing multiple AIGC model collections. When user A logs in and requests the gateway, the gateway returns the corresponding access endpoint of the instance for the user to connect and use.

以下图为例,AIGC-Gateway支持管理多个AIGC模型集合,用户登录时请求网关并选择使用模型,网关将返回实例对应访问端点,供用户连接使用。

image

New User Online(新用户访问)

As shown in the figure below, when a new user B logs in and selects an AIGC model, the gateway calls the instance collection interface to create a new instance for the user.

以下图为例,新用户B登录时选择AIGC模型,网关调用实例集合接口为用户创建对应的新实例。

image

Old User Offline(老用户下线)

As shown in the figure below, when an old user A logs out or the session expires, the gateway calls the instance collection interface to delete the instance accordingly, releasing computing resources while preserving storage resources.

以下图为例,老用户A登出或session过期,网关调用实例集合接口,定向缩容实例使计算资源释放,同时保留存储资源。

image

Old User Back Online(老用户重新上线)

As shown in the figure below, when an old user A logs in and selects an AIGC model, the gateway calls the instance collection interface to create a corresponding instance for user A. The instance name and access endpoint remain consistent with the previous settings, and the mounted persistent storage disk data will not be lost.

以下图为例,老用户A登录选择AIGC模型,网关调用实例集合接口为用户A创建对应的实例,实例名称与访问端点与之前保持一致,挂载的持久化存储盘数据不会丢失。

image

Jackstrawcd commented 1 year ago

AIGC-Gateway 允许用户自行控制开启和关闭吗

chrisliu1995 commented 1 year ago

AIGC-Gateway 允许用户自行控制开启和关闭吗

用户下线后缩容的逻辑可以有多种方式:

Jackstrawcd commented 1 year ago

AIGC-Gateway 允许用户自行控制开启和关闭吗

用户下线后缩容的逻辑可以有多种方式:

  • 直接释放计算资源
  • 用户输入参数,决定是否保留计算资源
  • 时间窗口模式,空闲时间达到一定值后自动下线

我不太清楚gateway的功能边界在哪,把一些业务逻辑如个人控制台、管理员功能,放在gateway 可以不

Jackstrawcd commented 1 year ago

gs这一层的鉴权需要考虑