diff --git a/README.md b/README.md index 24ebe13..d45a611 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ Before getting started, let's make sure you have everything you need for this wo You'll need Java 17 or newer for this workshop. Testcontainers libraries are compatible with Java 8+, but this workshop uses a Spring Boot 3.x application which requires Java 17 or newer. -We would recommend using [SDKMAN](https://sdkman.io/) to install Java on your machine if you are using MacOS, Linux or Windows WSL. +We would recommend using [SDKMAN](https://sdkman.io/) to install Java on your machine if you are using macOS, Linux or Windows WSL. ### Install Docker You need to have a Docker environment to use Testcontainers. * You can use Docker Desktop on your machine. * You can use [Testcontainers Cloud](https://testcontainers.com/cloud). If you are going to use Testcontainers Cloud, then you need to install [Testcontainers Desktop](https://testcontainers.com/desktop/) app. -* If you are using MacOS, you can use Testcontainers Desktop Embedded Runtime. +* If you are using macOS, you can use Testcontainers Desktop Embedded Runtime. * If you are using a local Docker, check by running: diff --git a/module-3/README.md b/module-3/README.md index c30bb89..9ddde3e 100644 --- a/module-3/README.md +++ b/module-3/README.md @@ -6,7 +6,7 @@ messages from it. 1. Annotate `KafkaCatTest` with `@Testcontainers` > [!NOTE] -> `@Tescontainers` will manage lifecycle of containers annotated with `@Container` +> `@Testcontainers` will manage lifecycle of containers annotated with `@Container` 2. Create a network to connect both containers diff --git a/module-5/README.md b/module-5/README.md index 049e34a..11dcf0c 100644 --- a/module-5/README.md +++ b/module-5/README.md @@ -65,7 +65,7 @@ public void reset() { 6. Add the call to `snapshot` as the last action to the `containerIsStarted` method. -7. Let's test how it works now. Setup the test `PostgresWithTemplatesTest` by creating the `PostgresWithTemplates` container, wiring the `JDBCTemplate`, and configuring the context to use our container: +7. Let's test how it works now. Set up the test `PostgresWithTemplatesTest` by creating the `PostgresWithTemplates` container, wiring the `JDBCTemplate`, and configuring the context to use our container: ```java static PostgresWithTemplates pg = new PostgresWithTemplates(); diff --git a/module-6/README.md b/module-6/README.md index 20dfc92..a84e0ce 100644 --- a/module-6/README.md +++ b/module-6/README.md @@ -4,9 +4,9 @@ We're going to create tests that use an Ollama module and enhance its lifecycle so the modified images are cached. -2. Here's an example of a code that starts the Ollama module, and accesses its API to ensure it's up and running. +2. Here's an example of code that starts the Ollama module, and accesses its API to ensure it's up and running. Put it into the `OllamaContainerTest` class and make it a test. -(Note how containers are `AutoCloseable` so you can spin use `try-with-resources` with them). +(Note how containers are `AutoCloseable` so you can use `try-with-resources` with them). ```java try ( @@ -20,7 +20,7 @@ try ( ``` 3. By default, the Ollama Docker images don't have any models inside. -So if we want to actually use it to run any inference we need to download the model into the container. +So if we want to actually use it to run an inference we need to download the model into the container. Create another test method and download a model into the Ollama container. ```java @@ -36,7 +36,7 @@ try (OllamaContainer ollama = new OllamaContainer("ollama/ollama:0.1.26")) { assertThat(modelName).contains("all-minilm"); } ``` -4. When you run this test the model is being pulled, and when we rerun the test, it will be pulled again, and again. +4. When you run this test, the model is being pulled, and when we rerun the test, it will be pulled again, and again. This is not ideal, so we can use the `commitToImage` method from the `OllamaContainer` to persist the model in a new Docker image. See how you can use the lower level Docker Client API to work with the images: @@ -101,7 +101,7 @@ try ( } ``` -8. Modify the custom image name (to get a clean stat) and run the test a few time to compare the execution time on the first run and the next ones. +8. Modify the custom image name (to get a clean stat) and run the test several times to compare the execution time on the first run and the next ones. 9. A nice detail of the `OllamaContainer` module is how it can automatically determine and enable the GPU support on runtimes that support it. This is code from the OllamaContainer class that does this. Learn how you can use Docker Client API and the `withCreateContainerCmdModifier` method to enable it. @@ -116,7 +116,7 @@ if (runtimes != null && runtimes.containsKey("nvidia")) { } ``` -10. You can also limit the resources a container has access to like CPU and memory. Here's an example of a test that checks the GC a Java process selects in constrained environments: +10. You can also limit the resources for a container like CPU and memory. Here's an example of a test that checks the GC a Java process selects in constrained environments: Add it to your test class, run the test, explore the results. ```java diff --git a/module-8/README.md b/module-8/README.md index a0d18c7..54582d0 100644 --- a/module-8/README.md +++ b/module-8/README.md @@ -71,7 +71,7 @@ helloworld.start(); ``` 10. Now we have the application to point our tunnel to, instantiate the `CloudflaredContainer` and point it to the `helloworld.getFirstMappedPort()`; -11. Assuming you have a valus in the `String url = cloudflare.getPublicUrl();` use the following method to try consuming the url (and ignoring the exceptions if the tunnel is declared, but Cloudflare didn't yet provision it). +11. Assuming you have a value in the `String url = cloudflare.getPublicUrl();` use the following method to try consuming the url (and ignoring the exceptions if the tunnel is declared, but Cloudflare didn't yet provision it). Note that we disable the DNS caching, because the domain might not be available during the first attempt, but we want to ignore it and try without cached DNS later. ```java