Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fogdong/kubevela-ai-demo
https://github.com/fogdong/kubevela-ai-demo
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fogdong/kubevela-ai-demo
- Owner: FogDong
- Created: 2022-01-18T02:39:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-25T12:57:42.000Z (almost 3 years ago)
- Last Synced: 2024-10-14T20:47:14.311Z (3 months ago)
- Language: Python
- Size: 1.77 MB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI 应用云原生最佳实践
这个案例包含了 [训练任务](train.py) 和 [推理服务](api.py) 两个应用。
对于 AI 应用开发者来说,操作流程如下:
- 写业务逻辑 code: train.py + api.py
- 配置下 [app.yaml](./app.yaml)
- 剩下的一键 `dagger up` 即可,包括
- build & deploy orchestration
- infrastructure resources rendering## Quickstart
If you have not setup Dagger environment, run
```
dagger init
dagger new test -p plans/ml
```Initialize parameters:
```
dagger input yaml parameters -f app.yaml
```Run:
```
dagger up
dagger query resources
```## Add a new capability
The [monitoring.cue](./plans/ml/monitoring.cue) is an example to add a new capability to an existing definition:
```go
package ml// This will register the new capability and expose it to users
parameters: serveModel: monitoring: {
groups: [...#monitorGroup]
}#monitorGroup: {
name: string
rules: [...#monitorRule]
}#monitorRule: {
alert: string
expr: string
for: string
annotations: [string]: string
}
```Then you can use the capability in `app.yaml`:
```yaml
serveModel:
...monitoring:
groups:
- name: example
rules:
- alert: APIHighRequestLatency
expr: api_http_request_latencies_second{quantile="0.5"} > 1
for: 10m
annotations:
summary: "High request latency on {{ $labels.instance }}"
description: "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)"
```