Skip to content

Commit 1beab64

Browse files
committed
Improved collective.big.bang managing
1 parent 4a0f27d commit 1beab64

File tree

6 files changed

+44
-33
lines changed

6 files changed

+44
-33
lines changed

base.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ zope-conf-additional =
171171
${zope-conf:additional}
172172
${zope-conf:amqp}
173173
${zope-conf:zamqp}
174+
environment-vars -=
175+
ACTIVE_BIGBANG True
176+
ADMIN_PASSWORD ${port:admin-password}
174177

175178
[omelette]
176179
recipe = collective.recipe.omelette

docker-dev.cfg

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22
parts +=
33
instance
44
instance-cron
5+
parts -=
6+
instance2
7+
instance3
8+
instance4
9+
instance1
510

611
[zeoserver]
712
file-storage = /data/filestorage/Data.fs
813
blob-storage = /data/blobstorage
914
zeo-address = zeo:8100
1015

11-
[instance1]
16+
[instance]
17+
<= instance1
1218
blob-storage = /data/blobstorage
1319
shared-blob = on
1420
zope-conf-additional =
15-
<product-config five.z2monitor>
16-
bind 0.0.0.0:${port:instance1-monitor}
17-
</product-config>
18-
${zope-conf:additional}
19-
${zope-conf:zamqp}
20-
eggs +=
21-
imio.prometheus
22-
23-
zcml +=
24-
imio.prometheus
21+
<product-config five.z2monitor>
22+
bind 0.0.0.0:${port:instance1-monitor}
23+
</product-config>
24+
${zope-conf:additional}
25+
${zope-conf:zamqp}
2526
environment-vars -=
2627
ACTIVE_BIGBANG True
2728
ADMIN_PASSWORD ${port:admin-password}
29+
2830
; makes shitty json beware
2931
;event-log-custom =
3032
; <syslog>
@@ -39,14 +41,15 @@ environment-vars -=
3941
; level INFO
4042
; </logfile>
4143

44+
[instance-amqp]
45+
blob-storage = /data/blobstorage
46+
4247
[instance-async]
4348
debug-mode = off
49+
blob-storage = /data/blobstorage
4450
environment-vars =
4551
ZC_ASYNC_UUID /data/async-uuid.txt
4652

47-
[instance]
48-
<= instance1
49-
5053
[instance-cron]
5154
<= instance1
5255
blob-storage = /data/blobstorage
@@ -60,9 +63,3 @@ zope-conf-additional =
6063
password ${port:admin-password}
6164
</clock-server>
6265
${zope-conf:zamqp}
63-
eggs +=
64-
collective.big.bang
65-
zcml +=
66-
collective.big.bang
67-
environment-vars +=
68-
ACTIVE_BIGBANG True

docker/Dockerfile-ubuntu-20.04

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ENV ZEO_ADDRESS=zeo:8100 \
9292
OO_PORT=2002 \
9393
USE_STREAM=False \
9494
CUSTOM_TMP=/var/tmp \
95-
ACTIVE_BIGBANG=True \
95+
ACTIVE_BIGBANG=False \
9696
SITE_ID=standard
9797

9898
EXPOSE 8081

