Skip to content

Commit

Permalink
[DEL] cron instances in docker manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Dec 19, 2023
1 parent c078ddd commit d213056
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 87 deletions.
56 changes: 28 additions & 28 deletions docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
depends_on:
- zeo
- libreoffice
- worker-cron
# - worker-cron
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
Expand All @@ -58,32 +58,32 @@ services:
test: "curl -f localhost:8081/$$PLONE_PATH/@@ok"
labels:
SERVICE_NAME: "instance1"
worker-cron:
image: imiobe/iadelib:dev
command: instance-cron
ports:
- "8087:8087"
networks:
- delib_internal
- delib_external
depends_on:
- zeo
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
- ADMIN_PASSWORD=test
- PUBLIC_URL=http://localhost/PM
- PLONE_PATH=demo
- CLUSTER=iadelib_pm42
- HOSTNAME=worker-cron
volumes:
- ./data/:/data
- tmp:/tmp
- vartmp:/var/tmp
healthcheck:
test: "curl -f localhost:8087/$$PLONE_PATH/@@ok"
labels:
SERVICE_NAME: "worker-cron"
# worker-cron:
# image: imiobe/iadelib:dev
# command: instance-cron
# ports:
# - "8087:8087"
# networks:
# - delib_internal
# - delib_external
# depends_on:
# - zeo
# environment:
# - ZEO_CLIENT_CACHE_SIZE=1000MB
# - ZODB_CACHE_SIZE=100000
# - ADMIN_PASSWORD=test
# - PUBLIC_URL=http://localhost/PM
# - PLONE_PATH=demo
# - CLUSTER=iadelib_pm42
# - HOSTNAME=worker-cron
# volumes:
# - ./data/:/data
# - tmp:/tmp
# - vartmp:/var/tmp
# healthcheck:
# test: "curl -f localhost:8087/$$PLONE_PATH/@@ok"
# labels:
# SERVICE_NAME: "worker-cron"
worker-async:
image: imiobe/iadelib:dev
command: instance-async
Expand All @@ -92,7 +92,7 @@ services:
depends_on:
- zeo
- libreoffice
- worker-cron
# - worker-cron
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
Expand Down
60 changes: 30 additions & 30 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
depends_on:
- zeo
- libreoffice
- worker-cron
# - worker-cron
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
Expand All @@ -62,32 +62,32 @@ services:
labels:
SERVICE_NAME: "instance1"

worker-cron:
image: imiobe/iadelib:latest
command: instance-cron
ports:
- "8087:8087"
networks:
- delib_internal
- delib_external
depends_on:
- zeo
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
- ADMIN_PASSWORD=test
- PUBLIC_URL=http://localhost/PM
- PLONE_PATH=demo
- CLUSTER=iadelib_pm42
- HOSTNAME=worker-cron
volumes:
- ./data:/data
- tmp:/tmp
- vartmp:/var/tmp
healthcheck:
test: "curl -f localhost:8087/$$PLONE_PATH/@@ok"
labels:
SERVICE_NAME: "worker-cron"
# worker-cron:
# image: imiobe/iadelib:latest
# command: instance-cron
# ports:
# - "8087:8087"
# networks:
# - delib_internal
# - delib_external
# depends_on:
# - zeo
# environment:
# - ZEO_CLIENT_CACHE_SIZE=1000MB
# - ZODB_CACHE_SIZE=100000
# - ADMIN_PASSWORD=test
# - PUBLIC_URL=http://localhost/PM
# - PLONE_PATH=demo
# - CLUSTER=iadelib_pm42
# - HOSTNAME=worker-cron
# volumes:
# - ./data:/data
# - tmp:/tmp
# - vartmp:/var/tmp
# healthcheck:
# test: "curl -f localhost:8087/$$PLONE_PATH/@@ok"
# labels:
# SERVICE_NAME: "worker-cron"

worker-async:
image: imiobe/iadelib:latest
Expand Down Expand Up @@ -122,7 +122,7 @@ services:
- delib_external
depends_on:
- zeo
- worker-cron
# - worker-cron
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
Expand All @@ -144,7 +144,7 @@ services:
- tmp:/tmp
- vartmp:/var/tmp
labels:
SERVICE_NAME: "worker-cron"
SERVICE_NAME: "worker-amqp"

maintenance:
image: imiobe/iadelib:latest
Expand All @@ -156,7 +156,7 @@ services:
depends_on:
- zeo
- libreoffice
- worker-cron
# - worker-cron
environment:
- ZEO_CLIENT_CACHE_SIZE=1000MB
- ZODB_CACHE_SIZE=100000
Expand Down
58 changes: 29 additions & 29 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ function setup() {
fi
chmod 777 /data/*
}
function wait_for_cron() {
echo "Waiting for cron"
URL="worker-cron:8087/$PLONE_PATH"
CURL="curl --write-out %{http_code} -so /dev/null $URL/@@ok"
MAX_TRIES=50
INTERVAL=5
set +e
SECONDS=0
response="404"
tries=0
while [[ $response != "200" && $tries -lt $MAX_TRIES ]]
do
sleep $INTERVAL
echo "Waiting for cron"
response=$($CURL)
((tries+=1))
done
set -e
if [[ $tries == "$MAX_TRIES" ]]; then
echo "Failed to reach $URL after $SECONDS s"
exit 1
else
echo "$URL is up. Waited $SECONDS s"
fi
}
# function wait_for_cron() {
# echo "Waiting for cron"
# URL="worker-cron:8087/$PLONE_PATH"
# CURL="curl --write-out %{http_code} -so /dev/null $URL/@@ok"
# MAX_TRIES=50
# INTERVAL=5
# set +e
# SECONDS=0
# response="404"
# tries=0
# while [[ $response != "200" && $tries -lt $MAX_TRIES ]]
# do
# sleep $INTERVAL
# echo "Waiting for cron"
# response=$($CURL)
# ((tries+=1))
# done
# set -e
# if [[ $tries == "$MAX_TRIES" ]]; then
# echo "Failed to reach $URL after $SECONDS s"
# exit 1
# else
# echo "$URL is up. Waited $SECONDS s"
# fi
# }
function start() {
echo "Starting $1"
cmd="bin/$1"
Expand All @@ -61,10 +61,10 @@ function start() {

setup "$1"

PRIORIY="instance-cron instance-debug maintenance script zeoserver"
if [[ "instance" == "$1" || ( ! $PRIORIY == *"$1"* && $# -gt 0 ) ]]; then
wait_for_cron "$1"
fi
#PRIORIY="instance-cron instance-debug maintenance script zeoserver"
#if [[ "instance" == "$1" || ( ! $PRIORIY == *"$1"* && $# -gt 0 ) ]]; then
# wait_for_cron "$1"
#fi

case "$1" in
"")
Expand Down

0 comments on commit d213056

Please sign in to comment.