Skip to content

Commit 7d75ee3

Browse files
LucaCanaliLuciferYang
authored andcommitted
[SPARK-45336][TEST] Use Oracle Database 23 Free for integration and testing
### What changes were proposed in this pull request? This proposes to update the Docker image used for integration tests and builds to Oracle Database 23c Free. ### Why are the changes needed? The Docker image used for integration tests and builds currently uses Oracle XE version 21.3.0. Oracle 21 support ends in April 2024. The latest Oracle release is 23c, it is a long-term release supported till 2032. With Oracle 23c, Oracle has changed the name of the free version of its database, from Oracle XE (Express Edition) to Oracle Database Free. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing test infrastructure. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#43123 from LucaCanali/useOracleFreeImage. Authored-by: Luca Canali <luca.canali@cern.ch> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
1 parent 06f4885 commit 7d75ee3

File tree

4 files changed

+37
-31
lines changed

4 files changed

+37
-31
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ jobs:
915915
HIVE_PROFILE: hive2.3
916916
GITHUB_PREV_SHA: ${{ github.event.before }}
917917
SPARK_LOCAL_IP: localhost
918-
ORACLE_DOCKER_IMAGE_NAME: gvenzl/oracle-xe:21.3.0
918+
ORACLE_DOCKER_IMAGE_NAME: gvenzl/oracle-free:23.3
919919
SKIP_MIMA: true
920920
SKIP_PACKAGING: true
921921
steps:

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/OracleIntegrationSuite.scala

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,40 +41,42 @@ import org.apache.spark.tags.DockerTest
4141
* - The documentation on how to build Oracle RDBMS in a container is at
4242
* https://github.com/oracle/docker-images/blob/master/OracleDatabase/SingleInstance/README.md
4343
* - Official Oracle container images can be found at https://container-registry.oracle.com
44-
* - A trustable and streamlined Oracle XE database image can be found on Docker Hub at
45-
* https://hub.docker.com/r/gvenzl/oracle-xe see also https://github.com/gvenzl/oci-oracle-xe
44+
* - Trustable and streamlined Oracle Database Free images can be found on Docker Hub at
45+
* https://hub.docker.com/r/gvenzl/oracle-free
46+
* see also https://github.com/gvenzl/oci-oracle-free
4647
* 2. Run: export ORACLE_DOCKER_IMAGE_NAME=image_you_want_to_use_for_testing
47-
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-xe:latest
48+
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-free:latest
4849
* 3. Run: export ENABLE_DOCKER_INTEGRATION_TESTS=1
4950
* 4. Start docker: sudo service docker start
5051
* - Optionally, docker pull $ORACLE_DOCKER_IMAGE_NAME
5152
* 5. Run Spark integration tests for Oracle with: ./build/sbt -Pdocker-integration-tests
5253
* "docker-integration-tests/testOnly org.apache.spark.sql.jdbc.OracleIntegrationSuite"
5354
*
54-
* A sequence of commands to build the Oracle XE database container image:
55+
* A sequence of commands to build the Oracle Database Free container image:
5556
* $ git clone https://github.com/oracle/docker-images.git
5657
* $ cd docker-images/OracleDatabase/SingleInstance/dockerfiles
57-
* $ ./buildContainerImage.sh -v 21.3.0 -x
58-
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:21.3.0-xe
58+
* $ ./buildContainerImage.sh -v 23.2.0 -f
59+
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:23.2.0-free
5960
*
60-
* This procedure has been validated with Oracle 18.4.0 and 21.3.0 Express Edition.
61+
* This procedure has been validated with Oracle Databae Free version 23.2.0,
62+
* and with Oracle Express Edition versions 18.4.0 and 21.3.0
6163
*/
6264
@DockerTest
6365
class OracleIntegrationSuite extends DockerJDBCIntegrationSuite with SharedSparkSession {
6466
import testImplicits._
6567

6668
override val db = new DatabaseOnDocker {
6769
lazy override val imageName =
68-
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-xe:21.3.0")
70+
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-free:23.3")
6971
val oracle_password = "Th1s1sThe0racle#Pass"
7072
override val env = Map(
7173
"ORACLE_PWD" -> oracle_password, // oracle images uses this
72-
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-xe uses this
74+
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-free uses this
7375
)
7476
override val usesIpc = false
7577
override val jdbcPort: Int = 1521
7678
override def getJdbcUrl(ip: String, port: Int): String =
77-
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/xe"
79+
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/freepdb1"
7880
}
7981

8082
override val connectionTimeout = timeout(7.minutes)

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,25 @@ import org.apache.spark.tags.DockerTest
3636
* - The documentation on how to build Oracle RDBMS in a container is at
3737
* https://github.com/oracle/docker-images/blob/master/OracleDatabase/SingleInstance/README.md
3838
* - Official Oracle container images can be found at https://container-registry.oracle.com
39-
* - A trustable and streamlined Oracle XE database image can be found on Docker Hub at
40-
* https://hub.docker.com/r/gvenzl/oracle-xe see also https://github.com/gvenzl/oci-oracle-xe
39+
* - Trustable and streamlined Oracle Database Free images can be found on Docker Hub at
40+
* https://hub.docker.com/r/gvenzl/oracle-free
41+
* see also https://github.com/gvenzl/oci-oracle-free
4142
* 2. Run: export ORACLE_DOCKER_IMAGE_NAME=image_you_want_to_use_for_testing
42-
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-xe:latest
43+
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-free:latest
4344
* 3. Run: export ENABLE_DOCKER_INTEGRATION_TESTS=1
4445
* 4. Start docker: sudo service docker start
4546
* - Optionally, docker pull $ORACLE_DOCKER_IMAGE_NAME
4647
* 5. Run Spark integration tests for Oracle with: ./build/sbt -Pdocker-integration-tests
4748
* "testOnly org.apache.spark.sql.jdbc.v2.OracleIntegrationSuite"
4849
*
49-
* A sequence of commands to build the Oracle XE database container image:
50+
* A sequence of commands to build the Oracle Database Free container image:
5051
* $ git clone https://github.com/oracle/docker-images.git
5152
* $ cd docker-images/OracleDatabase/SingleInstance/dockerfiles
52-
* $ ./buildContainerImage.sh -v 21.3.0 -x
53-
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:21.3.0-xe
53+
* $ ./buildContainerImage.sh -v 23.2.0 -f
54+
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:23.2.0-free
5455
*
55-
* This procedure has been validated with Oracle 18.4.0 and 21.3.0 Express Edition.
56+
* This procedure has been validated with Oracle Databae Free version 23.2.0,
57+
* and with Oracle Express Edition versions 18.4.0 and 21.3.0
5658
*/
5759
@DockerTest
5860
class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTest {
@@ -74,16 +76,16 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes
7476
override val namespaceOpt: Option[String] = Some("SYSTEM")
7577
override val db = new DatabaseOnDocker {
7678
lazy override val imageName =
77-
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-xe:21.3.0")
79+
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-free:23.3")
7880
val oracle_password = "Th1s1sThe0racle#Pass"
7981
override val env = Map(
8082
"ORACLE_PWD" -> oracle_password, // oracle images uses this
81-
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-xe uses this
83+
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-free uses this
8284
)
8385
override val usesIpc = false
8486
override val jdbcPort: Int = 1521
8587
override def getJdbcUrl(ip: String, port: Int): String =
86-
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/xe"
88+
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/freepdb1"
8789
}
8890

8991
override def sparkConf: SparkConf = super.sparkConf

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleNamespaceSuite.scala

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,25 @@ import org.apache.spark.tags.DockerTest
3232
* - The documentation on how to build Oracle RDBMS in a container is at
3333
* https://github.com/oracle/docker-images/blob/master/OracleDatabase/SingleInstance/README.md
3434
* - Official Oracle container images can be found at https://container-registry.oracle.com
35-
* - A trustable and streamlined Oracle XE database image can be found on Docker Hub at
36-
* https://hub.docker.com/r/gvenzl/oracle-xe see also https://github.com/gvenzl/oci-oracle-xe
35+
* - Trustable and streamlined Oracle Database Free images can be found on Docker Hub at
36+
* https://hub.docker.com/r/gvenzl/oracle-free
37+
* see also https://github.com/gvenzl/oci-oracle-free
3738
* 2. Run: export ORACLE_DOCKER_IMAGE_NAME=image_you_want_to_use_for_testing
38-
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-xe:latest
39+
* - Example: export ORACLE_DOCKER_IMAGE_NAME=gvenzl/oracle-free:latest
3940
* 3. Run: export ENABLE_DOCKER_INTEGRATION_TESTS=1
4041
* 4. Start docker: sudo service docker start
4142
* - Optionally, docker pull $ORACLE_DOCKER_IMAGE_NAME
4243
* 5. Run Spark integration tests for Oracle with: ./build/sbt -Pdocker-integration-tests
4344
* "testOnly org.apache.spark.sql.jdbc.v2.OracleNamespaceSuite"
4445
*
45-
* A sequence of commands to build the Oracle XE database container image:
46+
* A sequence of commands to build the Oracle Database Free container image:
4647
* $ git clone https://github.com/oracle/docker-images.git
4748
* $ cd docker-images/OracleDatabase/SingleInstance/dockerfiles
48-
* $ ./buildContainerImage.sh -v 21.3.0 -x
49-
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:21.3.0-xe
49+
* $ ./buildContainerImage.sh -v 23.2.0 -f
50+
* $ export ORACLE_DOCKER_IMAGE_NAME=oracle/database:23.2.0-free
5051
*
51-
* This procedure has been validated with Oracle 18.4.0 and 21.3.0 Express Edition.
52+
* This procedure has been validated with Oracle Databae Free version 23.2.0,
53+
* and with Oracle Express Edition versions 18.4.0 and 21.3.0
5254
*/
5355
@DockerTest
5456
class OracleNamespaceSuite extends DockerJDBCIntegrationSuite with V2JDBCNamespaceTest {
@@ -57,16 +59,16 @@ class OracleNamespaceSuite extends DockerJDBCIntegrationSuite with V2JDBCNamespa
5759

5860
override val db = new DatabaseOnDocker {
5961
lazy override val imageName =
60-
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-xe:21.3.0")
62+
sys.env.getOrElse("ORACLE_DOCKER_IMAGE_NAME", "gvenzl/oracle-free:23.3")
6163
val oracle_password = "Th1s1sThe0racle#Pass"
6264
override val env = Map(
6365
"ORACLE_PWD" -> oracle_password, // oracle images uses this
64-
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-xe uses this
66+
"ORACLE_PASSWORD" -> oracle_password // gvenzl/oracle-free uses this
6567
)
6668
override val usesIpc = false
6769
override val jdbcPort: Int = 1521
6870
override def getJdbcUrl(ip: String, port: Int): String =
69-
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/xe"
71+
s"jdbc:oracle:thin:system/$oracle_password@//$ip:$port/freepdb1"
7072
}
7173

7274
val map = new CaseInsensitiveStringMap(

0 commit comments

Comments
 (0)