init
This commit is contained in:
42
vw-agentic-rag/deploy/dev/config.yaml
Normal file
42
vw-agentic-rag/deploy/dev/config.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
app:
|
||||
name: agentic-rag
|
||||
max_tool_rounds: 3
|
||||
memory_ttl_days: 7
|
||||
port: 8000
|
||||
host: 0.0.0.0
|
||||
cors_origins:
|
||||
- '*'
|
||||
|
||||
provider: openai
|
||||
azure:
|
||||
api_key: h7ARU7tP7cblbpIQFpFXnhxVdFwH9rLXP654UfSJd8xKCJzeg4VOJQQJ99AKACi0881XJ3w3AAABACOGTlOf
|
||||
api_version: 2024-08-01-preview
|
||||
base_url: https://aoai-lab-jpe-fl.openai.azure.com
|
||||
deployment: gpt-4o
|
||||
openai:
|
||||
api_key: gpustack_0e3d5b35adaf239b_99adacd6f540c7d81006365c8030b16c
|
||||
base_url: http://sales2c-ai.chinanorth3.cloudapp.chinacloudapi.cn/v1-openai
|
||||
model: deepseek-chat
|
||||
|
||||
postgresql:
|
||||
database: agent_memory
|
||||
host: pg-aiflow-lab.postgres.database.azure.com
|
||||
password: P@ssw0rd
|
||||
port: 5432
|
||||
ttl_days: 7
|
||||
username: dev
|
||||
|
||||
logging:
|
||||
format: json
|
||||
level: INFO
|
||||
|
||||
retrieval:
|
||||
api_key: k1-YdKAldbSzCYjA5FpbAAzSeB6AVRN
|
||||
endpoint: http://aidemo.japaneast.cloudapp.azure.com/agentic-retrieval
|
||||
search:
|
||||
chunk_index: index-catonline-chunk-v2-prd
|
||||
standard_regulation_index: index-catonline-standard-regulation-v2-prd
|
||||
|
||||
citation:
|
||||
base_url: https://catonline.prod.cat.vgcserv.com.cn/#/common/detail
|
||||
|
||||
31
vw-agentic-rag/deploy/dev/deploy.sh
Normal file
31
vw-agentic-rag/deploy/dev/deploy.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
# login AKS
|
||||
az cloud set --name AzureCloud # Switch CLI to Azure cloud
|
||||
# az login # Log in to Azure China account (browser or device code flow)
|
||||
az account set -s 079d8bd8-b4cc-4892-9307-aa6dedf890e9 #! set subs
|
||||
az aks get-credentials -g rg-aiflow-lab -n aks-aiflow-lab --overwrite-existing --file ~/.kube/config
|
||||
####
|
||||
kubectl config use-context aks-aiflow-lab
|
||||
kubectl config current-context
|
||||
|
||||
docker build . -t agentic-rag:1.0.16
|
||||
docker tag agentic-rag:1.0.16 acraiflowlab.azurecr.io/agentic-rag:1.0.16
|
||||
docker push acraiflowlab.azurecr.io/agentic-rag:1.0.16
|
||||
|
||||
# kubectl create namespace knowledge-agent
|
||||
|
||||
kubectl delete configmap agentic-rag-config -n knowledge-agent
|
||||
kubectl create configmap agentic-rag-config -n knowledge-agent --from-file=config.yaml
|
||||
|
||||
kubectl delete deployment agentic-rag -n knowledge-agent
|
||||
# kubectl delete ingress agentic-retrieval-ingress -n knowledge-agent # 注释掉,不要删除生产 Ingress
|
||||
kubectl apply -f deploy/dev/k8s-manifest.yml -n knowledge-agent
|
||||
|
||||
# restart deployment
|
||||
kubectl rollout restart deployment agentic-rag -n knowledge-agent
|
||||
|
||||
kubectl rollout status deployment/agentic-rag -n knowledge-agent
|
||||
kubectl get deployment agentic-rag -o wide -n knowledge-agent
|
||||
kubectl get pods -l app=agentic-rag -o wide -n knowledge-agent
|
||||
# kubectl logs -f agentic-rag -n knowledge-agent
|
||||
|
||||
74
vw-agentic-rag/deploy/dev/k8s-manifest.yml
Normal file
74
vw-agentic-rag/deploy/dev/k8s-manifest.yml
Normal file
@@ -0,0 +1,74 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: agentic-rag
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: agentic-rag
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: agentic-rag
|
||||
spec:
|
||||
containers:
|
||||
- name: agentic-rag
|
||||
image: acraiflowlab.azurecr.io/agentic-rag:1.0.6
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: NEXT_PUBLIC_API_URL
|
||||
value: "http://localhost:8000/api"
|
||||
- name: LANGGRAPH_API_URL
|
||||
value: "http://localhost:8000"
|
||||
- name: NEXT_PUBLIC_API_URL_PREFIX
|
||||
value: "/agentic-rag"
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /app/config.yaml
|
||||
subPath: config.yaml
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: agentic-rag-config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: agentic-rag-service
|
||||
namespace: knowledge-agent
|
||||
spec:
|
||||
selector:
|
||||
app: agentic-rag
|
||||
ports:
|
||||
- name: api-8000
|
||||
port: 8000
|
||||
targetPort: 8000
|
||||
- name: api-3000
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: agentic-rag-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: aidemo.japaneast.cloudapp.azure.com
|
||||
http:
|
||||
paths:
|
||||
- path: /agentic-rag
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: agentic-rag-service
|
||||
port:
|
||||
number: 3000
|
||||
48
vw-agentic-rag/deploy/prd/config.yaml
Normal file
48
vw-agentic-rag/deploy/prd/config.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
app:
|
||||
name: agentic-rag
|
||||
max_tool_rounds: 4
|
||||
max_tool_rounds_user_manual: 2
|
||||
memory_ttl_days: 7
|
||||
port: 8000
|
||||
host: 0.0.0.0
|
||||
cors_origins:
|
||||
- '*'
|
||||
|
||||
provider: openai
|
||||
openai:
|
||||
api_key: gpustack_0e3d5b35adaf239b_99adacd6f540c7d81006365c8030b16c
|
||||
base_url: http://sales2c-ai.chinanorth3.cloudapp.chinacloudapi.cn/v1-openai
|
||||
model: deepseek-chat
|
||||
|
||||
|
||||
postgresql:
|
||||
database: agent_memory
|
||||
host: pg-sales2c-ai-prd.postgres.database.chinacloudapi.cn
|
||||
password: vwb54pSQDp8vYkusKms
|
||||
port: 5432
|
||||
ttl_days: 7
|
||||
username: pgadmin
|
||||
|
||||
logging:
|
||||
format: json
|
||||
level: INFO
|
||||
|
||||
retrieval:
|
||||
endpoint: "https://search-sales2c-ai-prd.search.azure.cn"
|
||||
api_key: "ev6B0OtF66WkDmQKJBa4n1Haa8e8p8N3zdaEBnbWtoAzSeAMWSid"
|
||||
api_version: "2024-11-01-preview"
|
||||
semantic_configuration: "default"
|
||||
embedding:
|
||||
base_url: "http://sales2c-ai.chinanorth3.cloudapp.chinacloudapi.cn/v1-openai"
|
||||
api_key: "gpustack_0e3d5b35adaf239b_99adacd6f540c7d81006365c8030b16c"
|
||||
model: "qwen3-embedding-8b"
|
||||
dimension: 4096
|
||||
api_version: null
|
||||
index:
|
||||
standard_regulation_index: index-catonline-standard-regulation-v2-prd
|
||||
chunk_index: index-catonline-chunk-v2-prd
|
||||
chunk_user_manual_index: index-cat-usermanual-chunk-prd
|
||||
|
||||
citation:
|
||||
base_url: https://catonline.prod.cat.vgcserv.com.cn/#/common/detail
|
||||
|
||||
33
vw-agentic-rag/deploy/prd/deploy.sh
Normal file
33
vw-agentic-rag/deploy/prd/deploy.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
# login AKS
|
||||
az cloud set --name AzureCloud # Switch CLI to Azure cloud
|
||||
# az login # Log in to Azure China account (browser or device code flow)
|
||||
az account set -s 079d8bd8-b4cc-4892-9307-aa6dedf890e9 #! set subs
|
||||
az aks get-credentials -g rg-aiflow-lab -n aks-aiflow-lab --overwrite-existing --file ~/.kube/config
|
||||
####
|
||||
kubectl config use-context aks-aiflow-lab
|
||||
kubectl config current-context
|
||||
|
||||
docker build . -t agentic-rag:1.0.16
|
||||
docker tag agentic-rag:1.0.16 acrsales2caiprd.azurecr.cn/agentic-rag:1.0.16
|
||||
docker push acrsales2caiprd.azurecr.cn/agentic-rag:1.0.16
|
||||
|
||||
# kubectl create namespace knowledge-agent
|
||||
|
||||
kubectl delete configmap agentic-rag-config -n knowledge-agent
|
||||
kubectl create configmap agentic-rag-config -n knowledge-agent --from-file=./deploy/prd/config.yaml --from-file=llm_prompt.yaml
|
||||
|
||||
kubectl delete deployment agentic-rag -n knowledge-agent
|
||||
# kubectl delete ingress agentic-rag-ingress -n knowledge-agent # 注释掉,不要删除生产 Ingress
|
||||
kubectl apply -f deploy/prd/k8s-manifest.yml -n knowledge-agent
|
||||
|
||||
# restart deployment
|
||||
kubectl rollout restart deployment agentic-rag -n knowledge-agent
|
||||
|
||||
kubectl rollout status deployment/agentic-rag -n knowledge-agent
|
||||
kubectl get deployment agentic-rag -o wide -n knowledge-agent
|
||||
kubectl get pods -l app=agentic-rag -o wide -n knowledge-agent
|
||||
|
||||
# Monitor logs
|
||||
kubectl logs -f deployment/agentic-rag -n knowledge-agent
|
||||
|
||||
77
vw-agentic-rag/deploy/prd/k8s-manifest.yml
Normal file
77
vw-agentic-rag/deploy/prd/k8s-manifest.yml
Normal file
@@ -0,0 +1,77 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: agentic-rag
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: agentic-rag
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: agentic-rag
|
||||
spec:
|
||||
containers:
|
||||
- name: agentic-rag
|
||||
image: acrsales2caiprd.azurecr.cn/agentic-rag:1.0.16
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: NEXT_PUBLIC_API_URL
|
||||
value: "http://localhost:8000/api"
|
||||
- name: LANGGRAPH_API_URL
|
||||
value: "http://localhost:8000"
|
||||
- name: NEXT_PUBLIC_API_URL_PREFIX
|
||||
value: "/agentic-rag"
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /app/config.yaml
|
||||
subPath: config.yaml
|
||||
- name: config-volume
|
||||
mountPath: /app/llm_prompt.yaml
|
||||
subPath: llm_prompt.yaml
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: agentic-rag-config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: agentic-rag-service
|
||||
namespace: knowledge-agent
|
||||
spec:
|
||||
selector:
|
||||
app: agentic-rag
|
||||
ports:
|
||||
- name: api-8000
|
||||
port: 8000
|
||||
targetPort: 8000
|
||||
- name: api-3000
|
||||
port: 3000
|
||||
targetPort: 3000
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: agentic-rag-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: ai.cdp.vgcserv.com.cn
|
||||
http:
|
||||
paths:
|
||||
- path: /agentic-rag
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: agentic-rag-service
|
||||
port:
|
||||
number: 3000
|
||||
Reference in New Issue
Block a user