-
Notifications
You must be signed in to change notification settings - Fork 31
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
First cut of the Transformation Playground Frontend and Backend #1190
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
TransformationPlayground/tp_backend/transform_expert/prompting/__init__.py
Outdated
Show resolved
Hide resolved
TransformationPlayground/tp_backend/transform_expert/tests/utils/test_transforms.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
logger.debug(f"Transformation logic:\n{transform_report.task.transform.to_file_format()}") | ||
except TestTargetInnaccessibleError as e: | ||
logger.error(f"Target cluster is not accessible: {str(e)}") | ||
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
except Exception as e: | ||
logger.error(f"Transformation failed: {str(e)}") | ||
logger.exception(e) | ||
return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same as the other issue) Can we tweak this code not to include the error in the response? This will set off alarms in our other security scanning tools such as our internal sonarqube instance.
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
TransformationPlayground/playground/transform_expert/prompting/templates.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this in front of the team @chelma
I did not get a chance to refine the associated jira's in advance of this change arriving - I expect there is going to be back and forth on a number of comments I've raised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding tests, lets make sure to update the CI.yml to run these tests so we have code coverage information as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will investigate!
</Container> | ||
|
||
{/* Testing/Output Column */} | ||
<Container header="Testing & Output Panel"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you cycle back and forth between source / transformation logic / output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't implemented this all yet (obviously), but here's the user journey I'm envisioning:
- The user loads in their input shapes. Currently, that's just copy/pasting JSON into a text field, but soon I'd like to be able to load the contents of a snapshot into the Playground via a configurable process. Imagine a dialogue where you select the S3 location of your snapshot, something extracts the templates, indices, and a configurable number of documents (that's a whole workstream right there), and presents them in the left panel so you can see everything in your snapshot, then click on specific items to see their JSON, etc. Even once we've added the ability to read from snapshots, we'll want to leave open the possibility of adding manual input shapes. Example - the user doesn't have access to a snapshot of their production cluster but they do have access to the settings JSON and a few documents, which they can manually enter as shapes into the Playground for testing.
- The user then uses the dropdowns to select what type of transformation they are performing. The "transform type" (Index vs. template vs. documents) dropdown will disappear, because it will be obvious from context (the user selected an index on the input panel, so...).
- Once that is selected, we will have a pre-canned transform (we'll hand-craft and save, no GenAI) that is supplied based on those selections that will serve as a default. The default will be populated into the UI and pinned against that shape in the backend.
- The user can then hit a "test" button to see how that default transform will work against their input shape (e.g. we kick off the validation process).
- If the user wants to include functional tests into validation (e.g. actually creating/deleting indices against a real test cluster), they can go through a dialogue to set up and test a connection to their target cluster. Currently, that process is just "paste a URL into a text field and assume there's no auth to worry about").
- If the user likes the results of the default, pre-canned transform and it passes validation - great! No further work needed. If not, they can either modify the transform directly in the UI and run the validation process again, or they can ask the GenAI assistant to modify the existing transform in some way (not currently implemented, but expect to be easy). Either way, the new transform is then pinned against the input shape in the backend so that we know there's something custom going on.
- The user then selects a different input shape and goes through this process until everything is transforming as they desire, then they can either hit a button to "deploy" their transformed data/metadata to the target cluster (think for metadata migrations which are inherently "low scale") or "bundle" the transformations for inclusion into the Migrations Assistant backfill/replay processes (which are anything but "low scale"). For the "deploy" button, this is basically just skipping the cleanup step of the validation process we've already performed (e.g. take the transformed output and PUT it against the target, but don't delete it afterwards). For bundling, this is taking the stuff we have in the server-side DB, packaging it into a tarball/zip/whatever, and sticking it somewhere (S3?) so that the backfill and replayer processes can pick it up and load the transform objects.
Signed-off-by: Chris Helma <[email protected]>
logger.debug(f"Validation report entries:\n{validation_report.report_entries}") | ||
except TestTargetInnaccessibleError as e: | ||
logger.error(f"Target cluster is not accessible: {str(e)}") | ||
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we tweak this code not to include the error in the response? This will set off alarms in our other security scanning tools such as our internal sonarqube instance.
except Exception as e: | ||
logger.error(f"Testing process failed: {str(e)}") | ||
logger.exception(e) | ||
return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same as the other issue) Can we tweak this code not to include the error in the response? This will set off alarms in our other security scanning tools such as our internal sonarqube instance.
Signed-off-by: Chris Helma <[email protected]>
Signed-off-by: Chris Helma <[email protected]>
Description
transforms/index/
path to create some Python code that will transform an input ES 6.8 Index Settings w/ multi-type mappings or ES 7.10 Index Settings into equivalent OpenSearch 2.X settings. The API returns the transform code, the result of invoking the transform against the user's input, and the validation results.Issues Resolved
Testing
The default view when you open the GUI, with an input ES 6.8 JSON filled in
The GenAI recommended transformation for that input JSON
The modal window for modifying the GenAI recommendations
The results of applying the user guidance in a new, GenAI recommend transform
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.