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

chore(deps): update localstack/localstack docker tag to v3.7.1 #745

Merged
merged 2 commits into from
Aug 31, 2024
Merged
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
2 changes: 1 addition & 1 deletion aws-cloudwatch-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "5432:5432"

localstack:
image: localstack/localstack:3.5.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestApplication {
@ServiceConnection
LocalStackContainer localstackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.5.0"));
DockerImageName.parse("localstack/localstack").withTag("3.7.1"));
}

@Bean
Expand Down
2 changes: 1 addition & 1 deletion aws-dynamodb-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TestApplication {
LocalStackContainer localstackContainer() {
LocalStackContainer localstackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"))
DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withCopyFileToContainer(
MountableFile.forHostPath(".localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
2 changes: 1 addition & 1 deletion aws-kinesis-project/consumer/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:

localstack:
image: localstack/localstack:3.5.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
@Import(LocalStackConfig.class)
Expand All @@ -15,7 +16,7 @@ public class TestKinesisConsumerApplication {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:16.4-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class LocalStackConfig {

static LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.5.0"));
DockerImageName.parse("localstack/localstack").withTag("3.7.1"));

static {
localStackContainer.start();
Expand Down
2 changes: 1 addition & 1 deletion aws-kinesis-project/producer/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TestKinesisProducerApplication {
LocalStackContainer localStackContainer(DynamicPropertyRegistry dynamicPropertyRegistry) {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"));
DockerImageName.parse("localstack/localstack").withTag("3.7.1"));
dynamicPropertyRegistry.add("spring.cloud.aws.endpoint", localStackContainer::getEndpoint);
dynamicPropertyRegistry.add(
"spring.cloud.aws.region.static", localStackContainer::getRegion);
Expand Down
2 changes: 1 addition & 1 deletion aws-lambda-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- aws-lambda

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ class ApplicationIntegrationTest {
static Network network = Network.newNetwork();

@Container
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16.2-alpine")
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:16.4-alpine")
.withNetwork(network)
.withNetworkAliases("postgres")
.withReuse(true);

@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.3.0"))
DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withNetwork(network)
.withEnv("LOCALSTACK_HOST", "localhost.localstack.cloud")
.withEnv("LAMBDA_DOCKER_NETWORK", ((Network.NetworkImpl) network).getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public class ContainersConfig {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.3-alpine"));
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine"));
}
}
2 changes: 1 addition & 1 deletion aws-parameterstore-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "5432:5432"

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestApplication {

@Bean
@ServiceConnection
PostgreSQLContainer<?> sqlContainer() {
return new PostgreSQLContainer<>("postgres:16.3-alpine");
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine"));
}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LocalStackContainerConfig {

@Container
private static final LocalStackContainer localStackContainer =
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.6.0"))
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
2 changes: 1 addition & 1 deletion aws-s3-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "5432:5432"

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public class TestS3Application {
@ServiceConnection
@RestartScope
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.2-alpine"))
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:16.4-alpine"))
.withReuse(true);
}

@Bean
LocalStackContainer localstackContainer(DynamicPropertyRegistry registry) {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"))
DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withCopyFileToContainer(
MountableFile.forHostPath(".localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
2 changes: 1 addition & 1 deletion aws-secretmanager-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- "5432:5432"

localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TestApplication {
@ServiceConnection
LocalStackContainer localStackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"))
DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"), "/etc/localstack/init/ready.d/")
.waitingFor(Wait.forLogMessage(".*LocalStack initialized successfully\n", 1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.utility.DockerImageName;

public interface DBTestContainer {

@Container @ServiceConnection
PostgreSQLContainer<?> sqlContainer = new PostgreSQLContainer<>("postgres:16.2-alpine");
PostgreSQLContainer<?> sqlContainer =
new PostgreSQLContainer<>(DockerImageName.parse("postgres").withTag("16.4-alpine"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LocalStackContainerConfig {

@Container
private static final LocalStackContainer localStackContainer =
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.3.0"))
new LocalStackContainer(DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withCopyFileToContainer(
MountableFile.forHostPath("localstack/"),
"/etc/localstack/init/ready.d/")
Expand Down
2 changes: 1 addition & 1 deletion aws-ses-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
localstack:
image: localstack/localstack:3.6.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
package com.example.awsspring;

import lombok.extern.slf4j.Slf4j;
import com.example.awsspring.common.LocalStackTestContainer;
Copy link

Choose a reason for hiding this comment

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

Refactor: Simplified LocalStack Configuration

The changes in the main method and the removal of the localStackContainer() method suggest a shift towards using a centralized or externalized configuration for LocalStack, possibly to enhance maintainability or align with updated practices. The new approach uses LocalStackTestContainer.class directly in the SpringApplication setup, which could streamline the setup process.

Ensure that this change integrates well with other parts of the application and that all necessary LocalStack configurations are properly managed in the new setup.

Also applies to: 9-9

import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.utility.DockerImageName;

@Slf4j
@TestConfiguration(proxyBeanMethods = false)
public class TestSESApplication {

@Bean
@ServiceConnection
LocalStackContainer localStackContainer() {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.6.0"));
localStackContainer.start();
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log);
localStackContainer.followOutput(logConsumer);
return localStackContainer;
}

public static void main(String[] args) {
SpringApplication.from(SESApplication::main).with(TestSESApplication.class).run(args);
SpringApplication.from(SESApplication::main).with(LocalStackTestContainer.class).run(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static com.example.awsspring.utils.AppConstants.PROFILE_TEST;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;

import com.example.awsspring.TestSESApplication;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
Expand All @@ -12,7 +11,7 @@
import org.springframework.test.web.servlet.MockMvc;

@ActiveProfiles({PROFILE_TEST})
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = TestSESApplication.class)
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = LocalStackTestContainer.class)
@AutoConfigureMockMvc
public abstract class AbstractIntegrationTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.awsspring.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.utility.DockerImageName;

@Slf4j
@TestConfiguration(proxyBeanMethods = false)
public class LocalStackTestContainer {

@Bean
@ServiceConnection
LocalStackContainer localStackContainer() {
LocalStackContainer localStackContainer =
new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.1"));
localStackContainer.start();
Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(log);
localStackContainer.followOutput(logConsumer);
return localStackContainer;
}
}
2 changes: 1 addition & 1 deletion aws-sns-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:

localstack:
image: localstack/localstack:3.7.0
image: localstack/localstack:3.7.1
ports:
- "4566:4566"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class ContainersConfig {
@ServiceConnection
LocalStackContainer localstackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.0"));
DockerImageName.parse("localstack/localstack").withTag("3.7.1"));
}
}
2 changes: 1 addition & 1 deletion aws-sqs-project/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
retries: 5

localstack:
image: localstack/localstack:3.7.0
image: localstack/localstack:3.7.1
environment:
- AWS_DEFAULT_REGION=us-east-1
- EDGE_PORT=4566
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class LocalStackTestContainers {
@ServiceConnection
LocalStackContainer localstackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("3.7.0"))
DockerImageName.parse("localstack/localstack").withTag("3.7.1"))
.withReuse(true);
}
}