What are Accelerators?
Accelerators in Aletyx Playground serve as project templates that can enable:- Provide a predefined project structure
- Include necessary dependencies
- Configure proper Maven settings
- Set up deployment configurations
- Establish CI/CD pipelines
- Add custom branding and organizational standards
Prerequisites
Before you begin, ensure you have:- Git installed
- Java 17 or later installed
- Maven 3.9.6+ installed
- Docker for testing your accelerator locally
- Access to Aletyx Playground - either at {‘container’: ‘quay.io/aletyx/playground:latest’, ‘url’: ‘https://playground.aletyx.ai’} or
Accelerator Structure
A typical accelerator repository has the following structure:Step 1: Setting Up the Base Project
Start by creating a basic repository structure:Initialize Git Repository
Create Basic .gitignore
Step 2: Create the POM.xml File
Create apom.xml file with dependencies for Apache KIE projects. Below is a template to start with:
Step 3: Configure Application Properties
Create anapplication.properties file in the src/main/resources directory:
Step 4: Add a GitHub Actions Workflow
Create a workflow file for CI/CD in.github/workflows/deploy.yml if you use GitHub actions. A sample can be found at updateThis
Step 5: Add a Docker Compose File for Local Testing
Create adocker-compose.yml file for testing the accelerator locally. The below is an example that can be used as a builder that utilizes the ${artifactId} that should be whatever you would want to call it for your implementation:
Step 6: Create the Sandbox Configuration
Create a.kie-sandbox directory with a configuration file to specify how the Sandbox should handle this accelerator:
.kie-sandbox/accelerator.yaml file:
Step 7: Add Sample DMN and BPMN Models
Sample DMN Model
Create a sample DMN file insrc/main/resources/decisions/simple-decision.dmn to demonstrate decision modeling capabilities.
Sample BPMN Process
Create a sample BPMN file insrc/main/resources/processes/simple-process.bpmn to demonstrate process modeling capabilities.
Step 8: Create a Dockerfile for Container Builds
Create a Dockerfile insrc/main/docker/Dockerfile.jvm:
Step 9: Add Deployment Scripts
Create deployment scripts for Kubernetes in the.github/scripts directory:
Example of a Keycloak Configuration Script using Community
Create.github/scripts/deploy-keycloak.sh:
Components Deployment Script
Create.github/scripts/deploy-components.sh:
Step 10: Add Maven Profiles
Update thepom.xml file to include profiles for different deployment scenarios:
Step 11: Add Persistence Configuration
Update thepom.xml to include persistence-related dependencies:
Step 12: Publishing and Using Your Accelerator
After creating and testing your accelerator, publish it to GitHub and make it available for use in Aletyx Playground. To see how this can be incorporated into yourPublishing to GitHub
Using the Accelerator in Aletyx Playground
- Open Aletyx Playground at https://playground.aletyx.ai
- Create a new project
- Click on “Apply Accelerator”
- Choose “Add Custom Accelerator”
- Enter your GitHub repository URL
- Follow the wizard to configure your new project
Advanced Configuration Options
Custom Environment Variables
Add environment-specific configuration using Quarkus profiles:Configuring Database Migrations
Add Flyway database migration support:Handling Secrets
Add secrets management through Kubernetes:Troubleshooting
Common Issues and Solutions
- Image Build Failures
- Issue: Docker image build fails with authentication errors
- Solution: Ensure Docker is logged in to your registry with
docker login - Kubernetes Deployment Issues
- Issue: “Error: ImagePullBackOff” in Kubernetes pods
- Solution: Check registry credentials and image path
- Quarkus Application Startup Problems
- Issue: Application fails to start due to database connection issues
- Solution: Verify database connection properties and ensure the database is accessible
- Maven Build Failures
- Issue: “Could not resolve dependencies” error
- Solution: Check network connectivity and Maven repository configuration
Accessing Logs
Access deployment logs to diagnose issues:Best Practices
- Externalizing Configuration
- Use environment variables for configuration that varies between environments
- Leverage Quarkus profiles (%dev, %test, %prod) for environment-specific settings
- Security Practices
- Never commit sensitive information (passwords, tokens) to your repository
- Use Kubernetes secrets for sensitive data
- Enable and configure OIDC authentication in production
- Performance Tuning
- Configure appropriate memory settings for containerized applications
- Set up proper connection pooling for database connections
- Enable response compression for API endpoints
- CI/CD Pipeline Efficiency
- Use Maven caching in CI/CD pipelines
- Create optimized container images
- Implement multi-stage builds where appropriate