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 Readiness checks and upscaling instances to handle Website deployments #2415

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

BenjaminSsempala
Copy link
Contributor

@BenjaminSsempala BenjaminSsempala commented Jan 27, 2025

Summary of Changes (What does this PR do?)

  • Adding Readiness checks and upscaling instances for Website deployments

Summary by CodeRabbit

  • New Features

    • Enhanced deployment process for website2 with advanced readiness checks.
    • Improved instance scaling during deployment to ensure smooth updates.
  • Improvements

    • Added configurable readiness monitoring parameters.
    • Implemented dynamic instance management during deployment.

Copy link

coderabbitai bot commented Jan 27, 2025

📝 Walkthrough

Walkthrough

The pull request introduces enhanced deployment configurations for the website2 frontend, focusing on improving deployment stability and traffic management. The changes involve adding readiness checks to the app.yaml configuration and implementing dynamic instance scaling during deployment. These modifications aim to create a more robust deployment process by introducing precise monitoring parameters and temporary instance scaling strategies.

Changes

File Change Summary
.github/workflows/deploy-frontends-to-production.yml Added readiness check parameters and instance scaling steps for website2 deployment

Sequence Diagram

sequenceDiagram
    participant Workflow as Deployment Workflow
    participant App as Website2
    
    Workflow->>App: Increase min instances to 2
    Workflow->>App: Apply Readiness Checks
    App-->>Workflow: Deployment Readiness Status
    Workflow->>App: Restore min instances to 1
Loading

Possibly related PRs

Suggested reviewers

  • Psalmz777
  • Baalmart

Poem

🚀 Deployments dance with grace and might,
Instances scaling, a technical delight!
Readiness checks, our digital friend,
Ensuring smooth launches without an end.
Code flows like poetry, deployment's sweet art! 🌟


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 or @coderabbitai title 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.

@BenjaminSsempala BenjaminSsempala changed the title Adding Readiness checks and upscaling instances for Website deployments Adding Readiness checks and upscaling instances to handle Website deployments Jan 27, 2025
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

🧹 Nitpick comments (1)
.github/workflows/deploy-frontends-to-production.yml (1)

304-308: Add error handling for instance scaling operations.

While the instance scaling strategy is good for maintaining availability during deployment, the implementation lacks error handling.

Consider adding error handling and verification:

  - name: Temporarily Increase Min Instances
    run: |
      echo "========== Setting minimum instances to 2 for deployment =========="
-     gcloud app services update default --min-instances=2 --quiet
+     if ! gcloud app services update default --min-instances=2 --quiet; then
+       echo "Failed to increase instances. Proceeding with deployment..."
+     fi
+     # Verify the change
+     actual_instances=$(gcloud app services describe default --format='get(basicScaling.minInstances)')
+     echo "Current min instances: $actual_instances"

  # ... deployment steps ...

  - name: Restore Min Instances
    run: |
      echo "========== Restoring minimum instances to 1 after deployment =========="
-     gcloud app services update default --min-instances=1 --quiet
+     if ! gcloud app services update default --min-instances=1 --quiet; then
+       echo "Failed to restore instances. Manual intervention may be required."
+       exit 1
+     fi
+     # Verify the change
+     actual_instances=$(gcloud app services describe default --format='get(basicScaling.minInstances)')
+     echo "Current min instances: $actual_instances"

Also applies to: 329-332

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b5ac692 and 7ca1b87.

📒 Files selected for processing (1)
  • .github/workflows/deploy-frontends-to-production.yml (3 hunks)

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 (1)
.github/workflows/deploy-frontends-to-production.yml (1)

304-308: Consider adding error handling for instance scaling operations.

While the instance scaling strategy is good for maintaining availability during deployment, the scaling operations should include error handling to ensure the instance count is properly restored even if the deployment fails.

 - name: Temporarily Increase Min Instances
   run: |
     echo "========== Setting minimum instances to 2 for deployment =========="
-    gcloud app services update default --min-instances=2 --quiet
+    if ! gcloud app services update default --min-instances=2 --quiet; then
+      echo "Failed to increase instances. Proceeding with deployment..."
+    fi

 # ... deployment steps ...

 - name: Restore Min Instances
   run: |
     echo "========== Restoring minimum instances to 1 after deployment =========="
-    gcloud app services update default --min-instances=1 --quiet
+    if ! gcloud app services update default --min-instances=1 --quiet; then
+      echo "::warning::Failed to restore instance count to 1. Manual intervention may be required."
+      exit 1
+    fi

Also applies to: 329-332

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7ca1b87 and db038d7.

📒 Files selected for processing (1)
  • .github/workflows/deploy-frontends-to-production.yml (3 hunks)
🔇 Additional comments (2)
.github/workflows/deploy-frontends-to-production.yml (2)

289-294: Thank you for implementing the suggested readiness check parameters!

The readiness check configuration looks good with the recommended values from the previous review.


Line range hint 304-332: Verify the cool-down period alignment.

The cool_down_period_sec is set to 80 seconds in the app.yaml configuration. Ensure this aligns with the instance scaling operations during deployment to prevent potential conflicts between automated scaling and manual scaling operations.

@Baalmart Baalmart merged commit 6e02ef2 into staging Jan 27, 2025
31 checks passed
@Baalmart Baalmart deleted the website-readiness-checl branch January 27, 2025 22:17
@Baalmart Baalmart mentioned this pull request Jan 27, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants