Commit Graph

37 Commits

Author SHA1 Message Date
douxu 05c64dda14 chore: add imagePullPolicy and migrate WaitGroup to wg.Go
- add imagePullPolicy: IfNotPresent to all k8s Deployments, DaemonSet
    (grafana, jaeger, loki, rabbitmq, redis, promtail)
  - migrate wg.Add(1)/go/defer wg.Done() pattern to wg.Go() (Go 1.25+)
    in logger/loki_syncer.go and task/worker.go
  - simplify redundant map existence check before delete in diagram/graph.go
  - update deploy.md to reflect pg PVC size (6Gi) and resource limits
2026-06-10 16:40:50 +08:00
douxu c4e892f1c7 fix: correct typo in Jaeger K8s service name
- rename `jaeger-serivce` to `jaeger-service` in jaeger-service.yaml
2026-06-08 17:05:21 +08:00
douxu 195150d9b1 fix: fix K8s service names, deployment command, and GORM logger
- rename all K8s services to xxx-service convention and update
    all configmap references (postgres, mongodb, loki, jaeger)
  - add explicit command: ["/app/modelrt"] to deployment to prevent
    args from being treated as the executable (no ENTRYPOINT in
    Dockerfile)
  - set deploy_env to development to bypass Redis empty-password
    guard in non-production Minikube environment
  - fix GormLogger Info/Warn/Error to use fmt.Sprintf(msg, data...)
    so GORM printf-style messages are formatted correctly and avoid
    json: unsupported type: func() time.Time serialization panic
  - expand pg PVC storage from 2Gi to 6Gi
  - rename loop variable msg to task in PushTaskToRabbitMQ for clarity
  - align comment indentation in queue_producer.go
2026-06-03 17:11:54 +08:00
douxu 3309e53653 docs: document Dockerfile smoke tests and load workflow for Minikube
- add 3-stage build table (builder/certs/scratch) with image size note
  - add build-arg USER_ID override example in section 5.1
  - add section 5.1.1 with smoke-test commands (size check, inspect, dry
    run, full start)
  - add workflow for loading pre-built local images into Minikube
    directly
  - bump builder base image from golang:1.25-alpine to
    golang:1.26-alpine
  - normalize inline Dockerfile comments to lowercase
  - remove example config COPY from final scratch stage
2026-06-02 16:35:13 +08:00
douxu c6545e29ba style: normalize log messages to lowercase across task package
- lowercase first letter of all logger.Info/Warn/Error message strings
    in task/worker.go, task/retry_queue.go, task/handler_factory.go,
    task/metrics_logger.go, task/retry_manager.go, task/queue_producer.go,
    task/initializer.go, task/test_task.go, and main.go
  - fix inline comments in main.go that mixed Chinese and uppercase English
  - align Dockerfile comment casing with project convention
2026-06-01 15:50:11 +08:00
douxu 57d1111a83 refactor: modernize Go idioms and add MongoDB K8s manifests
- replace interface{} with any across ~30 files for Go 1.18+ style
  - adopt for-range-over-int loops in place of explicit index loops
  - use maps.Copy from stdlib to replace manual map copy loops
  - use min() builtin for exponential backoff delay cap in retry_manager
  - add MongoDB 7.0 K8s manifests (StatefulSet, Service, PVC, Secret)
  - document PostgreSQL and MongoDB deploy steps in deploy.md with SSH tunnel port mappings
2026-05-29 14:28:58 +08:00
douxu bacd43617e chore: bind sensitive config to env vars and bump Go image to 1.25
- bind postgres.password to POSTGRES_PASSWORD env var via viper BindEnv
  - bind service.secret_key to SERVICE_SECRET_KEY env var via viper BindEnv
  - upgrade builder base image from golang:1.24-alpine to golang:1.25-alpine
2026-05-29 10:56:17 +08:00
douxu 57371fbf1f docs: add Minikube PostgreSQL manifests and clean deploy markdown
- add split PostgreSQL K8s manifests for ConfigMap, Service, PVC, and StatefulSet
- expose PostgreSQL through NodePort for local Minikube access
- replace deploy.md LaTeX text syntax with Markdown inline code formatting
- keep deployment documentation rendering stable in Wiki.js and Markdown viewers
2026-05-27 16:51:00 +08:00
douxu 42956d1793 feat: add dedicated message-exchange for task lifecycle notifications
- add constants/message.go with MessageTask* categories and message-exchange /
    message-queue / dead-letter routing constants
  - add mq/publish_message.go with PushMessageToRabbitMQ (confirm mode,
    dead-letter queue) separate from the existing event-exchange publisher
  - add mq/emit.go with TryEmitMessage for non-blocking, OTel-traced dispatch
  - add mq/event/task_event_gen.go with NewTaskSubmitted/Running/Completed/
    Failed/CancelledMessage constructors
  - wire TryEmitMessage into task worker and create/cancel handlers so all 5
    lifecycle transitions are published (previously task.* routed to
    event-exchange with no matching binding, causing silent drops)
  - harden Dockerfile: scratch final image, pinned alpine:3.21 certs stage,
    apk upgrade in builder, add -trimpath -mod=readonly go build flags
  - add full K8s manifests under deploy/k8s/ for Redis, RabbitMQ (mTLS),
    ModelRT (Downward API, scratch image, readOnlyRootFilesystem), Jaeger,
    Loki, Promtail, Grafana
  - expand deploy.md with async_task SQL schema, TLS cert generation steps,
    K8s deployment procedures, and SSH tunnel configuration
