Skip to content
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

Adding Custom Poolsize for WASM Functions #87

Merged
merged 4 commits into from Jan 4, 2024

Conversation

madflojo
Copy link
Member

@madflojo madflojo commented Jan 4, 2024

This PR adds a custom pool size configuration for both the default WASM function and multi-function configuration files. This allows users to specify a custom number of WASM instances to load into memory. Some functions (like an init function) may not need multiple instances, and some, like a request handler, might need many.

Summary by CodeRabbit

  • New Features

    • Introduced the ability to specify the number of function instances through the new PoolSize configuration.
  • Documentation

    • Updated documentation to reflect the new pool_size property in the configuration files.
  • Bug Fixes

    • Adjusted server test timing to improve reliability.

Copy link
Contributor

coderabbitai bot commented Jan 4, 2024

Important

Auto Review Skipped

Review was skipped due to path filters

Walkthrough

The recent update introduces a PoolSize field to manage the number of instances for a given function, enhancing the scalability of function deployments. Documentation has been updated to reflect the new pool_size property in configuration files, and a test has been adjusted for timing and formatting improvements.

Changes

Files Change Summary
pkg/app/app.go, pkg/config/config.go Added PoolSize field to engine.ModuleConfig & Function structs.
docs/.../configuration.md, docs/.../multi-function-services.md Updated docs to include pool_size property; replaced configuration with pool_size.
pkg/app/server_test.go Increased wait time in TestFullService; removed trailing newline.

🐇✨
In the land of code, the rabbits hopped,
Scaling functions, as servers popped.
With pools so vast, they set the pace,
A symphony of instances in digital space. 🚀🌌

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a3db481 and 4767737.
Files ignored due to filter (1)
  • testdata/tarmac.json
Files selected for processing (5)
  • docs/running-tarmac/configuration.md (1 hunks)
  • docs/wasm-functions/multi-function-services.md (2 hunks)
  • pkg/app/app.go (2 hunks)
  • pkg/app/server_test.go (2 hunks)
  • pkg/config/config.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • pkg/app/server_test.go
Additional comments: 4
docs/running-tarmac/configuration.md (1)
  • 29-29: The addition of APP_WASM_POOL_SIZE to the configuration options is consistent with the existing table format and aligns with the PR objectives to allow users to configure a custom pool size for WASM functions.
pkg/config/config.go (1)
  • 43-44: The addition of the PoolSize field to the Function struct is consistent with the PR objectives to allow configuration of the number of WASM instances and aligns with the AI-generated summary.
docs/wasm-functions/multi-function-services.md (2)
  • 20-21: The documentation update to include the pool_size property in the tarmac.json example is consistent with the PR objectives and the AI-generated summary.

  • 65-65: The update to the description of the function object, replacing configuration with pool_size, is consistent with the PR objectives and the AI-generated summary.

pkg/app/app.go Show resolved Hide resolved
pkg/app/app.go Show resolved Hide resolved
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a3db481) 29.93% compared to head (0d0312b) 81.42%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #87       +/-   ##
===========================================
+ Coverage   29.93%   81.42%   +51.48%     
===========================================
  Files          12       12               
  Lines        1306     1308        +2     
===========================================
+ Hits          391     1065      +674     
+ Misses        866      181      -685     
- Partials       49       62       +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@madflojo madflojo merged commit 85cd3de into tarmac-project:main Jan 4, 2024
13 checks passed
@madflojo madflojo deleted the custom-poolsize branch January 4, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant