6 Star 56 Fork 13

科大讯飞/aiges

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
Apache-2.0

AI Service Engine

Forks Stars Build Status GitHub release GitHub contributors License: Apache2.0

官方文档

👉👉👉点击进入

背景

AIGES是 Athena Serving Framework中的核心组件,它是一个个专为AI能力开发者打造的AI算法模型、引擎的通用封装工具。 您可以通过集成AIGES,快速部署AI算法模型、引擎,并托管于Athena Serving Framework,即可使用网络、分发策略、数据处理等配套辅助系统。 Athena Serving Framework 致力于加速AI算法模型、引擎云服务化,并借助云原生架构,为云服务的稳定提供多重保障。 您无需关注底层基础设施及服务化相关的开发、治理和运维,即可高效、安全地对模型、引擎进行部署、升级、扩缩、运营和监控。

上新!!!

👉👉👉快速了解 Cgo模式GRPC模式区别

整体架构

img

使用工作流(AthenaServing)

img

特性

☑ 支持模型推理成RPC服务(Serving框架会转成HTTP服务)

☑ 支持C代码推理

☑ 支持Python代码推理

☑ 支持once(非流式)推理、流式推理

☑ 支持配置中心,服务发现

☑ 支持负载均衡配置

☑ 支持HTTP/GRPC服务

☑ Cgo模式/GRPC模式切换 [go 和 python通信方式]

SDK

👉👉👉Python

AI协议

参见: 👉👉👉ase-proto

准备环境

python 版本请选用 3.9+ 也可以下载我们的docker镜像

如下流程可在容器环境中进行 (无需gpu):

docker run -itd --name mnist2 -p 1889:1888 public.ecr.aws/iflytek-open/aiges-gpu:10.1-1.17-3.9.13-ubuntu1804-v3.0-alpha11 bash

您也可以自己准备环境, 直接下载二进制在您自己的任何环境上运行aiges.

0. 装sdk

pip3 install aiges==0.5.0 -i https://pypi.python.org/simple

1. 下载加载器

  1. wget https://github.com/iflytek/aiges/releases/download/v3.0-alpha11/aiges_3.0-alpha11_linux_amd64.tar.gz

初始化 python wrapper 项目

通过aiges创建一个名为mnist的项目

python3 -m aiges create -n mnist

2. 初始项目结构

root# tree mnist/
mnist/
├── Dockerfile
├── README.md
├── requirements.txt
└── wrapper
    ├── test_data
    │   └── test.png
    └── wrapper.py

3. 解压加载器 [docker提供的镜像默认有AIservice,您可以用下述命令更新最新的AIservice binary]

tar zxvf aiges_3.0-alpha11_linux_amd64.tar.gz -C mnist

首次执行:

root@505a3a0e670c:/home/aiges# ./AIservice
加载器运行方法:

- 本地模式运行
1: ./AIservice -init  , 初始化配置文件 aiges.toml (若存在,则不会替换)
2: ./AIservice -m=0 , 仅用于本地模式运行
3: ./AIservice -mnist , 下载mnistdemo
- 配置中心模式 (开源计划删除)
- 更多参数选项: 请执行 ./AIservice -h

此时项目结构如下

➜  mnist git:(master) ✗ tree -L 3 .
.
├── AIservice
├── Dockerfile
├── include
│   ├── type.h
│   └── wrapper.h
├── library
│   ├── libahsc.so
│   ├── libIce.so.34
│   └── libIceUtil.so.34
├── README.md
├── requirements.txt
└── wrapper
    ├── test_data
    │   └── test.png
    └── wrapper.py

4 directories, 11 files

4. 配置PythonGrpc模式 初始化aiges 配置

顺序执行如下:

  • export AIGES_PLUGIN_MODE=python

  • ./AIservice -init 【会在当前目录下生成一个 aiges.toml】

  • ./AIservice -m 0 -c aiges.toml -s svcName

