[JDBC] Connectors Forge using Bob - #38
Open
Thomasgloria wants to merge 27 commits into
Open
Conversation
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
Signed-off-by: Gloria Thomas <Gloria.Thomas1@ibm.com>
…tors - Add deploy-openshift.sh script with full deployment orchestration - Add OpenShift resource templates (deployment, service, route, PVC, project) - Add deploy.env.template for OpenShift configuration - Rename connector-config.properties.template to connector-config.env.template - Support pre-built image deployment with driver PVC mounting - Include namespace creation, ConfigMap setup, and deployment verification
…e read from env file.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR introduces automated JDBC connector generation capabilities and streamlined AWS deployment for custom JDBC connectors in the CP4D Connector SDK.
What's New
Automated JDBC Connector Generation
Customers can now automatically generate custom JDBC connector code using the Custom JDBC Connector Mode. This eliminates manual configuration and reduces setup time significantly.
Connectors Forge JDBC Mode - Complete Documentation
Table of Contents
Overview
The Connectors Forge JDBC mode is an AI-powered assistant that guides users through creating custom JDBC connectors for IBM Cloud Pak for Data (CP4D). It automates the entire process from database information gathering to deployment on multiple platforms (AWS ECS Fargate, OpenShift, or self-hosted servers).
Key Features
Mode Purpose and Capabilities
What It Does
The Connectors Forge JDBC mode is a specialized AI assistant that:
When to Use
Use this mode when you need to:
Architecture
High-Level Architecture
Component Architecture
Deployment Approaches
1. Codeless Mode (Recommended for Quick Setup)
Overview: Uses pre-built Docker image from GitHub Container Registry
Docker Image:
ghcr.io/thomasgloria/wdp-connect-sdk-gen-jdbc-connectors-forge:latestBenefits:
Workflow:
Use Cases:
2. Developer Mode (Full Customization)
Overview: Generates complete customizable connector code
Benefits:
Workflow:
Use Cases:
Complete Workflow
Phase 0: Deployment Approach Selection
Purpose: Choose between Codeless or Developer mode
Steps:
Decision Factors:
Phase 1: Information Gathering
Purpose: Collect database-specific information
Information Collected:
Connector Metadata:
mysql,postgresql)JDBC Driver Information:
com.mysql.cj.jdbc.Driver)com.mysql:mysql-connector-j:8.0.33)jdbc:mysql://{host}:{port}/{database})Database Features:
Driver JAR (Codeless mode only):
Supported Databases (with pre-configured information):
Phase 2: DSL Creation
Purpose: Generate database-specific DSL configuration file
Process:
DSL-jdbc-{connector_name}.jsonDSL File Structure:
{ "connector_metadata": { "connector_name": "mysql", "connector_label": "MySQL", "connector_description": "JDBC connector for MySQL databases" }, "jdbc_driver": { "jdbc_url": "jdbc:mysql://{host}:{port}/{database}", "driver_class_name": "com.mysql.cj.jdbc.Driver" }, "connection_properties": { "additional_properties": [...] }, "database_specific_features": { "supports_schemas": false, "supports_catalogs": true, "system_schemas": ["information_schema", "mysql", "performance_schema", "sys"] }, "implementation_notes": { "dependencies": [{ "driver_dependencies": ["com.mysql:mysql-connector-j:8.0.33"] }] } }Output:
connectors-forge/codeless/jdbc/DSL-jdbc-{connector_name}.jsonPhase 2.5: Deployment Preparation (Codeless Mode Only)
Purpose: Prepare configuration files for deployment
Steps:
Select Deployment Type:
Create connector-config.env:
Confirm Configuration:
Create Deployment-Specific Config (if OpenShift):
connector-config.env Example:
Phase 3-9: Developer Mode Only
Phase 3: Label Confirmation
Phase 4: Code Generation (
./gradlew generateJavaJdbc)Phase 5: DSL Relocation
Phase 6: Connector Customization (
./gradlew customizeJdbcConnector)Phase 7: Test Generation (
./gradlew generateJdbcTests)Phase 8: Code Formatting (
./gradlew spotlessApply)Phase 9: Build (
./gradlew :jdbc_{name}:build)Phase 10/11: Deployment
Purpose: Deploy connector to selected platform
AWS ECS Fargate Deployment
Infrastructure Created:
Deployment Process:
cd connectors-forge/codeless/jdbc ./deploy-to-aws.shWhat Happens:
aws-deployment.propertiesAutomatic Driver Upload:
OpenShift Deployment
Process:
cd connectors-forge/codeless/jdbc ./deploy-openshift.shResources Created:
Self-Hosted Deployment
Process:
cd connectors-forge/codeless/jdbc ./deploy-container.shRequirements:
Implementation Details
DSL Configuration System
Purpose: Define connector behavior without code
Key Sections:
Driver Management
Automatic Download (Codeless Mode)
Supported Databases:
Process:
connectors-forge/codeless/jdbc/driver/driver.jarMaven Central URL Pattern:
Manual Provision (Codeless Mode)
Required for:
Process:
connectors-forge/codeless/jdbc/driver/driver.jarDeveloper Mode
Process:
build.gradleAWS Deployment Architecture
Complete Infrastructure Diagram
EFS Driver Upload Architecture
Security Architecture
Configuration Files
1. DSL-jdbc-{connector_name}.json
Location:
connectors-forge/codeless/jdbc/Purpose: Define connector behavior and database-specific features
Key Sections:
2. connector-config.env
Location:
connectors-forge/codeless/jdbc/Purpose: Runtime connector configuration
Key Variables:
CONNECTOR_DATASOURCE_TYPE=mysql CONNECTOR_LABEL=MySQL CONNECTOR_DESCRIPTION=JDBC connector for MySQL databases JDBC_DRIVER_CLASS=com.mysql.cj.jdbc.Driver JDBC_DRIVER_PATH=/mnt/efs/driver.jar3. aws-deployment.properties
Location:
connectors-forge/codeless/jdbc/Purpose: AWS infrastructure configuration
Key Properties:
4. deploy.env (OpenShift)
Location:
connectors-forge/codeless/jdbc/Purpose: OpenShift deployment configuration
Key Variables:
5. deploy-container.env
Location:
connectors-forge/codeless/jdbc/Purpose: Self-hosted deployment configuration
Key Variables:
Scripts and Automation
1. deploy-to-aws.sh
Purpose: Complete AWS ECS Fargate deployment automation
Size: 1074 lines
Key Functions:
Usage:
cd connectors-forge/codeless/jdbc ./deploy-to-aws.sh [path-to-properties-file]Features:
2. upload-driver-to-efs.sh
Purpose: Upload JDBC driver to EFS via temporary EC2
Key Functions:
Usage:
cd connectors-forge/codeless/jdbc ./upload-driver-to-efs.sh [path-to-properties-file]Process:
Time: ~3-5 minutes
3. deploy-openshift.sh
Purpose: Deploy connector to OpenShift
Features:
4. deploy-container.sh
Purpose: Deploy to self-hosted server via SSH
Features:
Best Practices
DSL Configuration
Research Database Documentation
Use Descriptive Names
jdbc_mysql,jdbc_postgresmydb,JDBC_MySQLRemove Example Fields
_example,_comment,_notefieldsSpecify Complete URL Templates
{placeholder}syntax for connection propertiesDriver Management
Automatic Download (when possible)
Manual Provision (when required)
Version Control
AWS Deployment
Use Private Subnets
Enable EFS Encryption
Monitor with CloudWatch
Cost Optimization
Security
Credentials Management
Network Security
IAM Permissions
Troubleshooting
Common Issues
1. Driver Not Found in Container
Symptoms:
ClassNotFoundExceptionfor JDBC driverSolutions:
2. EFS Mount Timeout
Symptoms:
Solutions:
3. Permission Denied on EFS
Symptoms:
Solutions:
4. Task Definition Registration Fails
Symptoms:
deploy-to-aws.shfails during task definition registrationSolutions:
5. Container Fails to Start
Symptoms:
Solutions:
Debugging Commands
Log Analysis
CloudWatch Logs Location:
/ecs/jdbc-connectorKey Log Patterns:
Getting Help
Check Documentation:
EFS-DRIVER-UPLOAD-GUIDE.mdAUTOMATIC-DRIVER-UPLOAD.mdFIX-EFS-ATTACHMENT.mdVerify Configuration:
Review Logs:
Summary
The Connectors Forge JDBC mode is a comprehensive solution for creating and deploying JDBC connectors to Cloud Pak for Data. It provides:
Key Capabilities
Workflow Summary
Architecture Highlights
Files and Scripts
The mode handles the complete lifecycle from database information gathering to production deployment, with comprehensive automation, error handling, and best practices built-in.