-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add Storage Blob and Queue Service Connection from Docker Compose #41321
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
Merged
rujche
merged 16 commits into
Azure:main
from
eddumelendez:docker-compose-service-connection
Aug 29, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5924e14
Add Storage Blob and Queue Service Connection from Docker Compose
eddumelendez ecee254
Fix pipeline failure by adding spring-boot-docker-compose in external…
rujche 436d9bb
1. Add "spring-cloud-azure-docker-compose" in dev profile.
rujche 3303a5d
Fix the version in spring-cloud-azure-docker-compose CHANGELOG.md.
rujche f7b4a0c
Fix the version in spring-cloud-azure-docker-compose pom.xml
rujche 926aca9
Update version by executing "py eng/versioning/update_versions.py --u…
rujche 014dc94
Fix error in bannedDependencies.
rujche bc22e55
Make number easier to read by converting 10000 to 10_000.
rujche 6b2d77e
Format codes.
rujche 5b820a9
Merge branch 'main' into docker-compose-service-connection
rujche 06fad66
Merge branch 'main' into docker-compose-service-connection
rujche 7821741
Upgrade spring-boot-docker-compose's version to 3.3.3.
rujche 9f4f5e8
Fix version error.
rujche 80933c1
Add "optional" for Storage sdk dependency.
rujche a07ec14
Delete "azure-spring-data-cosmos" because it's not used.
rujche fe9b371
Add "optional" for spring-cloud-azure-autoconfigure.
rujche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Release History | ||
|
|
||
| ## 5.15.0-beta.1 (Unreleased) | ||
|
|
||
| ### Features Added | ||
|
|
||
| ### Breaking Changes | ||
|
|
||
| ### Bugs Fixed | ||
|
|
||
| ### Other Changes |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <parent> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-client-sdk-parent</artifactId> | ||
| <version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} --> | ||
| <relativePath>../../parents/azure-client-sdk-parent</relativePath> | ||
| </parent> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <groupId>com.azure.spring</groupId> | ||
| <artifactId>spring-cloud-azure-docker-compose</artifactId> | ||
| <version>5.16.0-beta.1</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-docker-compose;current} --> | ||
|
|
||
| <name>Spring Cloud Azure Docker Compose</name> | ||
| <description>Spring Cloud Azure Docker Compose</description> | ||
| <url>https://microsoft.github.io/spring-cloud-azure</url> | ||
| <developers> | ||
| <developer> | ||
| <name>Spring Cloud Azure</name> | ||
| <email>SpringIntegSupport@microsoft.com</email> | ||
| </developer> | ||
| </developers> | ||
| <scm> | ||
| <connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection> | ||
| <developerConnection>scm:git:ssh://git@github.com:Azure/azure-sdk-for-java.git</developerConnection> | ||
| <url>https://github.com/Azure/azure-sdk-for-java</url> | ||
| </scm> | ||
| <issueManagement> | ||
| <system>GitHub</system> | ||
| <url>https://github.com/Azure/azure-sdk-for-java/issues</url> | ||
| </issueManagement> | ||
| <properties> | ||
| <!-- Enables fail on deprecated API usage. --> | ||
| <compiler.failondeprecatedstatus/> | ||
| <jacoco.skip>true</jacoco.skip> | ||
| </properties> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.azure.spring</groupId> | ||
| <artifactId>spring-cloud-azure-autoconfigure</artifactId> | ||
saragluna marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <version>5.16.0-beta.1</version> <!-- {x-version-update;com.azure.spring:spring-cloud-azure-autoconfigure;current} --> | ||
| <optional>true</optional> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-storage-blob</artifactId> | ||
saragluna marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <version>12.27.1</version> <!-- {x-version-update;com.azure:azure-storage-blob;dependency} --> | ||
| <optional>true</optional> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.azure</groupId> | ||
| <artifactId>azure-storage-queue</artifactId> | ||
| <version>12.22.1</version> <!-- {x-version-update;com.azure:azure-storage-queue;dependency} --> | ||
| <optional>true</optional> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-docker-compose</artifactId> | ||
| <version>3.3.3</version> <!-- {x-version-update;springboot3_org.springframework.boot:spring-boot-docker-compose;external_dependency} --> | ||
| </dependency> | ||
| <!-- Added this dependency to include necessary annotations used by reactor core. | ||
| Without this dependency, javadoc throws a warning as it cannot find enum When.MAYBE | ||
| which is used in @Nullable annotation in reactor core classes --> | ||
| <dependency> | ||
| <groupId>com.google.code.findbugs</groupId> | ||
| <artifactId>jsr305</artifactId> | ||
| <version>3.0.2</version> <!-- {x-version-update;springboot3_com.google.code.findbugs:jsr305;external_dependency} --> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-test</artifactId> | ||
| <version>3.3.3</version> <!-- {x-version-update;springboot3_org.springframework.boot:spring-boot-test;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework</groupId> | ||
| <artifactId>spring-test</artifactId> | ||
| <version>6.1.12</version> <!-- {x-version-update;springboot3_org.springframework:spring-test;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter</artifactId> | ||
| <version>5.10.3</version> <!-- {x-version-update;springboot3_org.junit.jupiter:junit-jupiter;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> | ||
| <version>3.25.3</version> <!-- {x-version-update;springboot3_org.assertj:assertj-core;external_dependency} --> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>com.github.spotbugs</groupId> | ||
| <artifactId>spotbugs-maven-plugin</artifactId> | ||
| <version>4.8.2.0</version> <!-- {x-version-update;springboot3_com.github.spotbugs:spotbugs-maven-plugin;external_dependency} --> | ||
| <configuration> | ||
| <skip>true</skip> | ||
| </configuration> | ||
saragluna marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </plugin> | ||
| <plugin> | ||
| <groupId>com.diffplug.spotless</groupId> | ||
| <artifactId>spotless-maven-plugin</artifactId> | ||
| <version>2.30.0</version> <!-- {x-version-update;springboot3_com.diffplug.spotless:spotless-maven-plugin;external_dependency} --> | ||
| <configuration> | ||
| <skip>true</skip> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.revapi</groupId> | ||
| <artifactId>revapi-maven-plugin</artifactId> | ||
| <version>0.14.6</version> <!-- {x-version-update;springboot3_org.revapi:revapi-maven-plugin;external_dependency} --> | ||
| <configuration> | ||
| <skip>true</skip> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>com.azure.tools</groupId> | ||
| <artifactId>codesnippet-maven-plugin</artifactId> | ||
| <version>1.0.0-beta.10</version> <!-- {x-version-update;com.azure.tools:codesnippet-maven-plugin;external_dependency} --> | ||
| <configuration> | ||
| <skip>true</skip> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>3.13.0</version> <!-- {x-version-update;springboot3_org.apache.maven.plugins:maven-compiler-plugin;external_dependency} --> | ||
| <executions> | ||
| <!-- disabled - the executing this after default-compile will generate module-info with major class version 55 (i.e Java 11) --> | ||
| <execution> | ||
| <id>base-modules-compile</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| <!-- disabled - compile without module-info for Java 8 --> | ||
| <execution> | ||
| <id>base-compile</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| <!-- disabled - compile with Java 8 --> | ||
| <execution> | ||
| <id>base-testCompile</id> | ||
| <phase>none</phase> | ||
| </execution> | ||
| <!-- Ensure we compile with Java 17 --> | ||
| <execution> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| </goals> | ||
| <configuration> | ||
| <release>17</release> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-enforcer-plugin</artifactId> | ||
| <version>3.4.1</version> <!-- {x-version-update;springboot3_org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} --> | ||
| <configuration> | ||
| <rules> | ||
| <bannedDependencies> | ||
| <includes> | ||
| <include>org.springframework.boot:spring-boot-docker-compose:[3.3.3]</include> <!-- {x-include-update;springboot3_org.springframework.boot:spring-boot-docker-compose;external_dependency} --> | ||
| </includes> | ||
| </bannedDependencies> | ||
| </rules> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-jar-plugin</artifactId> | ||
| <version>3.4.2</version> <!-- {x-version-update;springboot3_org.apache.maven.plugins:maven-jar-plugin;external_dependency} --> | ||
| <configuration> | ||
| <archive> | ||
| <manifestEntries> | ||
| <Automatic-Module-Name>com.azure.spring.cloud.docker.compose</Automatic-Module-Name> | ||
| </manifestEntries> | ||
| </archive> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
48 changes: 48 additions & 0 deletions
48
...entation/service/connection/storage/StorageBlobDockerComposeConnectionDetailsFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.spring.cloud.docker.compose.implementation.service.connection.storage; | ||
|
|
||
| import com.azure.spring.cloud.autoconfigure.implementation.storage.blob.properties.AzureStorageBlobConnectionDetails; | ||
| import org.springframework.boot.docker.compose.core.RunningService; | ||
| import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory; | ||
| import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource; | ||
|
|
||
| class StorageBlobDockerComposeConnectionDetailsFactory | ||
| extends DockerComposeConnectionDetailsFactory<AzureStorageBlobConnectionDetails> { | ||
|
|
||
| private static final int STORAGE_BLOB_PORT = 10_000; | ||
|
|
||
| protected StorageBlobDockerComposeConnectionDetailsFactory() { | ||
| super("azure-storage/azurite"); | ||
| } | ||
|
|
||
| @Override | ||
| protected AzureStorageBlobConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) { | ||
| return new StorageBlobContainerConnectionDetails(source.getRunningService()); | ||
| } | ||
|
|
||
| /** | ||
| * {@link AzureStorageBlobConnectionDetails} backed by a {@code Storage Blob} | ||
| * {@link RunningService}. | ||
| */ | ||
| private static class StorageBlobContainerConnectionDetails extends DockerComposeConnectionDetails | ||
| implements AzureStorageBlobConnectionDetails { | ||
|
|
||
| private final String host; | ||
|
|
||
| private final int port; | ||
|
|
||
| StorageBlobContainerConnectionDetails(RunningService service) { | ||
| super(service); | ||
| this.host = service.host(); | ||
| this.port = service.ports().get(STORAGE_BLOB_PORT); | ||
| } | ||
|
|
||
| @Override | ||
| public String getConnectionString() { | ||
| return "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://%s:%d/devstoreaccount1;" | ||
| .formatted(this.host, this.port); | ||
| } | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
...ntation/service/connection/storage/StorageQueueDockerComposeConnectionDetailsFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.spring.cloud.docker.compose.implementation.service.connection.storage; | ||
|
|
||
| import com.azure.spring.cloud.autoconfigure.implementation.storage.blob.properties.AzureStorageBlobConnectionDetails; | ||
| import com.azure.spring.cloud.autoconfigure.implementation.storage.queue.properties.AzureStorageQueueConnectionDetails; | ||
| import org.springframework.boot.docker.compose.core.RunningService; | ||
| import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory; | ||
| import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource; | ||
|
|
||
| class StorageQueueDockerComposeConnectionDetailsFactory | ||
| extends DockerComposeConnectionDetailsFactory<AzureStorageQueueConnectionDetails> { | ||
|
|
||
| private static final int STORAGE_QUEUE_PORT = 10_001; | ||
|
|
||
| protected StorageQueueDockerComposeConnectionDetailsFactory() { | ||
| super("azure-storage/azurite"); | ||
| } | ||
|
|
||
| @Override | ||
| protected AzureStorageQueueConnectionDetails getDockerComposeConnectionDetails(DockerComposeConnectionSource source) { | ||
| return new StorageQueueContainerConnectionDetails(source.getRunningService()); | ||
| } | ||
|
|
||
| /** | ||
| * {@link AzureStorageBlobConnectionDetails} backed by a {@code Storage Queue} | ||
| * {@link RunningService}. | ||
| */ | ||
| private static class StorageQueueContainerConnectionDetails extends DockerComposeConnectionDetails | ||
| implements AzureStorageQueueConnectionDetails { | ||
|
|
||
| private final String host; | ||
|
|
||
| private final int port; | ||
|
|
||
| StorageQueueContainerConnectionDetails(RunningService service) { | ||
| super(service); | ||
| this.host = service.host(); | ||
| this.port = service.ports().get(STORAGE_QUEUE_PORT); | ||
| } | ||
|
|
||
| @Override | ||
| public String getConnectionString() { | ||
| return "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://%s:%d/devstoreaccount1;" | ||
| .formatted(this.host, this.port); | ||
| } | ||
|
|
||
| @Override | ||
| public String getEndpoint() { | ||
| return "http://%s:%d".formatted(this.host, this.port); | ||
| } | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
sdk/spring/spring-cloud-azure-docker-compose/src/main/resources/META-INF/spring.factories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\ | ||
| com.azure.spring.cloud.docker.compose.implementation.service.connection.storage.StorageBlobDockerComposeConnectionDetailsFactory,\ | ||
| com.azure.spring.cloud.docker.compose.implementation.service.connection.storage.StorageQueueDockerComposeConnectionDetailsFactory |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.