Skip to content

๐Ÿง  Run Konveyor AI in OpenShift Dev Spaces with VS Code Extension

This guide walks you through running Konveyor AI using OpenShift Dev Spaces with VS Code as an IDE.
You'll analyze and modernize a real Java application using the Kai VS Code extension in a Red Hat Dev Spaces workspace.


๐Ÿงฐ Prerequisites

  • Access to an OpenShift cluster with Dev Spaces enabled
  • podman installed locally
  • A Quay.io container registry account
  • Kai .vsix file from Konveyor AI Releases
  • OpenAI credentials to use GPT-4o or a similar LLM

๐Ÿ—๏ธ Step 1: Build the Custom Dev Spaces Image

Create a Containerfile (based on Red Hat UBI for Dev Spaces):

# Use official Dev Spaces base 
#FROM registry.redhat.io/devspaces/udi-rhel9:3.18-2.1741779985
FROM quay.io/devfile/universal-developer-image:ubi9-latest

USER root

# Avoid flaky mirrors, timeouts, or zchunk checksum mismatches
RUN echo "fastestmirror=True" >> /etc/dnf/dnf.conf && \
    echo "skip_if_unavailable=True" >> /etc/dnf/dnf.conf && \
    echo "zchunk=False" >> /etc/dnf/dnf.conf

# Install dependencies required by Konveyor AI + typical tools
RUN dnf clean all && \
    dnf install -y --nobest --allowerasing \
        python3.12 python3.12-devel \
        java-17-openjdk-devel \
        nodejs maven \
        unzip git curl zsh \
        gcc make glibc-devel libffi-devel openssl-devel \
    && dnf clean all

# Add Kai extension from GitHub release
RUN curl -L -o /konveyor.vsix https://github.com/konveyor/editor-extensions/releases/download/v0.0.13/konveyor-v0.0.13.vsix
ENV DEFAULT_EXTENSIONS=/konveyor.vsix


ENV DEFAULT_EXTENSIONS=/konveyor-v0.0.13.vsix    

USER user

๐Ÿ› ๏ธ Build & Push

podman build -t quay.io/<your-username>/kai-devspaces:latest .
podman push quay.io/<your-username>/kai-devspaces:latest

๐Ÿ“ฆ Step 2: Create devfile.yaml

schemaVersion: 2.2.0
metadata:
  name: kai-devspaces
components:
  - name: kai-dev-container
    container:
      image: quay.io/<your-username>/kai-devspaces:latest
      memoryLimit: 8Gi

Launch a new Dev Spaces workspace using this devfile.yaml.


Screenshot 2025-03-26 at 4 40 04โ€ฏPM

Screenshot 2025-03-26 at 4 36 30โ€ฏPM

Screenshot 2025-03-26 at 4 42 59โ€ฏPM

๐Ÿ“‚ Step 3: Clone the Example Codebase

In your Dev Spaces terminal:

git clone https://github.com/rrbanda/coolstore.git
cd coolstore

โš™๏ธ Step 4: Configure the Extension specific details

Ensure .vscode/settings.json includes:

{
  "konveyor.analysis.useDefaultRulesets": true,
  "konveyor.analysis.labelSelector": "(konveyor.io/target=jakarta-ee || konveyor.io/target=openjdk11 || konveyor.io/target=openjdk17) || (discovery)"
}

Confgure the LLM

Configure source and target dependencies

https://github.com/user-attachments/assets/3e498252-f620-4985-bac7-e22b17819ec6


๐Ÿš€ Step 5: Run the Analysis

  1. Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Run: Konveyor: Run Analysis
  3. Once the RPC server is initialized, navigate to the Konveyor Analysis View and run the analysis

Run Analysis


๐Ÿงพ View and Filter Issues

The Konveyor Analysis View will list issues by file. Use the issue panel to filter and navigate easily:

Analysis View

Lost the panel? Use the Command Palette and reopen the view:

Reopen Panel


๐Ÿ› ๏ธ Apply Fixes

Change Import Namespaces

Search for a file like InventoryEntity.java, click the fix icon, and choose the effort level (Low/Medium/High):

Request Fix

Review the generated suggestion:

Resolution Details 1 Resolution Details 2

Use the Diff view to inspect and accept:

Change Import


๐Ÿ“ Apply Advanced Fixes

Modify Scope (CDI Beans)

Fix files like CatalogService.java:

CDI Fix 1 CDI Fix 2

EJB Replacements

For ShippingService.java:

EJB REST Replace


JMS to SmallRye

Resolve JMS issues by selecting Medium effort:

JMS Migration JMS Fix 1 JMS Fix 2 JMS Fix 3 JMS Fix 4


๐Ÿ’ก Agentic Workflow

Understand how Kai orchestrates fixes behind the scenes:

graph LR
 A[Validator] -->
 B[TaskManager] --> 
 C{TaskRunners}
   C -->D[Analyzer Agent]-->G
   C -->E[MavenCompiler Agent]-->G
   C -->F[Maven Dependency Agent]-->G
 G[Reflection Agent]-- Feedback Loop -->A
  • Validator Generate tasks on detected issues. Re-evaluated after each change to the codebase
  • Task Manager Queued by priority and passed to Task runners
  • Task Runners Understand how to handle specific types and errors and orchestrates agents.
  • Analyzer Agent Analyze migration issues and generate an LLM fix
  • MavenCompiler Agent Check compilation after fix
  • MavenDependency Agent Check dependencies after fix
  • Reflection Agent callibrate the source in conjunction to other agents.

โœ… Expected Behavior

  • Incident suggestions appear
  • You can select effort level and apply changes
  • Logs are saved in .vscode/konveyor-logs/
  • You can validate using:
mvn clean install && mvn compile

๐Ÿ“ Example Project Structure

coolstore/
โ”œโ”€โ”€ .vscode/
โ”‚   โ””โ”€โ”€ settings.json
โ”œโ”€โ”€ pom.xml
โ”œโ”€โ”€ src/
โ””โ”€โ”€ ...

๐Ÿ“Ž References


```

Let me know if you want this pushed into your GitHub repo or saved as a file.