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

[Feature] Design Proposal for aigc-gateway #1

Open
chrisliu1995 opened this issue Apr 25, 2023 · 4 comments
Open

[Feature] Design Proposal for aigc-gateway #1

chrisliu1995 opened this issue Apr 25, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@chrisliu1995
Copy link
Member

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:

  • User management. Each user has their own AIGC instance, and the gateway will maintain the mapping between the user and the instance.
  • User-level resource management. AIGC computing instances are created and destroyed based on the user's login/offline status, while preserving user data.

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

该网关具备如下特点:

  • 用户态管理。每个用户拥有各自的AIGC实例,网关将维护用户与实例的对应关系。
  • 用户级别资源管理。根据用户的登录/下线状态生成/销毁AIGC计算实例,保留用户持久化数据。

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
Copy link

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

@chrisliu1995
Copy link
Member Author

chrisliu1995 commented Apr 25, 2023

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

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

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

@Jackstrawcd
Copy link

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

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

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

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

@chrisliu1995 chrisliu1995 added the enhancement New feature or request label Apr 25, 2023
@Jackstrawcd
Copy link

gs这一层的鉴权需要考虑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants