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

feat(infra): upgrade postgresql SKU in test #1257

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

arealmaas
Copy link
Collaborator

@arealmaas arealmaas commented Oct 9, 2024

Description

image

Seems like it's CPU that we are struggling with the most. Upgrading to the next profile in the Burstable tier which has 2 cores. (B2s)

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Summary by CodeRabbit

  • New Features
    • Enhanced flexibility in PostgreSQL SKU selection with additional options available.
    • Updated default SKU from 'Standard_B1ms' to 'Standard_B2s' for improved resource allocation.

@arealmaas arealmaas requested review from a team as code owners October 9, 2024 09:55
Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

📝 Walkthrough

Walkthrough

The pull request introduces changes to two Bicep files related to PostgreSQL resource configuration. In the .azure/infrastructure/test.bicepparam file, the postgresSku parameter's name attribute has been updated to reflect a new SKU designation. Additionally, in the .azure/modules/postgreSql/create.bicep file, the Sku type declaration has been modified to include a broader range of SKU options, enhancing the flexibility for PostgreSQL server configurations.

Changes

File Path Change Summary
.azure/infrastructure/test.bicepparam Updated postgresSku parameter's name from 'Standard_B1ms' to 'Standard_B2s'.
.azure/modules/postgreSql/create.bicep Expanded Sku type declaration to include multiple SKU options: 'Standard_B1ms', 'Standard_B2s', 'Standard_B4ms', 'Standard_B8ms', 'Standard_B12ms', 'Standard_B16ms', and 'Standard_B20ms'.

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

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

sonarqubecloud bot commented Oct 9, 2024

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
.azure/modules/postgreSql/create.bicep (1)

27-27: LGTM! Consider adding a comment for SKU descriptions.

The expansion of the Sku type to include more options is a good improvement. It aligns well with the PR objective to upgrade the PostgreSQL SKU and provides more flexibility for different deployment scenarios.

Consider adding a comment above the Sku type declaration to briefly describe each SKU option or link to Azure documentation for SKU details. This would help future users understand the differences between these options without leaving the code. For example:

// SKU options for PostgreSQL Flexible Server
// Standard_B1ms: 1 vCore, 2 GB RAM
// Standard_B2s: 2 vCores, 4 GB RAM
// ...
// For full details, see: https://docs.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-compute-storage
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ca37063 and 6dfdb6d.