启动引擎,此时结果如下:【注意svcName必须和aiges 的section对应,当前默认就是 svcName】

root@012d31456c50:/home/aiges/mnist# ./AIservice -m 0 -c aiges.toml  -s svcName
2022/11/15 18:22:01 widgetpy.go:26: Starting Using Python :
config.toml version:
2022/11/15 18:22:01 utils.NewLocalLog success. -> LOGLEVEL:debug, FILENAME:./log/aiges.log, MAXSIZE:3, MAXBACKUPS:3, MAXAGE:3
2022/11/15 18:22:01 host2ip->ip:0.0.0.0,port:5090
2022/11/15 18:22:01 finderSwitch:0,finderSwitchErr:<nil>
2022/11/15 18:22:01 about to deal with hermes.
2022/11/15 18:22:02 NewSessionManager success.
2022/11/15 18:22:02 NewSidGenerator success.
2022/11/15 18:22:02 fn:AbleTrace,able:false
2022/11/15 18:22:02 about to deal finder.
2022/11/15 18:22:02 about to deal metrics.
2022/11/15 18:22:02 metrics is disable
2022/11/15 18:22:02 about to deal rateLimiter.
2022/11/15 18:22:02 about to deal vCpuManager.
2022/11/15 18:22:02 about to deal bvtVerifier.
2022/11/15 18:22:02 namespace not set, use default
2022/11/15 18:22:02 bvt is disable
header pass list: []
2022-11-15T18:22:02.476+0800 [WARN]  python-plugin: plugin configured with a nil SecureConfig
2022-11-15T18:22:02.477+0800 [DEBUG] python-plugin: starting plugin: path=/bin/sh args=[sh, -c, "/usr/bin/env python -m aiges.serve"]
2022-11-15T18:22:02.478+0800 [DEBUG] python-plugin: plugin started: path=/bin/sh pid=126
2022-11-15T18:22:02.478+0800 [DEBUG] python-plugin: waiting for RPC address: path=/bin/sh
2022-11-15T18:22:02.653+0800 [DEBUG] python-plugin: using plugin: version=1
2022-11-15T18:22:02.655+0800 [DEBUG] python-plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"
2022-11-15T18:22:02.656+0800 [DEBUG] python-plugin.sh:  root:wrapperInit:107 - INFO:  Importing module from wrapper.py: wrapper
2022-11-15T18:22:02.657+0800 [DEBUG] python-plugin.sh:  root:wrapperInit:119 - ERROR:  module 'wrapper' has no attribute 'Wrapper'
2022/11/15 18:22:02 grpc.go:20: Call WrapperInit Failed...ret: 30001

这是因为我们的 wrapper还未准备好

5. 编写推理逻辑wrapper,以mnist项目为例

下载 mnist demo:

  • ./AIservice -mnist

默认会下载 https://github.com/iflytek/aiges_demo.git 项目,并解压到当前目录 aiges_demo

如果此命令长时间没有反应,可能是因为GFW问题, 可手动下载 https://github.com/iflytek/aiges_demo/archive/refs/tags/v1.0.0.zip

unzip 解压到当 aiges_demo目录中即可【注意手动解压可能嵌套了一层 aiges_demo_1.0.0目录】。

删除 当前mnist下默认生成的wrapper目录,替换上述的demo

  • rm -r wrapper
  • cp -ra aiges_demo/mnist/wrapper/ ./
  • cp -ra aiges_demo/mnist/requirements.txt mnist/
  • pip install -r requirements.txt
  • export AIGES_PLUGIN_MODE=python
  • export PYTHONPATH=/home/aiges/mnist/wrapper
  • 再次运行引擎 ./AIservice -m 0 -c aiges.toml -s svcName

标准输出如下:

