From 83e0e6b7a0b9dea689c90e34416a195385bbe835 Mon Sep 17 00:00:00 2001 From: charliecheng630 <74488612+charliecheng630@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:41:40 +0800 Subject: [PATCH] [#2379] fix(hive-ci-image): Let user hive be able to access MySQL (#2523) ### What changes were proposed in this pull request? Let user hive be able to access MySQL in gravitino-ci-hive container. ### Why are the changes needed? Fix: #2379 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? existing tests --- catalogs/catalog-hadoop/build.gradle.kts | 2 +- catalogs/catalog-hive/build.gradle.kts | 2 +- catalogs/catalog-lakehouse-iceberg/build.gradle.kts | 2 +- dev/docker/hive/Dockerfile | 8 ++++---- docs/docker-image-details.md | 3 +++ integration-test/build.gradle.kts | 2 +- integration-test/trino-it/docker-compose.yaml | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/catalogs/catalog-hadoop/build.gradle.kts b/catalogs/catalog-hadoop/build.gradle.kts index a5ce82c0980..842c165f7a1 100644 --- a/catalogs/catalog-hadoop/build.gradle.kts +++ b/catalogs/catalog-hadoop/build.gradle.kts @@ -95,7 +95,7 @@ tasks.test { dependsOn(tasks.jar) doFirst { - environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.8") + environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.9") } val init = project.extra.get("initIntegrationTest") as (Test) -> Unit diff --git a/catalogs/catalog-hive/build.gradle.kts b/catalogs/catalog-hive/build.gradle.kts index d368f8a735a..ef761ece212 100644 --- a/catalogs/catalog-hive/build.gradle.kts +++ b/catalogs/catalog-hive/build.gradle.kts @@ -162,7 +162,7 @@ tasks.test { dependsOn(tasks.jar) doFirst { - environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.8") + environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.9") } val init = project.extra.get("initIntegrationTest") as (Test) -> Unit diff --git a/catalogs/catalog-lakehouse-iceberg/build.gradle.kts b/catalogs/catalog-lakehouse-iceberg/build.gradle.kts index e98927d367b..ae61b173cca 100644 --- a/catalogs/catalog-lakehouse-iceberg/build.gradle.kts +++ b/catalogs/catalog-lakehouse-iceberg/build.gradle.kts @@ -161,7 +161,7 @@ tasks.test { dependsOn(tasks.jar) doFirst { - environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.8") + environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.9") } val init = project.extra.get("initIntegrationTest") as (Test) -> Unit diff --git a/dev/docker/hive/Dockerfile b/dev/docker/hive/Dockerfile index 09c36893008..2dbcd786a05 100644 --- a/dev/docker/hive/Dockerfile +++ b/dev/docker/hive/Dockerfile @@ -38,9 +38,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install --fix-missing -yq \ openssh-server \ wget \ sudo \ - openjdk-8-jdk \ - mysql-server \ - && rm -rf /var/lib/apt/lists/* + openjdk-8-jdk ################################################################################# ## setup ssh @@ -125,6 +123,7 @@ ADD hive-site.xml ${HIVE_HOME}/conf/hive-site.xml ENV MYSQL_PWD=ds123 RUN echo "mysql-server mysql-server/root_password password ${MYSQL_PWD}" | debconf-set-selections RUN echo "mysql-server mysql-server/root_password_again password ${MYSQL_PWD}" | debconf-set-selections +RUN apt-get install -y mysql-server RUN chown -R mysql:mysql /var/lib/mysql RUN usermod -d /var/lib/mysql/ mysql @@ -150,8 +149,9 @@ RUN mkdir /home/datastrato RUN chown -R datastrato:hadoop /home/datastrato ################################################################################ -# removed install packages +# removed install packages and cache RUN rm -rf /tmp/packages +RUN rm -rf /var/lib/apt/lists/* ################################################################################ # expose port diff --git a/docs/docker-image-details.md b/docs/docker-image-details.md index 116d81f6ae4..9c826da483b 100644 --- a/docs/docker-image-details.md +++ b/docs/docker-image-details.md @@ -82,6 +82,9 @@ You can use this kind of image to test the catalog of Apache Hive. Changelog +- gravitino-ci-hive:0.1.9 + - Remove cache after installing packages. + - gravitino-ci-hive:0.1.8 - Change the value of `hive.server2.enable.doAs` to `true` diff --git a/integration-test/build.gradle.kts b/integration-test/build.gradle.kts index ed7bc7be574..0aacb8399ab 100644 --- a/integration-test/build.gradle.kts +++ b/integration-test/build.gradle.kts @@ -147,7 +147,7 @@ tasks.test { doFirst { // Gravitino CI Docker image - environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.8") + environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.9") environment("GRAVITINO_CI_TRINO_DOCKER_IMAGE", "datastrato/gravitino-ci-trino:0.1.5") copy { diff --git a/integration-test/trino-it/docker-compose.yaml b/integration-test/trino-it/docker-compose.yaml index ed783265b12..c099a919e8a 100644 --- a/integration-test/trino-it/docker-compose.yaml +++ b/integration-test/trino-it/docker-compose.yaml @@ -6,7 +6,7 @@ version: '3.0' services: hive: - image: datastrato/gravitino-ci-hive:0.1.8 + image: datastrato/gravitino-ci-hive:0.1.9 networks: - trino-net container_name: trino-ci-hive