diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..73095e5 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,185 @@ +# DevContainer for Java Spring Boot with GitHub Copilot App Modernization + +This DevContainer configuration provides a complete development environment for Java Spring Boot applications with support for GitHub Copilot App Modernization for Java. + +## Features + +### 🐳 Container Base +- **Base Image**: `mcr.microsoft.com/devcontainers/java:1-21-bullseye` +- **Docker-in-Docker**: Enabled for containerization workflows +- **Azure CLI**: Pre-installed for Azure deployment scenarios +- **GitHub CLI**: For GitHub integration and automation + +### ☕ Java Development +- **Multiple Java Versions**: Java 8, 11, 17, and 21 via SDKMAN +- **Build Tools**: Maven and Gradle +- **Spring Boot Support**: Complete Spring Boot development stack + +### 🚀 GitHub Copilot Extensions +- **GitHub Copilot**: AI-powered code completion +- **GitHub Copilot Chat**: Interactive AI assistance +- **GitHub Copilot App Modernization for Java**: Specialized tools for Java application modernization + +### 🛠️ Development Tools +- **Java Extension Pack**: Complete Java development experience +- **Spring Boot Extensions**: Spring Boot dashboard and tools +- **Testing Framework**: JUnit and testing extensions +- **Docker Support**: Docker extension for container management +- **Azure Tools**: Azure development extensions + +## Getting Started + +### Prerequisites +- [Visual Studio Code](https://code.visualstudio.com/) +- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +- [Docker Desktop](https://www.docker.com/products/docker-desktop/) + +### Usage + +1. **Open in DevContainer**: + - Open the project in VS Code + - Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) + - Select "Dev Containers: Reopen in Container" + - Wait for the container to build and configure + +2. **Verify Setup**: + ```bash + # Check Java version + java -version + + # Check Maven + mvn -version + + # List available Java versions + sdk list java + ``` + +3. **Run the Application**: + ```bash + # Using Maven wrapper + ./mvnw spring-boot:run + + # Or using Maven directly + mvn spring-boot:run + ``` + +## Available Ports + +- **8080**: Spring Boot Application (auto-forwarded) +- **3000**: Additional web services +- **5005**: Java Debug Port (for remote debugging) + +## Java Version Management + +Switch between Java versions using SDKMAN: + +```bash +# List installed versions +sdk list java + +# Use a specific version for current session +sdk use java 17.0.12-amzn + +# Set default version +sdk default java 11.0.24-amzn +``` + +## Application Modernization Features + +This DevContainer is specifically configured for GitHub Copilot App Modernization for Java: + +### Assessment Tools +- **AppCAT CLI**: Pre-installed for application assessment +- **Migration Analysis**: Built-in tools for analyzing modernization opportunities + +### Modernization Workflows +1. **Assessment**: Use AppCAT to assess the current application +2. **Planning**: Leverage Copilot to plan modernization steps +3. **Implementation**: Use AI-assisted code generation for updates +4. **Testing**: Comprehensive testing with multiple Java versions + +### Example Commands +```bash +# Assess application for cloud readiness +appcat assess --source . --target azure + +# Run tests with different Java versions +sdk use java 8.0.422-amzn && mvn test +sdk use java 11.0.24-amzn && mvn test +sdk use java 17.0.12-amzn && mvn test +``` + +## Development Workflow + +### Building the Project +```bash +# Clean and compile +mvn clean compile + +# Run tests +mvn test + +# Package application +mvn clean package + +# Run with specific profile +mvn spring-boot:run -Dspring-boot.run.profiles=dev +``` + +### Docker Integration +```bash +# Build Docker image +docker build -t bus-reservation . + +# Run with Docker Compose +docker-compose up -d +``` + +## Troubleshooting + +### Java Version Issues +If you encounter Java version conflicts: +1. Check current version: `java -version` +2. Switch to correct version: `sdk use java ` +3. Reload VS Code window if needed + +### Extension Issues +If extensions don't load properly: +1. Reload the window: `Ctrl+Shift+P` → "Developer: Reload Window" +2. Rebuild container: `Ctrl+Shift+P` → "Dev Containers: Rebuild Container" + +### Port Conflicts +If ports are already in use: +1. Check running processes: `netstat -tulpn | grep :8080` +2. Update port in `application.properties` or use environment variables + +## Customization + +### Adding Extensions +Edit `.devcontainer/devcontainer.json` and add extensions to the `extensions` array: + +```json +"extensions": [ + "your.extension.id" +] +``` + +### Environment Variables +Add environment variables in the `containerEnv` section: + +```json +"containerEnv": { + "CUSTOM_VAR": "value" +} +``` + +### Additional Tools +Modify `.devcontainer/post-create.sh` to install additional tools. + +## Support + +For issues related to: +- **DevContainer**: Check VS Code Dev Containers documentation +- **Java Development**: Refer to Java Extension Pack documentation +- **GitHub Copilot**: Visit GitHub Copilot documentation +- **App Modernization**: Check GitHub Copilot App Modernization for Java documentation diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..88848d4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,84 @@ +{ + "name": "Java Spring Boot with App Modernization", + "image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye", + + // Features to add to the dev container + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/azure-cli:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + + // Configure tool-specific properties + "customizations": { + "vscode": { + "extensions": [ + // Java Development Extensions + "vscjava.vscode-java-pack", + // GitHub Copilot Extensions + "github.copilot", + "github.copilot-chat", + + // GitHub Copilot App Modernization for Java + "vscjava.migrate-java-to-azure", + ], + "settings": { +// "java.jdt.ls.java.home": "/usr/local/sdkman/candidates/java/current/bin", + "java.configuration.runtimes": [ + /*{ + "name": "JavaSE-1.8", + "path": "/usr/local/sdkman/candidates/java/8.0.422-amzn" + }, + { + "name": "JavaSE-11", + "path": "/usr/local/sdkman/candidates/java/11.0.24-amzn" + }, + { + "name": "JavaSE-17", + "path": "/usr/local/sdkman/candidates/java/17.0.12-amzn" + },*/ + { + "name": "JavaSE-21", + "path": "/usr/local/sdkman/candidates/java/21.0.4-amzn" + } + ], + "java.compile.nullAnalysis.mode": "automatic", + "spring-boot.ls.checkUpdate": false, + "files.exclude": { + "**/.classpath": true, + "**/.project": true, + "**/.settings": true, + "**/.factorypath": true + } + } + } + }, + + // Ports to forward + "forwardPorts": [8080, 3000, 5005], + "portsAttributes": { + "8080": { + "label": "Spring Boot Application", + "onAutoForward": "notify" + }, + "5005": { + "label": "Java Debug Port", + "onAutoForward": "silent" + } + }, + + // Use 'postCreateCommand' to run commands after the container is created + "postCreateCommand": "bash .devcontainer/post-create.sh", + + // Mount the local file system and docker socket + "mounts": [ + "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind" + ], + + // Set container user + "containerUser": "root", + "remoteUser": "root", + + // Enable privileged mode for docker-in-docker + "privileged": true +} diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100644 index 0000000..a055328 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# Post-create script for Java Spring Boot DevContainer +echo "Setting up Java development environment..." + +# Install SDKMAN if not already installed +if [ ! -d "/usr/local/sdkman" ]; then + echo "Installing SDKMAN..." + curl -s "https://get.sdkman.io" | bash + source "/usr/local/sdkman/bin/sdkman-init.sh" +fi + +# Source SDKMAN +source "/usr/local/sdkman/bin/sdkman-init.sh" + +# Install multiple Java versions for app modernization scenarios +echo "Installing Java version..." +# sdk install java 8.0.422-amzn || true +# sdk install java 11.0.24-amzn || true +# sdk install java 17.0.12-amzn || true +sdk install java 21.0.4-amzn || true + +# Set Java 21 as default (can be changed based on project needs) +sdk default java 21.0.4-amzn + +# Install Maven (latest version) +echo "Installing Maven..." +sdk install maven || true + +# Install Gradle +# echo "Installing Gradle..." +# sdk install gradle || true + +# Update package list and install additional tools +echo "Installing additional development tools..." +sudo apt-get update +sudo apt-get install -y \ + curl \ + wget \ + git \ + unzip \ + jq \ + tree \ + htop + +# Make Maven wrapper executable +if [ -f "./mvnw" ]; then + chmod +x ./mvnw + echo "Maven wrapper made executable" +fi + +# Install AppCAT CLI for application assessment (useful for modernization) +echo "Installing AppCAT CLI for application assessment..." +# Prefer a local packaged folder if present, otherwise download and extract the release +if ls azure-migrate-appcat-for-java-cli-linux-amd64-* 1> /dev/null 2>&1; then + APP_DIR=$(ls -d azure-migrate-appcat-for-java-cli-linux-amd64-* 2>/dev/null | head -n1) +else + # Download and extract the release + curl -L https://aka.ms/appcat/azure-migrate-appcat-for-java-cli-linux-amd64.tar.gz | tar -xz + APP_DIR=$(ls -d azure-migrate-appcat-for-java-cli-linux-amd64-* 2>/dev/null | head -n1) +fi + +# Move the entire package directory into /usr/local/bin so its subfiles remain available to the tool, +# then create a symlink named 'appcat' in /usr/local/bin pointing to the packaged executable. +if [ -n "$APP_DIR" ] && [ -d "$APP_DIR" ]; then + sudo mv "$APP_DIR" /usr/local/bin/ + sudo chmod -R a+rX "/usr/local/bin/$APP_DIR" + if [ -f "/usr/local/bin/$APP_DIR/appcat" ]; then + sudo ln -sf "/usr/local/bin/$APP_DIR/appcat" /usr/local/bin/appcat + sudo chmod +x "/usr/local/bin/$APP_DIR/appcat" + fi +elif [ -f "./appcat" ]; then + sudo mv ./appcat /usr/local/bin/ + sudo chmod +x /usr/local/bin/appcat +else + echo "Warning: appcat binary or package not found. You may need to install it manually." +fi + +# Ensure /usr/local/bin is added to user's PATH for interactive shells +if ! grep -q '/usr/local/bin' ~/.bashrc; then + echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc +fi + +# Add a system-wide profile script so non-interactive/other users also see appcat in PATH +sudo bash -c 'cat > /etc/profile.d/appcat.sh <<"EOF" +# Add appcat to PATH +export PATH="/usr/local/bin:\$PATH" +EOF' +sudo chmod +x /etc/profile.d/appcat.sh + +# Create development directories +mkdir -p ~/workspace/tools +mkdir -p ~/workspace/scripts + +echo "✅ DevContainer setup completed successfully!" +echo "" +echo "Available Java versions:" +sdk list java | grep installed || echo "Run 'sdk list java' to see available versions" +echo "" +echo "Useful commands:" +echo " - sdk use java : Switch Java version" +echo " - mvn spring-boot:run : Run Spring Boot application" +echo " - mvn clean package : Build the application" +echo " - appcat assess : Assess application for modernization" +echo "" +echo "The development environment is ready for GitHub Copilot App Modernization!" diff --git a/asset-manager/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from asset-manager/.mvn/wrapper/maven-wrapper.properties rename to .mvn/wrapper/maven-wrapper.properties diff --git a/asset-manager/LICENSE b/LICENSE similarity index 100% rename from asset-manager/LICENSE rename to LICENSE diff --git a/asset-manager/PROMPTS.md b/PROMPTS.md similarity index 100% rename from asset-manager/PROMPTS.md rename to PROMPTS.md diff --git a/README.md b/README.md index 364f052..5c5b562 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,353 @@ -# Project Name +# Tech Summit FY26 Lab: GitHub Copilot App Modernization for Java - Migrate to Azure +A short lab that walks through assessing and migrating the sample Java application "asset-manager" from AWS/RabbitMQ/Postgres to Azure Blob Storage, Azure Service Bus, and Azure Database for PostgreSQL using GitHub Copilot App Modernization for Java. -(short, 1-3 sentenced, description of the project) +- [Tech Summit FY26 Lab: GitHub Copilot App Modernization for Java - Migrate to Azure](#tech-summit-fy26-lab-github-copilot-app-modernization-for-java---migrate-to-azure) + - [Overview](#overview) + - [Audience \& Objectives](#audience--objectives) + - [Estimated time \& difficulty](#estimated-time--difficulty) + - [About the Project](#about-the-project) + - [Original Infrastructure](#original-infrastructure) + - [Original Architecture](#original-architecture) + - [Migrated Infrastructure](#migrated-infrastructure) + - [Migrated Architecture](#migrated-architecture) + - [Prerequisites](#prerequisites) + - [Lab: Migrate the Sample Java Application](#lab-migrate-the-sample-java-application) + - [Assess Your Java Application](#assess-your-java-application) + - [Migrate to Azure Database for PostgreSQL Flexible Server](#migrate-to-azure-database-for-postgresql-flexible-server) + - [Migrate from AWS S3 to Azure Blob Storage](#migrate-from-aws-s3-to-azure-blob-storage) + - [Migrate from AMQP RabbitMQ to Azure Service Bus](#migrate-from-amqp-rabbitmq-to-azure-service-bus) + - [Completion](#completion) + - [Manual Verification \& Checkpoints:](#manual-verification--checkpoints) + - [Trouble Shooting](#trouble-shooting) + - [GHCP seems to be doing something unclear](#ghcp-seems-to-be-doing-something-unclear) + - [References \& resources](#references--resources) -## Features -This project framework provides the following features: +## Overview +This hands-on lab demonstrates assessing and migrating a Java web + worker application to Azure using GitHub Copilot App Modernization for Java. The lab is organized as small focused tasks with verification points after each major step. -* Feature 1 -* Feature 2 -* ... +GitHub Copilot App Modernization for Java, also referred to as `App Modernization for Java` or `AppMod`, assists with app assessment, planning and code remediation using a Visual Studio Code Extension and GitHub Copilot. +It automates repetitive tasks, boosting developer confidence and speeding up the Azure migration and ongoing optimization. -## Getting Started -### Prerequisites +## Audience & Objectives +- Audience: Cloud Solution Architects & Solution Engineers performing Java Cloud Migrations & Modernization. +- Learning objectives: + - Run an automated assessment for cloud readiness. + - Apply Copilot-generated migrations for DB, storage, and messaging. + - Verify migrated code locally. + +## Estimated time & difficulty +- Estimated time: 60–90 minutes +- Difficulty: Intermediate (familiarity with Java, Maven, VS Code, and Azure CLI recommended) -(ideally very short, if any) +## About the Project -- OS -- Library version -- ... +This application consists of two sub-modules, **Web** and **Worker**. Both of them contain functions of using storage service and message queue. -### Installation +### Original Infrastructure -(ideally very short) +The project uses the following original infrastructure: +* AWS S3 for image storage, using password-based authentication (access key/secret key) +* RabbitMQ for message queuing, using password-based authentication +* PostgreSQL database for metadata storage, using password-based authentication -- npm install [package name] -- mvn install -- ... +### Original Architecture -### Quickstart -(Add steps to get up and running quickly) +```mermaid +flowchart TD -1. git clone [repository clone url] -2. cd [repository name] -3. ... +%% Applications +WebApp[Web Application] +Worker[Worker Service] +%% Storage Components +S3[(AWS S3)] +LocalFS[("Local File System
dev only")] -## Demo +%% Message Broker +RabbitMQ(RabbitMQ) -A demo app is included to show how to use the project. +%% Database +PostgreSQL[(PostgreSQL)] -To run the demo, follow these steps: +%% Queues +Queue[image-processing queue] +RetryQueue[image-processing.retry queue] -(Add steps to start up the demo) +%% User +User([User]) -1. -2. -3. +%% User Flow +User -->|Upload Image| WebApp +User -->|View Images| WebApp -## Resources +%% Web App Flows +WebApp -->|Store Original Image| S3 +WebApp -->|Store Original Image| LocalFS +WebApp -->|Send Processing Message| RabbitMQ +WebApp -->|Store Metadata| PostgreSQL +WebApp -->|Retrieve Images| S3 +WebApp -->|Retrieve Images| LocalFS +WebApp -->|Retrieve Metadata| PostgreSQL -(Any additional resources or related projects) +%% RabbitMQ Flow +RabbitMQ -->|Push Message| Queue +Queue -->|Processing Failed| RetryQueue +RetryQueue -->|After 1 min delay| Queue +Queue -->|Consume Message| Worker + +%% Worker Flow +Worker -->|Download Original| S3 +Worker -->|Download Original| LocalFS +Worker -->|Upload Thumbnail| S3 +Worker -->|Upload Thumbnail| LocalFS +Worker -->|Store Metadata| PostgreSQL +Worker -->|Retrieve Metadata| PostgreSQL + +%% Styling +classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1 +classDef storage fill:#a5d6a7,stroke:#1b5e20,color:#1b5e20 +classDef broker fill:#ffcc80,stroke:#e65100,color:#e65100 +classDef db fill:#ce93d8,stroke:#4a148c,color:#4a148c +classDef queue fill:#fff59d,stroke:#f57f17,color:#f57f17 +classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c + +class WebApp,Worker app +class S3,LocalFS storage +class RabbitMQ broker +class PostgreSQL db +class Queue,RetryQueue queue +class User user +``` +Password-based authentication + +### Migrated Infrastructure + +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: + +* Azure Blob Storage for image storage, using managed identity authentication +* Azure Service Bus for message queuing, using managed identity authentication +* Azure Database for PostgreSQL for metadata storage, using managed identity authentication + +### Migrated Architecture + +```mermaid +flowchart TD + +%% Applications +WebApp[Web Application] +Worker[Worker Service] + +%% Azure Storage Components +AzBlob[(Azure Blob Storage)] +LocalFS[("Local File System
dev only")] + +%% Azure Message Broker +ServiceBus(Azure Service Bus) + +%% Azure Database +AzPostgreSQL[(Azure PostgreSQL)] + +%% Queues +Queue[image-processing queue] +RetryQueue[retry queue] + +%% User +User([User]) + +%% User Flow +User -->|Upload Image| WebApp +User -->|View Images| WebApp + +%% Web App Flows +WebApp -->|Store Original Image| AzBlob +WebApp -->|Store Original Image| LocalFS +WebApp -->|Send Processing Message| ServiceBus +WebApp -->|Store Metadata| AzPostgreSQL +WebApp -->|Retrieve Images| AzBlob +WebApp -->|Retrieve Images| LocalFS +WebApp -->|Retrieve Metadata| AzPostgreSQL + +%% Service Bus Flow +ServiceBus -->|Push Message| Queue +Queue -->|Processing Failed| RetryQueue +RetryQueue -->|After 1 min delay| Queue +Queue -->|Consume Message| Worker + +%% Worker Flow +Worker -->|Download Original| AzBlob +Worker -->|Download Original| LocalFS +Worker -->|Upload Thumbnail| AzBlob +Worker -->|Upload Thumbnail| LocalFS +Worker -->|Store Metadata| AzPostgreSQL +Worker -->|Retrieve Metadata| AzPostgreSQL + +%% Styling +classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1 +classDef storage fill:#68B3A1,stroke:#006064,color:#006064 +classDef broker fill:#B39DDB,stroke:#4527A0,color:#4527A0 +classDef db fill:#90CAF9,stroke:#1565C0,color:#1565C0 +classDef queue fill:#81C784,stroke:#2E7D32,color:#2E7D32 +classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c + +class WebApp,Worker app +class AzBlob,LocalFS storage +class ServiceBus broker +class AzPostgreSQL db +class Queue,RetryQueue queue +class User user +``` +Managed identity based authentication + +## Prerequisites + +To successfully complete this workshop, you need the following: + +- [VSCode](https://code.visualstudio.com/): The latest version is recommended. +- [A Github account with Github Copilot enabled](https://github.com/features/copilot): All plans are supported, including the Free plan. +- [GitHub Copilot extension in VSCode](https://code.visualstudio.com/docs/copilot/overview): The latest version is recommended. +- [GitHub Copilot app modernization for Java Extension](https://marketplace.visualstudio.com/items?itemName=vscjava.migrate-java-to-azure): The extension needed for migration +- [AppCAT](https://aka.ms/appcat-install): Required for the app assessment feature. +- [JDK 21](https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-21): Required for the code remediation feature and running the initial application locally. +- [Maven 3.9.9](https://maven.apache.org/install.html): Required for the assessment and code remediation feature. +- [Azure subscription](https://azure.microsoft.com/free/): Required if you want to deploy the migrated application to Azure. +- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli): Required if you want to deploy the migrated application to Azure locally. The latest version is recommended. + +## Lab: Migrate the Sample Java Application + +The following sections guide you through the process of migrating the sample Java application called `asset-manager` to Azure using GitHub Copilot App Modernization for Java. + +### Assess Your Java Application + +The first step is to assess the sample Java application called `asset-manager`. +The assessment provides insights into the application's readiness for migration to Azure. + +1. Open the VS code with all the prerequisites installed. Then open the project by running `code .` in the project directory or open the project inside VS Code. +2. Open the extension `GitHub Copilot App Modernization for Java`. +3. Hover the mouse over the **Assessment** section and click **Assess** button which looks like a triangle pointing right. Then, the Github Copilot Chat window will be opened and propose to run Modernization Assessor. Please confirm the tool usage by clicking **Continue**. + + ![Trigger Assessment](doc-media/1.trigger-assessment.png) + + > **NOTE**: If you are asked to allow the tool access the language models provided by GitHub Copilot Chat, select **Allow** to proceed. + +4. After each step, please manually input "continue" to confirm and proceed. +5. App Mod will then run a precheck asessment to see if **AppCAT** is installed: + + ![Precheck Assessment](doc-media/2.ghcp-precheck-assessment.png) + > **NOTE**: AppCAT should be installed already using the devcontainer. + +1. App Mod will try to install appcat eventually to make sure it's in the right place + + ![Install AppCAT](doc-media/3.ghcp-install-appcat.png) + +2. It will start the assessment after all prechecks and install have been completed. + + ![Run Assessment](doc-media/5.0.ghcp-run-assessment.png) + + > **NOTE**: You can click on the arrow dropdown next to **Running appmod-run-asessment* to view the params that are sent to the MCP server. + ![MCP Details Input](doc-media/5.1ghcp-assessment-details-mcp-input.png) +3. Wait for the assessment to be completed and the report to be generated. + + ![Assessment Report](doc-media/6.appmod-assessment-report.png) + +4. Review the **Summary** report. Take a look at the **Cloud Readiness** report under the **Issues** tab to view the proposed solutions for the issues identified in the summary report. + +### Migrate to Azure Database for PostgreSQL Flexible Server + +1. For this workshop, we will start with the **Database Migration**. +Select **Migrate to Azure Database for PostgreSQL (SDK on Public Cloud)** in the Solution report dropdown on the right. + + ![Database Migration](doc-media/7.0.appmod-db-migration.png) + +1. Right next to the Dropdown, click **Migrate**. +1. After clicking the Migrate button in the Solution Report, Copilot chat window will be opened with Agent Mode. +1. You should see GitHub Copilot run `#appmod-run-task by kbId: managed-identity-azure-sdk-public-cloud/mi-postgresql-azure-sdk-public-cloud` + + ![GHCP Database Migration](doc-media/7.1.ghcp-db-migration.png) + +1. GHCP will continue to run `appmod-run-task`, `appmod-fetch-knowledgebase`,`appmod-search-file` and other tasks using the MCP Server. During each step, please manually click **Continue** repeatedly to allow, confirm and proceed. The Copilot Agent uses various tools to facilitate application modernization. Each tool's usage requires confirmation by clicking the `Continue` button. +1. Wait for the tasks to complete and a **progress overview** will show up as well as a **migration plan** inside GitHub Copilot Chat. Durch each step, please manually input or click "confirm" or "continue" to confirm and proceed. You can find these files under `.github/appmod-java/code-migration/managed-identity-azure-sdk-public-cloud/progress.md`. + + + ![GHCP Database Migration Progress](doc-media/7.2.appmod-progress.png) + +1. Click **Continue** to confirm to run **Java Application Build-Fix** tool. This tool will attempt to resolve any build errors, in up to 10 iterations. +1. After the Build-Fix tool begins, click **Continue** to proceed and show progress and migration summary. +1. Review the proposed code changes and click **Keep** to apply them. + + ![Database Migration Code Update 1](doc-media/7.3.appmod-db-code-update-1.png) + + ![Database Migration Code Update 2](doc-media/7.4.appmod-db-code-update-2.png) +1. GHCP will continue to run `appmod-consistency-validation`. **Continue** and **Confirm** until it runs `appmod-create-migration-summary`. +1. Once GitHub Copilot provides oyu with next recommended actions after the **Summary** has been generated, this part of the lab is concluded. +1. Take a look at the **summary.md** file to review the changes. `.github/appmod-java/code-migration/managed-identity-azure-sdk-public-cloud/mi-postgresql-azure-sdk-public-cloud/summary.md` + +### Migrate from AWS S3 to Azure Blob Storage + +The Application `asset-manager` uses AWS S3 for image storage. Let's move to Azure Blob Storage instead. + +1. Open the Assessment Report. You can always find it by opening the GitHub Copilot App Modernization for Java Extension and look under Assessment. +1. For this part of the workshop, we will take a look at the **Storage Migration**. +We will **Migrate from AWS S3 to Azure Blob Storage**. + + ![Storage Migration](doc-media/8.0.appmod-storage-migration.png) +1. Click **Migrate**. +1. GitHub Copilot runs `#appmod-run-task by kbId: s3-to-azure-blob-storage` +1. GHCP will continue to run `appmod-run-task`, `appmod-fetch-knowledgebase`,`appmod-search-file` and other tasks using the MCP Server. During each step, please manually click **Continue** repeatedly to allow, confirm and proceed. The Copilot Agent uses various tools to facilitate application modernization. Each tool's usage requires confirmation by clicking the `Continue` button. +1. Review the proposed code changes and click **Keep** to apply them. + + ![Storage Migration Code Update](doc-media/8.1.appmod-storage-code-update-1.png) + +### Migrate from AMQP RabbitMQ to Azure Service Bus +The Application `asset-manager` uses Spring AMQP with RabbitMQ for message queuing. Let's move to Azure Service Bus instead. + +1. For this part of the workshop, we will take a look at the **Messaging Service Migration**. +We will **Migrate from AMQP RabbitMQ to Azure Service Bus**. + + ![Storage Migration](doc-media/9.0.appmod-ms-migration.png) +1. Click **Migrate**. +1. GitHub Copilot runs `#appmod-run-task by kbId: amqp-rabbitmq-servicebus` +1. GHCP will continue to run `appmod-run-task`, `appmod-fetch-knowledgebase`,`appmod-search-file` and other tasks using the MCP Server. During each step, please manually click **Continue** repeatedly to allow, confirm and proceed. The Copilot Agent uses various tools to facilitate application modernization. Each tool's usage requires confirmation by clicking the `Continue` button. +1. Review the proposed code changes and click **Keep** to apply them. + +### Completion + +Congratulations — you completed the lab! + +- You ran an automated assessment and applied Copilot-generated migrations for database, storage, and messaging. +- You reviewed and accepted the generated code changes and migration summary. + +**Next steps** +- You are free to deploy the migrated application to Azure using the provided deployment scripts in the [main repo](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/main/asset-manager/scripts): + (`scripts\deploy-to-azure.cmd` or `scripts/deploy-to-azure.sh`). +- Explore the `expected` branch to compare the final migrated state and learn from the changes. +- When finished, run the cleanup script to remove Azure resources (`scripts\cleanup-azure-resources.cmd` or `scripts/cleanup-azure-resources.sh`). + +**Resources** +- Review `.github/appmod-java/.../summary.md` and `plan.md` for migration details. +- See the References & resources section above for SDK and CLI documentation. + +**Well done!** +We hope this lab improved your confidence with App Modernization for Java and Azure migrations. + +### Manual Verification & Checkpoints: +After each major step you can run for build checks: +` +mvn -f web/ clean package +mvn -f worker/ clean package +` + +### Trouble Shooting + +#### GHCP seems to be doing something unclear +Go and take a look at `.github/appmod-java/code-migration/managed-identity-azure-sdk-public-cloud/progress.md` and `.github/appmod-java/code-migration/managed-identity-azure-sdk-public-cloud/plan.md`. +You will find the **Migration Session ID** in `plan.md` which you can always use to refer to the current migration plan. + +## References & resources +- [GitHub Copilot App Modernization for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.migrate-java-to-azure) +- [Azure CLI docs](https://learn.microsoft.com/cli/azure/) +- [Azure Database for PostgreSQL](https://learn.microsoft.com/en-us/azure/postgresql/) +- [Azure Blob Storage SDK for Java](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-java-get-started?tabs=azure-ad) +- [Azure Service Bus SDK for Java](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-java-how-to-use-queues?tabs=passwordless) -- Link to supporting information -- Link to similar sample -- ... diff --git a/asset-manager/README.md b/asset-manager/README.md deleted file mode 100644 index f4998f4..0000000 --- a/asset-manager/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Asset Manager -Sample project for migration tool code remediation that manages assets in cloud storage. - -## Current Infrastructure -The project currently uses the following infrastructure: -* AWS S3 for image storage, using password-based authentication (access key/secret key) -* RabbitMQ for message queuing, using password-based authentication -* PostgreSQL database for metadata storage, using password-based authentication - -## Current Architecture -```mermaid -flowchart TD - -%% Applications -WebApp[Web Application] -Worker[Worker Service] - -%% Storage Components -S3[(AWS S3)] -LocalFS[("Local File System
dev only")] - -%% Message Broker -RabbitMQ(RabbitMQ) - -%% Database -PostgreSQL[(PostgreSQL)] - -%% Queues -Queue[image-processing queue] -RetryQueue[image-processing.retry queue] - -%% User -User([User]) - -%% User Flow -User -->|Upload Image| WebApp -User -->|View Images| WebApp - -%% Web App Flows -WebApp -->|Store Original Image| S3 -WebApp -->|Store Original Image| LocalFS -WebApp -->|Send Processing Message| RabbitMQ -WebApp -->|Store Metadata| PostgreSQL -WebApp -->|Retrieve Images| S3 -WebApp -->|Retrieve Images| LocalFS -WebApp -->|Retrieve Metadata| PostgreSQL - -%% RabbitMQ Flow -RabbitMQ -->|Push Message| Queue -Queue -->|Processing Failed| RetryQueue -RetryQueue -->|After 1 min delay| Queue -Queue -->|Consume Message| Worker - -%% Worker Flow -Worker -->|Download Original| S3 -Worker -->|Download Original| LocalFS -Worker -->|Upload Thumbnail| S3 -Worker -->|Upload Thumbnail| LocalFS -Worker -->|Store Metadata| PostgreSQL -Worker -->|Retrieve Metadata| PostgreSQL - -%% Styling -classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1 -classDef storage fill:#a5d6a7,stroke:#1b5e20,color:#1b5e20 -classDef broker fill:#ffcc80,stroke:#e65100,color:#e65100 -classDef db fill:#ce93d8,stroke:#4a148c,color:#4a148c -classDef queue fill:#fff59d,stroke:#f57f17,color:#f57f17 -classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c - -class WebApp,Worker app -class S3,LocalFS storage -class RabbitMQ broker -class PostgreSQL db -class Queue,RetryQueue queue -class User user -``` -Password-based authentication - -## Migrated Infrastructure -After migration, the project will use the following Azure services: -* Azure Blob Storage for image storage, using managed identity authentication -* Azure Service Bus for message queuing, using managed identity authentication -* Azure Database for PostgreSQL for metadata storage, using managed identity authentication - -## Migrated Architecture -```mermaid -flowchart TD - -%% Applications -WebApp[Web Application] -Worker[Worker Service] - -%% Azure Storage Components -AzBlob[(Azure Blob Storage)] -LocalFS[("Local File System
dev only")] - -%% Azure Message Broker -ServiceBus(Azure Service Bus) - -%% Azure Database -AzPostgreSQL[(Azure PostgreSQL)] - -%% Queues -Queue[image-processing queue] -RetryQueue[retry queue] - -%% User -User([User]) - -%% User Flow -User -->|Upload Image| WebApp -User -->|View Images| WebApp - -%% Web App Flows -WebApp -->|Store Original Image| AzBlob -WebApp -->|Store Original Image| LocalFS -WebApp -->|Send Processing Message| ServiceBus -WebApp -->|Store Metadata| AzPostgreSQL -WebApp -->|Retrieve Images| AzBlob -WebApp -->|Retrieve Images| LocalFS -WebApp -->|Retrieve Metadata| AzPostgreSQL - -%% Service Bus Flow -ServiceBus -->|Push Message| Queue -Queue -->|Processing Failed| RetryQueue -RetryQueue -->|After 1 min delay| Queue -Queue -->|Consume Message| Worker - -%% Worker Flow -Worker -->|Download Original| AzBlob -Worker -->|Download Original| LocalFS -Worker -->|Upload Thumbnail| AzBlob -Worker -->|Upload Thumbnail| LocalFS -Worker -->|Store Metadata| AzPostgreSQL -Worker -->|Retrieve Metadata| AzPostgreSQL - -%% Styling -classDef app fill:#90caf9,stroke:#0d47a1,color:#0d47a1 -classDef storage fill:#68B3A1,stroke:#006064,color:#006064 -classDef broker fill:#B39DDB,stroke:#4527A0,color:#4527A0 -classDef db fill:#90CAF9,stroke:#1565C0,color:#1565C0 -classDef queue fill:#81C784,stroke:#2E7D32,color:#2E7D32 -classDef user fill:#ef9a9a,stroke:#b71c1c,color:#b71c1c - -class WebApp,Worker app -class AzBlob,LocalFS storage -class ServiceBus broker -class AzPostgreSQL db -class Queue,RetryQueue queue -class User user -``` -Managed identity based authentication - -## Run Locally - -**Prerequisites**: JDK, Docker - -Run the following commands to start the apps locally. This will: -* Use local file system instead of S3 to store the image -* Launch RabbitMQ and PostgreSQL using Docker - -Windows: - -```batch -cd asset-manager -scripts\start.cmd -``` - -Linux: - -```sh -cd asset-manager -scripts/start.sh -``` - -To stop, run `stop.cmd` or `stop.sh` in the `scripts` directory. \ No newline at end of file diff --git a/asset-manager/web/src/test/java/com/microsoft/migration/assets/AssetsManagerApplicationTests.java b/asset-manager/web/src/test/java/com/microsoft/migration/assets/AssetsManagerApplicationTests.java deleted file mode 100644 index 95c1e7f..0000000 --- a/asset-manager/web/src/test/java/com/microsoft/migration/assets/AssetsManagerApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.microsoft.migration.assets; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class AssetsManagerApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/doc-media/1.trigger-assessment.png b/doc-media/1.trigger-assessment.png new file mode 100644 index 0000000..986101b Binary files /dev/null and b/doc-media/1.trigger-assessment.png differ diff --git a/doc-media/2.ghcp-precheck-assessment.png b/doc-media/2.ghcp-precheck-assessment.png new file mode 100644 index 0000000..98e19d9 Binary files /dev/null and b/doc-media/2.ghcp-precheck-assessment.png differ diff --git a/doc-media/3.ghcp-install-appcat.png b/doc-media/3.ghcp-install-appcat.png new file mode 100644 index 0000000..c18eb19 Binary files /dev/null and b/doc-media/3.ghcp-install-appcat.png differ diff --git a/doc-media/4.ghcp-precheck-assessment.png b/doc-media/4.ghcp-precheck-assessment.png new file mode 100644 index 0000000..27a1a24 Binary files /dev/null and b/doc-media/4.ghcp-precheck-assessment.png differ diff --git a/doc-media/5.0.ghcp-run-assessment.png b/doc-media/5.0.ghcp-run-assessment.png new file mode 100644 index 0000000..b900087 Binary files /dev/null and b/doc-media/5.0.ghcp-run-assessment.png differ diff --git a/doc-media/5.1ghcp-assessment-details-mcp-input.png b/doc-media/5.1ghcp-assessment-details-mcp-input.png new file mode 100644 index 0000000..35d2a25 Binary files /dev/null and b/doc-media/5.1ghcp-assessment-details-mcp-input.png differ diff --git a/doc-media/5.ghcp-run-assessment.png b/doc-media/5.ghcp-run-assessment.png new file mode 100644 index 0000000..b900087 Binary files /dev/null and b/doc-media/5.ghcp-run-assessment.png differ diff --git a/doc-media/6.appmod-assessment-report.png b/doc-media/6.appmod-assessment-report.png new file mode 100644 index 0000000..31f981a Binary files /dev/null and b/doc-media/6.appmod-assessment-report.png differ diff --git a/doc-media/7.0.appmod-db-migration.png b/doc-media/7.0.appmod-db-migration.png new file mode 100644 index 0000000..80d85b4 Binary files /dev/null and b/doc-media/7.0.appmod-db-migration.png differ diff --git a/doc-media/7.1.ghcp-db-migration.png b/doc-media/7.1.ghcp-db-migration.png new file mode 100644 index 0000000..d82d22a Binary files /dev/null and b/doc-media/7.1.ghcp-db-migration.png differ diff --git a/doc-media/7.2.appmod-progress.png b/doc-media/7.2.appmod-progress.png new file mode 100644 index 0000000..07527c9 Binary files /dev/null and b/doc-media/7.2.appmod-progress.png differ diff --git a/doc-media/7.2appmod-progress.png b/doc-media/7.2appmod-progress.png new file mode 100644 index 0000000..07527c9 Binary files /dev/null and b/doc-media/7.2appmod-progress.png differ diff --git a/doc-media/7.3.appmod-db-code-update-1.png b/doc-media/7.3.appmod-db-code-update-1.png new file mode 100644 index 0000000..b1f2266 Binary files /dev/null and b/doc-media/7.3.appmod-db-code-update-1.png differ diff --git a/doc-media/7.4.appmod-db-code-update-2.png b/doc-media/7.4.appmod-db-code-update-2.png new file mode 100644 index 0000000..6c3d7d8 Binary files /dev/null and b/doc-media/7.4.appmod-db-code-update-2.png differ diff --git a/doc-media/7.appmod-db-migration.png b/doc-media/7.appmod-db-migration.png new file mode 100644 index 0000000..504bdc2 Binary files /dev/null and b/doc-media/7.appmod-db-migration.png differ diff --git a/doc-media/8.0.appmod-storage-migration.png b/doc-media/8.0.appmod-storage-migration.png new file mode 100644 index 0000000..015f803 Binary files /dev/null and b/doc-media/8.0.appmod-storage-migration.png differ diff --git a/doc-media/8.1.appmod-storage-code-update-1.png b/doc-media/8.1.appmod-storage-code-update-1.png new file mode 100644 index 0000000..1e68e5d Binary files /dev/null and b/doc-media/8.1.appmod-storage-code-update-1.png differ diff --git a/doc-media/9.0.appmod-ms-migration.png b/doc-media/9.0.appmod-ms-migration.png new file mode 100644 index 0000000..690775a Binary files /dev/null and b/doc-media/9.0.appmod-ms-migration.png differ diff --git a/mi-sql-public-demo/README.md b/mi-sql-public-demo/README.md deleted file mode 100644 index 2760566..0000000 --- a/mi-sql-public-demo/README.md +++ /dev/null @@ -1 +0,0 @@ -# sqldbmi diff --git a/mi-sql-public-demo/pom.xml b/mi-sql-public-demo/pom.xml deleted file mode 100644 index c7fcd64..0000000 --- a/mi-sql-public-demo/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - com.example - demo - 1.0-SNAPSHOT - - - 17 - 17 - - 17 - - - - - com.microsoft.sqlserver - mssql-jdbc - 10.2.0.jre11 - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 3.2.4 - - - package - - shade - - - - - com.example.MainSQL - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - \ No newline at end of file diff --git a/mi-sql-public-demo/src/main/java/com/example/MainSQL.java b/mi-sql-public-demo/src/main/java/com/example/MainSQL.java deleted file mode 100644 index 3f86b27..0000000 --- a/mi-sql-public-demo/src/main/java/com/example/MainSQL.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.example; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import java.sql.*; - -import com.microsoft.sqlserver.jdbc.SQLServerDataSource; - -public class MainSQL { - - - public static void main(String[] args) { - - Properties properties = new Properties(); - try (InputStream input = MainSQL.class.getClassLoader().getResourceAsStream("application.properties")) { - if (input == null) { - System.out.println("Sorry, unable to find application.properties"); - return; - } - // Load the properties file - properties.load(input); - } catch (IOException ex) { - ex.printStackTrace(); - return; - } - - String connString = properties.getProperty("AZURE_SQLDB_CONNECTIONSTRING"); - String user = properties.getProperty("AZURE_SQLDB_USER"); - String password = properties.getProperty("AZURE_SQLDB_PASSWORD"); - - connString = connString + ";user=" + user + ";password=" + password; - System.out.print(connString); - - SQLServerDataSource ds = new SQLServerDataSource(); - ds.setURL(connString); - try (Connection connection = ds.getConnection()) { - System.out.println("Connected successfully."); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - -} \ No newline at end of file diff --git a/mi-sql-public-demo/src/main/resources/application.properties b/mi-sql-public-demo/src/main/resources/application.properties deleted file mode 100644 index 81a04a4..0000000 --- a/mi-sql-public-demo/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -AZURE_SQLDB_CONNECTIONSTRING=jdbc:sqlserver://${AZ_DATABASE_SERVER_NAME}.database.windows.net:1433;database=demo;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; -AZURE_SQLDB_USER=demo@$AZ_DATABASE_NAME -AZURE_SQLDB_PASSWORD=$AZ_SQL_SERVER_PASSWORD \ No newline at end of file diff --git a/asset-manager/mvnw b/mvnw old mode 100755 new mode 100644 similarity index 100% rename from asset-manager/mvnw rename to mvnw diff --git a/asset-manager/mvnw.cmd b/mvnw.cmd similarity index 100% rename from asset-manager/mvnw.cmd rename to mvnw.cmd diff --git a/pids/worker.pid b/pids/worker.pid new file mode 100644 index 0000000..8883c3e --- /dev/null +++ b/pids/worker.pid @@ -0,0 +1 @@ +35908 \ No newline at end of file diff --git a/asset-manager/pom.xml b/pom.xml similarity index 100% rename from asset-manager/pom.xml rename to pom.xml diff --git a/rabbitmq-sender/pom.xml b/rabbitmq-sender/pom.xml deleted file mode 100644 index 74ab91e..0000000 --- a/rabbitmq-sender/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.3.0 - - - com.example - messaging-rabbitmq - 0.0.1-SNAPSHOT - messaging-rabbitmq - Demo project for rabbitmq - - 17 - - - - org.springframework.boot - spring-boot-starter-amqp - - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.projectlombok - lombok - provided - - - org.projectlombok - lombok - 1.18.24 - provided - - - - com.fasterxml.jackson.core - jackson-databind - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/MessagingRabbitmqApplication.java b/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/MessagingRabbitmqApplication.java deleted file mode 100644 index 6a28a6a..0000000 --- a/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/MessagingRabbitmqApplication.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.example.messagingrabbitmq; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.Bean; -import org.springframework.amqp.core.Queue; - -@SpringBootApplication -public class MessagingRabbitmqApplication { - - static final String queueName1 = "queue1"; - static final String queueName2 = "queue2"; - - public static void main(String[] args) throws InterruptedException { - ConfigurableApplicationContext applicationContext = SpringApplication.run(MessagingRabbitmqApplication.class); - Producer producer = applicationContext.getBean(Producer.class); - producer.run(); - } - - @Bean - public Queue queue1() { - return new Queue(queueName1, true); - } - - @Bean - public Queue queue2() { - return new Queue(queueName2, true); - } - -} diff --git a/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/Producer.java b/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/Producer.java deleted file mode 100644 index 0a0b816..0000000 --- a/rabbitmq-sender/src/main/java/com/example/messagingrabbitmq/Producer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.example.messagingrabbitmq; - -import org.springframework.amqp.core.Message; -import org.springframework.stereotype.Component; -import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Autowired; - -@Component -public class Producer { - - @Autowired - private final RabbitTemplate rabbitTemplate; - - public Producer(RabbitTemplate rabbitTemplate) { - this.rabbitTemplate = rabbitTemplate; - } - - public void run() { - for (int i = 0; i < 10; i++) { - System.out.println("Sending message..."+i); - String responseString = "test "+i; - Message responseMessage = new Message(responseString.getBytes()); - if (i % 2 == 0) { - rabbitTemplate.convertAndSend(MessagingRabbitmqApplication.queueName2, responseMessage); - } else { - rabbitTemplate.convertAndSend(MessagingRabbitmqApplication.queueName1, responseMessage); - } - } - } -} \ No newline at end of file diff --git a/rabbitmq-sender/src/main/resources/application.properties b/rabbitmq-sender/src/main/resources/application.properties deleted file mode 100644 index 93541af..0000000 --- a/rabbitmq-sender/src/main/resources/application.properties +++ /dev/null @@ -1,4 +0,0 @@ -spring.rabbitmq.password=secret -spring.rabbitmq.username=myuser -spring.rabbitmq.host=localhost -spring.rabbitmq.port=5671 diff --git a/asset-manager/scripts/start.cmd b/scripts/start.cmd similarity index 69% rename from asset-manager/scripts/start.cmd rename to scripts/start.cmd index 4752c68..716bc35 100644 --- a/asset-manager/scripts/start.cmd +++ b/scripts/start.cmd @@ -22,12 +22,11 @@ if not exist "%PROJECT_ROOT%\pids" mkdir "%PROJECT_ROOT%\pids" echo Starting web module... cd /d "%PROJECT_ROOT%\web" -start "Web Module" cmd /k "%PROJECT_ROOT%\mvnw.cmd spring-boot:run -Dspring-boot.run.jvmArguments=-Dspring.pid.file=%PROJECT_ROOT%\pids\web.pid -Dspring-boot.run.profiles=dev" +start "Web Module" cmd /k "%PROJECT_ROOT%\mvnw.cmd clean spring-boot:run -Dspring-boot.run.jvmArguments=-Dspring.pid.file=%PROJECT_ROOT%\pids\web.pid -Dspring-boot.run.profiles=dev" echo Starting worker module... cd /d "%PROJECT_ROOT%\worker" -start "Worker Module" cmd /k "%PROJECT_ROOT%\mvnw.cmd spring-boot:run -Dspring-boot.run.jvmArguments=-Dspring.pid.file=%PROJECT_ROOT%\pids\worker.pid -Dspring-boot.run.profiles=dev" +start "Worker Module" cmd /k "%PROJECT_ROOT%\mvnw.cmd clean spring-boot:run -Dspring-boot.run.jvmArguments=-Dspring.pid.file=%PROJECT_ROOT%\pids\worker.pid -Dspring-boot.run.profiles=dev" echo Web application: http://localhost:8080 -echo Worker application: http://localhost:8081 echo RabbitMQ Management: http://localhost:15672 (guest/guest) diff --git a/asset-manager/scripts/start.sh b/scripts/start.sh similarity index 66% rename from asset-manager/scripts/start.sh rename to scripts/start.sh index 9cb749c..62ad611 100644 --- a/asset-manager/scripts/start.sh +++ b/scripts/start.sh @@ -27,12 +27,11 @@ mkdir -p "$PROJECT_ROOT/logs" mkdir -p "$PROJECT_ROOT/pids" echo "Starting web module..." -cd "$PROJECT_ROOT/web" && "$PROJECT_ROOT/mvnw" spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.pid.file=$PROJECT_ROOT/pids/web.pid" -Dspring-boot.run.profiles=dev > "$PROJECT_ROOT/logs/web.log" 2>&1 & +cd "$PROJECT_ROOT/web" && "$PROJECT_ROOT/mvnw" clean spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.pid.file=$PROJECT_ROOT/pids/web.pid" -Dspring-boot.run.profiles=dev > "$PROJECT_ROOT/logs/web.log" 2>&1 & echo "Starting worker module..." -cd "$PROJECT_ROOT/worker" && "$PROJECT_ROOT/mvnw" spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.pid.file=$PROJECT_ROOT/pids/worker.pid" -Dspring-boot.run.profiles=dev > "$PROJECT_ROOT/logs/worker.log" 2>&1 & +cd "$PROJECT_ROOT/worker" && "$PROJECT_ROOT/mvnw" clean spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.pid.file=$PROJECT_ROOT/pids/worker.pid" -Dspring-boot.run.profiles=dev > "$PROJECT_ROOT/logs/worker.log" 2>&1 & echo "All services started! Check logs directory for output." echo "Web application: http://localhost:8080" -echo "Worker application: http://localhost:8081" echo "RabbitMQ Management: http://localhost:15672 (guest/guest)" \ No newline at end of file diff --git a/asset-manager/scripts/stop.cmd b/scripts/stop.cmd similarity index 100% rename from asset-manager/scripts/stop.cmd rename to scripts/stop.cmd diff --git a/asset-manager/scripts/stop.sh b/scripts/stop.sh similarity index 100% rename from asset-manager/scripts/stop.sh rename to scripts/stop.sh diff --git a/storage/az305.png b/storage/az305.png new file mode 100644 index 0000000..a0a2a69 Binary files /dev/null and b/storage/az305.png differ diff --git a/storage/az305_thumbnail.png b/storage/az305_thumbnail.png new file mode 100644 index 0000000..dce0559 Binary files /dev/null and b/storage/az305_thumbnail.png differ diff --git a/asset-manager/web/pom.xml b/web/pom.xml similarity index 100% rename from asset-manager/web/pom.xml rename to web/pom.xml diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/AssetsManagerApplication.java b/web/src/main/java/com/microsoft/migration/assets/AssetsManagerApplication.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/AssetsManagerApplication.java rename to web/src/main/java/com/microsoft/migration/assets/AssetsManagerApplication.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/config/AwsS3Config.java b/web/src/main/java/com/microsoft/migration/assets/config/AwsS3Config.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/config/AwsS3Config.java rename to web/src/main/java/com/microsoft/migration/assets/config/AwsS3Config.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/config/RabbitConfig.java b/web/src/main/java/com/microsoft/migration/assets/config/RabbitConfig.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/config/RabbitConfig.java rename to web/src/main/java/com/microsoft/migration/assets/config/RabbitConfig.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/controller/HomeController.java b/web/src/main/java/com/microsoft/migration/assets/controller/HomeController.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/controller/HomeController.java rename to web/src/main/java/com/microsoft/migration/assets/controller/HomeController.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/controller/S3Controller.java b/web/src/main/java/com/microsoft/migration/assets/controller/S3Controller.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/controller/S3Controller.java rename to web/src/main/java/com/microsoft/migration/assets/controller/S3Controller.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/model/ImageMetadata.java b/web/src/main/java/com/microsoft/migration/assets/model/ImageMetadata.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/model/ImageMetadata.java rename to web/src/main/java/com/microsoft/migration/assets/model/ImageMetadata.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/model/ImageProcessingMessage.java b/web/src/main/java/com/microsoft/migration/assets/model/ImageProcessingMessage.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/model/ImageProcessingMessage.java rename to web/src/main/java/com/microsoft/migration/assets/model/ImageProcessingMessage.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/model/S3StorageItem.java b/web/src/main/java/com/microsoft/migration/assets/model/S3StorageItem.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/model/S3StorageItem.java rename to web/src/main/java/com/microsoft/migration/assets/model/S3StorageItem.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/repository/ImageMetadataRepository.java b/web/src/main/java/com/microsoft/migration/assets/repository/ImageMetadataRepository.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/repository/ImageMetadataRepository.java rename to web/src/main/java/com/microsoft/migration/assets/repository/ImageMetadataRepository.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/service/AwsS3Service.java b/web/src/main/java/com/microsoft/migration/assets/service/AwsS3Service.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/service/AwsS3Service.java rename to web/src/main/java/com/microsoft/migration/assets/service/AwsS3Service.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/service/BackupMessageProcessor.java b/web/src/main/java/com/microsoft/migration/assets/service/BackupMessageProcessor.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/service/BackupMessageProcessor.java rename to web/src/main/java/com/microsoft/migration/assets/service/BackupMessageProcessor.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/service/LocalFileStorageService.java b/web/src/main/java/com/microsoft/migration/assets/service/LocalFileStorageService.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/service/LocalFileStorageService.java rename to web/src/main/java/com/microsoft/migration/assets/service/LocalFileStorageService.java diff --git a/asset-manager/web/src/main/java/com/microsoft/migration/assets/service/StorageService.java b/web/src/main/java/com/microsoft/migration/assets/service/StorageService.java similarity index 100% rename from asset-manager/web/src/main/java/com/microsoft/migration/assets/service/StorageService.java rename to web/src/main/java/com/microsoft/migration/assets/service/StorageService.java diff --git a/asset-manager/web/src/main/resources/application.properties b/web/src/main/resources/application.properties similarity index 100% rename from asset-manager/web/src/main/resources/application.properties rename to web/src/main/resources/application.properties diff --git a/asset-manager/web/src/main/resources/templates/layout.html b/web/src/main/resources/templates/layout.html similarity index 100% rename from asset-manager/web/src/main/resources/templates/layout.html rename to web/src/main/resources/templates/layout.html diff --git a/asset-manager/web/src/main/resources/templates/list.html b/web/src/main/resources/templates/list.html similarity index 100% rename from asset-manager/web/src/main/resources/templates/list.html rename to web/src/main/resources/templates/list.html diff --git a/asset-manager/web/src/main/resources/templates/upload.html b/web/src/main/resources/templates/upload.html similarity index 100% rename from asset-manager/web/src/main/resources/templates/upload.html rename to web/src/main/resources/templates/upload.html diff --git a/asset-manager/web/src/main/resources/templates/view.html b/web/src/main/resources/templates/view.html similarity index 100% rename from asset-manager/web/src/main/resources/templates/view.html rename to web/src/main/resources/templates/view.html diff --git a/asset-manager/worker/pom.xml b/worker/pom.xml similarity index 100% rename from asset-manager/worker/pom.xml rename to worker/pom.xml diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/WorkerApplication.java b/worker/src/main/java/com/microsoft/migration/assets/worker/WorkerApplication.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/WorkerApplication.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/WorkerApplication.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/config/AwsS3Config.java b/worker/src/main/java/com/microsoft/migration/assets/worker/config/AwsS3Config.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/config/AwsS3Config.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/config/AwsS3Config.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/config/RabbitConfig.java b/worker/src/main/java/com/microsoft/migration/assets/worker/config/RabbitConfig.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/config/RabbitConfig.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/config/RabbitConfig.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageMetadata.java b/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageMetadata.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageMetadata.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageMetadata.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageProcessingMessage.java b/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageProcessingMessage.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageProcessingMessage.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/model/ImageProcessingMessage.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/repository/ImageMetadataRepository.java b/worker/src/main/java/com/microsoft/migration/assets/worker/repository/ImageMetadataRepository.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/repository/ImageMetadataRepository.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/repository/ImageMetadataRepository.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/AbstractFileProcessingService.java b/worker/src/main/java/com/microsoft/migration/assets/worker/service/AbstractFileProcessingService.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/AbstractFileProcessingService.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/service/AbstractFileProcessingService.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/FileProcessor.java b/worker/src/main/java/com/microsoft/migration/assets/worker/service/FileProcessor.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/FileProcessor.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/service/FileProcessor.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/LocalFileProcessingService.java b/worker/src/main/java/com/microsoft/migration/assets/worker/service/LocalFileProcessingService.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/LocalFileProcessingService.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/service/LocalFileProcessingService.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/S3FileProcessingService.java b/worker/src/main/java/com/microsoft/migration/assets/worker/service/S3FileProcessingService.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/service/S3FileProcessingService.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/service/S3FileProcessingService.java diff --git a/asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/util/StorageUtil.java b/worker/src/main/java/com/microsoft/migration/assets/worker/util/StorageUtil.java similarity index 100% rename from asset-manager/worker/src/main/java/com/microsoft/migration/assets/worker/util/StorageUtil.java rename to worker/src/main/java/com/microsoft/migration/assets/worker/util/StorageUtil.java diff --git a/asset-manager/worker/src/main/resources/application.properties b/worker/src/main/resources/application.properties similarity index 91% rename from asset-manager/worker/src/main/resources/application.properties rename to worker/src/main/resources/application.properties index 2896bc7..324bf0f 100644 --- a/asset-manager/worker/src/main/resources/application.properties +++ b/worker/src/main/resources/application.properties @@ -4,9 +4,6 @@ aws.secretKey=your-secret-key aws.region=us-east-1 aws.s3.bucket=your-bucket-name -# Server port (different from web module) -server.port=8081 - # Application name spring.application.name=assets-manager-worker