Skip to content

Commit f724f86

Browse files
committed
Update docker configuration to deploy GrimoireLab
Refactor Docker and docker compose configuration to use the latest version of the containers and use the latest version of GrimoireLab core. Remove SortingHat as a service as it is partially included in GrimoireLab core. Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com> [ui] Fix taskId type from Int to ID Fix a bug that caused updating and deleting tasks from the UI to fail. The GraphQL Task type now uses an ID field that accepts both integers and strings, but the UI had not been updated to handle this change. Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com>
1 parent 93efef4 commit f724f86

5 files changed

Lines changed: 92 additions & 180 deletions

File tree

default-grimoirelab-settings/nginx.conf.template

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
upstream sortinghat {
3-
server sortinghat:9314;
4-
}
52
upstream grimoirelab_core {
63
server grimoirelab_core:9314;
74
}
@@ -21,23 +18,6 @@ server {
2118
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
2219
}
2320

24-
location /identities {
25-
rewrite ^/identities/(.*) /$1 break;
26-
27-
include /etc/nginx/uwsgi_params;
28-
uwsgi_pass sortinghat;
29-
uwsgi_param Host $host;
30-
uwsgi_param X-Real-IP $remote_addr;
31-
uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
32-
uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
33-
}
34-
35-
location ~ ^/identities/(css|js|fonts)/ {
36-
rewrite ^/identities/(.*) /$1 break;
37-
38-
root /sortinghat;
39-
}
40-
4121
location /static/ {
4222
alias /grimoirelab_core/;
4323
}
Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,20 @@
1-
version: '2.2'
2-
31
services:
4-
mariadb:
5-
image: mariadb:11.4
6-
ports:
7-
- "3306:3306"
8-
environment:
9-
- MYSQL_ROOT_PASSWORD=
10-
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
11-
healthcheck:
12-
test: [ "CMD", "/usr/local/bin/healthcheck.sh", "--su=root", "--connect", "--innodb_initialized" ]
13-
retries: 5
2+
mariadb:
3+
extends:
4+
file: ./docker-compose.yml
5+
service: mariadb
146

15-
redis:
16-
image: redis:7.4
17-
ports:
18-
- "6379:6379"
19-
healthcheck:
20-
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
21-
retries: 5
7+
redis:
8+
extends:
9+
file: ./docker-compose.yml
10+
service: redis
2211

23-
opensearch-node1:
24-
image: opensearchproject/opensearch:2.11.1
25-
environment:
26-
- cluster.name=opensearch-cluster
27-
- node.name=opensearch-node1
28-
- discovery.type=single-node
29-
- bootstrap.memory_lock=true
30-
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
31-
ulimits:
32-
memlock:
33-
soft: -1
34-
hard: -1
35-
nofile:
36-
soft: 65536
37-
hard: 65536
38-
ports:
39-
- 9200:9200
40-
- 9600:9600
12+
opensearch-node1:
13+
extends:
14+
file: ./docker-compose.yml
15+
service: opensearch-node1
4116

42-
opensearch-dashboards:
43-
image: opensearchproject/opensearch-dashboards:2.11.1
44-
ports:
45-
- 5601:5601
46-
expose:
47-
- "5601"
48-
environment:
49-
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200"]'
17+
opensearch-dashboards:
18+
extends:
19+
file: ./docker-compose.yml
20+
service: opensearch-dashboards

docker-compose/docker-compose.yml

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
version: '2.2'
2-
31
services:
42
mariadb:
53
image: mariadb:11.4
64
expose:
75
- "3306"
86
environment:
9-
- MYSQL_ROOT_PASSWORD=
10-
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
7+
MYSQL_ROOT_PASSWORD: ""
8+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
119
healthcheck:
1210
test: [ "CMD", "/usr/local/bin/healthcheck.sh", "--su=root", "--connect", "--innodb_initialized" ]
1311
retries: 5
12+
volumes:
13+
- mariadb_data:/var/lib/mysql
1414

1515
redis:
1616
image: redis:7.4
@@ -22,7 +22,7 @@ services:
2222

2323
grimoirelab_core:
2424
restart: on-failure:3
25-
image: grimoirelab/grimoirelab:dev
25+
image: grimoirelab/grimoirelab:2.x
2626
environment:
2727
GRIMOIRELAB_DB_HOST: mariadb
2828
GRIMOIRELAB_DB_PORT: 3306
@@ -32,8 +32,8 @@ services:
3232
GRIMOIRELAB_REDIS_HOST: redis
3333
GRIMOIRELAB_REDIS_PORT: 6379
3434
GRIMOIRELAB_REDIS_PASSWORD: ""
35-
GRIMOIRELAB_ARCHIVIST_WORKERS: 20
36-
GRIMOIRELAB_ARCHIVIST_STORAGE_URL: "https://admin:admin@opensearch-node1:9200"
35+
GRIMOIRELAB_SUPERUSER_USERNAME: admin
36+
GRIMOIRELAB_SUPERUSER_PASSWORD: admin
3737
expose:
3838
- "9314"
3939
volumes:
@@ -43,11 +43,11 @@ services:
4343
condition: service_healthy
4444
redis:
4545
condition: service_healthy
46-
command: grimoirelab run server --clear-tasks
46+
command: grimoirelab run server
4747

4848
grimoirelab_core_eventizers:
4949
restart: on-failure:3
50-
image: grimoirelab/grimoirelab:dev
50+
image: grimoirelab/grimoirelab:2.x
5151
environment:
5252
GRIMOIRELAB_DB_HOST: mariadb
5353
GRIMOIRELAB_DB_PORT: 3306
@@ -57,7 +57,6 @@ services:
5757
GRIMOIRELAB_REDIS_HOST: redis
5858
GRIMOIRELAB_REDIS_PORT: 6379
5959
GRIMOIRELAB_REDIS_PASSWORD: ""
60-
GRIMOIRELAB_ARCHIVIST_WORKERS: 20
6160
depends_on:
6261
mariadb:
6362
condition: service_healthy
@@ -67,7 +66,7 @@ services:
6766

6867
grimoirelab_core_archivists:
6968
restart: on-failure:3
70-
image: grimoirelab/grimoirelab:dev
69+
image: grimoirelab/grimoirelab:2.x
7170
environment:
7271
GRIMOIRELAB_DB_HOST: mariadb
7372
GRIMOIRELAB_DB_PORT: 3306
@@ -77,7 +76,9 @@ services:
7776
GRIMOIRELAB_REDIS_HOST: redis
7877
GRIMOIRELAB_REDIS_PORT: 6379
7978
GRIMOIRELAB_REDIS_PASSWORD: ""
80-
GRIMOIRELAB_ARCHIVIST_WORKERS: 20
79+
GRIMOIRELAB_ARCHIVIST_STORAGE_URL: "https://opensearch-node1:9200"
80+
GRIMOIRELAB_ARCHIVIST_STORAGE_USERNAME: "admin"
81+
GRIMOIRELAB_ARCHIVIST_STORAGE_PASSWORD: "GrimoireLab.1"
8182
depends_on:
8283
mariadb:
8384
condition: service_healthy
@@ -87,57 +88,52 @@ services:
8788
condition: service_started
8889
command: grimoirelab run archivists
8990

90-
sortinghat:
91-
restart: on-failure:3
92-
image: grimoirelab/sortinghat
93-
environment:
94-
- SORTINGHAT_SECRET_KEY=secret
95-
- SORTINGHAT_DB_HOST=mariadb
96-
- SORTINGHAT_DB_PORT=3306
97-
- SORTINGHAT_DB_DATABASE=sortinghat_db
98-
- SORTINGHAT_DB_USER=root
99-
- SORTINGHAT_DB_PASSWORD=
100-
- SORTINGHAT_REDIS_HOST=redis
101-
- SORTINGHAT_REDIS_PASSWORD=
102-
- SORTINGHAT_SUPERUSER_USERNAME=admin
103-
- SORTINGHAT_SUPERUSER_PASSWORD=admin
104-
- SORTINGHAT_ALLOWED_HOST=sortinghat,nginx,localhost,127.0.0.1,[::1]
105-
- SORTINGHAT_CORS_ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
106-
expose:
107-
- "9314"
108-
volumes:
109-
- sortinghat-static:/opt/venv/lib/python3.9/site-packages/sortinghat/static/
110-
depends_on:
111-
mariadb:
112-
condition: service_healthy
113-
redis:
114-
condition: service_healthy
91+
grimoirelab_core_ushers:
92+
restart: on-failure:3
93+
image: grimoirelab/grimoirelab:2.x
94+
environment:
95+
GRIMOIRELAB_DB_HOST: mariadb
96+
GRIMOIRELAB_DB_PORT: 3306
97+
GRIMOIRELAB_DB_DATABASE: core_db
98+
GRIMOIRELAB_DB_USER: root
99+
GRIMOIRELAB_DB_PASSWORD: ""
100+
GRIMOIRELAB_REDIS_HOST: redis
101+
GRIMOIRELAB_REDIS_PORT: 6379
102+
GRIMOIRELAB_REDIS_PASSWORD: ""
103+
depends_on:
104+
mariadb:
105+
condition: service_healthy
106+
redis:
107+
condition: service_healthy
108+
command: grimoirelab run ushers
115109

