Skip to content

Commit 3d87e28

Browse files
Merge pull request #45 from basedosdados/chore/separate-services
chore: use chatbot api as a separate service
2 parents 1a3a060 + ca3c68e commit 3d87e28

File tree

20 files changed

+935
-440
lines changed

20 files changed

+935
-440
lines changed

.env.example

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# Backend API host and port
2-
API_HOST=localhost
3-
API_PORT=8000
1+
# Base dos Dados API host and port
2+
WEBSITE_HOST=localhost
3+
WEBSITE_PORT=8080
4+
5+
# Chatbot API host and port
6+
CHATBOT_HOST=localhost
7+
CHATBOT_PORT=8000
48

59
# Log level
610
LOG_LEVEL=DEBUG

.github/workflows/deploy-dev.yaml

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

.github/workflows/deploy-prod.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ jobs:
6060
tag: prod
6161
pullPolicy: Always
6262
env:
63-
API_HOST: api-prod-service
64-
API_PORT: 80
65-
LOG_LEVEL: INFO
66-
LOG_BACKTRACE: true
67-
LOG_DIAGNOSE: false
68-
LOG_ENQUEUE: true
63+
WEBSITE_HOST: api-prod-service
64+
WEBSITE_PORT: 80
65+
CHATBOT_HOST: chatbot-api-prod-service
66+
CHATBOT_PORT: 80
6967
replicas: 1
7068
resources:
7169
requests:

.github/workflows/deploy-staging.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ jobs:
6060
tag: staging
6161
pullPolicy: Always
6262
env:
63-
API_HOST: api-staging-service
64-
API_PORT: 80
65-
LOG_LEVEL: INFO
66-
LOG_BACKTRACE: true
67-
LOG_DIAGNOSE: false
68-
LOG_ENQUEUE: true
63+
WEBSITE_HOST: api-staging-service
64+
WEBSITE_PORT: 80
65+
CHATBOT_HOST: chatbot-api-staging-service
66+
CHATBOT_PORT: 80
6967
replicas: 1
7068
resources:
7169
requests:

.github/workflows/release-dev.yaml

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

charts/basedosdados-chatbot-frontend/templates/deployment.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ spec:
3535
- name: streamlit
3636
containerPort: 8501
3737
env:
38-
{{- $env := .Values.chatbotFrontend.env | default dict }}
39-
- name: API_HOST
40-
value: {{ required ".Values.chatbotFrontend.env.API_HOST is required" $env.API_HOST | quote }}
41-
- name: API_PORT
42-
value: {{ required ".Values.chatbotFrontend.env.API_PORT is required" $env.API_PORT | quote }}
43-
{{- range $key, $value := omit $env "API_HOST" "API_PORT" }}
44-
- name: {{ $key }}
45-
value: {{ $value | quote }}
46-
{{- end }}
38+
- name: WEBSITE_HOST
39+
value: {{ required ".Values.chatbotFrontend.env.WEBSITE_HOST is required" $env.WEBSITE_HOST | quote }}
40+
- name: WEBSITE_PORT
41+
value: {{ required ".Values.chatbotFrontend.env.WEBSITE_PORT is required" $env.WEBSITE_PORT | quote }}
42+
- name: CHATBOT_HOST
43+
value: {{ required ".Values.chatbotFrontend.env.CHATBOT_HOST is required" $env.CHATBOT_HOST | quote }}
44+
- name: CHATBOT_PORT
45+
value: {{ required ".Values.chatbotFrontend.env.CHATBOT_PORT is required" $env.CHATBOT_PORT | quote }}
4746
{{- with .Values.chatbotFrontend.resources }}
4847
resources:
4948
{{- toYaml . | nindent 12 }}

charts/basedosdados-chatbot-frontend/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ spec:
1313
ports:
1414
- name: http
1515
port: 80
16-
targetPort: 8501
16+
targetPort: streamlit

charts/basedosdados-chatbot-frontend/values.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ chatbotFrontend:
1111

1212
# Environment variables
1313
env:
14-
API_HOST: localhost
15-
API_PORT: 8000
16-
LOG_LEVEL: DEBUG
17-
LOG_BACKTRACE: true
18-
LOG_DIAGNOSE: false
19-
LOG_ENQUEUE: true
14+
WEBSITE_HOST: basedosdados-api
15+
WEBSITE_PORT: 8000
16+
CHATBOT_PORT: chatbot-api
17+
CHATBOT_PORT: 8000
2018

2119
# Number of replicas
2220
replicas: 1

0 commit comments

Comments
 (0)