Skip to content

✨ Incident Infrastructure Improvements #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Jul 24, 2024

Conversation

JonahSussman
Copy link
Contributor

No description provided.

JonahSussman and others added 19 commits July 23, 2024 09:59
Signed-off-by: Jonah Sussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
…ebugging and tweaking prompts (konveyor#219)

* Update targets to match kantra v0.4.0+

* Add ability to trace LLM related data

Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
Copy link
Contributor

@fabianvf fabianvf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few questions, looks pretty good though and I like all the added tests. A lot of stuff was added to requirements.txt, just want to double check they are all required.

incident to fix: "{{ incident.message }}"
Line number: {{ incident.line_number }}
{% if incident.solution_str is defined %}
{{ incident.solution_str }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there still a way for users to override the templates for the solutions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_prompt still retrieves its prompt from the model provider, with a default of main.jinja, so that functionality is still there. Right now, there's no way to override the solution_handling templates though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want to just pass variables in from the solution handler to the normal template. Could we declare what variables are declared by a handler and what variables are required for a template so that we can fail on start with an invalid config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I understand.

get_incident_solution_for_file will pass the same variables to the user-specified prompt regardless. One of those variables, incident.solution_str, is generated by solution_consumer. Each solution consumer expects a Solution, which is indeed type-checked and uses prompts in the solution_handling directory. Right now, templates there can't be configured, but the main prompt can.

Copy link
Member

@jwmatthews jwmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to look over the rebase with:

  • Tracing
  • Logging to file

When I attempted to run I hit an exception with Tracing from a recent commit to let tracing follow the configured 'log' directory, looks like in the rebase we changed it up a little to not pass in the config object, but the code is still looking for the config object.

I think there is likely a piece missing for configuring the logging to file as well, when I ran I didn't see the 'logs' directory get created.

Signed-off-by: JonahSussman <[email protected]>
Signed-off-by: JonahSussman <[email protected]>
@JonahSussman JonahSussman requested a review from jwmatthews July 23, 2024 22:01
Copy link
Member

@jwmatthews jwmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run 'run_demo.py' I see:

INFO - 2024-07-24 08:07:12,405 - __main__ - [         run_demo.py:101  -        write_to_disk()] - Writing updated source code to ./coolstore/src/main/java/com/redhat/coolstore/rest/RestApplication.java
ERROR - 2024-07-24 08:07:12,405 - __main__ - [         run_demo.py:106  -        write_to_disk()] - Failed to write updated_file @ ./coolstore/src/main/java/com/redhat/coolstore/rest/RestApplication.java with error: string indices must be integers, not 'str'

https://gist.githubusercontent.com/jwmatthews/ce27a70514fd0899cb852df78916cba8/raw/80b0a3d3dbf8d8b1eca7e3ae252ac6058c7ae65d/gistfile1.txt

Signed-off-by: JonahSussman <[email protected]>
@JonahSussman JonahSussman requested a review from jwmatthews July 24, 2024 15:24
@jwmatthews
Copy link
Member

When I run 'run_demo.py' I see:

INFO - 2024-07-24 08:07:12,405 - __main__ - [         run_demo.py:101  -        write_to_disk()] - Writing updated source code to ./coolstore/src/main/java/com/redhat/coolstore/rest/RestApplication.java
ERROR - 2024-07-24 08:07:12,405 - __main__ - [         run_demo.py:106  -        write_to_disk()] - Failed to write updated_file @ ./coolstore/src/main/java/com/redhat/coolstore/rest/RestApplication.java with error: string indices must be integers, not 'str'

https://gist.githubusercontent.com/jwmatthews/ce27a70514fd0899cb852df78916cba8/raw/80b0a3d3dbf8d8b1eca7e3ae252ac6058c7ae65d/gistfile1.txt

run_demo.py is now working with @JonahSussman latest fix.
Verified run_demo.py is good with this PR on 2 different environments

  • MacOS arm64 via a developer flow (running local)
  • MacOS x86_64 via docker compose and local image build

Signed-off-by: JonahSussman <[email protected]>
Copy link
Member

@jwmatthews jwmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified success running with run_demo.py.

There is a slight tweak with the Trace data that could be addressed in this or a follow up PR

Signed-off-by: JonahSussman <[email protected]>
@JonahSussman JonahSussman merged commit 5203452 into konveyor:main Jul 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants