Skip to content

Commit

Permalink
Merge pull request #713 from bjwswang/main
Browse files Browse the repository at this point in the history
chore: add some logs in chat doc;increaset ingress timeout
  • Loading branch information
bjwswang authored Feb 2, 2024
2 parents b4556df + 0e30607 commit 82f6e6e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
9 changes: 8 additions & 1 deletion apiserver/pkg/chat/chat_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func (cs *ChatServer) ReceiveConversationDoc(ctx context.Context, messageID stri
if err != nil {
return nil, err
}

message.Answer = resp.Summary
message.Latency = int64(resp.TimecostForSummarization)
message.Documents = append(message.Documents, storage.Document{
Expand Down Expand Up @@ -212,7 +213,10 @@ func (cs *ChatServer) SummarizeConversationDoc(ctx context.Context, req Conversa
errStr += fmt.Sprintf(" ErrEmbedding: %s", errEmbedding.Error())
// break once error occurs
ctx.Done()
return
}
klog.V(1).ErrorS(errEmbedding, "ErrEmbedding", "document", doc.Filename, "conversation", "")
klog.V(5).Infof("Generate embeddings for doc %s is successful!")
}()

// For summary generation
Expand All @@ -231,9 +235,12 @@ func (cs *ChatServer) SummarizeConversationDoc(ctx context.Context, req Conversa
summary, errSummary = cs.GenerateSingleDocSummary(ctx, req, doc, documents, respStream)
if errSummary != nil {
// break once error occurs
errStr += fmt.Sprintf(" ErrSummary: %s", errEmbedding.Error())
errStr += fmt.Sprintf(" ErrSummary: %s", errSummary.Error())
ctx.Done()
klog.V(1).ErrorS(errSummary, "ErrSummary", "document", doc.Filename, "conversation", "")
return
}
klog.V(5).Infof("Generate summarization is done! Summary: %s", summary)
}()
// wait until all finished
wg.Wait()
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: arcadia
description: A Helm chart(KubeBB Component) for KubeAGI Arcadia
type: application
version: 0.2.28
version: 0.2.29
appVersion: "0.1.0"

keywords:
Expand Down
5 changes: 4 additions & 1 deletion deploy/charts/arcadia/templates/ingress-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ metadata:
nginx.ingress.kubernetes.io/load-balance: round_robin
nginx.ingress.kubernetes.io/proxy-body-size: ""
nginx.ingress.kubernetes.io/proxy-buffering: "on"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
nginx.ingress.kubernetes.io/proxy-connect-timeout: 600s
nginx.ingress.kubernetes.io/proxy-next-upstream-timeout: 600s
nginx.ingress.kubernetes.io/proxy-read-timeout: 600s
nginx.ingress.kubernetes.io/proxy-send-timeout: 600s
nginx.ingress.kubernetes.io/server-alias: ""
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/upstream-vhost: $host
Expand Down
7 changes: 6 additions & 1 deletion deploy/charts/arcadia/templates/ingress-fastchat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ metadata:
nginx.ingress.kubernetes.io/load-balance: round_robin
nginx.ingress.kubernetes.io/proxy-body-size: ""
nginx.ingress.kubernetes.io/proxy-buffering: "on"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
# It may take too long when call embedding/llm model,so we increase the proxy-connect-timeout to 600 seoncds
# WIth suggeststion https://stackoverflow.com/questions/24453388/nginx-reverse-proxy-causing-504-gateway-timeout
nginx.ingress.kubernetes.io/proxy-connect-timeout: 600s
nginx.ingress.kubernetes.io/proxy-next-upstream-timeout: 600s
nginx.ingress.kubernetes.io/proxy-read-timeout: 600s
nginx.ingress.kubernetes.io/proxy-send-timeout: 600s
nginx.ingress.kubernetes.io/server-alias: ""
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/upstream-vhost: $host
Expand Down

0 comments on commit 82f6e6e

Please sign in to comment.