-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade Lambda Runtimes to Ruby 3.3 and Java 17 #407
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
Open
anthony-jackson-code
wants to merge
20
commits into
main
Choose a base branch
from
feature/dev-environment-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
af15d98
Add comprehensive development deployment system for JavaBuilder
anthony-jackson-code a03da6f
Remove temporary template file
anthony-jackson-code 2564ba7
Update README files for new development deployment system
anthony-jackson-code 3d3d280
Fix deployment script to handle file permission issues
anthony-jackson-code 7f16d7b
Upgrade runtime versions: Ruby 2.7→3.3, Java 11→17
anthony-jackson-code 3acc955
Fix Ruby version consistency: Use Ruby 3.3 everywhere
anthony-jackson-code 3a5adeb
Implement Ruby-based development deployment following PR feedback
anthony-jackson-code d210a18
Address additional PR feedback
anthony-jackson-code 90986b6
Remove macOS-specific JDK path from deployment script
anthony-jackson-code 53df39c
Revert OAC and SSL wildcard changes, keep runtime upgrades
anthony-jackson-code ecd510a
Simplify artifact bucket handling to require pre-existing bucket
anthony-jackson-code 54bef22
Simplify artifact bucket handling in legacy shell script
anthony-jackson-code 243f625
Remove health-check.sh from git tracking
anthony-jackson-code d672e46
Document artifact bucket requirement and remove legacy script references
anthony-jackson-code f1e77a0
Remove legacy dev-deployment README
anthony-jackson-code bf399c0
Clean up .gitignore after removing legacy deployment script
anthony-jackson-code 362fb62
Revert certificate handling to original individual certificate approach
anthony-jackson-code f82c0cc
Update configurations and deployment scripts
anthony-jackson-code ba39255
Support multiple development stacks with branch-based naming
anthony-jackson-code f87c74d
chore: update Ruby and Python versions, domain names, and documentati…
anthony-jackson-code File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.7.8 | ||
| 3.0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2.7.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| # Javabuilder Dev Environment Deployment Guide | ||
|
|
||
| Comprehensive guide for deploying and managing the JavaBuilder AWS Lambda environment for development. | ||
|
|
||
| ## 🎯 Quick Start | ||
|
|
||
| For a complete no-SSL deployment (recommended for dev): | ||
| ```bash | ||
| ./deploy-javabuilder-dev-no-ssl-fixed.sh | ||
| ``` | ||
|
|
||
| For modular deployment: | ||
| ```bash | ||
| ./01-deploy-base-infrastructure.sh # Deploy IAM roles first | ||
| ./02-build-java-components.sh # Build Java artifacts | ||
| ./03-deploy-application.sh # Deploy application stack | ||
anthony-jackson-code marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## 📋 Current Environment Status | ||
anthony-jackson-code marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - **AWS Account**: 165336972514 | ||
| - **Profile**: codeorg-dev | ||
| - **Region**: us-east-1 | ||
| - **Stack Name**: javabuilder-dev | ||
| - **Bucket**: javabuilder-dev-artifacts-* | ||
|
|
||
| ### ✅ Working Components | ||
| - ✅ AWS CLI configured with `codeorg-dev` profile | ||
| - ✅ S3 bucket creation for artifacts | ||
| - ✅ ERB template processing with SSL removal | ||
| - ✅ CloudFormation template packaging and deployment | ||
| - ✅ Java artifacts built and packaged correctly | ||
| - ✅ Lambda functions deployed and active | ||
|
|
||
| ### 🔧 Key Components | ||
| - **javabuilder-authorizer**: Handles API Gateway authorization | ||
| - **api-gateway-routes**: API Gateway interaction logic | ||
| - **org-code-javabuilder**: Core Java logic built with Gradle | ||
| - **WebSocket API**: Real-time communication for build sessions | ||
| - **CloudFront**: Content delivery for build artifacts | ||
|
|
||
| ## 🚀 Deployment Options | ||
|
|
||
| ### Option 1: No-SSL Deployment (Recommended for Dev) | ||
| **Best for development environments without Route53 permissions** | ||
| ```bash | ||
| ./deploy-javabuilder-dev-no-ssl-fixed.sh | ||
| ``` | ||
| - Removes SSL certificates and custom domains | ||
| - Uses CloudFront default domain | ||
| - Faster deployment, fewer permissions needed | ||
|
|
||
| ### Option 2: Full SSL Deployment | ||
| **For production-like environments with Route53 access** | ||
| ```bash | ||
| ./01-deploy-base-infrastructure.sh | ||
| ./02-build-java-components.sh | ||
| ./03-deploy-application.sh | ||
| ``` | ||
|
|
||
| ### Option 3: Clean Slate Deployment | ||
| **If stack exists but needs complete refresh** | ||
| ```bash | ||
| ./cleanup-javabuilder-dev.sh # Remove existing stack | ||
| ./deploy-javabuilder-dev-no-ssl-fixed.sh # Deploy fresh | ||
| ``` | ||
|
|
||
| ## 🔧 Prerequisites | ||
|
|
||
| ### Required Software | ||
| - **AWS CLI**: Configure with `codeorg-dev` profile | ||
| - **Ruby**: For ERB template processing | ||
| - **Java/Gradle**: For building org-code-javabuilder components | ||
|
|
||
| ### Required Permissions | ||
| - CloudFormation stack management | ||
| - S3 bucket creation and object management | ||
| - Lambda function deployment | ||
| - IAM role creation (for base infrastructure) | ||
| - API Gateway management | ||
|
|
||
| ### Pre-Deployment Check | ||
| ```bash | ||
| ./pre-deploy-check.sh # Verify all prerequisites | ||
| ``` | ||
|
|
||
| ## 📁 Required Artifacts | ||
|
|
||
| ### Java Build Artifacts | ||
| - ✅ `org-code-javabuilder/lib/build/distributions/lib.zip` | ||
| - ✅ `org-code-javabuilder/font_config.zip` | ||
| - ✅ `org-code-javabuilder/change_runtime_directory/` (directory) | ||
|
|
||
| ### CloudFormation Templates | ||
| - `../cicd/3-app/javabuilder/template.yml.erb` (source) | ||
| - `process-template-no-ssl.rb` (SSL removal script) | ||
| - Generated templates: `template-no-ssl.yml`, `packaged-*.yml` | ||
|
|
||
| ## 🔍 Deployment Process Details | ||
|
|
||
| ### 1. Template Processing | ||
| - Processes ERB template with environment variables | ||
| - Removes SSL resources for no-SSL deployment | ||
| - Handles large template packaging via S3 | ||
|
|
||
| ### 2. Artifact Packaging | ||
| - Creates S3 bucket for deployment artifacts | ||
| - Packages Lambda code from local directories | ||
| - Uploads packaged template to S3 | ||
|
|
||
| ### 3. CloudFormation Deployment | ||
| - Uses `--template-url` for large templates | ||
| - Includes `CAPABILITY_AUTO_EXPAND` for SAM transforms | ||
| - Provides all required parameters via JSON file | ||
|
|
||
| ### 4. Post-Deployment Verification | ||
| - Validates stack creation status | ||
| - Tests WebSocket API endpoint | ||
| - Verifies CloudFront distribution | ||
| - Confirms Lambda function deployment | ||
|
|
||
| ## 🚨 Common Issues & Solutions | ||
|
|
||
| ### Template Too Large | ||
| **Error**: Template body exceeds 51200 characters | ||
| **Solution**: Script automatically uploads to S3 and uses `--template-url` | ||
|
|
||
| ### SSL Certificate Errors | ||
| **Error**: Certificate validation or Route53 permissions | ||
| **Solution**: Use no-SSL deployment script | ||
|
|
||
| ### Missing IAM Roles | ||
| **Error**: Stack exports not found | ||
| **Solution**: Deploy base infrastructure first with `01-deploy-base-infrastructure.sh` | ||
|
|
||
| ### Java Artifacts Missing | ||
| **Error**: CodeUri points to non-existent files | ||
| **Solution**: Run `02-build-java-components.sh` or ensure artifacts exist | ||
|
|
||
| ### Stack in ROLLBACK_COMPLETE State | ||
| **Error**: Cannot update stack in failed state | ||
| **Solution**: Use `cleanup-javabuilder-dev.sh` to delete and recreate | ||
|
|
||
| ## 🧪 Testing & Verification | ||
|
|
||
| ### Health Check Script | ||
| ```bash | ||
| ./test-deployment-health.sh # Verify deployment status | ||
| ``` | ||
|
|
||
| ### Manual Verification | ||
| ```bash | ||
| # Check stack status | ||
| aws cloudformation describe-stacks --stack-name javabuilder-dev --profile codeorg-dev | ||
|
|
||
| # Test WebSocket endpoint | ||
| aws apigatewayv2 get-apis --profile codeorg-dev | ||
|
|
||
| # Verify Lambda functions | ||
| aws lambda list-functions --profile codeorg-dev | grep -i javabuilder | ||
| ``` | ||
|
|
||
| ## 🧹 Cleanup & Maintenance | ||
|
|
||
| ### Clean Failed Deployments | ||
| ```bash | ||
| ./cleanup-failed-stack.sh # Remove failed stacks | ||
| ./cleanup-javabuilder-dev.sh # Remove specific dev stack | ||
| ``` | ||
|
|
||
| ### Artifact Management | ||
| - S3 buckets are created with unique suffixes | ||
| - Old artifacts remain in S3 (manual cleanup needed) | ||
| - CloudFormation stacks are idempotent (safe to redeploy) | ||
|
|
||
| ## 📖 File Reference | ||
|
|
||
| ### Main Scripts | ||
| - `deploy-javabuilder-dev-no-ssl-fixed.sh` - Complete no-SSL deployment | ||
| - `01-deploy-base-infrastructure.sh` - IAM roles and base resources | ||
| - `02-build-java-components.sh` - Build Java artifacts | ||
| - `03-deploy-application.sh` - Deploy application stack | ||
|
|
||
| ### Configuration Files | ||
| - `dev-deployment-params.json` - CloudFormation parameters | ||
| - `dev.config.json` - Environment configuration | ||
| - `process-template-no-ssl.rb` - SSL removal script | ||
|
|
||
| ### Generated Files | ||
| - `template-no-ssl.yml` - Processed template without SSL | ||
| - `packaged-*.yml` - CloudFormation packaged templates | ||
| - `runtime.zip` - Lambda runtime artifacts | ||
|
|
||
| For issues or questions, consult AWS CloudFormation logs or reach out to the DevOps team. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Cleanup JavaBuilder Dev Environment | ||
| set -e | ||
|
|
||
| PROFILE="codeorg-dev" | ||
| APP_STACK="javabuilder-dev" | ||
| BASE_STACK="javabuilder-base-infrastructure" | ||
|
|
||
| echo "🗑️ Starting JavaBuilder Dev Environment Cleanup..." | ||
|
|
||
| echo "📋 Checking if application stack exists..." | ||
| if aws cloudformation describe-stacks --stack-name "$APP_STACK" --profile "$PROFILE" >/dev/null 2>&1; then | ||
| echo "🔄 Deleting application stack: $APP_STACK" | ||
| aws cloudformation delete-stack --stack-name "$APP_STACK" --profile "$PROFILE" | ||
|
|
||
| echo "⏳ Waiting for application stack deletion to complete..." | ||
| aws cloudformation wait stack-delete-complete --stack-name "$APP_STACK" --profile "$PROFILE" | ||
| echo "✅ Application stack deleted successfully!" | ||
| else | ||
| echo "ℹ️ Application stack $APP_STACK not found" | ||
| fi | ||
|
|
||
| echo "🧹 Checking for leftover S3 buckets..." | ||
| echo "S3 buckets that may need manual cleanup:" | ||
| aws s3 ls --profile "$PROFILE" | grep javabuilder || echo "No JavaBuilder S3 buckets found" | ||
|
|
||
| echo "✅ Cleanup complete!" | ||
| echo "💡 To also remove base infrastructure, run:" | ||
| echo " aws cloudformation delete-stack --stack-name $BASE_STACK --profile $PROFILE" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.