-
Notifications
You must be signed in to change notification settings - Fork 124
[Core] Port 16058 reenable memory optimizations #2248
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18339050360/artifacts/4212864011Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18339065511/artifacts/4212924478Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18339326996/artifacts/4212962496Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18339421633/artifacts/4213006634Code Coverage Total Percentage:
|
port_ocean/core/handlers/entity_processor/jq_input_evaluator.py
Outdated
Show resolved
Hide resolved
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18346291715/artifacts/4215413722Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18347592987/artifacts/4215943856Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18349125396/artifacts/4216540195Code Coverage Total Percentage:
|
port_ocean/core/handlers/entity_processor/jq_input_evaluator.py
Outdated
Show resolved
Hide resolved
port_ocean/core/handlers/entity_processor/jq_input_evaluator.py
Outdated
Show resolved
Hide resolved
port_ocean/core/handlers/entity_processor/jq_input_evaluator.py
Outdated
Show resolved
Hide resolved
port_ocean/core/handlers/entity_processor/jq_entity_processor.py
Outdated
Show resolved
Hide resolved
port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py
Show resolved
Hide resolved
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18464589022/artifacts/4254144981Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18523130663/artifacts/4274587135Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18523196873/artifacts/4274606068Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18527314566/artifacts/4276050251Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18527308414/artifacts/4276050736Code Coverage Total Percentage:
|
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/18528052187/artifacts/4276327893Code Coverage Total Percentage:
|
misconfigurations_all: dict[str, str] = {} | ||
# Map the entity with jq expressions that classified as single item expressions with the single item as input | ||
mapped_entity_item = await self._search_as_object( | ||
modified_data[0], raw_entity_mappings["item"], misconfigurations_item |
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.
should we use get method instead?
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.
we always have the item, all and none props in the raw_entity_mappings object in this case (items to parse)
if misconfigurations_item: | ||
# The misconfigurations dict not contains the mapping expressions themselves, so we need to filter the original mapping by the misconfigured keys | ||
filtered_item_mappings = self._filter_mappings_by_keys( | ||
raw_entity_mappings["item"], list(misconfigurations_item.keys()) |
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.
should we use get method instead?
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.
see my last comment
with open(file_path, "r") as f: | ||
data["file"]["content"] = json.loads(f.read()) |
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.
should ve place this under a feature flag like use_disk?
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.
At least in this place I think it is not needed.... If the integration has not offloaded the data to disk (and marked the event as __type == "path") the ocean framework would continue as usual (without any disk usage)
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.
LGTM
User description
Description
Reenable Memory optimizations on ocean core
What - Memory optimizations
Why - OOMs on items to parse cases especially on file kind with big payload and yaml parsing
How - offloading of data to filesystem and streaming data from the disk
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Enhancement
Description
Re-enable memory optimizations for large payload processing
Add streaming data processing with filesystem offloading
Implement JQ expression input evaluation and mapping optimization
Add secure temporary file handling for items parsing
Diagram Walkthrough
File Walkthrough
3 files
Enhanced JQ processor with memory optimizations
New JQ input evaluation utility module
Added streaming processing and secure file handling
2 files
Updated items_to_parse_name field type
Version bump to 0.28.13
1 files
Fixed generator wrapper parameter passing
1 files
Comprehensive tests for mapping optimizations
1 files
Version 0.28.13 release notes
2 files
Added jq binary to Docker image
Added jq binary to local Docker image