DBZ-6216 Update testcontainers to use quay.io images

When needed update also version.
Update also leftovers in readme files.
This commit is contained in:
Vojtech Juranek 2023-04-05 13:49:28 +02:00 committed by Jiri Pechanec
parent 434833e179
commit 44f2f40c56
13 changed files with 19 additions and 19 deletions

View File

@ -43,7 +43,7 @@ public static DebeziumContainer getDebeziumContainer() {
}
public static void setupDebeziumContainer(String debeziumContainerImageVersion) {
DEBEZIUM_CONTAINER = new DebeziumContainer(DockerImageName.parse("debezium/connect:" + debeziumContainerImageVersion))
DEBEZIUM_CONTAINER = new DebeziumContainer(DockerImageName.parse("quay.io/debezium/connect:" + debeziumContainerImageVersion))
.withEnv("ENABLE_DEBEZIUM_SCRIPTING", "true")
.withEnv("CONNECT_REST_EXTENSION_CLASSES", "io.debezium.kcrestextension.DebeziumConnectRestExtension")
.withNetwork(NETWORK)

View File

@ -49,7 +49,7 @@ public class MySqlParserIT extends AbstractConnectorTest {
@Before
public void beforeEach() {
String mysqlImage = ContainerImageVersions.getStableImage("debezium/example-mysql");
String mysqlImage = ContainerImageVersions.getStableImage("quay.io/debezium/example-mysql");
DockerImageName mysqlDockerImageName = DockerImageName.parse(mysqlImage).asCompatibleSubstituteFor("mysql");
mySQLContainer = new MySQLContainer<>(mysqlDockerImageName)
.withDatabaseName("mysql")

View File

@ -2,7 +2,7 @@ This module uses the [quay.io/debezium/postgres:10.0](https://github.com/debeziu
## Using the PostgreSQL Server
As mentioned in the [README.md]() file, our Maven build can be used to start a container using either one of these images. The `debezium/postgres:10.0` image is used:
As mentioned in the [README.md]() file, our Maven build can be used to start a container using either one of these images. The `quay.io/debezium/postgres:10` image is used:
$ mvn docker:start
@ -16,6 +16,6 @@ To stop and remove the container, simply use the following commands:
Although using the Maven command is far simpler, the Maven command really just runs a Docker command to start the container, so it's equivalent to:
$ docker run -it -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres quay.io/debezium/postgres:10.0 postgres
$ docker run -it -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres quay.io/debezium/postgres:10 postgres
This will use the `quay.io/debezium/postgres:10.0` image to start a new container where the PostgreSQL instance uses the settings from [the container image](https://github.com/debezium/container-images/tree/main/postgres/10/postgresql.conf.sample)
This will use the `quay.io/debezium/postgres:10` image to start a new container where the PostgreSQL instance uses the settings from [the container image](https://github.com/debezium/container-images/tree/main/postgres/10/postgresql.conf.sample)

View File

@ -19,8 +19,8 @@ This module contains both unit tests and integration tests.
A *unit test* is a JUnit test class named `*Test.java` or `Test*.java` that never requires or uses external services, though it can use the file system and can run any components within the same JVM process. They should run very quickly, be independent of each other, and clean up after itself.
An *integration test* is a JUnit test class named `*IT.java` or `IT*.java` that uses a PostgreSQL database server running in a custom Docker container based upon the [debezium/postgres:9.6](https://github.com/debezium/container-images/tree/main/postgres/9.6) Docker image maintained by the Debezium team.
This docker image uses a default PostgreSQL 9.6 image on top of which it installs the [Debezium Logical Decoding plugin](https://github.com/debezium/postgres-decoderbufs) which is required in order to be able to receive database events.
An *integration test* is a JUnit test class named `*IT.java` or `IT*.java` that uses a PostgreSQL database server running in a custom Docker container based upon the [quay.io/debezium/postgres:10](https://github.com/debezium/container-images/tree/main/postgres/10) Docker image maintained by the Debezium team.
This docker image uses a default PostgreSQL 10 image on top of which it installs the [Debezium Logical Decoding plugin](https://github.com/debezium/postgres-decoderbufs) which is required in order to be able to receive database events.
The build will automatically start the PostgreSQL container before the integration tests are run and automatically stop and remove it after all of the integration tests complete (regardless of whether they succeed or fail).
Running `mvn install` will compile all code and run the unit and integration tests. If there are any compile problems or any of the unit tests fail, the build will stop immediately. Otherwise, the command will continue to create the module's artifacts, create the Docker image with PostgreSQL and custom scripts, start the Docker container, run the integration tests, stop the container (even if there are integration test failures), and run checkstyle on the code. If there are still no problems, the build will then install the module's artifacts into the local Maven repository.

View File

@ -45,7 +45,7 @@ public class PostgresShutdownIT extends AbstractConnectorTest {
private static final Logger LOGGER = LoggerFactory.getLogger(PostgresShutdownIT.class);
private static final String POSTGRES_IMAGE = ContainerImageVersions.getStableImage("debezium/example-postgres");
private static final String POSTGRES_IMAGE = ContainerImageVersions.getStableImage("quay.io/debezium/example-postgres");
private static final String INSERT_STMT = "INSERT INTO s1.a (aa) VALUES (1);" +
"INSERT INTO s2.a (aa) VALUES (1);";

View File

@ -20,7 +20,7 @@
*/
public class DatabaseTestResource implements QuarkusTestResourceLifecycleManager {
private static final String POSTGRES_IMAGE = "debezium/postgres:11";
private static final String POSTGRES_IMAGE = "quay.io/debezium/postgres:15";
private static final DockerImageName POSTGRES_DOCKER_IMAGE_NAME = DockerImageName.parse(POSTGRES_IMAGE)
.asCompatibleSubstituteFor("postgres");

View File

@ -20,7 +20,7 @@
*/
public class DatabaseTestResource implements QuarkusTestResourceLifecycleManager {
private static final String POSTGRES_IMAGE = "debezium/postgres:11";
private static final String POSTGRES_IMAGE = "quay.io/debezium/postgres:15";
private static final DockerImageName POSTGRES_DOCKER_IMAGE_NAME = DockerImageName.parse(POSTGRES_IMAGE)
.asCompatibleSubstituteFor("postgres");

View File

@ -35,7 +35,7 @@ The following properties can be set to further configure image build
| -----| ------------- | ----------- |
| image.push.skip | true | Skips push to remote registry |
| image.push.registry | quay.io | remote registry base |
| image.name | debezium/kafka:${project.version}-${image.version.strimzi}-kafka-${version.kafka} | Name of built image |
| image.name | quay.io/debezium/kafka:${project.version}-${image.version.strimzi}-kafka-${version.kafka} | Name of built image |
| image.fullname | ${image.push.registry}/${image.name} | Full name of the built image |
| image.base.name | strimzi/kafka:${image.version.strimzi}-kafka-${version.kafka} | Base for built image |
| image.version.strimzi | latest | Version of Strimzi Kafka image |

View File

@ -40,8 +40,8 @@
*/
public class DebeziumContainer extends GenericContainer<DebeziumContainer> {
private static final String DEBEZIUM_CONTAINER = "debezium/connect";
private static final String DEBEZIUM_STABLE_TAG = ContainerImageVersions.getStableVersion("debezium/connect");
private static final String DEBEZIUM_CONTAINER = "quay.io/debezium/connect";
private static final String DEBEZIUM_STABLE_TAG = ContainerImageVersions.getStableVersion("quay.io/debezium/connect");
private static final String DEBEZIUM_NIGHTLY_TAG = "nightly";
private static final int KAFKA_CONNECT_PORT = 8083;

View File

@ -25,7 +25,7 @@ public class MySqlTestResourceLifecycleManager implements QuarkusTestResourceLif
public static final String PRIVILEGED_PASSWORD = "mysqlpassword";
public static final String ROOT_PASSWORD = "debezium";
public static final String DBNAME = "inventory";
public static final String IMAGE = "debezium/example-mysql";
public static final String IMAGE = "quay.io/debezium/example-mysql";
public static final String HOST = "localhost";
public static final Integer PORT = 3306;

View File

@ -22,7 +22,7 @@ public class PostgresTestResourceLifecycleManager implements QuarkusTestResource
public static final String POSTGRES_USER = "postgres";
public static final String POSTGRES_PASSWORD = "postgres";
public static final String POSTGRES_DBNAME = "postgres";
public static final String POSTGRES_IMAGE = "debezium/example-postgres";
public static final String POSTGRES_IMAGE = "quay.io/debezium/example-postgres";
public static final String POSTGRES_HOST = "localhost";
public static final Integer POSTGRES_PORT = 5432;

View File

@ -9,7 +9,7 @@
public final class ImageNames {
private static final String POSTGRES_IMAGE = "debezium/postgres:11";
private static final String POSTGRES_IMAGE = "quay.io/debezium/postgres:15";
public static final DockerImageName POSTGRES_DOCKER_IMAGE_NAME = DockerImageName.parse(POSTGRES_IMAGE)
.asCompatibleSubstituteFor("postgres");

View File

@ -78,13 +78,13 @@ public class DebeziumContainerTest {
public static PostgreSQLContainer<?> postgresContainer =
new PostgreSQLContainer<>(
DockerImageName.parse("debezium/postgres:11")
DockerImageName.parse("quay.io/debezium/postgres:15")
.asCompatibleSubstituteFor("postgres"))
.withNetwork(network)
.withNetworkAliases("postgres"); // <3>
public static DebeziumContainer debeziumContainer =
new DebeziumContainer("debezium/connect:{debezium-version}")
new DebeziumContainer("quay.io/debezium/connect:{debezium-version}")
.withNetwork(network)
.withKafka(kafkaContainer)
.dependsOn(kafkaContainer); // <4>
@ -99,7 +99,7 @@ public class DebeziumContainerTest {
----
<1> Define a Docker network to be used by all the services
<2> Set up a container for Apache Kafka
<3> Set up a container for Postgres 11 (using {prodname}'s Postgres container image)
<3> Set up a container for Postgres 15 (using {prodname}'s Postgres container image)
<4> Set up a container for Kafka Connect with {prodname} {debezium-version}
<5> Start all three containers