Skip to content

Commit 5796100

Browse files
committed
feat(database): update TimescaleDB Docker images to pg18
- Changed Docker images in various configurations and test utilities from `timescale/timescaledb:latest-pg17` to `timescale/timescaledb-ha:pg18` for improved performance and compatibility. - Updated the contributing guide, docker-compose file, and multiple test files to reflect the new image version. - Removed outdated documentation files related to GitHub installation flow and backup/restore test utilities to streamline the repository. This commit enhances the database setup by ensuring the use of the latest TimescaleDB version, improving overall stability and performance.
1 parent 1ecb33b commit 5796100

23 files changed

+22
-4306
lines changed

.github/workflows/rust-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ jobs:
250250
251251
services:
252252
timescaledb:
253-
image: timescale/timescaledb:latest-pg17
253+
image: timescale/timescaledb-ha:pg18
254254
env:
255255
POSTGRES_DB: test_db
256256
POSTGRES_USER: test_user

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ docker run -d \
4848
-e POSTGRES_USER=temps \
4949
-e POSTGRES_PASSWORD=temps \
5050
-e POSTGRES_DB=temps \
51-
timescale/timescaledb:latest-pg16
51+
timescale/timescaledb-ha:pg18
5252
```
5353

5454
### Run the Server

crates/temps-analytics-events/src/services/events_service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ mod tests {
15811581
};
15821582

15831583
// Use TimescaleDB with pgvector support
1584-
let postgres_image = GenericImage::new("timescale/timescaledb", "latest-pg17")
1584+
let postgres_image = GenericImage::new("timescale/timescaledb-ha", "pg18")
15851585
.with_exposed_port(ContainerPort::Tcp(5432))
15861586
.with_wait_for(WaitFor::message_on_stderr(
15871587
"database system is ready to accept connections",
@@ -1971,7 +1971,7 @@ mod tests {
19711971
};
19721972

19731973
// Setup PostgreSQL test container with TimescaleDB
1974-
let postgres_image = GenericImage::new("timescale/timescaledb", "latest-pg17")
1974+
let postgres_image = GenericImage::new("timescale/timescaledb-ha", "pg18")
19751975
.with_exposed_port(ContainerPort::Tcp(5432))
19761976
.with_wait_for(WaitFor::message_on_stderr(
19771977
"database system is ready to accept connections",

crates/temps-analytics/src/testing/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl TestDatabase {
2626
Uuid::new_v4().to_string().replace('-', "")
2727
);
2828

29-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
29+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
3030
.with_exposed_port(ContainerPort::Tcp(5432))
3131
.with_env_var("POSTGRES_DB", "test_db")
3232
.with_env_var("POSTGRES_USER", "test_user")

crates/temps-database/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod tests {
1717
#[tokio::test]
1818
async fn test_establish_connection() -> anyhow::Result<()> {
1919
// Start TimescaleDB container
20-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
20+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
2121
.with_env_var("POSTGRES_DB", "postgres")
2222
.with_env_var("POSTGRES_USER", "postgres")
2323
.with_env_var("POSTGRES_PASSWORD", "postgres")
@@ -64,7 +64,7 @@ mod tests {
6464
#[tokio::test]
6565
async fn test_establish_connection_with_migrations() -> anyhow::Result<()> {
6666
// Start TimescaleDB container
67-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
67+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
6868
.with_env_var("POSTGRES_DB", "postgres")
6969
.with_env_var("POSTGRES_USER", "postgres")
7070
.with_env_var("POSTGRES_PASSWORD", "postgres")

crates/temps-database/src/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl SharedContainer {
8686
let password = "test_password";
8787

8888
// Start TimescaleDB container
89-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
89+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
9090
.with_env_var("POSTGRES_DB", db_name)
9191
.with_env_var("POSTGRES_USER", username)
9292
.with_env_var("POSTGRES_PASSWORD", password)
@@ -477,7 +477,7 @@ impl TestDatabase {
477477
password: &str,
478478
) -> anyhow::Result<Self> {
479479
// Start TimescaleDB container
480-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
480+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
481481
.with_env_var("POSTGRES_DB", db_name)
482482
.with_env_var("POSTGRES_USER", username)
483483
.with_env_var("POSTGRES_PASSWORD", password)

crates/temps-migrations/tests/migration_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async fn test_migration_up() -> anyhow::Result<()> {
1717
}
1818

1919
// Start TimescaleDB container
20-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
20+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
2121
.with_env_var("POSTGRES_DB", "postgres")
2222
.with_env_var("POSTGRES_USER", "postgres")
2323
.with_env_var("POSTGRES_PASSWORD", "postgres")
@@ -88,7 +88,7 @@ async fn test_migration_down() -> anyhow::Result<()> {
8888
}
8989

9090
// Start TimescaleDB container
91-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
91+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
9292
.with_env_var("POSTGRES_DB", "postgres")
9393
.with_env_var("POSTGRES_USER", "postgres")
9494
.with_env_var("POSTGRES_PASSWORD", "postgres")
@@ -162,7 +162,7 @@ async fn test_migration_status() -> anyhow::Result<()> {
162162
}
163163

164164
// Start TimescaleDB container
165-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
165+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
166166
.with_env_var("POSTGRES_DB", "postgres")
167167
.with_env_var("POSTGRES_USER", "postgres")
168168
.with_env_var("POSTGRES_PASSWORD", "postgres")
@@ -226,7 +226,7 @@ async fn test_migration_status() -> anyhow::Result<()> {
226226
#[tokio::test]
227227
async fn test_pgvector_extension() -> anyhow::Result<()> {
228228
// Start TimescaleDB container
229-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
229+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
230230
.with_env_var("POSTGRES_DB", "postgres")
231231
.with_env_var("POSTGRES_USER", "postgres")
232232
.with_env_var("POSTGRES_PASSWORD", "postgres")
@@ -336,7 +336,7 @@ async fn test_table_constraints() -> anyhow::Result<()> {
336336
}
337337

338338
// Start TimescaleDB container
339-
let postgres_container = GenericImage::new("timescale/timescaledb", "latest-pg17")
339+
let postgres_container = GenericImage::new("timescale/timescaledb-ha", "pg18")
340340
.with_env_var("POSTGRES_DB", "postgres")
341341
.with_env_var("POSTGRES_USER", "postgres")
342342
.with_env_var("POSTGRES_PASSWORD", "postgres")

crates/temps-providers/src/externalsvc/postgres.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct PostgresInputConfig {
6969
#[schemars(example = "example_ssl_mode", default = "default_ssl_mode_string")]
7070
pub ssl_mode: Option<String>,
7171

72-
/// Docker image to use (defaults to postgres:18-alpine, supports timescaledb/timescaledb-ha:pg17)
72+
/// Docker image to use (defaults to postgres:18-alpine, supports timescale/timescaledb-ha:pg18)
7373
#[serde(default = "default_docker_image")]
7474
#[schemars(example = "example_docker_image", default = "default_docker_image")]
7575
pub docker_image: Option<String>,
@@ -557,7 +557,7 @@ impl PostgresService {
557557
}
558558

559559
/// Extract PostgreSQL major version from Docker image name
560-
/// Examples: "postgres:16-alpine" -> 16, "timescale/timescaledb-ha:pg17" -> 17
560+
/// Examples: "postgres:16-alpine" -> 16, "timescale/timescaledb-ha:pg18" -> 18
561561
fn extract_postgres_version(docker_image: &str) -> Result<u32> {
562562
// Try to extract version from image name
563563
if let Some(tag) = docker_image.split(':').nth(1) {
@@ -1849,12 +1849,12 @@ mod tests {
18491849
password: Some("mypass".to_string()),
18501850
max_connections: 50,
18511851
ssl_mode: Some("disable".to_string()),
1852-
docker_image: Some("timescale/timescaledb-ha:pg17".to_string()),
1852+
docker_image: Some("timescale/timescaledb-ha:pg18".to_string()),
18531853
};
18541854

18551855
let runtime_config: PostgresConfig = config.into();
18561856

1857-
assert_eq!(runtime_config.docker_image, "timescale/timescaledb-ha:pg17");
1857+
assert_eq!(runtime_config.docker_image, "timescale/timescaledb-ha:pg18");
18581858
}
18591859

18601860
#[test]
@@ -2073,7 +2073,7 @@ mod tests {
20732073
("postgres:16.0-alpine", 16),
20742074
("postgres:17.2-alpine", 17),
20752075
("timescale/timescaledb-ha:pg16", 16),
2076-
("timescale/timescaledb-ha:pg17", 17),
2076+
("timescale/timescaledb-ha:pg18", 18),
20772077
("postgres:15", 15),
20782078
("postgres:14.5", 14),
20792079
];

crates/temps-providers/src/handlers/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub struct CreateExternalServiceRequest {
241241
#[derive(Debug, Serialize, Deserialize, ToSchema)]
242242
pub struct UpdateExternalServiceRequest {
243243
pub parameters: HashMap<String, serde_json::Value>,
244-
/// Docker image to use for the service (e.g., "postgres:17-alpine", "timescale/timescaledb-ha:pg17")
244+
/// Docker image to use for the service (e.g., "postgres:18-alpine", "timescale/timescaledb-ha:pg18")
245245
/// When provided, the service will be recreated with the new image while preserving data
246246
#[serde(skip_serializing_if = "Option::is_none")]
247247
pub docker_image: Option<String>,

crates/temps-providers/src/services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub struct ImportExternalServiceRequest {
148148
pub struct UpdateExternalServiceRequest {
149149
pub name: Option<String>,
150150
pub parameters: HashMap<String, serde_json::Value>,
151-
/// Docker image to use for the service (e.g., "postgres:17-alpine", "timescale/timescaledb-ha:pg17")
151+
/// Docker image to use for the service (e.g., "postgres:18-alpine", "timescale/timescaledb-ha:pg18")
152152
/// When provided, the service container will be recreated with the new image
153153
pub docker_image: Option<String>,
154154
}

0 commit comments

Comments
 (0)