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

114 use e2 medium for all pro tests in testing env #116

Merged
merged 8 commits into from
Sep 15, 2024

Conversation

dudizimber
Copy link
Collaborator

@dudizimber dudizimber commented Sep 11, 2024

fix #114

Summary by CodeRabbit

  • New Features
    • Introduced the e2-medium instance type option in configuration, enhancing resource allocation flexibility.
  • Bug Fixes
    • Improved GitHub Actions workflows for more efficient deployment and testing with updated instance types.
  • Chores
    • Updated .gitignore to include sensitive files, ensuring better repository security.

@dudizimber dudizimber linked an issue Sep 11, 2024 that may be closed by this pull request
Copy link

coderabbitai bot commented Sep 11, 2024

Walkthrough

The pull request introduces several changes across multiple files, primarily focusing on modifications to GitHub Actions workflows and configuration files. Key updates include the addition of a conditional job to remove specific strings from a plans file, updates to instance types in testing workflows, enhancements to the .gitignore file, and the inclusion of a new instance type option in the omnistrate.pro.yaml configuration. These changes refine the workflows and improve resource allocation options.

Changes

File Change Summary
.github/workflows/build-release-image.yaml Added a conditional job to remove - e2-medium from plans based on specific criteria.
.github/workflows/build-test-image.yaml Updated extraParams to change instance type from e2-custom-4-8192 to e2-medium across multiple job definitions.
.gitignore Added entries for .omnistrate and secrets to be ignored by Git.
omnistrate.pro.yaml Added e2-medium option to various service configurations for enhanced flexibility.
falkordb-cluster/cluster-entrypoint.sh Added memory limit mapping for e2-medium instance type with a limit of 2GB.
falkordb-node/node-entrypoint.sh Updated memory limit mapping to include e2-medium with a limit of 2GB.

Possibly related PRs

  • 20 add 64gb machine type for pro tier #21: Modifies the .github/workflows/build-release-image.yaml, indicating potential overlap in workflow logic.
  • change node sizes #49: Changes in .github/workflows/build-test-image.yaml involve updating instance types, aligning with the main PR's focus.
  • add cluster update memory test #93: Introduces a new job in .github/workflows/build-test-image.yaml for updating memory, relating to the main PR's changes in workflow logic and instance configurations.

Suggested labels

enhancement

Poem

In the meadow, changes bloom,
Workflows dance, dispelling gloom.
With e2-medium, options grow,
Secrets hidden, safe below.
A rabbit hops with joyful cheer,
For smoother paths, the spring is near! 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 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.

@dudizimber dudizimber marked this pull request as ready for review September 15, 2024 07:20
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: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2254ff6 and b75b925.

Files selected for processing (4)
  • .github/workflows/build-release-image.yaml (1 hunks)
  • .github/workflows/build-test-image.yaml (20 hunks)
  • .gitignore (1 hunks)
  • omnistrate.pro.yaml (9 hunks)
Files skipped from review due to trivial changes (1)
  • omnistrate.pro.yaml
Additional comments not posted (12)
.gitignore (2)

2-2: Good addition to .gitignore.

Adding .omnistrate to .gitignore is a good practice to keep the repository clean by not tracking unnecessary files or directories.


3-3: Critical addition to .gitignore.

Adding secrets to .gitignore is crucial for maintaining the security of the repository by preventing sensitive information from being committed. Great catch!

Please ensure that no sensitive information has been accidentally committed before this change. If any sensitive information is found in the commit history, it should be properly removed and revoked.

.github/workflows/build-release-image.yaml (1)

84-87: Verify the impact of removing the - e2-medium string.

The changes look good! The new step conditionally removes the - e2-medium string from the plans file for the 'pro' environment, enhancing the customization of the release process.

Please ensure that removing the - e2-medium string does not have any unintended consequences or break any existing functionality. Consider running tests or manually verifying the behavior of the 'pro' environment after this change.

.github/workflows/build-test-image.yaml (9)

141-141: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


151-151: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


161-161: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


171-171: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


181-181: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


191-191: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


231-231: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


241-241: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.


251-251: LGTM!

The instance type change from e2-custom-4-8192 to e2-medium aligns with the PR objective.

@@ -198,7 +198,7 @@ jobs:
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
extraParams: "--resource-key 'standalone' --instance-name 'test-standalone-update-memory' --instance-description 'test-standalone-update-memory' --instance-type 'e2-custom-4-8192' --new-instance-type 'e2-custom-8-16384' --storage-size '30' --rdb-config 'medium' --aof-config 'always'"
extraParams: "--resource-key 'standalone' --instance-name 'test-standalone-update-memory' --instance-description 'test-standalone-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always'"
Copy link

Choose a reason for hiding this comment

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

Update the new-instance-type parameter to match the PR objective.

The initial instance type has been updated to e2-medium, which aligns with the PR objective. However, the new-instance-type parameter is still set to e2-custom-4-8192.

Consider updating the new-instance-type parameter to a value that is consistent with the PR objective, such as e2-medium or a different instance type that is intended for the memory update test.

