Skip to content

Commit 8d71707

Browse files
added llm chatbot service (#242)
* added llm chatbot service
1 parent 0003897 commit 8d71707

28 files changed

Lines changed: 338 additions & 6 deletions

.github/workflows/pr-build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ jobs:
9393
cache-from: type=gha,scope=workshop-service
9494
cache-to: type=gha,mode=max,scope=workshop-service
9595

96+
- name: Build crapi-chatbot image
97+
uses: docker/build-push-action@v3
98+
with:
99+
context: ./services/chatbot
100+
tags: crapi/crapi-chatbot:${{ env.TAG_LATEST }},crapi/crapi-chatbot:${{ env.TAG_NAME }}
101+
push: false
102+
load: true
103+
platforms: linux/amd64
104+
cache-from: type=gha,scope==chatbot-service
105+
cache-to: type=gha,mode=max,scope=chatbot-service
106+
96107
- name: Build crapi-community image
97108
uses: docker/build-push-action@v3
98109
with:

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ jobs:
102102
cache-from: type=gha,scope=workshop-service
103103
cache-to: type=gha,mode=max,scope=workshop-service
104104

105+
- name: Build crapi-chatbot all platforms and push to Docker Hub
106+
uses: docker/build-push-action@v3
107+
with:
108+
context: ./services/chatbot
109+
tags: crapi/crapi-chatbot:${{ env.TAG_LATEST }},crapi/crapi-chatbot:${{ env.TAG_NAME }}
110+
platforms: ${{ env.PLATFORMS }}
111+
push: true
112+
cache-from: type=gha,scope=chatbot-service
113+
cache-to: type=gha,mode=max,scope=chatbot-service
114+
105115
- name: Build crapi-community all platforms and push to Docker Hub
106116
uses: docker/build-push-action@v3
107117
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ deploy/vagrant/.vagrant
33
.secrets
44
.vscode/
55
*.local
6+
services/chatbot/db

deploy/docker/docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ services:
145145
cpus: '0.3'
146146
memory: 128M
147147

148+
crapi-chatbot:
149+
container_name: crapi-chatbot
150+
image: crapi/crapi-chatbot:${VERSION:-latest}
151+
ports:
152+
- "${LISTEN_IP:-127.0.0.1}:5002:5002"
153+
148154
crapi-web:
149155
container_name: crapi-web
150156
image: crapi/crapi-web:${VERSION:-latest}
@@ -155,6 +161,7 @@ services:
155161
- COMMUNITY_SERVICE=crapi-community:${COMMUNITY_SERVER_PORT:-8087}
156162
- IDENTITY_SERVICE=crapi-identity:${IDENTITY_SERVER_PORT:-8080}
157163
- WORKSHOP_SERVICE=crapi-workshop:${WORKSHOP_SERVER_PORT:-8000}
164+
- CHATBOT_SERVICE=crapi-chatbot:${CHATBOT_SERVER_PORT:-5002}
158165
- TLS_ENABLED=${TLS_ENABLED:-false}
159166
depends_on:
160167
crapi-community:

deploy/docker/scripts/load.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ docker load -i gateway-service.tar
33
docker load -i crapi-identity.tar
44
docker load -i crapi-community.tar
55
docker load -i crapi-workshop.tar
6+
docker load -i crapi-chatbot.tar
67
docker load -i crapi-web.tar
78
docker load -i postgres.tar
89
docker load -i mongo.tar

deploy/docker/scripts/save.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ docker save crapi/gateway-service:develop -o gateway-service.tar
33
docker save crapi/crapi-identity:develop -o crapi-identity.tar
44
docker save crapi/crapi-community:develop -o crapi-community.tar
55
docker save crapi/crapi-workshop:develop -o crapi-workshop.tar
6+
docker save crapi/crapi-chatbot:develop -o crapi-chatbot.tar
67
docker save crapi/crapi-web:develop -o crapi-web.tar
78
docker save postgres:14 -o postgres.tar
89
docker save mongo:4.4 -o mongo.tar

deploy/helm/templates/web/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ data:
99
COMMUNITY_SERVICE: {{ .Values.community.service.name }}:{{ .Values.community.port }}
1010
IDENTITY_SERVICE: {{ .Values.identity.service.name }}:{{ .Values.identity.port }}
1111
WORKSHOP_SERVICE: {{ .Values.workshop.service.name }}:{{ .Values.workshop.port }}
12+
CHATBOT_SERVICE: {{ .Values.chatbot.service.name }}:{{ .Values.chatbot.port }}
1213
TLS_ENABLED: {{ .Values.tlsEnabled | quote }}

deploy/helm/values-safe.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ community:
1919
workshop:
2020
image: crapi/crapi-workshop
2121
port: 8000
22+
chatbot:
23+
image: crapi/crapi-chatbot
24+
port: 5002
2225
mailhog:
2326
image: crapi/mailhog
2427
webPort: 8025

deploy/helm/values-tls.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ community:
2222
workshop:
2323
image: crapi/crapi-workshop
2424
port: 8000
25+
chatbot:
26+
image: crapi/crapi-chatbot
27+
port: 5002
2528
mailhog:
2629
image: crapi/mailhog
2730
mongodb:

deploy/helm/values.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,31 @@ workshop:
132132
serviceSelectorLabels:
133133
app: crapi-workshop
134134

135+
chatbot:
136+
name: crapi-chatbot
137+
image: crapi/crapi-chatbot
138+
port: 5002
139+
replicaCount: 1
140+
service:
141+
name: crapi-chatbot
142+
labels:
143+
app: crapi-chatbot
144+
config:
145+
name: crapi-chatbot-configmap
146+
labels:
147+
app: crapi-chatbot
148+
postgresDbDriver: postgres
149+
mongoDbDriver: mongodb
150+
secretKey: crapi
151+
deploymentLabels:
152+
app: crapi-chatbot
153+
podLabels:
154+
app: crapi-chatbot
155+
deploymentSelectorMatchLabels:
156+
app: crapi-chatbot
157+
serviceSelectorLabels:
158+
app: crapi-chatbot
159+
135160
mailhog:
136161
name: mailhog
137162
image: crapi/mailhog

0 commit comments

Comments
 (0)