Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Use localhost instead of container hostname #748

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions crates/integration_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -41,25 +39,21 @@ 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 = "localhost:8181".to_string();

let read_port = format!("{}:{}", rest_catalog_ip, REST_CATALOG_PORT);
loop {
if !scan_port_addr(&read_port) {
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;
}
}

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()),
Expand Down
9 changes: 4 additions & 5 deletions crates/integration_tests/testdata/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,8 +34,6 @@ services:
- minio
networks:
rest_bridge:
aliases:
- icebergdata.minio
ports:
- 8181:8181
expose:
Expand All @@ -52,10 +50,11 @@ services:
networks:
rest_bridge:
ports:
- 9000:9000
- 9001:9001
expose:
- 9001
- 9000
- 9001
command: ["server", "/data", "--console-address", ":9001"]

mc:
Expand Down
Loading