Skip to content

Commit

Permalink
Override Accumulo Docker entrypoint for Mac
Browse files Browse the repository at this point in the history
Docker containerrs on Mac are not accessible from the host via their IP
addresses. Previously, the Accumulo containers would advertise this IP
address in ZooKeeper, causing the tests to hang when running them on MacOS.
This commit changes that address to 0.0.0.0, which will have Accumulo bind
to all ports and advertise the hostname of the container in ZooKeeper.
We also change the hostname of the container to 'localhost' so clients will
connect to the containers at the local address.
  • Loading branch information
adamjshook authored and electrum committed Jan 31, 2021
1 parent 09c0d4b commit 6ef6769
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugin/trino-accumulo/pom.xml
Expand Up @@ -242,6 +242,7 @@
</dependency>

<!-- for testing -->

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand All @@ -266,6 +267,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java-api</artifactId>
<version>3.2.7</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down
Expand Up @@ -50,6 +50,10 @@ private TestingAccumuloServer()
accumuloContainer.withFixedExposedPort(ACCUMULO_MASTER_PORT, ACCUMULO_MASTER_PORT);
accumuloContainer.withFixedExposedPort(ACCUMULO_TSERVER_PORT, ACCUMULO_TSERVER_PORT);
accumuloContainer.withExposedPorts(ZOOKEEPER_PORT);
accumuloContainer.withCreateContainerCmdModifier(cmd -> cmd
.withHostName("localhost")
.withEnv("ADDRESS=0.0.0.0")
.withEntrypoint("supervisord", "-c", "/etc/supervisord.conf"));
accumuloContainer.waitingFor(Wait.forHealthcheck().withStartupTimeout(Duration.ofMinutes(10)));
accumuloContainer.withCopyFileToContainer(forClasspathResource(ITERATORS_JAR), ACCUMULO_EXT_PATH + "/" + ITERATORS_JAR);

Expand Down

0 comments on commit 6ef6769

Please sign in to comment.