Skip to content

Commit 64a84de

Browse files
committed
Set postgres to exact version that gets bundled.
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
1 parent 4782828 commit 64a84de

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

.cargo/config.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
[env]
2-
POSTGRESQL_VERSION = "15"
2+
# PostgreSQL version that gets bundled with `postgresql_embedded`
3+
#
4+
# - This needs refer to the exact version that is downloaded by
5+
# postgresql_embedded bundle step (e.g. not omit minor or bugfix)
6+
# - Also note that we can't change the major version without making sure
7+
# the database directories in ~/.feldera for users get upgraded too.
8+
POSTGRESQL_VERSION = "15.13.0"

.github/workflows/test-integration.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
--health-timeout=5s \
2424
--health-retries=5 \
2525
${{ vars.FELDERA_IMAGE_NAME }}:sha-${{ github.sha }}
26-
- name: Wait for container to become healthy (max 10s)
26+
- name: Wait for container to become healthy (max 50s)
2727
run: |
2828
for i in {1..50}; do
2929
status=$(docker inspect --format '{{json .State.Health}}' pipeline-manager-no-internet | jq -r .Status 2>/dev/null || echo "starting")
@@ -39,10 +39,10 @@ jobs:
3939
done
4040
echo "Timed out waiting for pipeline-manager to become healthy"
4141
exit 1
42-
- name: Cleanup
42+
- name: Logs & Cleanup
4343
if: always()
4444
run: |
45-
docker logs pipeline-manager-no-internet
45+
docker logs pipeline-manager-no-internet || true
4646
docker rm -f pipeline-manager-no-internet || true
4747
docker network rm no-internet-net || true
4848

crates/pipeline-manager/src/db/pg_setup.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ pub(crate) async fn install(
2525
persistent: bool,
2626
port: Option<u16>,
2727
) -> Result<PostgreSQL, PostgreSQLError> {
28-
let mut pg_settings = PostgreSQLSettings::default();
29-
pg_settings.data_dir = database_dir;
30-
pg_settings.username = "postgres".to_string();
31-
pg_settings.password = "postgres".to_string();
32-
// Set to v15 in build.rs, note that we can't change/upgrade this without making
33-
// sure the database directories in ~/.feldera get upgraded too.
34-
pg_settings.version = VersionReq::from_str(env!("POSTGRESQL_VERSION"))?;
35-
pg_settings.temporary = !persistent;
36-
pg_settings.port = port.unwrap_or(5432);
28+
let pg_settings = PostgreSQLSettings {
29+
data_dir: database_dir,
30+
username: "postgres".to_string(),
31+
password: "postgres".to_string(),
32+
version: VersionReq::from_str(format!("={}", env!("POSTGRESQL_VERSION")).as_str())?,
33+
temporary: !persistent,
34+
port: port.unwrap_or(5432),
35+
..Default::default()
36+
};
3737

3838
let mut postgresql = PostgreSQL::new(pg_settings);
3939
postgresql.setup().await?;

0 commit comments

Comments
 (0)