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

Add versioning and resource_id to function names(#230) #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ojninja16
Copy link

@ojninja16 ojninja16 commented Jan 31, 2025

  • Added SeBS version to Docker image tags
  • Included resource_id in function names for unique identification.
  • Updated default_function_name method across platforms to use resource_id.

Summary by CodeRabbit

Release Notes

  • Configuration

    • Added SeBS version identifier to system configuration
  • Functionality

    • Enhanced function name generation across cloud platforms to include resource-specific identifiers
    • Updated Docker image tagging to incorporate SeBS version information
  • Versioning

    • Introduced SeBS version tracking in configuration and build processes

Copy link

coderabbitai bot commented Jan 31, 2025

Walkthrough

This pull request introduces a new version tracking mechanism for the Serverless Benchmarking System (SeBS). The changes span multiple files, adding a SeBS_version configuration key and modifying function name generation across different cloud providers and deployment methods. The modifications enhance the system's ability to uniquely identify and tag functions and Docker images by incorporating version and resource-specific identifiers.

Changes

File Change Summary
config/systems.json Added "SeBS_version": "1.1.0" under the "general" section
sebs.py Updated default_function_name() to include resource configuration
sebs/aws/aws.py Modified function name generation to include resources.resources_id
sebs/config.py Enhanced image tag generation to include SeBS version
sebs/gcp/gcp.py Updated function name generation with resource identifiers
sebs/local/local.py Modified function name generation to include resources_id
sebs/openwhisk/openwhisk.py Added resource-based function name generation
tools/build_docker_images.py Incorporated SeBS version in Docker image tagging

Sequence Diagram

sequenceDiagram
    participant Config as Config System
    participant BuildTool as Build Docker Images
    participant Deployment as Deployment Client
    
    Config->>Config: Add SeBS_version
    Config->>BuildTool: Pass SeBS version
    BuildTool->>BuildTool: Tag images with version
    Deployment->>Deployment: Generate function names with resources
Loading

Possibly related PRs

Suggested reviewers

  • mcopik

Poem

🐰 A Rabbit's Versioning Tale

In configs and clouds, a version takes flight,
SeBS now tracks its journey with digital might
Resources and tags, a harmonious song
Benchmarking systems, no longer go wrong!
🚀 Version 1.1.0, hop hop hooray! 🎉

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
config/systems.json (1)

3-4: Consider using environment variables for versioning.

While adding versioning is good, hardcoding the version in the config file may lead to version drift. Consider:

  1. Using environment variables for the version.
  2. Adding a VERSION file at the root of the project.
  3. Using git tags for version tracking.

This would make version management more maintainable and automated.

sebs/gcp/gcp.py (1)

107-111: LGTM! Consider these minor improvements.

The changes align well with the PR objectives. Two suggestions to improve the code:

  1. Consider using named placeholders for better readability
  2. Consider converting this to an instance method since it uses an instance parameter
-    @staticmethod
-    def default_function_name(code_package: Benchmark,resources:Resources) -> str:
-        # Create function name
-        func_name = "{}-{}-{}-{}".format(
-            code_package.benchmark, code_package.language_name, code_package.language_version,resources.resources_id
-        )
+    def default_function_name(self, code_package: Benchmark, resources: Resources) -> str:
+        # Create function name
+        func_name = "{benchmark}-{lang}-{ver}-{res_id}".format(
+            benchmark=code_package.benchmark,
+            lang=code_package.language_name,
+            ver=code_package.language_version,
+            res_id=resources.resources_id
+        )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0478b79 and 76fc6e7.

📒 Files selected for processing (8)
  • config/systems.json (1 hunks)
  • sebs.py (1 hunks)
  • sebs/aws/aws.py (1 hunks)
  • sebs/config.py (1 hunks)
  • sebs/gcp/gcp.py (1 hunks)
  • sebs/local/local.py (2 hunks)
  • sebs/openwhisk/openwhisk.py (2 hunks)
  • tools/build_docker_images.py (1 hunks)
🔇 Additional comments (8)
sebs/config.py (1)

93-95: LGTM! Good use of dict.get() with default value.

The implementation safely handles missing version information by defaulting to "unknown".

tools/build_docker_images.py (1)

40-41: LGTM! Consistent with config.py implementation.

The implementation maintains consistency with config.py by using the same default value and version retrieval method.

sebs/local/local.py (2)

20-20: LGTM!

The import of Resources from sebs.faas.config is correctly added to support the new resource ID functionality.


345-349: LGTM! Function name generation enhanced with resource ID.

The function name format now includes the resource ID, which improves uniqueness and traceability of deployed functions.

sebs/openwhisk/openwhisk.py (2)

15-15: LGTM!

The import of Resources from sebs.faas.config is correctly added to support the new resource ID functionality.


Line range hint 392-399: LGTM! Function name generation enhanced with resource ID.

The function name format now includes the resource ID, which improves uniqueness and traceability of deployed functions.

sebs.py (1)

496-496: LGTM! Function call updated to include resource configuration.

The call to default_function_name is correctly updated to pass the required resource configuration.

sebs/aws/aws.py (1)

392-401: LGTM! Function name generation enhanced with resource ID and AWS-specific formatting.

The function name format now includes the resource ID and maintains AWS Lambda naming restrictions by replacing hyphens and dots with underscores.

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.

1 participant