2022/11/15 21:26:29 widgetpy.go:26: Starting Using Python :
config.toml version:
2022/11/15 21:26:29 utils.NewLocalLog success. -> LOGLEVEL:debug, FILENAME:./log/aiges.log, MAXSIZE:3, MAXBACKUPS:3, MAXAGE:3
2022/11/15 21:26:29 host2ip->ip:0.0.0.0,port:5090
2022/11/15 21:26:29 finderSwitch:0,finderSwitchErr:<nil>
2022/11/15 21:26:29 about to deal with hermes.
2022/11/15 21:26:30 NewSessionManager success.
2022/11/15 21:26:30 NewSidGenerator success.
2022/11/15 21:26:30 fn:AbleTrace,able:false
2022/11/15 21:26:30 about to deal finder.
2022/11/15 21:26:30 about to deal metrics.
2022/11/15 21:26:30 metrics is disable
2022/11/15 21:26:30 about to deal rateLimiter.
2022/11/15 21:26:30 about to deal vCpuManager.
2022/11/15 21:26:30 about to deal bvtVerifier.
2022/11/15 21:26:30 namespace not set, use default
2022/11/15 21:26:30 bvt is disable
header pass list: []
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] POST   /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] PUT    /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] PATCH  /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] HEAD   /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
2022-11-15T21:26:30.116+0800 [WARN]  python-plugin: plugin configured with a nil SecureConfig
2022-11-15T21:26:30.116+0800 [DEBUG] python-plugin: starting plugin: path=/bin/sh args=[sh, -c, "/usr/bin/env python -m aiges.serve"]
[GIN-debug] OPTIONS /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] DELETE /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] CONNECT /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] TRACE  /v1/svcName               --> github.com/xfyun/aiges/httproto.(*Server).ginHandler.func1 (3 handlers)
[GIN-debug] GET    /test.json                --> github.com/xfyun/aiges/httproto.getDemo (3 handlers)
2022-11-15T21:26:30.116+0800 [DEBUG] python-plugin: plugin started: path=/bin/sh pid=1081
2022-11-15T21:26:30.116+0800 [DEBUG] python-plugin: waiting for RPC address: path=/bin/sh
[GIN-debug] GET    /swagger/*any             --> github.com/swaggo/gin-swagger.CustomWrapHandler.func1 (3 handlers)
2022-11-15T21:26:30.242+0800 [DEBUG] python-plugin: using plugin: version=1
2022-11-15T21:26:30.244+0800 [DEBUG] python-plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"
2022-11-15T21:26:30.245+0800 [DEBUG] python-plugin.sh:  root:wrapperInit:107 - INFO:  Importing module from wrapper.py: wrapper
2022-11-15T21:26:31.642+0800 [DEBUG] python-plugin.sh:  root:_check_path:151 - WARNING:  <class 'FileNotFoundError'>
2022-11-15T21:26:31.643+0800 [DEBUG] python-plugin.sh:  root:wrapperInit:112 - INFO:  User Wrapper newed Success.. starting call user init functions...
2022-11-15T21:26:31.643+0800 [DEBUG] python-plugin.sh:  root:wrapperInit:85 - INFO:  Initializing ...
2022-11-15T21:26:31.666+0800 [DEBUG] python-plugin.sh:  root:wrapperSchema:141 - INFO:  Entering warpperSchema ...
2022-11-15T21:26:31.672+0800 [DEBUG] python-plugin.sh:  root:test_value:233 - WARNING:  test_data/0.png not exist.. check
2022-11-15T21:26:31.672+0800 [DEBUG] python-plugin.sh:  root:schema:434 - INFO:  Genrating Schema...
aiService.Init: init success!
2022/11/15 21:26:31 about to x.run
2022/11/15 21:26:31 about init interceptor
2022/11/15 21:26:31 success init interceptor
2022/11/15 21:26:31 about to call grpc.NewServer(opts...),maxRecv:4194304,maxSend:4194304
2022/11/15 21:26:31 about to call utils.RegisterXsfCallServer(x.grpcserver, srv)
2022/11/15 21:26:31 about to call reflection.Register(x.grpcserver)
2022/11/15 21:26:31 about to exec userCallback
2022/11/15 21:26:31 deal with UserHighPriority
2022/11/15 21:26:31 deal with UserNormalPriority
2022/11/15 21:26:31 deal with UserLowPriority
2022/11/15 21:26:31 about to call x.grpcserver.Serve
2022/11/15 21:26:31 about to check if the grpc service([::]:5090) is started
2022/11/15 21:26:31 grpc server([::]:5090) started successfully
2022/11/15 21:26:31 bvtVerifierInst is disable,ignore...
2022/11/15 21:26:31 about to call finderadapter.Register([::]:5090)
2022/11/15 21:26:31 about to exec fcDelayInst
2022/11/15 21:26:31 about to call fc delay task
2022/11/15 21:26:31 blocking for grpcserver.Serve

默认监听 http端口是: 1888, 可从aiges.toml文件中看到

5. Postman调试

 {
	"header":{
		"appid":"123456",
		"uid":"39769795890",
		"did":"SR082321940000200",
		"imei":"8664020318693660",
		"imsi":"4600264952729100",
		"mac":"6c:92:bf:65:c6:14",
		"net_type":"wifi",
		"net_isp":"CMCC",
		"status":3,
		"res_id":""
	},
	"parameter":{
		"svcName":{
			"result":{
				"encoding":"utf8",
				"compress":"raw",
				"format":"plain",
                "data_type": "text"
			}
		}
	},
	"payload":{
		"img":{
			"encoding":"jpg",
			"status":3,
			"image":"iVBORw0KGgoAAAANSUhEUgAAAOEAAADgCAYAAAD17wHfAAANa0lEQVR4Xu3dr29USxyG8VpUExQOhcGRIAkGU1OFh/+gCZI/AEdSWdMEj0A2QW+CQyFRyAYFloS9eTf5hsm7c2a295w9c3484hPgnrvdb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4v08sBxEO4NgR6uzaGun8FPqBn/nmjQgHQITogwgHQITogwgHQITogwgHQITogwgHUIpQarsoFKFiy9E0BREuGxEOQJt3dQ3CHAWkr6+uIdildGJg0SoYhVbijwnzQYRAY0QINEaEQGNECDRGhEBjRAg0RoRAY4rwP1Ov0CXSgGK4AAAAAElFTkSuQmCC"
		}
		
	}
}

返回响应

{
    "header": {
        "code": 0,
        "sid": "0d9115af-0c6b-4526-a539-05b3c8aa9cfa",
        "status": 3
    },
    "payload": {
        "result": {
            "compress": "raw",
            "encoding": "utf8",
            "format": "plain",
            "seq": "0",
            "status": "3",
            "text":"{\"result\": 7, \"msg\": \"\识\别\结\果\为\数\字: 7\"}"
        }
    }
}

6. swagger调试mnist

当前默认集成了 swagger2.0 for openapi3.0.

启动后访问:

http://<yourip>:1888

如下图:

img

Try it out ! 可以复制上述 postman部分的 body进行请求。

img2

可以看到识别结果返回

  • 至此,单独的aiges加载器完成基本运行

由于alpha 是裁剪后,并刚刚合并了 http接口部分,很多功能还不完善,但是基本可以托管能力

目前已知问题:

  • python进程退出未做处理,需要跟随父进程自动退出

  • 部分运行异常暂时没时间处理

联系我们

  • focus on:

ifly

  • contact:

weixin

注意备注来源: 开源

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

专为AI能力开发者打造的AI算法模型、引擎的通用服务化工具。 expand collapse
Cancel

Releases (1)

All

Contributors

All

Activities

Load More
can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iflytek/aiges.git
git@gitee.com:iflytek/aiges.git
iflytek
aiges
aiges
grpc

Search