-
Notifications
You must be signed in to change notification settings - Fork 148
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
feat: add odoo 17.0 #260
feat: add odoo 17.0 #260
Conversation
4220049
to
f07bd32
Compare
@@ -0,0 +1,85 @@ | |||
# Odoo dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, how do you decide which package version to freeze ?
@@ -86,7 +86,7 @@ if [ ! -f "${CONFIG_TARGET}" ]; then | |||
fi | |||
|
|||
# Wait until postgres is up | |||
pg_isready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, sorry about this. I proposed the use of pg_isready
(#255), but after seeing this red build I realize it's not working as expected.
It seems pg_isready
is not enough: https://stackoverflow.com/questions/35069027/docker-wait-for-postgresql-to-be-running
There's a 100% dockerized solution to this, but it requires changes in the docker compose files, basically:
db:
...
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-h", "localhost" ]
interval: 5s
timeout: 5s
retries: 5
odoo:
...
depends_on:
db:
condition: service_healthy
NOTE: -h localhost
seems to be very important when running pg_isready
in the db container, as it otherwise may lead to false positives due to the db that's started in the init process.
With this solution we wouldn't really need to wait in the odoo container like we do now, as everything would be handled by docker. However, it's not such a bad idea to wait here too.. but, unfortunately, pg_isready
is not enough 😢
We'd need a wrapper like this it seems:
#!/bin/bash
set -e
# Default value (set to 0 to disable)
PGTIMEOUT=${PGTIMEOUT:-10}
if [ ${PGTIMEOUT:-10} -le 0 ]; then
exit 0
fi
if [ -z "$PGHOST" ]; then
echo "ERROR: PGHOST is not defined" 1>&2
exit 1
fi
echo -n "Waiting for PostgreSQL to be ready ..."
start_time=$(date +%s)
until pg_isready -q -t 1 >/dev/null; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ "$elapsed_time" -ge "$PGTIMEOUT" ]; then
echo "."
echo "Unable to reach PostgreSQL server" 1>&2
exit 1
fi
echo -n "."
done
echo " [OK]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I have just revert, you fix, I will open a PR to use pg_isready as you describe
Co-authored-by: Denis Leemann <[email protected]>
No description provided.