Fix review app / demo functionality
Background
Recently, review app deployments started timing out for no reason that was immediately apparent. This can be seen locally by attempting to run make demo-pull demo
. The underlying issues:
-
postgresql-client
is installed in thebase
build target with default ubuntu postgres (v10) - in the
dev
build target we add the postgres repo to install postgres v14 - in the review build target, only the v10 postgres files are copied:
COPY --from=dev --chown=ella-user:ella-user /usr/share/postgresql/10 /usr/share/postgresql/10
- The [common_pg_startup][ops/common/common_pg_startup] script explicitly calls v14 binaries (
/usr/lib/postgresql/14/bin/initdb
), which do not exist in the review image
Implementation
- in
base
build target:- Add the postgres repo
- Use
ENV POSTGRES_VERSION
to set the postgres version in a single location - Install
postgresql-client-$POSTGRES_VERSION
- in
dev
build target:- Install
postgresql-$POSTGRES_VERSION postgresql-contrib-$POSTGRES_VERSION
- Install
- in
review
build target:- Use unversioned path for postgres files copied from
dev
build target - Also copy the
/usr/share/postgres-common
fromdev
- Use unversioned path for postgres files copied from
Edited by Tor Solli-Nowlan