ComputeNest agent integrations for Google ADK with Alibaba Cloud Bailian
Project description
详细指南
Python部署请参考ATA文档:https://ata.atatech.org/articles/11020487205 如有疑问,可加入“Aone Python应用部署答疑群”群 钉钉群号: 109775038267
项目结构
├── APP-META (构建用到的文件)
│ └── docker-config (构建镜像时的工作目录)
│ ├── Dockerfile
│ └── environment
│ └── common
│ ├── base (要使用aone启动应用,必须包含的脚本/配置)
│ │ ├── app
│ │ │ └── bin
│ │ │ ├── appctl.sh
│ │ │ ├── health.sh
│ │ │ ├── setenv.sh
│ │ │ ├── start.sh
│ │ │ └── stop.sh
│ │ └── cai
│ │ ├── bin
│ │ │ └── nginxctl
│ │ └── conf
│ │ ├── mime.types
│ │ └── nginx-proxy.conf
│ └── custom (项目自定义的脚本/配置)
│ └── app
│ └── bin
│ ├── health.sh
│ ├── setenv.sh
│ ├── start.sh
│ └── stop.sh
├── README.md
├── app
│ ├── __init__.py
│ ├── api (对外暴露的后端API)
│ │ ├── __init__.py
│ │ ├── main.py
│ │ └── routes
│ │ ├── __init__.py
│ │ ├── health.py
│ │ └── hello.py
│ ├── config (应用配置相关)
│ │ ├── __init__.py
│ │ ├── env.py
│ │ ├── diamond.py
│ ├── lifecycle (应用生命周期相关)
│ │ ├── __init__.py
│ │ └── manager.py
│ └──main.py (主文件,初始化FastAPI,设置路由并启动)
│
├── conf (配置文件)
│ └── circus.ini (circus用于进程管理,Python应用的启动在此定义)
│
└── computenest-agent-integrations.release (构建文件)
自定义启动脚本
定制启动脚本请写到APP-META/.../common/custom目录下
APP-META/.../common/custom目录中存储了健康检查(health.sh)、环境变量(setenv.sh)、启动(start.sh)、停止(stop.sh)等脚本,这些脚本会在容器启动时被执行。如果项目有特殊需求,可以在custom目录下修改对应的脚本,最好不要直接修改base目录下的脚本,否则可能导致项目无法正常启动,如遇项目启动问题,请联系源码模板负责人。
本地启动
1. 安装依赖
- 首先安装uv,最简单的是
pip install uv,其它方法:https://docs.astral.sh/uv/getting-started/installation/ - uv安装依赖:uv sync
- 如果不使用uv,可以手动pip安装pyproject.toml中的依赖
2. 启动命令
uv run python -m app.main
注意uv run自动激活了.venv虚拟环境,如果要直接运行python -m app.main,首先需要激活虚拟环境: source .venv/bin/activate
注意由于main.py被放置在app目录下,所以需要使用python -m模块启动,这是Python工程推荐做法,如果你希望直接使用python main.py启动,可以将main.py移出app目录,在根目录启动。
3. FastAPI 交互式API文档页
4. VSCode调试
创建launch.json时,选择Python调试程序->模块->输入app.main即可
Aone部署
1. 部署
2. FastAPI 交互式API文档页
http://{host}/docs
脚手架介绍
该脚手架用于快速搭建并在Aone部署基于FastAPI的Python后端应用,也可以用于自定义部署参考,如果你希望部署其它框架或开源产品,只需删除app目录,并修改conf/circus.ini中的启动命令,但必须参考app/api/routes/health.py提供/status.taobao健康检查接口,如果你不需要VIPServer的优雅上下线,直接在/status.taobao中返回"success"即可。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file computenest_agent_integrations-0.1.0.tar.gz.
File metadata
- Download URL: computenest_agent_integrations-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3521ea6509e51151c25fbecce6ef4b3ca3777e91ac684f1f0c17008cc1d01bf0
|
|
| MD5 |
c598ee94022475973efad173259adc10
|
|
| BLAKE2b-256 |
5415be294971154a842df41090c93564d3a74491b8e404974acd26903281cba4
|
File details
Details for the file computenest_agent_integrations-0.1.0-py3-none-any.whl.
File metadata
- Download URL: computenest_agent_integrations-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d12afca7ca8f71c898f0b5dfdca148b487288405fd9d4b704129366df16445d2
|
|
| MD5 |
adadfbe751a1dc26d79343d713ccceb2
|
|
| BLAKE2b-256 |
adccd4c7ba3967c7ccd85b543036b198b25af108feb386263c3a0820ca2c447f
|