This is an automated email from the ASF dual-hosted git repository.
okumin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new f5ce542718d HIVE-29260: Add smoke tests for Docker images (#6238)
f5ce542718d is described below
commit f5ce542718dab6048ff43f2b40bdc19667e0fc7f
Author: Shohei Okumiya <[email protected]>
AuthorDate: Mon Feb 9 16:20:54 2026 +0900
HIVE-29260: Add smoke tests for Docker images (#6238)
* HIVE-29260: Add smoke tests for Docker images
* Change the profile name
* Change the container name
---
.github/workflows/docker-GA-images.yml | 69 ++++++++++++++-
itests/hive-iceberg/pom.xml | 1 -
itests/pom.xml | 14 +++
itests/test-docker/helm/ozone/values.yaml | 30 +++++++
itests/test-docker/k8s/beeline/deployment.yaml | 44 ++++++++++
itests/test-docker/k8s/hadoop/configmap.yaml | 48 +++++++++++
.../test-docker/k8s/hive-metastore/configmap.yaml | 44 ++++++++++
.../test-docker/k8s/hive-metastore/deployment.yaml | 75 ++++++++++++++++
itests/test-docker/k8s/hive-metastore/service.yaml | 30 +++++++
itests/test-docker/k8s/hive/configmap.yaml | 76 +++++++++++++++++
itests/test-docker/k8s/hive/deployment.yaml | 83 ++++++++++++++++++
itests/test-docker/k8s/hive/service.yaml | 27 ++++++
itests/test-docker/pom.xml | 99 ++++++++++++++++++++++
itests/test-docker/scripts/setup.sh | 55 ++++++++++++
itests/test-docker/scripts/teardown.sh | 32 +++++++
itests/test-docker/scripts/test_hive_server2.sh | 24 ++++++
.../iceberg/rest/HiveIcebergRESTCatalogClient.java | 80 +++++++++++++++++
.../iceberg/rest/HiveIcebergRESTCatalogTests.java | 78 +++++++++++++++++
.../rest/HiveIcebergRESTViewCatalogTests.java | 88 +++++++++++++++++++
19 files changed, 994 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/docker-GA-images.yml
b/.github/workflows/docker-GA-images.yml
index 3c2629e1378..9f8e49a549d 100644
--- a/.github/workflows/docker-GA-images.yml
+++ b/.github/workflows/docker-GA-images.yml
@@ -112,6 +112,63 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
+ - name: Build Hive Image locally
+ uses: docker/build-push-action@v4
+ with:
+ context: ./packaging/src/docker/
+ file: ./packaging/src/docker/Dockerfile
+ push: false
+ load: true
+ tags: hive:test
+ build-args:
+ |
+ HIVE_VERSION=${{ env.HIVE_VERSION }}
+ HADOOP_VERSION=${{ env.HADOOP_VERSION }}
+ TEZ_VERSION=${{ env.TEZ_VERSION }}
+ BUILD_ENV=${{ env.BUILD_ENV }}
+
+ - name: Build Standalone Metastore Image locally
+ uses: docker/build-push-action@v4
+ with:
+ context: ./standalone-metastore/packaging/src/docker/
+ file: ./standalone-metastore/packaging/src/docker/Dockerfile
+ push: false
+ load: true
+ tags: hive:standalone-metastore-test
+ build-args:
+ |
+ HIVE_VERSION=${{ env.HIVE_VERSION }}
+ HADOOP_VERSION=${{ env.HADOOP_VERSION }}
+ BUILD_ENV=${{ env.BUILD_ENV }}
+
+ - name: Create k8s cluster
+ uses: helm/kind-action@v1
+
+ - name: Set up Helm
+ uses: azure/setup-helm@v4
+
+ - name: Load images
+ run: kind load docker-image hive:test hive:standalone-metastore-test
--name chart-testing
+
+ - name: Deploy Hive
+ run: |
+ ./itests/test-docker/scripts/setup.sh
+
+ - name: Run JUnit
+ # On workflow_dispatch, the checked-out source code and libraries
could be inconsistent with the specified Hive release
+ if: github.event_name != 'workflow_dispatch'
+ run: |
+ mvn --batch-mode test -Pitests -Pdocker -pl itests/test-docker
+
+ - name: Test HiveServer2
+ run: |
+ ./itests/test-docker/scripts/test_hive_server2.sh
+
+ - name: Clean up k8s
+ run: |
+ ./itests/test-docker/scripts/teardown.sh
+ kind delete cluster --name chart-testing
+
- name: Build and push Hive Image to docker hub
uses: docker/build-push-action@v4
with:
@@ -141,8 +198,16 @@ jobs:
HADOOP_VERSION=${{ env.HADOOP_VERSION }}
BUILD_ENV=${{ env.BUILD_ENV }}
- - name: Dump disk usage on failure
- if: failure()
+ - name: Dump resource space at the end
+ run: |
+ df -h
+ free -h
+
+ - name: Dump resource usage on failure
+ if: failure() || cancelled()
run: |
df -h
du -xh / --max-depth=3 2>/dev/null | sort -h | tail -50
+ free -h
+ ps aux --sort -rss | head -n 30
+ kubectl get pods
diff --git a/itests/hive-iceberg/pom.xml b/itests/hive-iceberg/pom.xml
index 70bdb9bc95a..5e661cc65e9 100644
--- a/itests/hive-iceberg/pom.xml
+++ b/itests/hive-iceberg/pom.xml
@@ -27,7 +27,6 @@
<hive.path.to.root>../..</hive.path.to.root>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<log4j2.debug>false</log4j2.debug>
- <iceberg.version>1.10.0</iceberg.version>
</properties>
<dependencies>
<dependency>
diff --git a/itests/pom.xml b/itests/pom.xml
index 669364573db..f89b4a8e134 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -26,6 +26,8 @@
<properties>
<hive.path.to.root>..</hive.path.to.root>
<wiremock-jre8.version>2.32.0</wiremock-jre8.version>
+ <iceberg.version>1.10.0</iceberg.version>
+ <assertj.version>3.27.3</assertj.version>
</properties>
<modules>
<module>custom-serde</module>
@@ -44,6 +46,7 @@
<module>qtest-druid</module>
<module>qtest-kudu</module>
<module>qtest-iceberg</module>
+ <module>test-docker</module>
<module>hive-iceberg</module>
</modules>
<dependencyManagement>
@@ -69,6 +72,11 @@
<artifactId>hive-metastore</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hive</groupId>
+ <artifactId>hive-standalone-metastore-client</artifactId>
+ <version>${standalone-metastore.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-common</artifactId>
@@ -497,6 +505,12 @@
<artifactId>hive-iceberg-handler</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>${assertj.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
diff --git a/itests/test-docker/helm/ozone/values.yaml
b/itests/test-docker/helm/ozone/values.yaml
new file mode 100644
index 00000000000..49423acba62
--- /dev/null
+++ b/itests/test-docker/helm/ozone/values.yaml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+datanode:
+ replicas: 1
+env:
+# GitHub Actions provide tiny spaces
+- name: OZONE-SITE.XML_hdds.datanode.volume.min.free.space
+ value: "256MB"
+- name: OZONE-SITE.XML_hdds.scm.safemode.enabled
+ value: "false"
+- name: OZONE-SITE.XML_ozone.scm.container.size
+ value: 128MB
+- name: OZONE-SITE.XML_ozone.scm.block.size
+ value: 32MB
+- name: OZONE-SITE.XML_ozone.server.default.replication
+ value: "1"
diff --git a/itests/test-docker/k8s/beeline/deployment.yaml
b/itests/test-docker/k8s/beeline/deployment.yaml
new file mode 100644
index 00000000000..f6d535e3d5a
--- /dev/null
+++ b/itests/test-docker/k8s/beeline/deployment.yaml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ labels:
+ app: beeline
+ name: beeline
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: beeline
+ template:
+ metadata:
+ labels:
+ app: beeline
+ spec:
+ containers:
+ - name: hive-toolbox
+ image: hive:test
+ command:
+ - timeout
+ args:
+ - infinity
+ - sleep
+ - infinity
+ env:
+ - name: TERM
+ value: dumb
diff --git a/itests/test-docker/k8s/hadoop/configmap.yaml
b/itests/test-docker/k8s/hadoop/configmap.yaml
new file mode 100644
index 00000000000..f88a326a4c7
--- /dev/null
+++ b/itests/test-docker/k8s/hadoop/configmap.yaml
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: hadoop-config
+data:
+ core-site.xml: |
+ <configuration>
+ <property>
+ <name>fs.s3a.endpoint</name>
+ <value>http://ozone-s3g-rest:9878</value>
+ </property>
+ <property>
+ <name>fs.s3a.path.style.access</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>fs.s3a.change.detection.version.required</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>fs.s3a.change.detection.mode</name>
+ <value>none</value>
+ </property>
+ <property>
+ <name>fs.s3a.access.key</name>
+ <value>hadoop</value>
+ </property>
+ <property>
+ <name>fs.s3a.secret.key</name>
+ <value>dummy</value>
+ </property>
+ </configuration>
diff --git a/itests/test-docker/k8s/hive-metastore/configmap.yaml
b/itests/test-docker/k8s/hive-metastore/configmap.yaml
new file mode 100644
index 00000000000..72d0ce44762
--- /dev/null
+++ b/itests/test-docker/k8s/hive-metastore/configmap.yaml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: hive-metastore-config
+data:
+ metastore-site.xml: |
+ <configuration>
+ <property>
+ <name>metastore.warehouse.dir</name>
+ <value>s3a://test/test-warehouse</value>
+ </property>
+ <property>
+ <name>hive.metastore.warehouse.external.dir</name>
+ <value>s3a://test/test-warehouse</value>
+ </property>
+ <property>
+ <name>metastore.event.db.notification.api.auth</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>metastore.catalog.servlet.port</name>
+ <value>9001</value>
+ </property>
+ <property>
+ <name>metastore.catalog.servlet.auth</name>
+ <value>none</value>
+ </property>
+ </configuration>
diff --git a/itests/test-docker/k8s/hive-metastore/deployment.yaml
b/itests/test-docker/k8s/hive-metastore/deployment.yaml
new file mode 100644
index 00000000000..cee75d06e0e
--- /dev/null
+++ b/itests/test-docker/k8s/hive-metastore/deployment.yaml
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ labels:
+ app: hive-metastore
+ name: hive-metastore
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: hive-metastore
+ template:
+ metadata:
+ labels:
+ app: hive-metastore
+ spec:
+ initContainers:
+ - name: download-aws-sdk
+ image: ubuntu:26.04
+ command:
+ - /bin/bash
+ args:
+ - -c
+ - |
+ apt-get update
+ apt-get install -y --no-install-recommends ca-certificates wget
+ wget
https://repo1.maven.org/maven2/software/amazon/awssdk/bundle/2.26.19/bundle-2.26.19.jar
-P /tmp/ext-jars
+ volumeMounts:
+ - name: ext-jars
+ mountPath: /tmp/ext-jars
+ containers:
+ - name: hive-metastore
+ image: hive:standalone-metastore-test
+ env:
+ - name: HADOOP_OPTIONAL_TOOLS
+ value: hadoop-aws
+ - name: HIVE_CUSTOM_CONF_DIR
+ value: /etc/hive/conf
+ readinessProbe:
+ tcpSocket:
+ port: 9083
+ volumeMounts:
+ - name: ext-jars
+ mountPath: /tmp/ext-jars
+ - name: hadoop-config
+ mountPath: /etc/hive/conf/core-site.xml
+ subPath: core-site.xml
+ - name: hive-metastore-config
+ mountPath: /etc/hive/conf/metastore-site.xml
+ subPath: metastore-site.xml
+ volumes:
+ - name: ext-jars
+ emptyDir: {}
+ - name: hadoop-config
+ configMap:
+ name: hadoop-config
+ - name: hive-metastore-config
+ configMap:
+ name: hive-metastore-config
diff --git a/itests/test-docker/k8s/hive-metastore/service.yaml
b/itests/test-docker/k8s/hive-metastore/service.yaml
new file mode 100644
index 00000000000..a20052c4ba9
--- /dev/null
+++ b/itests/test-docker/k8s/hive-metastore/service.yaml
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: hive-metastore
+ labels:
+ app: hive-metastore
+spec:
+ ports:
+ - name: thrift
+ port: 9083
+ - name: rest
+ port: 9001
+ selector:
+ app: hive-metastore
diff --git a/itests/test-docker/k8s/hive/configmap.yaml
b/itests/test-docker/k8s/hive/configmap.yaml
new file mode 100644
index 00000000000..7829d80edf0
--- /dev/null
+++ b/itests/test-docker/k8s/hive/configmap.yaml
@@ -0,0 +1,76 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: hive-config
+data:
+ hive-site.xml: |
+ <configuration>
+ <property>
+ <name>hive.metastore.uris</name>
+ <value>thrift://hive-metastore:9083</value>
+ </property>
+ <property>
+ <name>hive.server2.enable.doAs</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>hive.tez.exec.inplace.progress</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>hive.tez.exec.print.summary</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>hive.exec.scratchdir</name>
+ <value>/opt/hive/scratch_dir</value>
+ </property>
+ <property>
+ <name>hive.user.install.directory</name>
+ <value>/opt/hive/install_dir</value>
+ </property>
+ <property>
+ <name>tez.runtime.optimize.local.fetch</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>hive.exec.submit.local.task.via.child</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>hive.compactor.worker.threads</name>
+ <value>1</value>
+ </property>
+ <property>
+ <name>mapreduce.framework.name</name>
+ <value>local</value>
+ </property>
+ <property>
+ <name>tez.local.mode</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>hive.metastore.warehouse.dir</name>
+ <value>s3a://test/test-warehouse</value>
+ </property>
+ <property>
+ <name>hive.metastore.event.db.notification.api.auth</name>
+ <value>false</value>
+ </property>
+ </configuration>
diff --git a/itests/test-docker/k8s/hive/deployment.yaml
b/itests/test-docker/k8s/hive/deployment.yaml
new file mode 100644
index 00000000000..81fb105233f
--- /dev/null
+++ b/itests/test-docker/k8s/hive/deployment.yaml
@@ -0,0 +1,83 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ labels:
+ app: hive
+ name: hive
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: hive
+ template:
+ metadata:
+ labels:
+ app: hive
+ spec:
+ initContainers:
+ - name: download-aws-sdk
+ image: ubuntu:26.04
+ command:
+ - /bin/bash
+ args:
+ - -c
+ - |
+ apt-get update
+ apt-get install -y --no-install-recommends ca-certificates wget
+ wget
https://repo1.maven.org/maven2/software/amazon/awssdk/bundle/2.26.19/bundle-2.26.19.jar
-P /tmp/ext-jars
+ volumeMounts:
+ - name: ext-jars
+ mountPath: /tmp/ext-jars
+ containers:
+ - name: hive
+ image: hive:test
+ env:
+ - name: HADOOP_OPTIONAL_TOOLS
+ value: hadoop-aws
+ - name: AWS_ACCESS_KEY_ID
+ value: hadoop
+ - name: AWS_SECRET_ACCESS_KEY
+ value: dummy
+ - name: IS_RESUME
+ value: "true"
+ - name: SERVICE_NAME
+ value: hiveserver2
+ - name: HIVE_CUSTOM_CONF_DIR
+ value: /etc/hive/conf
+ readinessProbe:
+ tcpSocket:
+ port: 10000
+ volumeMounts:
+ - name: ext-jars
+ mountPath: /tmp/ext-jars
+ - name: hadoop-config
+ mountPath: /etc/hive/conf/core-site.xml
+ subPath: core-site.xml
+ - name: hive-config
+ mountPath: /etc/hive/conf/hive-site.xml
+ subPath: hive-site.xml
+ volumes:
+ - name: ext-jars
+ emptyDir: {}
+ - name: hadoop-config
+ configMap:
+ name: hadoop-config
+ - name: hive-config
+ configMap:
+ name: hive-config
diff --git a/itests/test-docker/k8s/hive/service.yaml
b/itests/test-docker/k8s/hive/service.yaml
new file mode 100644
index 00000000000..60b7b67428b
--- /dev/null
+++ b/itests/test-docker/k8s/hive/service.yaml
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: hive
+ labels:
+ app: hive
+spec:
+ ports:
+ - port: 10000
+ selector:
+ app: hive
diff --git a/itests/test-docker/pom.xml b/itests/test-docker/pom.xml
new file mode 100644
index 00000000000..7983dd1cb58
--- /dev/null
+++ b/itests/test-docker/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.hive</groupId>
+ <artifactId>hive-it</artifactId>
+ <version>4.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>test-docker</artifactId>
+ <packaging>jar</packaging>
+ <name>Hive Integration - Testing Docker images</name>
+ <properties>
+ <hive.path.to.root>../..</hive.path.to.root>
+ <skip.docker.integration.tests>true</skip.docker.integration.tests>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-aws</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-api</artifactId>
+ <version>${iceberg.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-core</artifactId>
+ <version>${iceberg.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-core</artifactId>
+ <version>${iceberg.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-open-api</artifactId>
+ <version>${iceberg.version}</version>
+ <classifier>test-fixtures</classifier>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit.jupiter.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>${skip.docker.integration.tests}</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>docker</id>
+ <properties>
+ <skip.docker.integration.tests>false</skip.docker.integration.tests>
+ </properties>
+ </profile>
+ </profiles>
+</project>
diff --git a/itests/test-docker/scripts/setup.sh
b/itests/test-docker/scripts/setup.sh
new file mode 100755
index 00000000000..9068670e4f4
--- /dev/null
+++ b/itests/test-docker/scripts/setup.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eux
+
+BUCKET=/s3v/test
+
+wait_and_monitor_deployment() {
+ local app="$1"
+ until kubectl rollout status deployment "$app" --timeout=30s; do
+ kubectl get deployment "$app"
+ kubectl get pods -l app="$app"
+ kubectl describe deployment "$app"
+ done
+}
+
+helm repo add ozone https://apache.github.io/ozone-helm-charts/
+helm install ozone ozone/ozone --version 0.2.0 --values
itests/test-docker/helm/ozone/values.yaml --wait
+# Wait for a while because Ozone's Helm chart does not have readiness probes...
+sleep 10
+if kubectl exec statefulset/ozone-om -- ozone sh bucket info "$BUCKET"
>/dev/null 2>&1; then
+ echo "Bucket already exists. Skipping."
+else
+ echo "Bucket does not exist. Creating..."
+ kubectl exec statefulset/ozone-om -- ozone sh bucket create "$BUCKET"
+fi
+
+base_dir=$(dirname "$(cd "$(dirname "$0")" || exit; pwd)")
+
+kubectl apply -f "$base_dir/k8s/*"
+
+wait_and_monitor_deployment hive-metastore
+wait_and_monitor_deployment hive
+wait_and_monitor_deployment beeline
+
+mkdir -p "$base_dir/target"
+nohup kubectl port-forward service/hive-metastore 9083 >
"$base_dir/target/hive-metastore-thrift.log" 2>&1 &
+echo $! > "$base_dir/target/hive-metastore-thrift.pid"
+nohup kubectl port-forward service/hive-metastore 9001 >
"$base_dir/target/hive-metastore-rest.log" 2>&1 &
+echo $! > "$base_dir/target/hive-metastore-rest.pid"
+nohup kubectl port-forward service/ozone-s3g-rest 9878 >
"$base_dir/target/ozone-s3g.log" &
+echo $! > "$base_dir/target/ozone-s3g.pid"
diff --git a/itests/test-docker/scripts/teardown.sh
b/itests/test-docker/scripts/teardown.sh
new file mode 100755
index 00000000000..ac73b652e7b
--- /dev/null
+++ b/itests/test-docker/scripts/teardown.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eux
+
+base_dir=$(dirname "$(cd "$(dirname "$0")" || exit; pwd)")
+
+if [ -f "$base_dir/target/hive-metastore-thrift.pid" ]; then
+ kill $(cat "$base_dir/target/hive-metastore-thrift.pid")
+fi
+if [ -f "$base_dir/target/hive-metastore-rest.pid" ]; then
+ kill $(cat "$base_dir/target/hive-metastore-rest.pid")
+fi
+if [ -f "$base_dir/target/ozone-s3g.pid" ]; then
+ kill $(cat "$base_dir/target/ozone-s3g.pid")
+fi
+
+kubectl delete -f "$base_dir/k8s/*"
+helm uninstall ozone
diff --git a/itests/test-docker/scripts/test_hive_server2.sh
b/itests/test-docker/scripts/test_hive_server2.sh
new file mode 100755
index 00000000000..18561fb62f5
--- /dev/null
+++ b/itests/test-docker/scripts/test_hive_server2.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eux
+
+kubectl exec deployment/beeline -- beeline -u 'jdbc:hive2://hive:10000/' \
+ -e 'create table if not exists test_hive_server2 (id int, name string)
stored by iceberg'
+kubectl exec deployment/beeline -- beeline -u 'jdbc:hive2://hive:10000/' \
+ -e "insert into test_hive_server2 values (1, 'aaa'), (2, 'bbb')"
+kubectl exec deployment/beeline -- beeline -u 'jdbc:hive2://hive:10000/' \
+ -e 'select * from test_hive_server2'
diff --git
a/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogClient.java
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogClient.java
new file mode 100644
index 00000000000..48667576d2f
--- /dev/null
+++
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogClient.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.iceberg.rest;
+
+import java.nio.file.Files;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.iceberg.CatalogProperties;
+import org.apache.iceberg.catalog.Namespace;
+
+class HiveIcebergRESTCatalogClient {
+ private static final Namespace DEFAULT_NS = Namespace.of("default");
+
+ private final RESTCatalog restCatalog;
+ private final Configuration conf;
+
+ HiveIcebergRESTCatalogClient() throws Exception {
+ this(Collections.emptyMap());
+ }
+
+ HiveIcebergRESTCatalogClient(Map<String, String> additionalProperties)
throws Exception {
+ var properties = new HashMap<>(additionalProperties);
+ properties.put(CatalogProperties.URI, "http://localhost:9001/iceberg");
+ restCatalog = RCKUtils.initCatalogClient(properties);
+ conf = new Configuration(false);
+ conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");
+ conf.set("fs.s3a.endpoint", "http://localhost:9878");
+ conf.set("fs.s3a.path.style.access", "true");
+ conf.set("fs.s3a.change.detection.version.required", "false");
+ conf.set("fs.s3a.change.detection.mode", "none");
+ conf.set("fs.s3a.access.key", "hadoop");
+ conf.set("fs.s3a.secret.key", "dummy");
+ conf.set("hadoop.tmp.dir",
Files.createTempDirectory("hive-docker-test").toString());
+ }
+
+ RESTCatalog getRestCatalog() {
+ return restCatalog;
+ }
+
+ void cleanupWarehouse() throws Exception {
+ restCatalog.listNamespaces().stream().filter(namespace ->
!DEFAULT_NS.equals(namespace)).forEach(namespace -> {
+ restCatalog.listTables(namespace).forEach(restCatalog::dropTable);
+ restCatalog.listViews(namespace).forEach(restCatalog::dropView);
+ restCatalog.dropNamespace(namespace);
+ });
+ // Delete the DB directories explicitly since HiveCatalog#dropNamespace
does not wipe them out
+ var warehouseRoot = new Path("s3a://test/test-warehouse");
+ var fs = warehouseRoot.getFileSystem(conf);
+ if (!fs.exists(warehouseRoot)) {
+ return;
+ }
+ for (FileStatus fileStatus : fs.listStatus(warehouseRoot)) {
+ fs.delete(fileStatus.getPath(), true);
+ }
+ }
+
+ void close() throws Exception {
+ cleanupWarehouse();
+ restCatalog.close();
+ }
+}
diff --git
a/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java
new file mode 100644
index 00000000000..680ef9b5758
--- /dev/null
+++
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTCatalogTests.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.iceberg.rest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Map;
+import org.apache.iceberg.catalog.CatalogTests;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+
+class HiveIcebergRESTCatalogTests extends CatalogTests<RESTCatalog> {
+ private static HiveIcebergRESTCatalogClient client;
+
+ @BeforeAll
+ static void beforeClass() throws Exception {
+ client = new HiveIcebergRESTCatalogClient();
+
+ assertThat(client.getRestCatalog().listNamespaces())
+ .withFailMessage("Namespaces list should not contain: %s",
RCKUtils.TEST_NAMESPACES)
+ .doesNotContainAnyElementsOf(RCKUtils.TEST_NAMESPACES);
+ }
+
+ @BeforeEach
+ void before() throws Exception {
+ client.cleanupWarehouse();
+ }
+
+ @AfterAll
+ static void afterClass() throws Exception {
+ client.close();
+ }
+
+ @Override
+ protected RESTCatalog catalog() {
+ return client.getRestCatalog();
+ }
+
+ @Override
+ protected RESTCatalog initCatalog(String catalogName, Map<String, String>
additionalProperties) {
+ try {
+ return new
HiveIcebergRESTCatalogClient(additionalProperties).getRestCatalog();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ protected boolean requiresNamespaceCreate() {
+ return true;
+ }
+
+ @Override
+ protected boolean supportsNamesWithSlashes() {
+ return false;
+ }
+
+ @Override
+ protected boolean supportsServerSideRetry() {
+ return true;
+ }
+}
diff --git
a/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTViewCatalogTests.java
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTViewCatalogTests.java
new file mode 100644
index 00000000000..20041bdbca9
--- /dev/null
+++
b/itests/test-docker/src/test/java/org/apache/iceberg/rest/HiveIcebergRESTViewCatalogTests.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.iceberg.rest;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.iceberg.view.ViewCatalogTests;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+
+class HiveIcebergRESTViewCatalogTests extends ViewCatalogTests<RESTCatalog> {
+ private static HiveIcebergRESTCatalogClient client;
+
+ @BeforeAll
+ static void beforeClass() throws Exception {
+ client = new HiveIcebergRESTCatalogClient();
+
+ assertThat(client.getRestCatalog().listNamespaces())
+ .withFailMessage("Namespaces list should not contain: %s",
RCKUtils.TEST_NAMESPACES)
+ .doesNotContainAnyElementsOf(RCKUtils.TEST_NAMESPACES);
+ }
+
+ @BeforeEach
+ void before() throws Exception {
+ client.cleanupWarehouse();
+ }
+
+ @AfterAll
+ static void afterClass() throws Exception {
+ client.close();
+ }
+
+ @Override
+ protected RESTCatalog catalog() {
+ return client.getRestCatalog();
+ }
+
+ @Override
+ protected RESTCatalog tableCatalog() {
+ return client.getRestCatalog();
+ }
+
+ @Override
+ protected boolean requiresNamespaceCreate() {
+ return true;
+ }
+
+ @Override
+ protected boolean supportsServerSideRetry() {
+ return true;
+ }
+
+ @Override
+ public void completeCreateView() {
+ // This test case requires https://github.com/apache/iceberg/pull/14653
+ }
+
+ @Override
+ public void createAndReplaceViewWithLocation() {
+ // This test case requires https://github.com/apache/iceberg/pull/14653
+ }
+
+ @Override
+ public void createViewWithCustomMetadataLocation() {
+ // This test case requires https://github.com/apache/iceberg/pull/14653
+ }
+
+ @Override
+ public void updateViewLocation() {
+ // This test case requires https://github.com/apache/iceberg/pull/14653
+ }
+}