Skip to content

Commit 7f0149f

Browse files
committed
fix keycloak not running locally
1 parent 5cf3757 commit 7f0149f

File tree

3 files changed

+214
-149
lines changed

3 files changed

+214
-149
lines changed

.github/workflows/deploy-to-test.yaml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy to Rancher Test (PR branches)
33
on:
44
push:
55
branches:
6-
- '**'
6+
- "**"
77

88
env:
99
REPO_OWNER: aet-devops25
@@ -21,15 +21,15 @@ env:
2121
jobs:
2222
test-genai-service:
2323
runs-on: ubuntu-latest
24-
24+
2525
steps:
2626
- name: Checkout code
2727
uses: actions/checkout@v4
2828

2929
- name: Set up Python 3.11
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: '3.11'
32+
python-version: "3.11"
3333

3434
- name: Cache pip dependencies
3535
uses: actions/cache@v4
@@ -87,7 +87,7 @@ jobs:
8787
docker build -t ${{ env.DOCUMENT_IMAGE }}:$TAG -t ${{ env.DOCUMENT_IMAGE }}:latest -f ${{ env.DOCUMENT_DIR }}/Dockerfile ./server
8888
docker push ${{ env.DOCUMENT_IMAGE }}:$TAG
8989
docker push ${{ env.DOCUMENT_IMAGE }}:latest
90-
90+
9191
- name: Build and Push Anonymization Service Image
9292
run: |
9393
docker build -t ${{ env.ANONYMIZATION_IMAGE }}:$TAG -t ${{ env.ANONYMIZATION_IMAGE }}:latest -f ${{ env.ANONYMIZATION_DIR }}/Dockerfile ./server
@@ -105,3 +105,49 @@ jobs:
105105
docker build -t ${{ env.GENAI_IMAGE }}:$TAG -t ${{ env.GENAI_IMAGE }}:latest -f ${{ env.GENAI_DIR }}/Dockerfile ${{ env.GENAI_DIR }}
106106
docker push ${{ env.GENAI_IMAGE }}:$TAG
107107
docker push ${{ env.GENAI_IMAGE }}:latest
108+
109+
deploy-helm:
110+
name: Deploy to Helm cluster
111+
needs: build-and-push
112+
runs-on: ubuntu-latest
113+
114+
steps:
115+
- name: Checkout code
116+
uses: actions/checkout@v4
117+
118+
- name: Decode Kubeconfig
119+
run: |
120+
mkdir -p $HOME/.kube
121+
echo "${{ secrets.KUBECONFIG }}" | base64 --decode > $HOME/.kube/config
122+
123+
- name: Setup kubectl
124+
uses: azure/setup-kubectl@v3
125+
with:
126+
version: "1.27.2"
127+
128+
- name: Setup Helm
129+
uses: azure/setup-helm@v3
130+
with:
131+
version: "3.11.0"
132+
133+
- name: Deploy via Helm
134+
run: |
135+
helm repo update
136+
137+
helm upgrade --install oopsops-app \
138+
./helm/oopsops \
139+
--namespace oopsops-test \
140+
--create-namespace \
141+
--set client.image.tag=${{ env.TAG }} \
142+
--set document-service.image.tag=${{ env.TAG }} \
143+
--set anonymization-service.image.tag=${{ env.TAG }} \
144+
--set authentication-service.image.tag=${{ env.TAG }} \
145+
--set genai-service.image.tag=${{ env.TAG }} \
146+
147+
- name: Verify rollout
148+
run: |
149+
kubectl rollout status deployment/authentication-service -n oopsops-test
150+
kubectl rollout status deployment/document-service -n oopsops-test
151+
kubectl rollout status deployment/anonymization-service -n oopsops-test
152+
kubectl rollout status deployment/genai-service -n oopsops-test
153+
kubectl rollout status deployment/client -n oopsops-test

docker-compose.yaml

Lines changed: 60 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ services:
77
- "8081:81"
88
depends_on:
99
- client
10-
- document-service
11-
- authentication-service
1210

1311
postgres:
1412
image: postgres:alpine
@@ -71,9 +69,6 @@ services:
7169

7270
authentication-service:
7371
image: ghcr.io/aet-devops25/team-oopsops/server/authentication-service:latest
74-
depends_on:
75-
keycloak:
76-
condition: service_healthy
7772
build:
7873
context: ./server
7974
dockerfile: authentication-service/Dockerfile
@@ -140,80 +135,79 @@ services:
140135
volumes:
141136
- ./keycloak:/opt/keycloak/data/import
142137
environment:
138+
KC_HEALTH_ENABLED: "true"
143139
KEYCLOAK_ADMIN: admin
144140
KEYCLOAK_ADMIN_PASSWORD: admin
145141
healthcheck:
146-
test: ["CMD", "wget", "-q", "-O-", "http://localhost:8080/realms/oopsops/.well-known/openid-configuration"]
147-
interval: 10s
148-
timeout: 5s
149-
retries: 5
142+
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/9000;echo -e 'GET /health/ready HTTP/1.1\r\nhost: http://localhost\r\nConnection: close\r\n\r\n' >&3;if [ $? -eq 0 ]; then echo 'Healthcheck Successful';exit 0;else echo 'Healthcheck Failed';exit 1;fi;"]
143+
interval: 30s
144+
timeout: 10s
145+
retries: 3
150146
ports:
151147
- "8085:8080"
152148
restart: unless-stopped
153149