docker/docker-compose.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
mem_limit: 200M
1818
mem_reservation: 150M
1919
zeo:
20-
image: imiobe/iadelib:4.2.9
20+
image: imiobe/iadelib:latest
2121
command: zeoserver
2222
environment:
2323
- MOUNTPOINT=demo
@@ -33,7 +33,7 @@ services:
3333
# restart:
3434
# unless-stopped
3535
instance1:
36-
image: imiobe/iadelib:4.2.9
36+
image: imiobe/iadelib:latest
3737
command: instance
3838
ports:
3939
- "20081:8081"
@@ -47,7 +47,6 @@ services:
4747
environment:
4848
- ZEO_CLIENT_CACHE_SIZE=1000MB
4949
- ZODB_CACHE_SIZE=100000
50-
- ADMIN_PASSWORD=tata
5150
- CLUSTER=iadelib_pm42
5251
- MOUNTPOINT=demo
5352
- HOSTNAME=instance1
@@ -61,7 +60,7 @@ services:
6160
labels:
6261
SERVICE_NAME: "instance1"
6362
instance2:
64-
image: imiobe/iadelib:4.2.9
63+
image: imiobe/iadelib:latest
6564
command: instance
6665
ports:
6766
- "20082:8081"
@@ -75,7 +74,6 @@ services:
7574
environment:
7675
- ZEO_CLIENT_CACHE_SIZE=1000MB
7776
- ZODB_CACHE_SIZE=100000
78-
- ADMIN_PASSWORD=tata
7977
- CLUSTER=iadelib_pm42
8078
- MOUNTPOINT=demo
8179
- HOSTNAME=instance2
@@ -89,7 +87,7 @@ services:
8987
labels:
9088
SERVICE_NAME: "instance2"
9189
instance3:
92-
image: imiobe/iadelib:4.2.9
90+
image: imiobe/iadelib:latest
9391
command: instance
9492
ports:
9593
- "20083:8081"
@@ -119,7 +117,7 @@ services:
119117
# restart:
120118
# unless-stopped
121119
worker-cron:
122-
image: imiobe/iadelib:4.2.9
120+
image: imiobe/iadelib:latest
123121
command: instance-cron
124122
ports:
125123
- "8087:8087"
@@ -148,7 +146,7 @@ services:
148146
restart:
149147
unless-stopped
150148
worker-async:
151-
image: imiobe/iadelib:4.2.9
149+
image: imiobe/iadelib:latest
152150
command: instance-async
153151
networks:
154152
- internal
@@ -175,7 +173,7 @@ services:
175173
# restart:
176174
# unless-stopped
177175
worker-amqp:
178-
image: imiobe/iadelib:4.2.9
176+
image: imiobe/iadelib:latest
179177
command: instance-amqp
180178
ports:
181179
- "20085:8286"
@@ -212,7 +210,7 @@ services:
212210
# restart:
213211
# unless-stopped
214212
debug:
215-
image: imiobe/iadelib:4.2.9
213+
image: imiobe/iadelib:latest
216214
entrypoint: bash
217215
ports:
218216
- "20089:8080"

docker/docker-entrypoint.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ set -e
44
PRIORIY="instance-cron zeoserver"
55
CURL="curl --write-out '%{http_code}' -so /dev/null worker-cron:8087/standard/@@ok"
66

7-
mkdir -p -m 777 /data/{log,instance-debug,filestorage,blobstorage,instance-async,instance-amqp,instance1}
7+
mkdir -p -m 777 /data/{log,filestorage,blobstorage}
88
python docker-initialize.py
99

10+
if [[ $MOUNTPOINT ]]
11+
then
12+
mkdir -p -m 777 "/data/blobstorage-$MOUNTPOINT"
13+
fi
14+
1015
if [[ "instance" == "$1" || ! $PRIORIY == *"$1"* ]]
1116
then
12-
echo "Wating instance-cron ..."
17+
echo "Waiting instance-cron ..."
1318
sleep 20
1419
response=$($CURL)
1520
echo "received response $response"
@@ -21,6 +26,13 @@ then
2126
echo "received response $response"
2227
done
2328
fi
29+
30+
if [[ "instance-cron" == "$1" ]]
31+
then
32+
echo "Setting ACTIVE_BIGBANG"
33+
export ACTIVE_BIGBANG="True"
34+
fi
35+
2436
echo "Starting $1"
2537
exec "bin/python" "bin/$1" "fg"
2638

prod.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ zope-conf-additional =
2222
${zope-conf:zamqp}
2323
environment-vars -=
2424
ACTIVE_BIGBANG True
25+
ADMIN_PASSWORD ${port:admin-password}
2526

2627
[instance3]
2728
<= instance2

0 commit comments

Comments
 (0)