Skip to content

Commit 0942e3c

Browse files
fix: Hms test on macos should use correct arch (#461)
1 parent 08c46fb commit 0942e3c

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

crates/catalog/hms/testdata/hms_catalog/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
FROM openjdk:8-jre-slim AS build
16+
FROM --platform=$BUILDPLATFORM openjdk:8-jre-slim AS build
17+
18+
ARG BUILDPLATFORM
1719

1820
RUN apt-get update -qq && apt-get -qq -y install curl
1921

crates/catalog/hms/testdata/hms_catalog/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ services:
4141
hive-metastore:
4242
image: iceberg-hive-metastore
4343
build: ./
44+
platform: ${DOCKER_DEFAULT_PLATFORM}
4445
expose:
4546
- 9083
4647
environment:

crates/integrations/datafusion/testdata/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ services:
4141
hive-metastore:
4242
image: iceberg-hive-metastore
4343
build: ./hms_catalog/
44+
platform: ${DOCKER_DEFAULT_PLATFORM}
4445
expose:
4546
- 9083
4647
environment:

crates/integrations/datafusion/testdata/hms_catalog/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
FROM openjdk:8-jre-slim AS build
16+
FROM --platform=$BUILDPLATFORM openjdk:8-jre-slim AS build
1717

1818
RUN apt-get update -qq && apt-get -qq -y install curl
1919

crates/test_utils/src/docker.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,23 @@ impl DockerCompose {
3939
self.project_name.as_str()
4040
}
4141

42+
fn get_os_arch() -> String {
43+
let mut cmd = Command::new("docker");
44+
cmd.arg("info")
45+
.arg("--format")
46+
.arg("{{.OSType}}/{{.Architecture}}");
47+
48+
get_cmd_output(cmd, "Get os arch".to_string())
49+
.trim()
50+
.to_string()
51+
}
52+
4253
pub fn run(&self) {
4354
let mut cmd = Command::new("docker");
4455
cmd.current_dir(&self.docker_compose_dir);
4556

57+
cmd.env("DOCKER_DEFAULT_PLATFORM", Self::get_os_arch());
58+
4659
cmd.args(vec![
4760
"compose",
4861
"-p",

0 commit comments

Comments
 (0)