154150

155-
prometheus:
156-
image: prom/prometheus:v2.52.0
157-
container_name: prometheus
158-
ports:
159-
- "9090:9090"
160-
volumes:
161-
- ./prometheus:/etc/prometheus
162-
- prometheus_data:/prometheus
163-
command:
164-
- '--config.file=/etc/prometheus/prometheus.yml'
165-
- '--storage.tsdb.path=/prometheus'
166-
- '--web.console.libraries=/etc/prometheus/console_libraries'
167-
- '--web.console.templates=/etc/prometheus/consoles'
168-
- '--web.enable-lifecycle'
169-
restart: unless-stopped
151+
# prometheus:
152+
# image: prom/prometheus:v2.52.0
153+
# container_name: prometheus
154+
# ports:
155+
# - "9090:9090"
156+
# volumes:
157+
# - ./prometheus:/etc/prometheus
158+
# - prometheus_data:/prometheus
159+
# command:
160+
# - '--config.file=/etc/prometheus/prometheus.yml'
161+
# - '--storage.tsdb.path=/prometheus'
162+
# - '--web.console.libraries=/etc/prometheus/console_libraries'
163+
# - '--web.console.templates=/etc/prometheus/consoles'
164+
# - '--web.enable-lifecycle'
165+
# restart: unless-stopped
170166

171-
grafana:
172-
image: grafana/grafana-oss:latest
173-
container_name: grafana
174-
ports:
175-
- "3001:3000"
176-
volumes:
177-
- grafana-storage:/var/lib/grafana
178-
- ./grafana/provisioning:/etc/grafana/provisioning:ro
179-
environment:
180-
- GF_SECURITY_ADMIN_USER=admin
181-
- GF_SECURITY_ADMIN_PASSWORD=admin
182-
- GF_USERS_ALLOW_SIGN_UP=false
183-
- GF_FEATURE_TOGGLES_ENABLE=logsInExplore
184-
- GF_LOG_CONSOLECOLORS=true
185-
# entrypoint: ["sh", "-c", "/etc/grafana/provisioning/init_grafana.sh"]
186-
depends_on:
187-
- prometheus
188-
- loki
189-
restart: unless-stopped
167+
# grafana:
168+
# image: grafana/grafana-oss:latest
169+
# container_name: grafana
170+
# ports:
171+
# - "3001:3000"
172+
# volumes:
173+
# - grafana-storage:/var/lib/grafana
174+
# - ./grafana/provisioning:/etc/grafana/provisioning:ro
175+
# environment:
176+
# - GF_SECURITY_ADMIN_USER=admin
177+
# - GF_SECURITY_ADMIN_PASSWORD=admin
178+
# - GF_USERS_ALLOW_SIGN_UP=false
179+
# - GF_FEATURE_TOGGLES_ENABLE=logsInExplore
180+
# - GF_LOG_CONSOLECOLORS=true
181+
# # entrypoint: ["sh", "-c", "/etc/grafana/provisioning/init_grafana.sh"]
182+
# depends_on:
183+
# - prometheus
184+
# - loki
185+
# restart: unless-stopped
190186

191-
promtail:
192-
image: grafana/promtail:latest
193-
volumes:
194-
- /var/lib/docker/containers:/var/lib/docker/containers:ro
195-
- ./promtail/promtail.yml:/etc/promtail/promtail.yml
196-
command: -config.file=/etc/promtail/promtail.yml
197-
depends_on:
198-
- loki
199-
restart: unless-stopped
200-
201-
loki:
202-
image: grafana/loki:2.9.0
203-
ports:
204-
- "3100:3100"
205-
volumes:
206-
- ./loki/loki-config.yaml:/etc/loki/loki-config.yaml:ro
207-
- loki-data:/loki
208-
command: -config.file=/etc/loki/loki-config.yaml
209-
restart: unless-stopped
210-
187+
# promtail:
188+
# image: grafana/promtail:latest
189+
# volumes:
190+
# - /var/lib/docker/containers:/var/lib/docker/containers:ro
191+
# - ./promtail/promtail.yml:/etc/promtail/promtail.yml
192+
# command: -config.file=/etc/promtail/promtail.yml
193+
# depends_on:
194+
# - loki
195+
# restart: unless-stopped
211196

197+
# loki:
198+
# image: grafana/loki:2.9.0
199+
# ports:
200+
# - "3100:3100"
201+
# volumes:
202+
# - ./loki/loki-config.yaml:/etc/loki/loki-config.yaml:ro
203+
# - loki-data:/loki
204+
# command: -config.file=/etc/loki/loki-config.yaml
205+
# restart: unless-stopped
212206

213207
volumes:
214208
postgres-data:
215209
pgadmin-data:
216210
genai-chroma-data:
217-
prometheus_data:
218-
grafana-storage:
219-
loki-data:
211+
# prometheus_data:
212+
# grafana-storage:
213+
# loki-data:

0 commit comments

Comments
 (0)