Skip to content

Commit

Permalink
Updates with nbdev_prepare, continuing with template2
Browse files Browse the repository at this point in the history
  • Loading branch information
jwmatthews committed Nov 11, 2023
1 parent 9273615 commit 777dbb3
Show file tree
Hide file tree
Showing 128 changed files with 7,048 additions and 1,014 deletions.
19 changes: 5 additions & 14 deletions _proc/04_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,12 @@
"Writing eap8/eap7 to ./example/coolstuff-javaee/eap8_eap7.md\n",
"Writing openshift to ./example/coolstuff-javaee/openshift.md\n",
"Writing quarkus/springboot to ./example/coolstuff-javaee/quarkus_springboot.md\n",
"\n",
"We have results from 3 RuleSet(s) in ../data/example_reports/konveyor-examples/example-1/output.yaml\n",
"\n"
]
},
{
"ename": "KeyError",
"evalue": "'description'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb Cell 6\u001b[0m line \u001b[0;36m1\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m r \u001b[39m=\u001b[39m report\u001b[39m.\u001b[39mget_report()\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mWe have results from \u001b[39m\u001b[39m{\u001b[39;00m\u001b[39mlen\u001b[39m(r\u001b[39m.\u001b[39mkeys())\u001b[39m}\u001b[39;00m\u001b[39m RuleSet(s) in \u001b[39m\u001b[39m{\u001b[39;00mpath_to_report\u001b[39m}\u001b[39;00m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=14'>15</a>\u001b[0m report\u001b[39m.\u001b[39;49mwrite_markdown(output_dir)\n",
"\u001b[1;32m/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb Cell 6\u001b[0m line \u001b[0;36m5\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=48'>49</a>\u001b[0m f\u001b[39m.\u001b[39mtruncate(\u001b[39m0\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=49'>50</a>\u001b[0m buffer \u001b[39m=\u001b[39m StringIO()\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=50'>51</a>\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get_markdown_snippet(ruleset_name, buffer)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=51'>52</a>\u001b[0m buffer\u001b[39m.\u001b[39mseek(\u001b[39m0\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=52'>53</a>\u001b[0m shutil\u001b[39m.\u001b[39mcopyfileobj(buffer, f)\n",
"\u001b[1;32m/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb Cell 6\u001b[0m line \u001b[0;36m6\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=59'>60</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m# \u001b[39m\u001b[39m{\u001b[39;00mruleset_name\u001b[39m}\u001b[39;00m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=60'>61</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m## Description\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=61'>62</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m{\u001b[39;00mruleset[\u001b[39m'\u001b[39;49m\u001b[39mdescription\u001b[39;49m\u001b[39m'\u001b[39;49m]\u001b[39m}\u001b[39;00m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=62'>63</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/04_report.ipynb#X20sZmlsZQ%3D%3D?line=63'>64</a>\u001b[0m f\u001b[39m.\u001b[39mwrite(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39m\"\u001b[39m)\n",
"\u001b[0;31mKeyError\u001b[0m: 'description'"
"\n",
"Writing discovery-rules to ./example/konveyor-examples/example-1/discovery-rules.md\n",
"Writing eap8/eap7 to ./example/konveyor-examples/example-1/eap8_eap7.md\n",
"Writing openshift to ./example/konveyor-examples/example-1/openshift.md\n"
]
}
],
Expand Down
41 changes: 30 additions & 11 deletions _proc/05_llm_result_and_analysis_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"text/markdown": [
"---\n",
"\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/result.py#L15){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/result.py#L16){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### LLMResult\n",
"\n",
Expand All @@ -44,7 +44,7 @@
"text/plain": [
"---\n",
"\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/result.py#L15){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/result.py#L16){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### LLMResult\n",
"\n",
Expand Down Expand Up @@ -75,14 +75,26 @@
},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'kyma_poc.result'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/05_llm_result_and_analysis_report.ipynb Cell 5\u001b[0m line \u001b[0;36m1\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/05_llm_result_and_analysis_report.ipynb#W6sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mkyma_poc\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mresult\u001b[39;00m \u001b[39mimport\u001b[39;00m LLMResult\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/05_llm_result_and_analysis_report.ipynb#W6sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m example_solved_git_path \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m../data/coolstuff-quarkus\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/jmatthews/git/jwmatthews/kyma_poc/nbs/05_llm_result_and_analysis_report.ipynb#W6sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m example_initial_git_path \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m../data/coolstuff-javaee\u001b[39m\u001b[39m\"\u001b[39m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'kyma_poc.result'"
"name": "stdout",
"output_type": "stream",
"text": [
"Skipping eap7/websphere as it is not in ['quarkus/springboot']\n",
"Skipping eap8/eap7 as it is not in ['quarkus/springboot']\n",
"Skipping openshift as it is not in ['quarkus/springboot']\n",
"Processing quarkus/springboot quarkus_springboot\n",
"Skipping cdi-to-quarkus-00030 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Error: too many values to unpack (expected 2)\n",
"Skipping javaee-pom-to-quarkus-00000 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00010 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00020 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00030 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00040 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00050 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00060 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping jaxrs-to-quarkus-00020 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping quarkus-flyway-00000 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping quarkus-flyway-00010 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Process complete\n"
]
}
],
Expand All @@ -91,11 +103,18 @@
"example_initial_git_path = \"../data/coolstuff-javaee\"\n",
"path_to_report = '../data/example_reports/coolstuff-javaee/output.yaml'\n",
"output_dir = './example/reports/coolstuff-javaee'\n",
" \n",
"#model_name = \"gpt-3.5-turbo-16k\" \n",
"model_name=\"gpt-4-1106-preview\"\n",
"\n",
"llmResult = LLMResult()\n",
"llmResult.set_path_original_source(example_initial_git_path)\n",
"llmResult.set_path_solved_source(example_solved_git_path)\n",
"llmResult.parse_report(path_to_report)"
"llmResult.parse_report(path_to_report)\n",
"limit_to_rulesets = ['quarkus/springboot']\n",
"#limit_to_violations = ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"#llmResult.process(model_name, limit_to_rulesets, limit_to_violations)\n",
"llmResult.process(model_name, limit_to_rulesets)"
]
}
],
Expand Down
137 changes: 137 additions & 0 deletions _proc/06_llm_result_and_analysis_report.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"cells": [
{
"cell_type": "raw",
"metadata": {},
"source": [
"---\n",
"output-file: llm_result_and_analysis_report.html\n",
"title: Read an analysis report and for each violation, generate a sample patch for\n",
" an incident\n",
"\n",
"---\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"---\n",
"\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/resultb.py#L16){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### LLMResultB\n",
"\n",
"> LLMResultB ()\n",
"\n",
"The intent of this class is to help us form several Prompt examples using a single application\n",
"which we have already migrated. We are using this single application and picking a few \n",
"violations our analyzer finds and then will construct a few prompt examples to assess the\n",
"quality of response from a LLM"
],
"text/plain": [
"---\n",
"\n",
"[source](https://github.com/jwmatthews/kyma_poc/blob/main/kyma_poc/resultb.py#L16){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### LLMResultB\n",
"\n",
"> LLMResultB ()\n",
"\n",
"The intent of this class is to help us form several Prompt examples using a single application\n",
"which we have already migrated. We are using this single application and picking a few \n",
"violations our analyzer finds and then will construct a few prompt examples to assess the\n",
"quality of response from a LLM"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#| echo: false\n",
"#| output: asis\n",
"show_doc(LLMResultB)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"language": "python"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Skipping eap7/websphere as it is not in ['quarkus/springboot']\n",
"Skipping eap8/eap7 as it is not in ['quarkus/springboot']\n",
"Skipping openshift as it is not in ['quarkus/springboot']\n",
"Processing quarkus/springboot quarkus_springboot\n",
"Skipping cdi-to-quarkus-00030 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Error: too many values to unpack (expected 2)\n",
"Skipping javaee-pom-to-quarkus-00000 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00010 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00020 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00030 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00040 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00050 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping javaee-pom-to-quarkus-00060 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping jaxrs-to-quarkus-00020 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping quarkus-flyway-00000 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Skipping quarkus-flyway-00010 as it is not in ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"Process complete\n"
]
}
],
"source": [
"example_solved_git_path = \"../data/coolstuff-quarkus\"\n",
"example_initial_git_path = \"../data/coolstuff-javaee\"\n",
"path_to_report = '../data/example_reports/coolstuff-javaee/output.yaml'\n",
"#output_dir = './example/reports_B/coolstuff-javaee'\n",
" \n",
"model_name = \"gpt-3.5-turbo-16k\" \n",
"#model_name=\"gpt-4-1106-preview\"\n",
"\n",
"llmResult = LLMResultB()\n",
"llmResult.set_path_original_source(example_initial_git_path)\n",
"llmResult.set_path_solved_source(example_solved_git_path)\n",
"llmResult.parse_report(path_to_report)\n",
"limit_to_rulesets = ['quarkus/springboot']\n",
"#limit_to_violations = ['cdi-to-quarkus-00040', 'cdi-to-quarkus-00050']\n",
"#llmResult.process(model_name, limit_to_rulesets, limit_to_violations)\n",
"llmResult.process(model_name, limit_to_rulesets)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"language": "python",
"name": "python3"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
2 changes: 1 addition & 1 deletion _proc/example/coolstuff-javaee/eap7_websphere.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# eap7/websphere
## Description
Provides analysis of WebSphere proprietary classes and constructs that may require individual attention when migrating to JBoss EAP 7+.
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 1
Expand Down
2 changes: 1 addition & 1 deletion _proc/example/coolstuff-javaee/eap8_eap7.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# eap8/eap7
## Description
This ruleset provides rules to support the migration to hibernate search 6.0. Developed under WINDUPRULE-900
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 13
Expand Down
2 changes: 1 addition & 1 deletion _proc/example/coolstuff-javaee/openshift.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# openshift
## Description
This ruleset detects the Java Mail API, which may be problematic when migrating an application to a cloud environment.
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 1
Expand Down
2 changes: 1 addition & 1 deletion _proc/example/coolstuff-javaee/quarkus_springboot.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# quarkus/springboot
## Description
This ruleset gives hints to migrate from Spring Scheduled to Quarkus spring-scheduled extension
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 13
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# discovery-rules
## Description

* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 1
Expand Down
2 changes: 1 addition & 1 deletion _proc/example/konveyor-examples/example-1/eap8_eap7.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# eap8/eap7
## Description
This ruleset provides rules to support the migration to hibernate search 6.0. Developed under WINDUPRULE-900
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 2
Expand Down
2 changes: 1 addition & 1 deletion _proc/example/konveyor-examples/example-1/openshift.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# openshift
## Description
This ruleset detects the Java Mail API, which may be problematic when migrating an application to a cloud environment.
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated/quarkus
* Source of rules: https://github.com/konveyor/rulesets/tree/main/default/generated
* Sample application: https://github.com/deewhyweb/eap-coolstore-monolith
## Violations
Number of Violations: 2
Expand Down
Loading

0 comments on commit 777dbb3

Please sign in to comment.