|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: codebase-embedder-config |
| 5 | + namespace: costrict |
| 6 | +data: |
| 7 | + conf.yaml: | |
| 8 | + Name: codebase-embedder |
| 9 | + Host: 0.0.0.0 |
| 10 | + Port: 8888 |
| 11 | + Timeout: 120000 #ms |
| 12 | + MaxConns: 500 |
| 13 | + MaxBytes: 104857600 # 100MB |
| 14 | + DevServer: |
| 15 | + Enabled: true |
| 16 | + Verbose: false |
| 17 | + Mode: test # dev,test,rt,pre, pro |
| 18 | + |
| 19 | + Auth: |
| 20 | + UserInfoHeader: "x-userinfo" |
| 21 | + Database: |
| 22 | + Driver: postgres |
| 23 | + DataSource: postgres://postgres:costrict@postgres-postgresql-primary.costrict.svc.cluster.local:5432/codebase_embedder?sslmode=disable |
| 24 | + AutoMigrate: |
| 25 | + enable: true |
| 26 | + IndexTask: |
| 27 | + PoolSize: 1000 |
| 28 | + QueueSize: 100 |
| 29 | + LockTimeout: 10s |
| 30 | + EmbeddingTask: |
| 31 | + PoolSize: 20 |
| 32 | + MaxConcurrency: 10 |
| 33 | + Timeout: 18000s |
| 34 | + OverlapTokens: 100 |
| 35 | + MaxTokensPerChunk: 1000 |
| 36 | + EnableMarkdownParsing: false |
| 37 | + GraphTask: |
| 38 | + MaxConcurrency: 100 |
| 39 | + Timeout: 18000s |
| 40 | + ConfFile: "etc/codegraph.yaml" |
| 41 | + |
| 42 | + Cleaner: |
| 43 | + Cron: "0 0 * * *" |
| 44 | + CodebaseExpireDays: 30 |
| 45 | + |
| 46 | + Redis: |
| 47 | + Addr: costrict-redis-master.costrict.svc.cluster.local:6379 |
| 48 | + DefaultExpiration: 1h |
| 49 | + |
| 50 | + VectorStore: |
| 51 | + Type: weaviate |
| 52 | + Timeout: 60s |
| 53 | + MaxRetries: 5 |
| 54 | + StoreSourceCode: false |
| 55 | + FetchSourceCode: true |
| 56 | + BaseURL: http://codebase-querier-svc.costrict:8888/codebase-indexer/api/v1/snippets/read |
| 57 | + Weaviate: |
| 58 | + MaxDocuments: 20 |
| 59 | + Endpoint: "weaviate-service.costrict.svc.cluster.local:8080" |
| 60 | + BatchSize: 100 |
| 61 | + ClassName: "CodebaseIndex" |
| 62 | + Embedder: |
| 63 | + Timeout: 30s |
| 64 | + MaxRetries: 3 |
| 65 | + BatchSize: 10 |
| 66 | + StripNewLines: true |
| 67 | + Model: gte-modernbert-base |
| 68 | + ApiKey: "sk-xpiL5eRv65f8LKO8Ac9f1f66702c4f769f0794Ea0cF6B6Db" |
| 69 | + ApiBase: http://10.20.19.2:32326/v1/embeddings |
| 70 | + Reranker: |
| 71 | + Timeout: 10s |
| 72 | + MaxRetries: 3 |
| 73 | + Model: gte-reranker-modernbert-base |
| 74 | + ApiKey: "sk-xpiL5eRv65f8LKO8Ac9f1f66702c4f769f0794Ea0cF6B6Db" |
| 75 | + ApiBase: http://10.20.19.2:32323/v1/rerank |
| 76 | + |
| 77 | + Log: |
| 78 | + Mode: console # console,file,volume |
| 79 | + ServiceName: "codebase-embedder" |
| 80 | + Encoding: plain # json,plain |
| 81 | + Path: "/app/logs" |
| 82 | + Level: info # debug,info,error,severe |
| 83 | + KeepDays: 7 |
| 84 | + MaxSize: 100 # MB per file, take affect when Rotation is size. |
| 85 | + Rotation: daily # split by day or size |
| 86 | + Validation: |
| 87 | + enabled: true |
| 88 | + check_content: true |
| 89 | + fail_on_mismatch: false |
| 90 | + log_level: "info" |
| 91 | + max_concurrency: 5 |
| 92 | + skip_patterns: [] |
| 93 | + TokenLimit: |
| 94 | + max_running_tasks: 100 |
| 95 | + enabled: true |
| 96 | +--- |
| 97 | +apiVersion: apps/v1 |
| 98 | +kind: Deployment |
| 99 | +metadata: |
| 100 | + name: codebase-embedder |
| 101 | + namespace: costrict |
| 102 | + labels: |
| 103 | + app: codebase-embedder |
| 104 | +spec: |
| 105 | + replicas: 3 |
| 106 | + selector: |
| 107 | + matchLabels: |
| 108 | + app: codebase-embedder |
| 109 | + template: |
| 110 | + metadata: |
| 111 | + labels: |
| 112 | + app: codebase-embedder |
| 113 | + spec: |
| 114 | + containers: |
| 115 | + - name: codebase-embedder |
| 116 | + image: zgsm/codebase-embedder:v0.1.0 |
| 117 | + imagePullPolicy: IfNotPresent |
| 118 | + command: |
| 119 | + - /app/server |
| 120 | + - -f |
| 121 | + - /app/conf/conf.yaml |
| 122 | + ports: |
| 123 | + - containerPort: 8888 |
| 124 | + name: http |
| 125 | + - containerPort: 6060 |
| 126 | + name: metrics |
| 127 | + env: |
| 128 | + - name: TZ |
| 129 | + value: Asia/Shanghai |
| 130 | + - name: INDEX_NODE |
| 131 | + value: "1" |
| 132 | + livenessProbe: |
| 133 | + tcpSocket: |
| 134 | + port: 8888 |
| 135 | + initialDelaySeconds: 15 |
| 136 | + periodSeconds: 20 |
| 137 | + resources: |
| 138 | + requests: |
| 139 | + cpu: "4" |
| 140 | + memory: 8Gi |
| 141 | + limits: |
| 142 | + cpu: "8" |
| 143 | + memory: 16Gi |
| 144 | + volumeMounts: |
| 145 | + - name: logs |
| 146 | + mountPath: /app/logs |
| 147 | + - name: app-conf |
| 148 | + mountPath: /app/conf |
| 149 | + volumes: |
| 150 | + - name: app-conf |
| 151 | + configMap: |
| 152 | + name: codebase-embedder-config |
| 153 | + - name: logs |
| 154 | + emptyDir: {} |
| 155 | +--- |
| 156 | +apiVersion: v1 |
| 157 | +kind: Service |
| 158 | +metadata: |
| 159 | + name: codebase-embedder-svc |
| 160 | + namespace: costrict |
| 161 | +spec: |
| 162 | + type: NodePort |
| 163 | + ports: |
| 164 | + - port: 8888 |
| 165 | + targetPort: 8888 |
| 166 | + name: http |
| 167 | + nodePort: 32002 |
| 168 | + - port: 6470 |
| 169 | + targetPort: 6060 |
| 170 | + name: metrics |
| 171 | + selector: |
| 172 | + app: codebase-embedder |
0 commit comments