This is an automated email from the ASF dual-hosted git repository.
liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/main by this push:
new 0942e3c fix: Hms test on macos should use correct arch (#461)
0942e3c is described below
commit 0942e3cd34d0fd19d7b825feafe67428e703a3f5
Author: Renjie Liu <[email protected]>
AuthorDate: Mon Jul 15 21:57:24 2024 +0800
fix: Hms test on macos should use correct arch (#461)
---
crates/catalog/hms/testdata/hms_catalog/Dockerfile | 4 +++-
crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml | 1 +
crates/integrations/datafusion/testdata/docker-compose.yaml | 1 +
.../integrations/datafusion/testdata/hms_catalog/Dockerfile | 2 +-
crates/test_utils/src/docker.rs | 13 +++++++++++++
5 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/crates/catalog/hms/testdata/hms_catalog/Dockerfile
b/crates/catalog/hms/testdata/hms_catalog/Dockerfile
index ff8c9fa..8392e17 100644
--- a/crates/catalog/hms/testdata/hms_catalog/Dockerfile
+++ b/crates/catalog/hms/testdata/hms_catalog/Dockerfile
@@ -13,7 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:8-jre-slim AS build
+FROM --platform=$BUILDPLATFORM openjdk:8-jre-slim AS build
+
+ARG BUILDPLATFORM
RUN apt-get update -qq && apt-get -qq -y install curl
diff --git a/crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml
b/crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml
index b9afac4..181fac1 100644
--- a/crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml
+++ b/crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml
@@ -41,6 +41,7 @@ services:
hive-metastore:
image: iceberg-hive-metastore
build: ./
+ platform: ${DOCKER_DEFAULT_PLATFORM}
expose:
- 9083
environment:
diff --git a/crates/integrations/datafusion/testdata/docker-compose.yaml
b/crates/integrations/datafusion/testdata/docker-compose.yaml
index 2445fc2..be915ab 100644
--- a/crates/integrations/datafusion/testdata/docker-compose.yaml
+++ b/crates/integrations/datafusion/testdata/docker-compose.yaml
@@ -41,6 +41,7 @@ services:
hive-metastore:
image: iceberg-hive-metastore
build: ./hms_catalog/
+ platform: ${DOCKER_DEFAULT_PLATFORM}
expose:
- 9083
environment:
diff --git a/crates/integrations/datafusion/testdata/hms_catalog/Dockerfile
b/crates/integrations/datafusion/testdata/hms_catalog/Dockerfile
index ff8c9fa..abece56 100644
--- a/crates/integrations/datafusion/testdata/hms_catalog/Dockerfile
+++ b/crates/integrations/datafusion/testdata/hms_catalog/Dockerfile
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM openjdk:8-jre-slim AS build
+FROM --platform=$BUILDPLATFORM openjdk:8-jre-slim AS build
RUN apt-get update -qq && apt-get -qq -y install curl
diff --git a/crates/test_utils/src/docker.rs b/crates/test_utils/src/docker.rs
index df3c754..3247fc9 100644
--- a/crates/test_utils/src/docker.rs
+++ b/crates/test_utils/src/docker.rs
@@ -39,10 +39,23 @@ impl DockerCompose {
self.project_name.as_str()
}
+ fn get_os_arch() -> String {
+ let mut cmd = Command::new("docker");
+ cmd.arg("info")
+ .arg("--format")
+ .arg("{{.OSType}}/{{.Architecture}}");
+
+ get_cmd_output(cmd, "Get os arch".to_string())
+ .trim()
+ .to_string()
+ }
+
pub fn run(&self) {
let mut cmd = Command::new("docker");
cmd.current_dir(&self.docker_compose_dir);
+ cmd.env("DOCKER_DEFAULT_PLATFORM", Self::get_os_arch());
+
cmd.args(vec![
"compose",
"-p",