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

Fix deployment App engine #2421

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Fix deployment App engine #2421

merged 1 commit into from
Jan 28, 2025

Conversation

BenjaminSsempala
Copy link
Contributor

@BenjaminSsempala BenjaminSsempala commented Jan 28, 2025

Summary of Changes (What does this PR do?)

  • Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included issue number in the "Closes #ISSUE-NUMBER" part of the "What are the relevant tickets?" section to link the issue.
  • I've updated corresponding documentation for the changes in this PR.
  • I have written unit and/or e2e tests for my change(s).

How should this be manually tested?

  • Please include the steps to be done inorder to setup and test this PR.

What are the relevant tickets?

Screenshots (optional)

Summary by CodeRabbit

  • Deployment
    • Updated production deployment workflow for websites
    • Added version cleanup step after deployment
    • Simplified deployment process by removing temporary instance scaling steps

Copy link

coderabbitai bot commented Jan 28, 2025

📝 Walkthrough

Walkthrough

The pull request modifies the GitHub Actions workflow configuration for production frontend deployments. The changes primarily involve removing temporary instance scaling steps for the website2 deployment and adding a new "Delete Old Versions" step for both website and website2 jobs. This simplifies the deployment process by eliminating manual instance management and introducing an automatic cleanup mechanism for older application versions.

Changes

File Change Summary
.github/workflows/deploy-frontends-to-production.yml - Removed steps that temporarily increase and restore minimum instances for website2
- Added "Delete Old Versions" step for both website and website2 jobs

Possibly related PRs

Suggested Reviewers

  • Psalmz777
  • Baalmart

Poem

🚀 Deployment dance, steps refined
Old versions fade, new code aligned
Workflows sing their silent song
Scaling back, no longer wrong
Clean and swift, the pipeline flows! 🌟


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.

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

323-323: Remove trailing spaces on line 323.

There are trailing spaces that should be removed to maintain consistent formatting.

-     
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 323-323: trailing spaces

(trailing-spaces)


Line range hint 171-186: Consider optimizing readiness check configuration.

The website2 deployment includes readiness check configuration while website doesn't. Consider adding similar readiness checks to the website deployment for consistency and improved deployment reliability.

# Add to website's app.yaml configuration
+          echo "readiness_check:" >> app.yaml
+          echo "  check_interval_sec: 10" >> app.yaml
+          echo "  timeout_sec: 15" >> app.yaml
+          echo "  failure_threshold: 2" >> app.yaml
+          echo "  success_threshold: 2" >> app.yaml
+          echo "  app_start_timeout_sec: 1800" >> app.yaml

Also applies to: 293-308

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 323-323: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bdf7bf4 and b95a620.

📒 Files selected for processing (1)
  • .github/workflows/deploy-frontends-to-production.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/deploy-frontends-to-production.yml

[error] 323-323: trailing spaces

(trailing-spaces)

🔇 Additional comments (3)
.github/workflows/deploy-frontends-to-production.yml (3)

Line range hint 1-38: LGTM! Well-structured workflow configuration.

The workflow configuration with manual triggers and boolean inputs for each frontend application provides good flexibility and control over deployments.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 323-323: trailing spaces

(trailing-spaces)


Line range hint 324-330: Verify the cleanup strategy for old versions.

The "Delete Old Versions" step keeps the 3 most recent versions (excluding 'maintenance' versions) for both website and website2 services. While this is a good practice for managing App Engine versions:

  1. Ensure this aligns with your rollback requirements
  2. Consider the impact on blue-green deployments if in use
  3. Verify that the 'maintenance' version exclusion is intentional

Also applies to: 258-264

✅ Verification successful

Cleanup strategy is well-implemented and follows best practices

The version cleanup implementation:

  • Maintains 3 recent versions across all environments, providing sufficient rollback options
  • Consistently protects maintenance versions in all environments
  • Aligns with App Engine's version management best practices
  • No concerns regarding blue-green deployments as traffic splitting isn't used
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check current App Engine versions to understand the impact

# List current versions for the default service
echo "Current versions for default service:"
gcloud app versions list --service=default --sort-by '~LAST_DEPLOYED' --format 'table(VERSION.ID,TRAFFIC_SPLIT,LAST_DEPLOYED,VERSION.CREATED_BY)'

# Check if maintenance version exists
echo -e "\nChecking for maintenance version:"
gcloud app versions list --service=default --filter="version_id:maintenance" --format 'table(VERSION.ID,TRAFFIC_SPLIT,LAST_DEPLOYED)'

Length of output: 644


Script:

#!/bin/bash
# Check for blue-green deployment patterns and rollback configurations
echo "Checking deployment patterns:"
rg -A 5 -B 5 "traffic|split|migrate" .github/workflows/deploy-frontends-to-production.yml

echo -e "\nChecking for rollback configurations:"
rg -A 5 -B 5 "rollback|revert|previous" .github/workflows/deploy-frontends-to-production.yml

echo -e "\nChecking for similar cleanup patterns:"
rg -A 5 -B 5 "versions list.*sort-by.*LAST_DEPLOYED" .github/workflows/

Length of output: 6823

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 323-323: trailing spaces

(trailing-spaces)


Line range hint 165-169: Review scaling configuration differences.

The cool_down_period_sec differs between website (120s) and website2 (80s). Consider:

  1. Documenting why these values differ
  2. Aligning them if there's no specific reason for the difference

Also applies to: 287-291

✅ Verification successful

Different cool-down periods are justified for these distinct services

The difference in cool-down periods (120s vs 80s) is appropriate as these are separate services with different architectures:

  • website: Django/React monolithic application
  • website2: Separate implementation with likely different resource patterns

The cool-down period variation reflects their distinct scaling needs and startup characteristics.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check historical scaling patterns to validate cool-down periods

# Get App Engine metrics for the past week
echo "Checking instance scaling patterns for the past week:"
gcloud app instances list --service=default --format='table(ID,VERSION.ID,VM_STATUS,VM_DEBUG_ENABLED)'

Length of output: 318


Script:

#!/bin/bash
# Search for yaml files containing scaling configurations
echo "Searching for scaling configurations in yaml files:"
rg -A 5 -B 5 "cool_down_period_sec" 

echo -e "\nSearching for any documentation about scaling:"
rg -i "cool.*down|scaling.*period|autoscaling" "*.md"

Length of output: 358


Script:

#!/bin/bash
# List all yaml files in the repository
echo "Finding all yaml files:"
fd -e yaml -e yml

echo -e "\nChecking content of the deployment workflow file:"
cat .github/workflows/deploy-frontends-to-production.yml

echo -e "\nChecking website directory for configuration files:"
ls -R website/

Length of output: 46058

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 323-323: trailing spaces

(trailing-spaces)

@Baalmart Baalmart merged commit fdd718f into staging Jan 28, 2025
31 checks passed
@Baalmart Baalmart deleted the app-eng branch January 28, 2025 09:31
@Baalmart Baalmart mentioned this pull request Jan 28, 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