You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(docs, testcontainers): add MariaDB support and usage examples
- Updated `CONTRIBUTING.md` and `README.md` with MariaDB-specific details and examples.
- Added `withImage` and MariaDB configuration options to `ClouderaHiveMetastoreContainer`.
- Incremented project version to `0.1.73-SNAPSHOT`.
The PostgreSQL variant uses `ghcr.io/openprojectx/postgres14-jdk17:latest` as its base and keeps the existing tag. The MariaDB variant uses `ghcr.io/openprojectx/mariadb10.6-jdk17:latest` as its base and gets a `-mariadb` tag suffix. The MariaDB image is built with `HMS_DATABASE_TYPE=mariadb`, so it uses `/hive-schema-3.1.3000.mysql.sql`, `org.mariadb.jdbc.Driver`, `useMysqlMetadata=true`, and MariaDB environment variables by default.
86
86
87
+
Smoke-run the published images with Docker:
88
+
89
+
```bash
90
+
docker run --rm --name cloudera-hms -p 9083:9083 -p 5432:5432 ghcr.io/openprojectx/cloudera-hms:latest
91
+
docker run --rm --name cloudera-hms-mariadb -p 9083:9083 -p 3306:3306 ghcr.io/openprojectx/cloudera-hms:latest-mariadb
92
+
```
93
+
94
+
Use `POSTGRES_*` environment variables for the PostgreSQL image and `MARIADB_*` environment variables for the MariaDB image. Both variants expose the Hive Metastore Thrift service on port `9083`.
95
+
87
96
The Jib tasks in `:image` are marked incompatible with Gradle configuration cache because that path has been unstable in this build.
val metastore =ClouderaHiveMetastoreContainer.withImage("my-registry/cloudera-hms:test")
83
+
.withDatabaseType("postgresql")
72
84
.withDatabaseName("metastore_db")
73
85
.withDatabaseUser("hive")
74
86
.withDatabasePassword("hive-password")
75
87
```
76
88
77
-
Or set `CLOUDERA_HMS_TEST_IMAGE` and keep using the default constructor.
89
+
Or set `CLOUDERA_HMS_TEST_IMAGE` and keep using the default constructor. For MariaDB, point it at a `-mariadb` image tag and set `HMS_DATABASE_TYPE` through the wrapper:
Run the MariaDB image normally; it is built with `HMS_DATABASE_TYPE=mariadb` and defaults to `/hive-schema-3.1.3000.mysql.sql`, `org.mariadb.jdbc.Driver`, and a `jdbc:mariadb://127.0.0.1:3306/metastore_db?useMysqlMetadata=true` URL.
132
174
175
+
Run the PostgreSQL image with Docker:
176
+
177
+
```bash
178
+
docker run --rm \
179
+
--name cloudera-hms \
180
+
-p 9083:9083 \
181
+
-p 5432:5432 \
182
+
ghcr.io/openprojectx/cloudera-hms:latest
183
+
```
184
+
185
+
Run the MariaDB image with Docker:
186
+
187
+
```bash
188
+
docker run --rm \
189
+
--name cloudera-hms-mariadb \
190
+
-p 9083:9083 \
191
+
-p 3306:3306 \
192
+
ghcr.io/openprojectx/cloudera-hms:latest-mariadb
193
+
```
194
+
195
+
Both images expose the Hive Metastore Thrift service on `9083`. The PostgreSQL variant also exposes `5432`; the MariaDB variant also exposes `3306`.
196
+
197
+
Override the default database credentials when needed:
198
+
199
+
```bash
200
+
docker run --rm \
201
+
--name cloudera-hms \
202
+
-p 9083:9083 \
203
+
-e POSTGRES_DB=metastore_db \
204
+
-e POSTGRES_USER=hive \
205
+
-e POSTGRES_PASSWORD=hive-password \
206
+
ghcr.io/openprojectx/cloudera-hms:latest
207
+
```
208
+
209
+
```bash
210
+
docker run --rm \
211
+
--name cloudera-hms-mariadb \
212
+
-p 9083:9083 \
213
+
-e MARIADB_DATABASE=metastore_db \
214
+
-e MARIADB_USER=hive \
215
+
-e MARIADB_PASSWORD=hive-password \
216
+
ghcr.io/openprojectx/cloudera-hms:latest-mariadb
217
+
```
218
+
133
219
For contributor-oriented build commands, version alignment, and verification notes, see [CONTRIBUTING.md](/data/Git/cloudera-hms/CONTRIBUTING.md).
Copy file name to clipboardExpand all lines: testcontainers/src/main/kotlin/org/openprojectx/cloudera/hms/testcontainers/ClouderaHiveMetastoreContainer.kt
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,9 @@ class ClouderaHiveMetastoreContainer(
0 commit comments