116110
sortinghat_worker:
117111
image: grimoirelab/sortinghat-worker
118112
environment:
119-
- SORTINGHAT_SECRET_KEY=secret
120-
- SORTINGHAT_DB_HOST=mariadb
121-
- SORTINGHAT_DB_PORT=3306
122-
- SORTINGHAT_DB_DATABASE=sortinghat_db
123-
- SORTINGHAT_DB_USER=root
124-
- SORTINGHAT_DB_PASSWORD=
125-
- SORTINGHAT_REDIS_HOST=redis
126-
- SORTINGHAT_REDIS_PASSWORD=
113+
SORTINGHAT_SECRET_KEY: secret
114+
SORTINGHAT_DB_HOST: mariadb
115+
SORTINGHAT_DB_PORT: 3306
116+
SORTINGHAT_DB_DATABASE: core_db
117+
SORTINGHAT_DB_USER: root
118+
SORTINGHAT_DB_PASSWORD: ""
119+
SORTINGHAT_REDIS_HOST: redis
120+
GRIMOIRELAB_REDIS_PORT: 6379
121+
SORTINGHAT_REDIS_PASSWORD: ""
127122
depends_on:
128123
mariadb:
129124
condition: service_healthy
130125
redis:
131126
condition: service_healthy
132127

133128
opensearch-node1:
134-
image: opensearchproject/opensearch:2.11.1
129+
image: opensearchproject/opensearch:3
135130
environment:
136-
- cluster.name=opensearch-cluster
137-
- node.name=opensearch-node1
138-
- discovery.type=single-node
139-
- bootstrap.memory_lock=true
140-
- "OPENSEARCH_JAVA_OPTS=-Xms2g -Xmx2g"
131+
cluster.name: opensearch-cluster
132+
node.name: opensearch-node1
133+
discovery.type: single-node
134+
bootstrap.memory_lock: true
135+
OPENSEARCH_JAVA_OPTS: "-Xms2g -Xmx2g"
136+
OPENSEARCH_INITIAL_ADMIN_PASSWORD: "GrimoireLab.1"
141137
ulimits:
142138
memlock:
143139
soft: -1
@@ -148,9 +144,11 @@ services:
148144
ports:
149145
- 9200:9200
150146
- 9600:9600
147+
volumes:
148+
- opensearch_data:/usr/share/opensearch/data
151149

152150
opensearch-dashboards:
153-
image: opensearchproject/opensearch-dashboards:2.11.1
151+
image: opensearchproject/opensearch-dashboards:3
154152
ports:
155153
- 5601:5601
156154
expose:
@@ -164,17 +162,18 @@ services:
164162
volumes:
165163
- ../default-grimoirelab-settings/nginx.conf.template:/etc/nginx/templates/default.conf.template
166164
- ../default-grimoirelab-settings/uwsgi_params:/etc/nginx/uwsgi_params
167-
- sortinghat-static:/sortinghat:ro
168165
- core-static:/grimoirelab_core:ro
169166
ports:
170167
- 8000:8000
171168
depends_on:
172-
- sortinghat
173169
- grimoirelab_core
174170
healthcheck:
175-
test: "curl -s --head http://localhost:8000/identities/api/ | grep Set-Cookie || exit 1"
171+
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
172+
interval: 30s
173+
timeout: 10s
176174
retries: 5
177175

178176
volumes:
179-
sortinghat-static:
177+
mariadb_data:
178+
opensearch_data:
180179
core-static:

0 commit comments

Comments
 (0)