Skip to content

Commit 3ea0c2b

Browse files
lsy357biwang75678kidkidkidmocayo
authored
[feat][all] feature v1.1.0 (#101)
* [feat] [infra] docker image & helm chart (#3) * fix(evaluation): evaltarget converter panic - code sync with 89dbdac81e57ca417544b7de0d41673ff9cc33b1 * feat(evaluation): add target type CozeWrokflow - code sync with MR-260 * fix(evaluation): BatchGetEvaluatorByID with write db option - code sync with d12af290149f205b9d3045cdddf2d311920a202c * fix(evaluation): SubmitExperiment auth - code sync with 42016a6664026ffaafd3a0992f7ea9d76609f052 * feat(observability): commercial open core - code sync with 4ba2ec7dfa6d6fcefeab523f3fe71f389f938193 * fix(observability): metrics init once - code sync with a5ba037c610d78b1790afa50ea726e1634337ad5 * fix(observability): add logic delete time filter - code sync with 302f3cf4ee5569d3779104dff432f4e50e187d50 * fix(observability): span ttl - code sync with bf9d052caf9f0cc5e7475eae5311c70c4d45254a * fix(evaluation): expt zombie items status trans - code sync with da7fca75c9d96caff2cc310b4b98a13b00fda7f5 * fix(observability): GetTrace with span_ids - code sync with b336860ed3b285b278b3f42a54906d94d059b71d * feat(prompt): commercial open core - code sync with 61731c0337f9c079db0d9a7adb4a83517b31d7f2 * fix(infra): error mw parse kitex bizerr - code sync with 0e277ef5ecf0c764c18f2a79a019ba4137c832a4 * fix(prompt): prompt debug without cancel - code sync with 39875a9e438039e2298ce3df895a5e66eece7762 * fix(prompt): ListPrompt with committed only - code sync with 9468a33e35d6ea1672fc4804014809b5b66f031d * feat(prompt): openapi event collector - code sync with f26b33d8bac6449e47d6d5d1d731b06c8ac4bc4e * feat(prompt): openapi sdk panic - code sync with da3319bbd7665738874e9c09992d3b4319dcc9f1 * feat(evaluation): expt report item search enhancement - code sync with MR-292 * feat(infra): docker image & helm chart --------- Co-authored-by: liushengyang <liushengyang@bytedance.com> # Conflicts: # backend/script/gorm_gen/generate.go * feat(infra): docker compose makefile change (#4) * [feat] [infra] update helm release (#5) * feat(infra): docker compose makefile change * feat(infra): update helm release * [feat] [backend] sync code (#6) * fix(evaluation): expt statistic cnt err - code sync with 424de1cabe35b36a0cb0d169dea7854382c2e38f * fix(evaluation): mysql/rmq docker cfg * feat(backend): update go version (#7) * fix(backend): golint (#9) * [fix] [evaluation] mysql ddl with create nx (#10) * fix(evaluation): mysql ddl with create nx * chore(infra): gitignore add venv * fix(infra): tracer err lint (#11) * feat(backend): ttl up into 365d (#13) * [fix] [frontend] i18n texts in prompt-pages and evaluation pages (#14) * fix(prompt-pages): text * fix(evaluate): text * [feat] [wiki] update content (#12) * feat(wiki): update for docker image & k8s * update * change conf * make helm * update * expose 8888 * feat(docker): jianrong * update * [fix] [prompt] placeholder var name (#15) * fix(prompt): placeholder var name * doc(intl): readme * [fix][infra] dev/debug wait err (#16) * fix(infra): debug wait & model_example conf * fix(evaluation): expt statistic save err * feat(helm) add minikube conf (#17) * [fix][infra] license header author (#18) * fix(infra): license header author * fix(backend): minio ut * chore(infra): gitignore add chart (#19) * [fix] [prompt] prompt clone var error (#20) * fix(prompt): url after delete * fix(prompt): copy vars * [ci] [workflow] remove hard code git user (#21) * ci: remove hard code git user in fe ci * [fix][backend] revise readme (#22) * change deployment guide --------- Co-authored-by: gcx75678 <biwang75678@gmail.com> Co-authored-by: kidkidkid <20141845+kidkidkid@users.noreply.github.com> Co-authored-by: Mocayo <mocayo@qq.com>
1 parent c32d6de commit 3ea0c2b

755 files changed

Lines changed: 101111 additions & 7818 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.air.toml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/frontend-ci.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,13 @@ jobs:
2323
runs-on: ubuntu-latest
2424
env:
2525
NODE_VERSION: '18'
26-
# should be ci trigger user
27-
GIT_USER_NAME: 'mocayo'
28-
GIT_USER_EMAIL: 'qihai@bytedance.com'
2926
BUILD_BRANCH: ${{ github.ref }}
3027
steps:
3128
- name: Checkout
3229
uses: actions/checkout@v4
3330
with:
3431
fetch-depth: 1
3532

36-
- name: Config Git User
37-
run: |
38-
git config --local user.name ${{ env.GIT_USER_NAME }}
39-
git config --local user.email ${{ env.GIT_USER_EMAIL }}
40-
4133
- name: Setup Node
4234
uses: actions/setup-node@v3
4335
with:

.github/workflows/frontend-tsc-ci.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,12 @@ jobs:
2323
runs-on: ubuntu-latest
2424
env:
2525
NODE_VERSION: '18'
26-
# should be ci trigger user
27-
GIT_USER_NAME: 'mocayo'
28-
GIT_USER_EMAIL: 'qihai@bytedance.com'
2926
steps:
3027
- name: Checkout
3128
uses: actions/checkout@v4
3229
with:
3330
fetch-depth: 1
3431

35-
- name: Config Git User
36-
run: |
37-
git config --local user.name ${{ env.GIT_USER_NAME }}
38-
git config --local user.email ${{ env.GIT_USER_EMAIL }}
39-
4032
- name: Setup Node
4133
uses: actions/setup-node@v3
4234
with:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ log/
4242
node_modules/
4343

4444
.eslintcache
45+
46+
venv/
47+
48+
# Helm chart dependencies
49+
release/deployment/helm-chart/umbrella/charts/
50+
release/deployment/helm-chart/umbrella/Chart.lock
51+

Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

Makefile

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
IMAGE_REGISTRY := docker.io
2+
IMAGE_REPOSITORY := cozedev
3+
IMAGE_NAME := coze-loop
4+
5+
DOCKER_COMPOSE_DIR := ./release/deployment/docker-compose
6+
7+
HELM_CHART_DIR := ./release/deployment/helm-chart/umbrella
8+
HELM_NAMESPACE := coze-loop
9+
HELM_RELEASE := coze-loop
10+
11+
.PHONY: image mini-start mini-tunnel
12+
13+
.PHONY: FORCE
14+
FORCE:
15+
16+
image%:
17+
@case "$*" in \
18+
-login) \
19+
docker login $(IMAGE_REGISTRY) -u $(IMAGE_REPOSITORY) ;; \
20+
-bpush-*) \
21+
version="$*"; \
22+
version="$${version#-bpush-}"; \
23+
docker buildx build \
24+
--platform linux/amd64,linux/arm64 \
25+
--progress=plain \
26+
--push \
27+
-f ./release/image/Dockerfile \
28+
-t $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest \
29+
-t $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):"$$version" \
30+
.; \
31+
docker pull $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest; \
32+
docker run --rm $(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest du -sh /coze-loop/bin; \
33+
docker run --rm $(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest du -sh /coze-loop/resources; \
34+
docker run --rm $(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest du -sh /coze-loop ;; \
35+
-help|*) \
36+
echo "Usage:"; \
37+
echo " make image--login # Login to the image registry ($(IMAGE_REGISTRY))"; \
38+
echo " make image-<version> # Build & push multi-arch image with tags <version> and latest"; \
39+
echo; \
40+
echo "Examples:"; \
41+
echo " make image--login # Login before pushing images"; \
42+
echo " make image-1.0.0 # Build & push images tagged '1.0.0' and 'latest'"; \
43+
echo; \
44+
echo "Notes:"; \
45+
echo " - 'image--login' logs in using IMAGE_REPOSITORY as the username."; \
46+
echo " - 'image-<version>' will push to $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME)"; \
47+
exit 1 ;; \
48+
esac
49+
50+
compose%:
51+
@case "$*" in \
52+
-up) \
53+
docker compose \
54+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
55+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
56+
--profile "*" \
57+
up ;; \
58+
-restart-*) \
59+
svc="$*"; \
60+
svc="$${svc#-restart-}"; \
61+
docker compose \
62+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
63+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
64+
restart "$$svc" ;; \
65+
-down) \
66+
docker compose \
67+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
68+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
69+
--profile "*" \
70+
down ;; \
71+
-down-v) \
72+
docker compose \
73+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
74+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
75+
--profile "*" \
76+
down -v ;; \
77+
-up-dev) \
78+
docker compose \
79+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
80+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-dev.yml \
81+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
82+
--profile "*" \
83+
up --build ;; \
84+
-restart-dev-*) \
85+
svc="$*"; \
86+
svc="$${svc#-restart-dev-}"; \
87+
docker compose \
88+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
89+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-dev.yml \
90+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
91+
restart "$$svc" ;; \
92+
-down-dev) \
93+
docker compose \
94+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
95+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-dev.yml \
96+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
97+
--profile "*" \
98+
down ;; \
99+
-down-v-dev) \
100+
docker compose \
101+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
102+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-dev.yml \
103+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
104+
--profile "*" \
105+
down -v ;; \
106+
-up-debug) \
107+
docker compose \
108+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
109+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-debug.yml \
110+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
111+
--profile "*" \
112+
up --build ;; \
113+
-restart-debug-*) \
114+
svc="$*"; \
115+
svc="$${svc#-restart-debug-}"; \
116+
docker compose \
117+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
118+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-debug.yml \
119+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
120+
restart "$$svc" ;; \
121+
-down-debug) \
122+
docker compose \
123+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
124+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-debug.yml \
125+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
126+
--profile "*" \
127+
down ;; \
128+
-down-v-debug) \
129+
docker compose \
130+
-f $(DOCKER_COMPOSE_DIR)/docker-compose.yml \
131+
-f $(DOCKER_COMPOSE_DIR)/docker-compose-debug.yml \
132+
--env-file $(DOCKER_COMPOSE_DIR)/.env \
133+
--profile "*" \
134+
down -v ;; \
135+
-help|*) \
136+
echo "Usage:"; \
137+
echo " # Stable profile"; \
138+
echo " make compose-up # Start base services"; \
139+
echo " make compose-restart-<svc> # Restart specific base service"; \
140+
echo " make compose-down # Stop base services"; \
141+
echo " make compose-down-v # Stop base services and remove volumes"; \
142+
echo; \
143+
echo " # Dev profile"; \
144+
echo " make compose-up-dev # Start base + dev services (build)"; \
145+
echo " make compose-restart-dev-<svc> # Restart specific dev service"; \
146+
echo " make compose-down-dev # Stop base + dev services"; \
147+
echo " make compose-down-v-dev # Stop base + dev services and remove volumes"; \
148+
echo; \
149+
echo " # Debug profile"; \
150+
echo " make compose-up-debug # Start base + debug services (build)"; \
151+
echo " make compose-restart-debug-<svc> # Restart specific debug service"; \
152+
echo " make compose-down-debug # Stop base + debug services"; \
153+
echo " make compose-down-v-debug # Stop base + debug services and remove volumes"; \
154+
echo; \
155+
echo "Notes:"; \
156+
echo " - '<svc>' means the name of a service in docker-compose.yml"; \
157+
echo " - '--profile \"*\"' is only needed for 'up', not for 'down' or 'restart'."; \
158+
echo " - If you used multiple -f files for 'up', use the same -f set for 'down' or 'restart'."; \
159+
exit 1 ;; \
160+
esac
161+
162+
helm%:
163+
@case "$*" in \
164+
-login) \
165+
helm registry login $(IMAGE_REGISTRY) -u $(IMAGE_REPOSITORY) ;; \
166+
-chart-deps) \
167+
helm dependency build $(HELM_CHART_DIR) ;; \
168+
-chart-deps-clean) \
169+
rm -rf $(HELM_CHART_DIR)/charts $(HELM_CHART_DIR)/Chart.lock ;; \
170+
-chart-bpush-*) \
171+
version="$*"; \
172+
version="$${version#-chart-bpush-}"; \
173+
helm dependency build $(HELM_CHART_DIR); \
174+
helm package $(HELM_CHART_DIR) --version "$$version"-helm; \
175+
helm push $(IMAGE_NAME)-"$$version"-helm.tgz oci://$(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY); \
176+
rm -f $(IMAGE_NAME)-"$$version"-helm.tgz; \
177+
rm -rf $(HELM_CHART_DIR)/charts $(HELM_CHART_DIR)/Chart.lock ;; \
178+
-ctx) \
179+
kubectl config get-contexts ;; \
180+
-ctx-*) \
181+
ctx="$*"; \
182+
ctx="$${ctx#-ctx-}"; \
183+
echo "switch to context: $$ctx"; \
184+
kubectl config use-context "$$ctx" ;; \
185+
-ns) \
186+
kubectl get namespaces ;; \
187+
-pod) \
188+
kubectl get pods -n $(HELM_NAMESPACE) ;; \
189+
-svc) \
190+
kubectl get svc -n $(HELM_NAMESPACE) -o wide ;; \
191+
-ingress) \
192+
kubectl get ingress -n $(HELM_NAMESPACE) ;; \
193+
-up) \
194+
helm upgrade \
195+
--install --force $(HELM_RELEASE) $(HELM_CHART_DIR) \
196+
--namespace $(HELM_NAMESPACE) --create-namespace \
197+
-f $(HELM_CHART_DIR)/values.yaml ;; \
198+
-up-exp-minikube-*) \
199+
vals="$*"; \
200+
vals="$${vals#-up-exp-minikube-}"; \
201+
helm upgrade \
202+
--install --force $(HELM_RELEASE) $(HELM_CHART_DIR) \
203+
--namespace $(HELM_NAMESPACE) --create-namespace \
204+
-f $(HELM_CHART_DIR)/examples/minikube/"$$vals".values.yaml ;; \
205+
-down) \
206+
helm list -n $(HELM_NAMESPACE) -q \
207+
| \
208+
xargs -r -n1 helm uninstall -n $(HELM_NAMESPACE) ;; \
209+
-logf-*) \
210+
app="$*"; \
211+
app="$${app#-logf-}"; \
212+
kubectl -n $(HELM_NAMESPACE) logs \
213+
-l app=$(HELM_RELEASE)-$$app \
214+
--all-containers=true \
215+
--tail=100 \
216+
--prefix=true \
217+
--max-log-requests=10 \
218+
-f ;; \
219+
-tpl-*) \
220+
app="$*"; \
221+
app="$${app#-tpl-}"; \
222+
helm template $(HELM_RELEASE) $(HELM_CHART_DIR) \
223+
--namespace $(HELM_NAMESPACE) \
224+
-f $(HELM_CHART_DIR)/values.yaml | \
225+
APP="$$app" yq eval '. | select(.kind == "Deployment" and .metadata.name == ("coze-loop-" + strenv(APP)))' - ;; \
226+
-help|*) \
227+
echo "Usage:"; \
228+
echo; \
229+
echo " # Auth & Chart packaging"; \
230+
echo " make helm-login # OCI login to registry ($(IMAGE_REGISTRY)) using user=$(IMAGE_REPOSITORY)"; \
231+
echo " make helm-chart-deps # Build chart dependencies (helm dependency build)"; \
232+
echo " make helm-chart-deps-clean # Clean deps: remove charts/ and Chart.lock"; \
233+
echo " make helm-chart-bpush-<version> # Package chart as <version>-helm and push to OCI ($(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY))"; \
234+
echo; \
235+
echo " # Kube context & namespace"; \
236+
echo " make helm-ctx # List kube contexts"; \
237+
echo " make helm-ctx-<context> # Switch to kube context <context>"; \
238+
echo " make helm-ns # List namespaces"; \
239+
echo; \
240+
echo " # Inspect resources in namespace $(HELM_NAMESPACE)"; \
241+
echo " make helm-pod # List pods (wide)"; \
242+
echo " make helm-svc # List services (wide)"; \
243+
echo " make helm-ingress # List ingress resources"; \
244+
echo; \
245+
echo " # Release lifecycle"; \
246+
echo " make helm-up # helm upgrade --install $(HELM_RELEASE) from $(HELM_CHART_DIR) (uses values.yaml)"; \
247+
echo " make helm-up-exp-minikube-<vals> # helm upgrade using examples/minikube/<vals>.values.yaml"; \
248+
echo " make helm-down # Uninstall ALL releases in namespace $(HELM_NAMESPACE)"; \
249+
echo; \
250+
echo " # Logs & templating"; \
251+
echo " make helm-logf-<app> # Follow logs for pods with label app=$(HELM_RELEASE)-<app>, all containers"; \
252+
echo " make helm-tpl-<app> # Render only Deployment coze-loop-<app> to stdout (no apply)"; \
253+
echo; \
254+
echo "Examples:"; \
255+
echo " make helm-login"; \
256+
echo " make helm-chart-deps && make helm-chart-bpush-1.0.0"; \
257+
echo " make helm-ctx && make helm-ctx-minikube"; \
258+
echo " make helm-up # installs/updates $(HELM_RELEASE) in $(HELM_NAMESPACE)"; \
259+
echo " make helm-logf-app # e.g., app=api => label app=$(HELM_RELEASE)-api"; \
260+
echo; \
261+
echo "Notes:"; \
262+
echo " - Ensure HELM_NAMESPACE and HELM_RELEASE are exported or set in the environment."; \
263+
echo " - helm-chart-bpush-<version> produces <chart>-<version>-helm.tgz then pushes and cleans local artifact."; \
264+
echo " - Template filter expects Deployment.metadata.name = \"coze-loop-<app>\"."; \
265+
exit 1 ;; \
266+
esac
267+
268+
minikube%:
269+
@case "$*" in \
270+
-start) \
271+
minikube start --addons=ingress ;; \
272+
-tunnel) \
273+
sudo minikube tunnel ;; \
274+
-help|*) \
275+
echo "Usage:"; \
276+
echo; \
277+
echo " make minikube-start # Start minikube with ingress addon enabled"; \
278+
echo " make minikube-tunnel # Run minikube tunnel (requires sudo), exposes LoadBalancer/Ingress services locally"; \
279+
echo; \
280+
echo "Examples:"; \
281+
echo " make minikube-start"; \
282+
echo " make minikube-tunnel"; \
283+
echo; \
284+
echo "Notes:"; \
285+
echo " - 'minikube-start' uses '--addons=ingress' to enable NGINX ingress controller automatically."; \
286+
echo " - 'minikube-tunnel' will bind service external IPs to localhost for LoadBalancer/Ingress access."; \
287+
echo " - 'minikube-tunnel' may require admin privileges (sudo) depending on your OS/network setup."; \
288+
exit 1 ;; \
289+
esac

0 commit comments

Comments
 (0)