📒 Files selected for processing (2)
  • .azure/infrastructure/test.bicepparam (1 hunks)
  • .azure/modules/postgreSql/create.bicep (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
.azure/infrastructure/test.bicepparam (1)

33-35: Approved: PostgreSQL SKU upgrade aligns with PR objectives.

The change from 'Standard_B1ms' to 'Standard_B2s' for the PostgreSQL SKU is appropriate and aligns with the PR objective to address CPU limitations. This upgrade doubles the vCPU count from 1 to 2 and increases RAM from 2 GiB to 4 GiB, which should help alleviate the reported performance issues.

Consider the following recommendations:

  1. Monitor the performance improvement after deployment to ensure it meets the expected outcomes.
  2. Keep an eye on the cost implications of this upgrade and adjust if necessary.
  3. Set up alerts for CPU and memory usage to proactively identify any future scaling needs.
  4. Document this change in your infrastructure documentation, including the rationale for the upgrade.

To ensure this change is reflected correctly in other parts of the infrastructure, run the following script:

✅ Verification successful

Verified: PostgreSQL SKU change is consistent across the infrastructure.

  • The old SKU 'Standard_B1ms' is no longer referenced.
  • The new SKU 'Standard_B2s' is correctly applied in .azure/infrastructure/test.bicepparam.
  • No documentation updates are required regarding the SKU changes.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the PostgreSQL SKU change is consistent across the infrastructure

# Test 1: Check for any hardcoded references to the old SKU
echo "Checking for any remaining references to 'Standard_B1ms':"
rg --type bicep --type bicepparam 'Standard_B1ms'

# Test 2: Verify the new SKU is used consistently
echo "Verifying 'Standard_B2s' usage:"
rg --type bicep --type bicepparam 'Standard_B2s'

# Test 3: Check for any comments or documentation that might need updating
echo "Checking for potential documentation updates:"
rg --type md --type txt 'PostgreSQL.+SKU|Standard_B1ms|Standard_B2s'

Length of output: 540


Script:

#!/bin/bash
# Description: Verify the PostgreSQL SKU change is consistent across the infrastructure

# Test 1: Check for any hardcoded references to the old SKU
echo "Checking for any remaining references to 'Standard_B1ms':"
rg --glob "*.bicep" --glob "*.bicepparam" 'Standard_B1ms'

# Test 2: Verify the new SKU is used consistently
echo "Verifying 'Standard_B2s' usage:"
rg --glob "*.bicep" --glob "*.bicepparam" 'Standard_B2s'

# Test 3: Check for any comments or documentation that might need updating
echo "Checking for potential documentation updates:"
rg --glob "*.md" --glob "*.txt" 'PostgreSQL.+SKU|Standard_B1ms|Standard_B2s'

Length of output: 802


Script:

#!/bin/bash
# Description: Verify the PostgreSQL SKU change is consistent across the infrastructure

# Step 1: List all .bicep and .bicepparam files
echo "Listing all .bicep and .bicepparam files:"
fd --extension bicep --extension bicepparam

# Step 2: Check for any hardcoded references to the old SKU
echo "Checking for any remaining references to 'Standard_B1ms':"
fd --extension bicep --extension bicepparam | xargs rg 'Standard_B1ms'

# Step 3: Verify the new SKU is used consistently
echo "Verifying 'Standard_B2s' usage:"
fd --extension bicep --extension bicepparam | xargs rg 'Standard_B2s'

# Step 4: Check for any comments or documentation that might need updating
echo "Checking for potential documentation updates:"
fd --extension md --extension txt | xargs rg 'PostgreSQL.+SKU|Standard_B1ms|Standard_B2s'

Length of output: 682


Script:

#!/bin/bash
# Description: Specifically verify the PostgreSQL SKU change in .azure/infrastructure/test.bicepparam

# Define the target file
TARGET_FILE=".azure/infrastructure/test.bicepparam"

# Check if the target file exists
if [ -f "$TARGET_FILE" ]; then
  echo "Found target file: $TARGET_FILE"
  
  # Test 1: Check for any remaining references to the old SKU
  echo "Checking for any remaining references to 'Standard_B1ms' in $TARGET_FILE:"
  rg 'Standard_B1ms' "$TARGET_FILE"
  
  # Test 2: Verify the new SKU is used consistently
  echo "Verifying 'Standard_B2s' usage in $TARGET_FILE:"
  rg 'Standard_B2s' "$TARGET_FILE"
else
  echo "Target file $TARGET_FILE does not exist."
fi

# Test 3: Check for any comments or documentation that might need updating
echo "Checking for potential documentation updates related to SKUs:"
rg 'PostgreSQL.+SKU|Standard_B1ms|Standard_B2s' --glob "*.md" --glob "*.txt"

Length of output: 947

.azure/modules/postgreSql/create.bicep (1)

Line range hint 39-52: Consider reviewing logical replication configuration for new SKUs.

With the expanded SKU options, it might be worth revisiting the commented-out logical replication configuration. Different SKUs might have varying capabilities or requirements for logical replication.

Please review if the logical replication settings need to be adjusted or enabled for any of the new SKU options. You may want to run the following command to check if there are any SKU-specific configurations in the Azure documentation:

@arealmaas arealmaas merged commit 5a751af into main Oct 9, 2024
19 checks passed
@arealmaas arealmaas deleted the feat/upgrade-sku-for-postgresql-in-test branch October 9, 2024 13:24
oskogstad pushed a commit that referenced this pull request Oct 10, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.23.0](v1.22.0...v1.23.0)
(2024-10-10)


### Features

* **infra:** upgrade postgresql SKU in test
([#1257](#1257))
([5a751af](5a751af))
* **webAPI:** Add legacy HTML support for MainContentReference
([#1256](#1256))
([482b38a](482b38a))


### Bug Fixes

* Add missing return types for Transmissions and Activities in OpenAPI
spec ([#1244](#1244))
([972870d](972870d))
* **graphQL:** Missing MediaType on dialog attachment url
([#1264](#1264))
([3919343](3919343))
* Refactor probes and add more health checks
([#1159](#1159))
([6889a96](6889a96))
* **webapi:** ensure correct health checks are used in probes
([#1249](#1249))
([f951152](f951152))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants