Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[SPARK-10521] Utilize ipcMode to avoid shared memory issues with DB2
Upgrade docker-client to latest version that has support for passing
ipcMode configuration to docker which will fix DB2 shared memory issues.
  • Loading branch information
lresende committed Apr 9, 2016
commit b9bf63518c249f45f6cbf9c6e06871ade2b5b355
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import java.util.Properties
import org.apache.spark.tags.DockerTest

@DockerTest
class Db2IntegrationSuite extends DockerJDBCIntegrationSuite {
class DB2IntegrationSuite extends DockerJDBCIntegrationSuite {
override val db = new DatabaseOnDocker {
override val imageName = "lresende/db2express-c:10.5.0.5-3.10.0"
override val env = Map(
"DB2INST1_PASSWORD" -> "rootpass",
"LICENSE" -> "accept"
)
override val usesIpc = true
override val jdbcPort: Int = 50000
override def getJdbcUrl(ip: String, port: Int): String =
s"jdbc:db2://$ip:$port/foo:user=db2inst1;password=rootpass;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ abstract class DatabaseOnDocker {
*/
val env: Map[String, String]

/**
* Wheather or not to use ipc mode for shared memory when starting docker image
*/
val usesIpc: Boolean

/**
* The container-internal JDBC port that the database listens on.
*/
Expand Down Expand Up @@ -102,6 +107,7 @@ abstract class DockerJDBCIntegrationSuite
val dockerIp = DockerUtils.getDockerIp()
val hostConfig: HostConfig = HostConfig.builder()
.networkMode("bridge")
.ipcMode(if (db.usesIpc) "host" else "")
.portBindings(
Map(s"${db.jdbcPort}/tcp" -> List(PortBinding.of(dockerIp, externalPort)).asJava).asJava)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationSuite {
override val env = Map(
"MYSQL_ROOT_PASSWORD" -> "rootpass"
)
override val usesIpc = false
override val jdbcPort: Int = 3306
override def getJdbcUrl(ip: String, port: Int): String =
s"jdbc:mysql://$ip:$port/mysql?user=root&password=rootpass"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationSuite with SharedSQLCo
override val env = Map(
"ORACLE_ROOT_PASSWORD" -> "oracle"
)
override val usesIpc = false
override val jdbcPort: Int = 1521
override def getJdbcUrl(ip: String, port: Int): String =
s"jdbc:oracle:thin:system/oracle@//$ip:$port/xe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationSuite {
override val env = Map(
"POSTGRES_PASSWORD" -> "rootpass"
)
override val usesIpc = false
override val jdbcPort = 5432
override def getJdbcUrl(ip: String, port: Int): String =
s"jdbc:postgresql://$ip:$port/postgres?user=postgres&password=rootpass"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@
<groupId>com.spotify</groupId>
<artifactId>docker-client</artifactId>
<classifier>shaded</classifier>
<version>3.5.9</version>
<version>3.6.6</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down