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

Update MariaDB containers #9554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions modules/mariadb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ dependencies {
api project(':jdbc')

compileOnly project(':r2dbc')
compileOnly 'org.mariadb:r2dbc-mariadb:1.0.3'
compileOnly 'org.mariadb:r2dbc-mariadb:1.3.0'

testImplementation project(':jdbc-test')
testImplementation 'org.mariadb.jdbc:mariadb-java-client:3.4.1'
testImplementation 'org.mariadb.jdbc:mariadb-java-client:3.5.1'

testImplementation testFixtures(project(':r2dbc'))
testRuntimeOnly 'org.mariadb:r2dbc-mariadb:1.0.3'
testRuntimeOnly 'org.mariadb:r2dbc-mariadb:1.3.0'
Comment on lines +7 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use dependabot to update our dependencies. Please revert

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ public class MariaDBContainer<SELF extends MariaDBContainer<SELF>> extends JdbcD

private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("mariadb");

private static final DockerImageName FOUNDATION_IMAGE_NAME = DockerImageName.parse("quay.io/repository/mariadb-foundation/mariadb-devel");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/repository/ shouldn't be part of this. It won't resolve otherwise:

$ podman pull 'quay.io/repository/mariadb-foundation/mariadb-devel:11.7'
Trying to pull quay.io/repository/mariadb-foundation/mariadb-devel:11.7...
Error: initializing source docker://quay.io/repository/mariadb-foundation/mariadb-devel:11.7: reading manifest 11.7 in quay.io/repository/mariadb-foundation/mariadb-devel: unauthorized: access to the requested resource is not authorized


@Deprecated
public static final String DEFAULT_TAG = "10.3.6";
public static final String DEFAULT_TAG = "10.11.10";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default constructor is deprecated and for those using it will bring a new version, which is unexpected. User must declare the version they want to use


public static final String NAME = "mariadb";