@@ -208,7 +208,7 @@
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
extraParams: "--resource-key 'single-Zone' --instance-name 'test-replication-update-memory' --instance-description 'test-replication-update-memory' --instance-type 'e2-custom-4-8192' --new-instance-type 'e2-custom-8-16384' --storage-size '30' --rdb-config 'medium' --aof-config 'always'"
extraParams: "--resource-key 'single-Zone' --instance-name 'test-replication-update-memory' --instance-description 'test-replication-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always'"
Copy link

Choose a reason for hiding this comment

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

Update the new-instance-type parameter to match the PR objective.

The initial instance type has been updated to e2-medium, which aligns with the PR objective. However, the new-instance-type parameter is still set to e2-custom-4-8192.

Consider updating the new-instance-type parameter to a value that is consistent with the PR objective, such as e2-medium or a different instance type that is intended for the memory update test.

@@ -218,7 +218,7 @@
subscriptionId: sub-GJPV3NoNC0
serviceId: ${{ vars.OMNISTRATE_INTERNAL_SERVICE_ID }}
environmentId: ${{ vars.OMNISTRATE_INTERNAL_DEV_ENVIRONMENT}}
extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-update-memory' --instance-description 'test-cluster-update-memory' --instance-type 'e2-custom-4-8192' --new-instance-type 'e2-custom-8-16384' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --cluster-replicas '1' --host-count '6'"
extraParams: "--resource-key 'cluster-Single-Zone' --instance-name 'test-cluster-update-memory' --instance-description 'test-cluster-update-memory' --instance-type 'e2-medium' --new-instance-type 'e2-custom-4-8192' --storage-size '30' --rdb-config 'medium' --aof-config 'always' --cluster-replicas '1' --host-count '6'"
Copy link

Choose a reason for hiding this comment

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

Update the new-instance-type parameter to match the PR objective.

The initial instance type has been updated to e2-medium, which aligns with the PR objective. However, the new-instance-type parameter is still set to e2-custom-4-8192.

Consider updating the new-instance-type parameter to a value that is consistent with the PR objective, such as e2-medium or a different instance type that is intended for the memory update test.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b75b925 and a6e4528.

Files selected for processing (2)
  • falkordb-cluster/cluster-entrypoint.sh (1 hunks)
  • falkordb-node/node-entrypoint.sh (1 hunks)
Additional context used
Shellcheck
falkordb-node/node-entrypoint.sh

[warning] 200-200: Quotes/backslashes will be treated literally. Use an array.

(SC2089)

Additional comments not posted (2)
falkordb-cluster/cluster-entrypoint.sh (1)

128-128: LGTM!

The addition of the e2-medium entry to the memory_limit_instance_type_map is consistent with the existing structure and enhances the memory configuration options based on the instance type.

falkordb-node/node-entrypoint.sh (1)

200-200: Looks good! The change enhances the flexibility of the script.

Adding support for the e2-medium instance type expands the utility of the get_memory_limit function and allows the script to be used in more diverse environments. This is a positive enhancement.

Tools
Shellcheck

[warning] 200-200: Quotes/backslashes will be treated literally. Use an array.

(SC2089)

@@ -197,7 +197,7 @@ get_self_host_ip() {

get_memory_limit() {

memory_limit_instance_type_map="{\"e2-custom-small-1024\":\"100MB\",\"e2-custom-4-8192\":\"6GB\",\"e2-custom-8-16384\":\"13GB\",\"e2-custom-16-32768\":\"30GB\",\"e2-custom-32-65536\":\"62GB\"}"
memory_limit_instance_type_map="{\"e2-custom-small-1024\":\"100MB\",\"e2-medium\":\"2GB\",\"e2-custom-4-8192\":\"6GB\",\"e2-custom-8-16384\":\"13GB\",\"e2-custom-16-32768\":\"30GB\",\"e2-custom-32-65536\":\"62GB\"}"
Copy link

Choose a reason for hiding this comment

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

Consider refactoring the memory_limit_instance_type_map to use an array.

Shellcheck warns that using a string for the memory_limit_instance_type_map is error-prone because quotes and backslashes will be treated literally. It recommends using an array instead.

Here's a suggested refactoring:

memory_limit_instance_type_map=(
  ["e2-custom-small-1024"]="100MB"
  ["e2-medium"]="2GB" 
  ["e2-custom-4-8192"]="6GB"
  ["e2-custom-8-16384"]="13GB"
  ["e2-custom-16-32768"]="30GB"
  ["e2-custom-32-65536"]="62GB"
)

# ...

MEMORY_LIMIT=${memory_limit_instance_type_map[$INSTANCE_TYPE]}

This makes the code more robust and maintainable. Let me know if you'd like me to submit a PR with this refactoring.

Tools
Shellcheck

[warning] 200-200: Quotes/backslashes will be treated literally. Use an array.

(SC2089)

@dudizimber dudizimber merged commit 0587254 into main Sep 15, 2024
25 checks passed
@dudizimber dudizimber deleted the 114-use-e2-medium-for-all-pro-tests-in-testing-env branch September 15, 2024 09:23
@coderabbitai coderabbitai bot mentioned this pull request Sep 16, 2024
@coderabbitai coderabbitai bot mentioned this pull request Sep 25, 2024
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.

Use e2-medium for all Pro tests in testing env
2 participants