From 1049fb567bb3b229882ff73ee7f592e5b0511197 Mon Sep 17 00:00:00 2001 From: Fokko Date: Sun, 1 Dec 2024 20:50:59 +0100 Subject: [PATCH 1/3] Use localhost instead of container hostname --- crates/integration_tests/src/lib.rs | 12 ++++-------- .../integration_tests/testdata/docker-compose.yaml | 3 ++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/integration_tests/src/lib.rs b/crates/integration_tests/src/lib.rs index 5777a4018..17d7a1d5b 100644 --- a/crates/integration_tests/src/lib.rs +++ b/crates/integration_tests/src/lib.rs @@ -41,11 +41,10 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { // Start docker compose docker_compose.run(); - let rest_catalog_ip = docker_compose.get_container_ip("rest"); + let rest_catalog_addr = format!("localhost:{}", REST_CATALOG_PORT); - let read_port = format!("{}:{}", rest_catalog_ip, REST_CATALOG_PORT); loop { - if !scan_port_addr(&read_port) { + if !scan_port_addr(&rest_catalog_addr) { log::info!("Waiting for 1s rest catalog to ready..."); sleep(std::time::Duration::from_millis(1000)).await; } else { @@ -53,13 +52,10 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { } } - let container_ip = docker_compose.get_container_ip("minio"); - let read_port = format!("{}:{}", container_ip, 9000); - let config = RestCatalogConfig::builder() - .uri(format!("http://{}:{}", rest_catalog_ip, REST_CATALOG_PORT)) + .uri(format!("http://{}", rest_catalog_addr)) .props(HashMap::from([ - (S3_ENDPOINT.to_string(), format!("http://{}", read_port)), + (S3_ENDPOINT.to_string(), "http://localhost:9000".to_string()), (S3_ACCESS_KEY_ID.to_string(), "admin".to_string()), (S3_SECRET_ACCESS_KEY.to_string(), "password".to_string()), (S3_REGION.to_string(), "us-east-1".to_string()), diff --git a/crates/integration_tests/testdata/docker-compose.yaml b/crates/integration_tests/testdata/docker-compose.yaml index 490f4eb94..2dd24d079 100644 --- a/crates/integration_tests/testdata/docker-compose.yaml +++ b/crates/integration_tests/testdata/docker-compose.yaml @@ -52,10 +52,11 @@ services: networks: rest_bridge: ports: + - 9000:9000 - 9001:9001 expose: - - 9001 - 9000 + - 9001 command: ["server", "/data", "--console-address", ":9001"] mc: From 0da54786ef74c08822ef0002ac8623b9486ca2d8 Mon Sep 17 00:00:00 2001 From: Fokko Date: Mon, 2 Dec 2024 06:07:52 +0100 Subject: [PATCH 2/3] Bump Tabular image to something more recent --- crates/integration_tests/src/lib.rs | 4 ++-- crates/integration_tests/testdata/docker-compose.yaml | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/integration_tests/src/lib.rs b/crates/integration_tests/src/lib.rs index 17d7a1d5b..ef222ff57 100644 --- a/crates/integration_tests/src/lib.rs +++ b/crates/integration_tests/src/lib.rs @@ -41,7 +41,7 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { // Start docker compose docker_compose.run(); - let rest_catalog_addr = format!("localhost:{}", REST_CATALOG_PORT); + let rest_catalog_addr = format!("127.0.0.1:{}", REST_CATALOG_PORT); loop { if !scan_port_addr(&rest_catalog_addr) { @@ -55,7 +55,7 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { let config = RestCatalogConfig::builder() .uri(format!("http://{}", rest_catalog_addr)) .props(HashMap::from([ - (S3_ENDPOINT.to_string(), "http://localhost:9000".to_string()), + (S3_ENDPOINT.to_string(), "http://127.0.0.1:9000".to_string()), (S3_ACCESS_KEY_ID.to_string(), "admin".to_string()), (S3_SECRET_ACCESS_KEY.to_string(), "password".to_string()), (S3_REGION.to_string(), "us-east-1".to_string()), diff --git a/crates/integration_tests/testdata/docker-compose.yaml b/crates/integration_tests/testdata/docker-compose.yaml index 2dd24d079..744a329b5 100644 --- a/crates/integration_tests/testdata/docker-compose.yaml +++ b/crates/integration_tests/testdata/docker-compose.yaml @@ -20,12 +20,12 @@ networks: services: rest: - image: tabulario/iceberg-rest:0.10.0 + image: tabulario/iceberg-rest:1.6.0 environment: - AWS_ACCESS_KEY_ID=admin - AWS_SECRET_ACCESS_KEY=password - AWS_REGION=us-east-1 - - CATALOG_CATOLOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog + - CATALOG_CATALOG__IMPL=org.apache.iceberg.jdbc.JdbcCatalog - CATALOG_URI=jdbc:sqlite:file:/tmp/iceberg_rest_mode=memory - CATALOG_WAREHOUSE=s3://icebergdata/demo - CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO @@ -34,8 +34,6 @@ services: - minio networks: rest_bridge: - aliases: - - icebergdata.minio ports: - 8181:8181 expose: From 078eb881b44759597414c3d080d181c7b5da23be Mon Sep 17 00:00:00 2001 From: Fokko Date: Mon, 2 Dec 2024 20:56:42 +0100 Subject: [PATCH 3/3] Add a sleep to give the JVM some more time --- crates/integration_tests/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/integration_tests/src/lib.rs b/crates/integration_tests/src/lib.rs index ef222ff57..3f8f1fbe8 100644 --- a/crates/integration_tests/src/lib.rs +++ b/crates/integration_tests/src/lib.rs @@ -24,8 +24,6 @@ use iceberg_test_utils::{normalize_test_name, set_up}; use port_scanner::scan_port_addr; use tokio::time::sleep; -const REST_CATALOG_PORT: u16 = 8181; - pub struct TestFixture { pub _docker_compose: DockerCompose, pub rest_catalog: RestCatalog, @@ -41,12 +39,12 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { // Start docker compose docker_compose.run(); - let rest_catalog_addr = format!("127.0.0.1:{}", REST_CATALOG_PORT); + let rest_catalog_addr = "localhost:8181".to_string(); loop { + sleep(std::time::Duration::from_millis(1000)).await; if !scan_port_addr(&rest_catalog_addr) { log::info!("Waiting for 1s rest catalog to ready..."); - sleep(std::time::Duration::from_millis(1000)).await; } else { break; } @@ -55,7 +53,7 @@ pub async fn set_test_fixture(func: &str) -> TestFixture { let config = RestCatalogConfig::builder() .uri(format!("http://{}", rest_catalog_addr)) .props(HashMap::from([ - (S3_ENDPOINT.to_string(), "http://127.0.0.1:9000".to_string()), + (S3_ENDPOINT.to_string(), "http://localhost:9000".to_string()), (S3_ACCESS_KEY_ID.to_string(), "admin".to_string()), (S3_SECRET_ACCESS_KEY.to_string(), "password".to_string()), (S3_REGION.to_string(), "us-east-1".to_string()),