2026-05-13 16:58:36 +08:00
douxu 9661278935 refactor: rename TaskParams to Params and remove debug prints
- rename TaskParams interface to Params in task/base_task.go for brevity                                                     - remove debug fmt.Println/Printf statements from graph.go and handler_factory.go
  - fix is_local flag from false to true for existing test components in deploy.md                                             - add 6 new test component records (ns4-ns8) to deploy seed data
2026-04-28 17:41:28 +08:00
douxu 1b1f43db7f feat: implement topology analysis async task with BFS connectivity check
- add TopologyAnalysisHandler.Execute() with 5-phase BFS reachability
    check between start/end component UUIDs; support CheckInService flag
    to skip out-of-service nodes during traversal
  - carry task params through RabbitMQ message (TaskQueueMessage.Params)
    instead of re-querying DB in handler; update TaskHandler.Execute
    interface and all handler signatures accordingly
  - fix BuildMultiBranchTree UUIDFrom condition bug; return nodeMap for
    O(1) lookup; add QueryTopologicByStartUUID for directed traversal
  - add QueryBayByUUID/QueryBaysByUUIDs and
    QueryComponentsInServiceByUUIDs (two-column select) to database layer
  - add diagram.FindPath via LCA algorithm for tree path reconstruction
  - move initTracerProvider to middleware.InitTracerProvider; add
    OtelConfig struct to ModelRTConfig for endpoint configuration
  - update topology analysis params to start/end_component_uuid +
    check_in_service; remove dead topology init code
2026-04-24 17:14:46 +08:00
douxu d3b1f0afbe add code of send all target removed system signal in real time data pull api and fix bug of component attribute query api 2026-01-14 17:32:01 +08:00
douxu 29d0e06c94 add new structure field of measurement table and add new test data of component table and station table 2026-01-04 17:12:00 +08:00
douxu e74bedd47f fix bug of token4-token7 type recommend api 2025-12-31 16:24:27 +08:00
douxu 42751c1020 optimize the logic for loading the cache of measurement nodes for traversing components 2025-12-25 17:17:20 +08:00
douxu 7ea38615b4 unified caching system collection key names 2025-12-24 09:34:03 +08:00
douxu 6e16a9a39a fix bug of measurement recommend injection func 2025-12-24 09:06:42 +08:00
douxu f45f10507b fix bug of measurement recommend of token6 complete op and token7 hierarchy recommend 2025-12-23 14:52:39 +08:00
douxu 41e2998739 optimize deploy doc and optimize TraverseAttributeGroupTables func 2025-12-22 17:38:15 +08:00
douxu 689d31c246 optimize dockerfile and config generate of docker deploy 2025-12-17 17:09:20 +08:00
douxu d4d8c2c975 optimize deploy file 2025-12-12 15:20:50 +08:00
douxu 716f56babb optimize docker deploy file 2025-12-12 11:01:18 +08:00
douxu befb4e8971 fix bug of server deploy 2025-12-11 16:42:25 +08:00
douxu 2a3852a246 add diagram node link process api 2025-12-10 16:12:13 +08:00
douxu 3f70be0d1c fix bug of new version of measurement recommend api 2025-12-06 18:32:00 +08:00
douxu a21a423624 optimize func of measurement data injection 2025-12-05 17:12:14 +08:00
douxu 666e1a9289 optimzie shell of measurement recommend api 2025-12-05 16:36:11 +08:00
douxu 46e72ce588 optimize redis test data lua shell 2025-12-04 17:26:35 +08:00
douxu 10b91abee9 optimize real time data computing api 2025-12-01 17:22:29 +08:00
douxu 329b4827f8 fix bug of real time data injection shell 2025-12-01 11:27:38 +08:00
douxu a7d894d2de write code for real time data compute shell 2025-11-28 17:17:58 +08:00
douxu 6f3134b5e9 optimize struct of real time data subscription api and fix bug of real time data pull api 2025-11-26 17:49:24 +08:00
douxu b6e47177fb debugging API using single measurement point subscription case 2025-11-25 16:13:55 +08:00
douxu 5e311a7071 optimize redis real time data injection func 2025-11-21 17:02:07 +08:00
douxu 36f267aec7 add data_injection func to mock real time data in redis 2025-11-20 17:37:12 +08:00
douxu 357d06868e optimize deploy doc 2025-11-19 17:44:45 +08:00
douxu 86199269f8 add deploy.md of deploy modelRT project 2025-10-17 17:10:10 +08:00