Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docker compose startup script #122

Merged
merged 1 commit into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.9'

services:
elasticsearch:
container_name: temporal-elasticsearch
container_name: temporal-elasticsearch-iwf
environment:
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
Expand All @@ -17,7 +17,7 @@ services:
expose:
- 9200
postgresql:
container_name: temporal-postgresql
container_name: temporal-postgresql-iwf
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
Expand All @@ -27,7 +27,7 @@ services:
expose:
- 5432
temporal:
container_name: temporal
container_name: temporal-iwf
depends_on:
- postgresql
- elasticsearch
Expand All @@ -51,7 +51,7 @@ services:
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
container_name: temporal-admin-tools
container_name: temporal-admin-tools-iwf
depends_on:
- temporal
environment:
Expand All @@ -65,7 +65,7 @@ services:
- ./init.sh:/etc/temporal/init.sh
entrypoint: sh -c "/etc/temporal/init.sh"
temporal-ui:
container_name: temporal-ui
container_name: temporal-ui-iwf
depends_on:
- temporal
environment:
Expand Down
15 changes: 9 additions & 6 deletions docker-compose/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
# use new version of tctl so that we can skip the prompt
tctl config set version next

# TODO break the loop after commands are successful
for run in {1..20}; do
for run in {1..60}; do
sleep 1
tctl namespace register default || true
tctl search-attribute create -name IwfWorkflowType -type Keyword -y || true
tctl search-attribute create -name IwfGlobalWorkflowVersion -type Int -y || true
tctl search-attribute create -name IwfExecutingStateIds -type Keyword -y || true
echo "now trying to register iWF system search attributes..."
if tctl search-attribute create -name IwfWorkflowType -type Keyword -y; then
break
fi
done

tctl search-attribute create -name IwfGlobalWorkflowVersion -type Int -y
tctl search-attribute create -name IwfExecutingStateIds -type Keyword -y

tail -f /dev/null
14 changes: 10 additions & 4 deletions script/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ do
echo "Waiting for ${HOST} to be ready..."
fi
done
# TODO remove this hack by using tctl to make sure namespace is registered
# then remove the hack in init.sh
echo "now waiting 20s for server to be ready, so that another script will register namespace/search attributes. TODO need to remove this hack... see https://github.com/indeedeng/iwf/issues/74"
sleep 20

echo "now waiting 20s for server to be ready, so that another script will register namespace/search attributes."

for run in {1..60}; do
sleep 1
if nc -zv temporal 7233; then
break
fi
done
sleep 2
"${SRC_ROOT}/iwf-server" --config "${CONFIG_TEMPLATE_PATH}" start "$@"