Skip to content

Commit

Permalink
fix: make Lake indexer work with macos (#392)
Browse files Browse the repository at this point in the history
Update integration-tests/src/env/containers.rs:
* use ipv4 port for macos localstack
* pull from the near-lake-indexer's specific tag that has both macos and linux images

---------

Co-authored-by: Xiangyi Zheng <xiangyi@near.org>
  • Loading branch information
itegulov and ppca authored Dec 1, 2023
1 parent 5e03bf3 commit 6f46b0b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions integration-tests/src/env/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,16 @@ impl<'a> LocalStack<'a> {
.await?;

let s3_address = format!("http://{}:{}", address, Self::S3_CONTAINER_PORT);
let s3_host_port = container.get_host_port_ipv6(Self::S3_CONTAINER_PORT);
let s3_host_address = format!("http://[::1]:{s3_host_port}");
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
let s3_host_address = {
let s3_host_port = container.get_host_port_ipv4(Self::S3_CONTAINER_PORT);
format!("http://127.0.0.1:{s3_host_port}")
};
#[cfg(target_arch = "x86_64")]
let s3_host_address = {
let s3_host_port = container.get_host_port_ipv6(Self::S3_CONTAINER_PORT);
format!("http://[::1]:{s3_host_port}")
};

tracing::info!(
s3_address,
Expand Down Expand Up @@ -600,7 +608,7 @@ impl<'a> LakeIndexer<'a> {

let image = GenericImage::new(
"ghcr.io/near/near-lake-indexer",
"e6519c922435f3d18b5f2ddac5d1ec171ef4dd6b",
"18ef24922fd7b5b8985ea793fdf7a939e57216ba",
)
.with_env_var("AWS_ACCESS_KEY_ID", "FAKE_LOCALSTACK_KEY_ID")
.with_env_var("AWS_SECRET_ACCESS_KEY", "FAKE_LOCALSTACK_ACCESS_KEY")
Expand Down

0 comments on commit 6f46b0b

Please sign in to comment.