Generative AI
Application Migration
2024 June
1
2
What we’ll discuss today…
3
Konveyor Overview
4
“Surface insights on applications at scale to empower enterprise architects to make better-informed decisions related to modernization activities”
Konveyor
Mission and goals
5
Analysis Engine
Analysis Report
YAML
Analysis Rules
YAML
OpenAPI Spec validation
Language Provider
Language Server Protocol Implementation
Source Code
Binaries
Translate conditions in a Rule to LSP queries
Analysis Rules
Community Knowledge + Custom Rules
Custom Rules for Organization specific frameworks/technologies
Report informs Architect of areas of concern
Organization Wide View of Application Information
Target technology tags
Discovered source technology tags
Analysis Incident
Analysis Info Details
Sample Analysis Report
Example: Recommendation to replace JMS Topic with an Emitter
7
Konveyor AI (Kai) Goal
8
Konveyor AI (Kai)
Goal
Goal: Improve the economics of re-platforming and refactoring applications to Kubernetes and cloud-native technologies by leveraging Generative AI
Approach:
9
Modernization Engagement running at Scale
General Pattern
10
Modernization Engagement running at Scale
General Pattern
Konveyor AI (Kai) focus area
11
Konveyor AI (Kai)
Workflow
12
Konveyor AI (Kai) Approach
13
Konveyor AI (Kai)
Generative AI to automate source code changes between technologies
14
Kai + Konveyor
Functional Overview
15
Large Language Model (LLM)
Concerns/Limitations
16
Approach: LLM Limited Context Windows
Source Code Analysis Guides LLM interaction
Source Code Repository
Konveyor Analysis
Analysis Report
Issue #1
Issue #2
Issue #N
LLM Request
LLM Request
LLM Request
Aggregate Responses
17
Approach: Need to augment a LLM’s knowledge
Retrieval Augmented Generation
How can we influence a LLM to give us better info on knowledge it wasn’t ‘trained’ on?
18
Retrieval Augmented Generation (RAG)
Approach
Source Code
Solved Issues (code snippets)
Analysis Issues
Prompt Instructions
+
Large Language Model (LLM)
Updated Source Code
Reasoning
Issue to fix: "Stateless EJBs can be converted to a cdi bean by importing `jakarta.enterprise.context.ApplicationScoped` and replacing the `@Stateless` annotation with a scope eg `@ApplicationScoped`"
Line number: 14
diff --git a/src/main/java/org/jboss/as/quickstarts/bmt/ManagedComponent.java b/src/main/java/org/jboss/as/quickstarts/bmt/ManagedComponent.java�…
-@Stateless
-@TransactionManagement(TransactionManagementType.BEAN)
-// tell the container not to manage transactions
+@ApplicationScoped
…
Agent workflow
20
Differentiator
What differentiates this approach from a CoPilot clone
21
Large scale migration methodology
22
Migration methodology
The path to Kubernetes adoption
Assess
Prepare
Pilot
Scale
Rationalize
23
Assess
Understand the application landscape
Technologies & Runtimes
ALM Processes
Early identification of risks
Mitigation strategies
Holistic view of the application landscape
24
Rationalize
Classify and define migration approach for each application type
Rehost (lift & shift)
Replatform (lift & reshape)
Repurchase
Refactor (rewrite & decouple)
Assess, review,�prioritize.
Retire
Retain as is (for now)
?
Existing�App
25
Prepare
Mitigate risks and configure the runtime platform
Deployment Manifests
Runtime Images
Configuration Model
ALM
Implement application deployment model
Execute mitigation strategy
26
Pilot
Migrate and learn
Migrate a representative set of apps
Document everything
Test the migration process
Test the organization
Execute the first migration wave
27
Scale
Migrate the whole portfolio iteratively
Scale the adoption team
Migrate in waves
Migrate the application portfolio
28
Inserting Kai into the migration process
29
Scale
Applying Kai at Scale
Impact of Kai in the Scale stage
Pilot
Seed
Support
Automate
30
Pilot
Migrate and learn
Migrate a representative set of apps
Document everything
Test the migration process
Test the organization
Execute the first migration wave
Create custom rules
31
Pilot
Create custom rules
32
Seed
Initialize the knowledge base for Kai
33
Support
Start leveraging LLMs and provide feedback to refine the data set
34
Automate
Scale out automated source code fixes
35
Konveyor AI (Kai)
IDE Usage Walkthrough
36
IDE Usage Walkthrough
Use case and target persona
Use case
37
IDE Usage Walkthrough
Workflow
38
Run Konveyor Analysis from within IDE
39
Info from each incident is used to resolve the issue.
These ‘hints’ are passed to the LLM so it knows exactly what we need to do to resolve the issue
Konveyor Analysis Issue Details in the IDE
40
Step 1: Right click to generate a suggested fix
Step 3: Review suggested changes or make edits
Step 2: Consult the LLMs reasoning for changes
Step 4: Accept or Reject
Thank you!
41
Backup Slides
42
Konveyor is focused on Application Modernization to help accelerate the adoption of Kubernetes at scale
44
Konveyor Hub
Assets Generation
Reporting
Assessment
Code Transformation
Planning
Analysis
45
Konveyor Unified Experience
46
Unified Experience: Overview
See https://github.com/konveyor/enhancements/tree/master/enhancements/unified_experience for more information
47
Unified Experience: Personas
48
Step #1 - Surface Information
49
Step #2 - Make Decisions
50
Step #3 - Plan Work
51
Step #4 - Do Work
52
Konveyor Analysis
53
Source Code Analysis Engine for Multiple Languages
Language Provider
Language Server Protocol (LSP) Implementation
Analysis Engine
Source Code
54
Custom Migration Targets
Streamline knowledge sharing abstracting migration teams from the complexity
55
Example of a Rule
- category: mandatory� description: Remote EJBs are not supported in Quarkus� ruleID: remote-ejb-to-quarkus-00000� when:� or:� - java.referenced:� location: ANNOTATION� pattern: javax.ejb.Remote� - java.referenced:� location: ANNOTATION� pattern: jakarta.ejb.Remote� message: |-� Remote EJBs are not supported in Quarkus, and therefore its use must be removed and replaced with REST functionality. In order to do this:� 1. Replace the `@Remote` annotation on the class with a `@jakarta.ws.rs.Path("<endpoint>")` annotation. An endpoint must be added to the annotation in place of `<endpoint>` to specify the actual path to the REST service.� 2. Remove `@Stateless` annotations if present. Given that REST services are stateless by nature, it makes it unnecessary.
remote-ejb-to-quarkus-00000:� description: Remote EJBs are not supported in Quarkus� incidents:� - uri: file:///tmp/source-code/src/main/java/com/redhat/coolstore/service/ShippingService.java� message: "Remote EJBs are not supported in Quarkus,.....\n"� lineNumber: 12� variables:� file: file:///tmp/source-code/src/main/java/com/redhat/coolstore/service/ShippingService.java� kind: Class� name: Stateless� package: com.redhat.coolstore.service
Example of an Analysis Issue
56
Kai Backup Slides
57
Approach
Approach to leveraging LLMs
58
Kai + InstructLab Workflow
59
Solved Example:
Konveyor Migration Data
Organization wide view of structured migration data
60
How do we find a ‘Solved Example’ for initial prompt
Talk to LLM and ask to help us to pick out the most relevant pieces of code to help with future generations
Functional Overview
62
“Cascaded changes” - edits that impact multiple files in a repo
i.e. changing a method signature and all of it’s usages…
Leverage LSP for real-time parsing of code and recognition of errors to address
Example of possible UX (similar to CoPilot)
Example of GitHub Copilot Explain UX
Kai will help the MigrationFactory team by providing an experience similar to CoPilot
The value-add for Kai is: