Skip to content

Commit 410445d

Browse files
authored
update asset manager readme in source branch (Azure-Samples#28)
* update source branch readme * remove duplicate content
1 parent 3f373da commit 410445d

File tree

1 file changed

+3
-149
lines changed

1 file changed

+3
-149
lines changed

asset-manager/README.md

Lines changed: 3 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Asset Manager
2-
Sample project for migration tool code remediation that manages assets in cloud storage.
32

4-
## Current Infrastructure
5-
The project currently uses the following infrastructure, in [`main`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/main/asset-manager) branch:
3+
This [`source`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/source/asset-manager) branch of the asset-manager project is the original state before being migrated to Azure service:
64
* AWS S3 for image storage, using password-based authentication (access key/secret key)
75
* RabbitMQ for message queuing, using password-based authentication
86
* PostgreSQL database for metadata storage, using password-based authentication
@@ -76,89 +74,14 @@ class User user
7674
```
7775
Password-based authentication
7876

79-
## Migrated Infrastructure
80-
After migration, the project will use the following Azure services, in [`expected`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/expected/asset-manager) branch:
81-
* Azure Blob Storage for image storage, using managed identity authentication
82-
* Azure Service Bus for message queuing, using managed identity authentication
83-
* Azure Database for PostgreSQL for metadata storage, using managed identity authentication
84-
85-
## Migrated Architecture
86-
```mermaid
87-
flowchart TD
88-
89-
%% Applications
90-
WebApp[Web Application]
91-
Worker[Worker Service]
92-
93-
%% Azure Storage Components
94-
AzBlob[(Azure Blob Storage)]
95-
LocalFS[("Local File System<br/>dev only")]
96-
97-
%% Azure Message Broker
98-
ServiceBus(Azure Service Bus)
99-
100-
%% Azure Database
101-
AzPostgreSQL[(Azure PostgreSQL)]
102-
103-
%% Queues
104-
Queue[image-processing queue]
105-
RetryQueue[retry queue]
106-
107-
%% User
108-
User([User])
109-
110-
%% User Flow
111-
User -->|Upload Image| WebApp
112-
User -->|View Images| WebApp
113-
114-
%% Web App Flows
115-
WebApp -->|Store Original Image| AzBlob
116-
WebApp -->|Store Original Image| LocalFS
117-
WebApp -->|Send Processing Message| ServiceBus
118-
WebApp -->|Store Metadata| AzPostgreSQL
119-
WebApp -->|Retrieve Images| AzBlob
120-
WebApp -->|Retrieve Images| LocalFS
121-
WebApp -->|Retrieve Metadata| AzPostgreSQL
122-
123-
%% Service Bus Flow
124-
ServiceBus -->|Push Message| Queue
125-
Queue -->|Processing Failed| RetryQueue
126-
RetryQueue -->|After 1 min delay| Queue
127-
Queue -->|Consume Message| Worker
128-
129-
%% Worker Flow
130-
Worker -->|Download Original| AzBlob
131-
Worker -->|Download Original| LocalFS
132-
Worker -->|Upload Thumbnail| AzBlob
133-
Worker -->|Upload Thumbnail| LocalFS
134-
Worker -->|Store Metadata| AzPostgreSQL
135-
Worker -->|Retrieve Metadata| AzPostgreSQL
136-
137-
%% Styling
138-
classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1
139-
classDef storage fill:#68B3A1,stroke:#006064,color:#006064
140-
classDef broker fill:#B39DDB,stroke:#4527A0,color:#4527A0
141-
classDef db fill:#90CAF9,stroke:#1565C0,color:#1565C0
142-
classDef queue fill:#81C784,stroke:#2E7D32,color:#2E7D32
143-
classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c
144-
145-
class WebApp,Worker app
146-
class AzBlob,LocalFS storage
147-
class ServiceBus broker
148-
class AzPostgreSQL db
149-
class Queue,RetryQueue queue
150-
class User user
151-
```
152-
Managed identity based authentication
153-
15477
## Run Locally
15578

156-
Check out the [`main`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/main/asset-manager) branch to run the current infrastructure locally:
79+
Check out the [`source`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/source/asset-manager) branch to run the current infrastructure locally:
15780

15881
```bash
15982
git clone https://github.com/Azure-Samples/java-migration-copilot-samples.git
16083
cd java-migration-copilot-samples/asset-manager
161-
git checkout main
84+
git checkout source
16285
```
16386

16487
**Prerequisites**: JDK, Docker
@@ -181,72 +104,3 @@ scripts/start.sh
181104

182105
To stop, run `stop.cmd` or `stop.sh` in the `scripts` directory.
183106

184-
## Run Migrated Code on Azure
185-
186-
Check out the [`expected`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/expected/asset-manager) branch to run the migrated infrastructure on Azure:
187-
188-
```bash
189-
git clone https://github.com/Azure-Samples/java-migration-copilot-samples.git
190-
cd java-migration-copilot-samples/asset-manager
191-
git checkout expected
192-
```
193-
194-
**Prerequisites**: Azure CLI and you have signed in using `az login`
195-
196-
Run the following commands to deploy the apps to Azure. This will:
197-
* Use Azure Blob Storage instead of S3 to store the image
198-
* Use Azure Service Bus instead of RabbitMQ for message queuing
199-
* Use Azure Database for PostgreSQL Flexible Server instead of PostgreSQL for metadata storage
200-
201-
Windows:
202-
203-
```batch
204-
scripts\deploy-to-azure.cmd -ResourceGroupName <your resource group name> -Location <your resource group location, e.g., eastus2> -Prefix <your unique resource prefix>
205-
```
206-
207-
Linux:
208-
209-
```bash
210-
scripts/deploy-to-azure.sh -ResourceGroupName <your resource group name> -Location <your resource group location, e.g., eastus2> -Prefix <your unique resource prefix>
211-
```
212-
213-
To clean up, run `scripts\cleanup-azure-resources.cmd -ResourceGroupName <your resource group name>` or `scripts/cleanup-azure-resources.sh -ResourceGroupName <your resource group name>` for Windows and Linux, respectively.
214-
215-
### Use GitHub Codespaces for Deployment
216-
217-
The deployment scripts can also be executed in GitHub Codespaces, which pre-installs the necessary dependencies. Follow the steps below to deploy the apps to Azure using GitHub Codespaces:
218-
219-
1. Open the repository in GitHub Codespaces by selecting on the **Code** button, selecting **Codespaces** tab, openining the existing codespace or selecting **Create codespace** for the target branch.
220-
1. The codespace will automatically open in the browser. Wait until it is ready.
221-
1. Navigate to the terminal in the codespace and run `az login` to sign in to Azure. Follow the instructions to complete the sign-in process.
222-
1. At the last step of the sign-in process, you will be asked to select a subscription and tenant. Select the appropriate subscription and tenant.
223-
1. Run the following commands in the terminal to deploy the apps to Azure:
224-
225-
```bash
226-
cd asset-manager && git pull
227-
scripts/deploy-to-azure.sh -ResourceGroupName <your resource group name> -Location <your resource group location, e.g., eastus2> -Prefix <your unique resource prefix>
228-
```
229-
230-
1. To clean up, run `scripts\cleanup-azure-resources.cmd -ResourceGroupName <your resource group name>` or `scripts/cleanup-azure-resources.sh -ResourceGroupName <your resource group name>` for Windows and Linux, respectively.
231-
232-
## Java Migration Copilot Workshop
233-
234-
Check out the [`workshop`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/workshop/asset-manager) branch for Java Migration Copilot workshop:
235-
236-
```bash
237-
git clone https://github.com/Azure-Samples/java-migration-copilot-samples.git
238-
cd java-migration-copilot-samples/asset-manager
239-
git checkout workshop
240-
```
241-
242-
Compared to the `main` branch, the `workshop` branch has additional commits that have already migrated the code for **Web Application** with custom code remediation, including:
243-
* Azure Blob Storage for image storage, using managed identity authentication
244-
* Azure Service Bus for message queuing, using managed identity authentication
245-
246-
The remaining targets of the workshop are:
247-
* For both **Web Application** and **Worker Service**, migrate to Azure Database for PostgreSQL Flexible server for metadata storage with managed identity authentication, using predefined prompt.
248-
* For **Worker Service**, migrate to Azure Blob Storage and Azure Service Bus for image storage and message queuing, respectively, with managed identity authentication, using custom propmt created from existing commits that migrated the **Web Application**.
249-
250-
Once the workshop is successfully completed, you should be able to run the migrated code on Azure, similar to [Run Migrated Code on Azure](#run-migrated-code-on-azure) but using the `workshop` branch with the migrated code.
251-
252-
For more details, refer to the [workshop guide](https://github.com/Azure-Samples/java-migration-copilot-samples/blob/workshop/asset-manager/WORKSHOP.md).

0 commit comments

Comments
 (0)