Expand Down Expand Up @@ -55,7 +57,7 @@ public MariaDBContainer(String dockerImageName) {

public MariaDBContainer(final DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, FOUNDATION_IMAGE_NAME);

addExposedPort(MARIADB_PORT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import org.testcontainers.utility.DockerImageName;

public interface MariaDBTestImages {
DockerImageName MARIADB_IMAGE = DockerImageName.parse("mariadb:10.3.39");
DockerImageName MARIADB_IMAGE = DockerImageName.parse("mariadb:10.11.10");
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected ConnectionFactoryOptions getOptions(MariaDBContainer<?> container) {

@Override
protected String createR2DBCUrl() {
return "r2dbc:tc:mariadb:///db?TC_IMAGE_TAG=10.3.39";
return "r2dbc:tc:mariadb:///db?TC_IMAGE_TAG=10.11.10";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ public static Iterable<Object[]> data() {
"jdbc:tc:mariadb://hostname/databasename?user=someuser&TC_INITSCRIPT=somepath/init_mariadb.sql",
EnumSet.of(Options.ScriptedSchema, Options.JDBCParams),
},
{ "jdbc:tc:mariadb:10.3.39://hostname/databasename", EnumSet.noneOf(Options.class) },
{ "jdbc:tc:mariadb:10.11.10://hostname/databasename", EnumSet.noneOf(Options.class) },
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?TC_INITSCRIPT=somepath/init_unicode_mariadb.sql&useUnicode=yes&characterEncoding=utf8",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?TC_INITSCRIPT=somepath/init_unicode_mariadb.sql&useUnicode=yes&characterEncoding=utf8",
EnumSet.of(Options.CharacterSet),
},
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?user=someuser&TC_INITSCRIPT=somepath/init_mariadb.sql",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?user=someuser&TC_INITSCRIPT=somepath/init_mariadb.sql",
EnumSet.of(Options.ScriptedSchema, Options.JDBCParams),
},
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?user=someuser&TC_INITFUNCTION=org.testcontainers.jdbc.AbstractJDBCDriverTest::sampleInitFunction",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?user=someuser&TC_INITFUNCTION=org.testcontainers.jdbc.AbstractJDBCDriverTest::sampleInitFunction",
EnumSet.of(Options.ScriptedSchema, Options.JDBCParams),
},
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?user=someuser&password=somepwd&TC_INITSCRIPT=somepath/init_mariadb.sql",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?user=someuser&password=somepwd&TC_INITSCRIPT=somepath/init_mariadb.sql",
EnumSet.of(Options.ScriptedSchema, Options.JDBCParams),
},
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?user=someuser&password=somepwd&TC_INITFUNCTION=org.testcontainers.jdbc.AbstractJDBCDriverTest::sampleInitFunction",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?user=someuser&password=somepwd&TC_INITFUNCTION=org.testcontainers.jdbc.AbstractJDBCDriverTest::sampleInitFunction",
EnumSet.of(Options.ScriptedSchema, Options.JDBCParams),
},
{
"jdbc:tc:mariadb:10.3.39://hostname/databasename?TC_MY_CNF=somepath/mariadb_conf_override",
"jdbc:tc:mariadb:10.11.10://hostname/databasename?TC_MY_CNF=somepath/mariadb_conf_override",
EnumSet.of(Options.CustomIniFile),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testSimple() throws SQLException {
public void testSpecificVersion() throws SQLException {
try (
MariaDBContainer<?> mariadbOldVersion = new MariaDBContainer<>(
MariaDBTestImages.MARIADB_IMAGE.withTag("10.3.39")
MariaDBTestImages.MARIADB_IMAGE.withTag("10.11.10")
)
) {
mariadbOldVersion.start();
Expand All @@ -49,7 +49,7 @@ public void testSpecificVersion() throws SQLException {

assertThat(resultSetString)
.as("The database version can be set using a container rule parameter")
.startsWith("10.3.39");
.startsWith("10.11.10");
}
}

Expand All @@ -59,7 +59,7 @@ public void testMariaDBWithCustomIniFile() throws SQLException {

try (
MariaDBContainer<?> mariadbCustomConfig = new MariaDBContainer<>(
MariaDBTestImages.MARIADB_IMAGE.withTag("10.3.39")
MariaDBTestImages.MARIADB_IMAGE.withTag("10.11.10")
)
.withConfigurationOverride("somepath/mariadb_conf_override")
) {
Expand Down Expand Up @@ -107,7 +107,7 @@ public void testWithOnlyUserReadableCustomIniFile() throws Exception {

try (
MariaDBContainer<?> mariadbCustomConfig = new MariaDBContainer<>(
MariaDBTestImages.MARIADB_IMAGE.withTag("10.3.39")
MariaDBTestImages.MARIADB_IMAGE.withTag("10.11.10")
)
.withConfigurationOverride("somepath/mariadb_conf_override")
) {
Expand Down Expand Up @@ -144,6 +144,18 @@ public void testEmptyPasswordWithRootUser() throws SQLException {
}
}

@Test
public void testFondationImages() throws SQLException {
try (MariaDBContainer<?> mysql = new MariaDBContainer<>("quay.io/repository/mariadb-foundation/mariadb-devel?tab=tags&tag=11.7").withUsername("root")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason to declare .withUsername("root")? It's great to have a test, however, quay has had many outages in the past https://status.redhat.com/history. Not sure we want to cause those failures on our CI system.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering to the quay.io registry component there seems to be one incident in August 2024 since February 2024 when they migrated there. The March 2024 incident looked like deployment rather than pulls.

Did you experience more than these?

There's currently about 300-400 pulls per day on the mariadb-devel image so I'm just hoping its reliable enough for everyone.

mysql.start();

ResultSet resultSet = performQuery(mysql, "SELECT 1");
int resultSetInt = resultSet.getInt(1);

assertThat(resultSetInt).isEqualTo(1);
}
}

private void assertThatCustomIniFileWasUsed(MariaDBContainer<?> mariadb) throws SQLException {
try (ResultSet resultSet = performQuery(mariadb, "SELECT @@GLOBAL.innodb_max_undo_log_size")) {
long result = resultSet.getLong(1);
Expand Down