Implement memory resource granting and revocation functionality for components#172
Implement memory resource granting and revocation functionality for components#172
Conversation
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
|
@copilot could you please fix the following build error? |
... Fixed! The build error was caused by using a non-existent |
ee252eb to
545bbdd
Compare
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
1 similar comment
🔍 Security Audit WarningsThe Click to view cargo audit outputThese are warnings (not vulnerabilities) but should be reviewed for:
The security job will continue to pass as these are warnings, not blocking security issues. |
|
@copilot can you please add the revoke permission for memory |
Implemented memory resource revocation functionality! The manager.revoke_permission("my-component", "resource", &serde_json::json!({
"memory": "512Mi"
})).await?;The implementation includes comprehensive test coverage and proper cleanup of policy structures. (commit 94ceccc) |
|
@copilot could you please fix these test failiures? |
... Fixed! The test compilation errors were caused by missing the third |
170ca51 to
1e25f3d
Compare
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…ntation Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…s to store Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
… components Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
1e25f3d to
fce9cd7
Compare
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
This PR implements comprehensive memory resource management functionality that allows administrators to both grant and revoke memory limits for WebAssembly components using Kubernetes-style memory specifications. The implementation maps policy file memory limits to Wasmtime's StoreLimitsBuilder API.
Key Features
Grant memory permissions: Components can receive memory limits via the
grant_permissionAPI:Revoke memory permissions: Components can have memory limits removed via the
revoke_permissionAPI:Kubernetes-style memory limits: Supports standard k8s memory format with suffixes:
"512Mi"- 512 mebibytes"1Gi"- 1 gibibyte"256Ki"- 256 kibibytes"1024"- raw bytesPolicy integration: Memory limits are stored in policy documents and parsed into the WASI state template:
Implementation Details
"resource"permission type to bothgrant_permissionandrevoke_permissionmethodsextract_memory_limitfunction converts k8s-style strings to bytesResourceLimiterimplementation wrapsStoreLimitsfor proper trait compatibilityremove_resource_permission_from_policyfunction removes memory limits from policiesTesting
Added comprehensive test coverage including:
The implementation provides complete memory resource management while maintaining the project's principles of minimal, surgical changes.
Fixes #171.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.