Add S2I support and cleanup unused files
- Add complete Source-to-Image (S2I) deployment support - Create .s2i/ directory with assemble/run scripts and environment config - Add openshift-s2i.yaml template for S2I deployment - Add scripts/deploy-s2i.sh for automated S2I deployment - Add README-S2I.md with comprehensive S2I documentation - Update README.md and AIAgents-Support.md with S2I information - Clean up unused files: Dockerfile.simple, HTML backups, daemonset files - Remove unused Makefile and openshift-git-deploy.yaml - Update kustomization.yaml to use deployment instead of daemonset - Update undeploy-complete.sh to remove deployment instead of daemonset - Maintain clean and organized codebase structure
This commit is contained in:
40
.s2i/bin/assemble
Executable file
40
.s2i/bin/assemble
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# S2I Assemble Script for ORU Analyzer
|
||||
# This script is called during the S2I build process
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== ORU Analyzer S2I Assemble Script ==="
|
||||
echo "Building ORU Analyzer from source..."
|
||||
|
||||
# Install Python dependencies
|
||||
echo "Installing Python dependencies..."
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Create application directory structure
|
||||
echo "Creating application directory structure..."
|
||||
mkdir -p /opt/app-root/src/app/static
|
||||
mkdir -p /opt/app-root/src/app/templates
|
||||
mkdir -p /opt/app-root/src/logs
|
||||
|
||||
# Copy application files
|
||||
echo "Copying application files..."
|
||||
cp -r app/* /opt/app-root/src/app/
|
||||
|
||||
# Set proper permissions
|
||||
echo "Setting permissions..."
|
||||
chmod +x /opt/app-root/src/app/main.py
|
||||
chmod -R 755 /opt/app-root/src/app/static
|
||||
|
||||
# Create startup script
|
||||
echo "Creating startup script..."
|
||||
cat > /opt/app-root/src/start.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
echo "Starting ORU Analyzer..."
|
||||
cd /opt/app-root/src
|
||||
exec python -m uvicorn app.main:app --host 0.0.0.0 --port 8080 --workers 1
|
||||
EOF
|
||||
|
||||
chmod +x /opt/app-root/src/start.sh
|
||||
|
||||
echo "=== S2I Assemble completed successfully ==="
|
||||
19
.s2i/bin/run
Executable file
19
.s2i/bin/run
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# S2I Run Script for ORU Analyzer
|
||||
# This script is called when the container starts
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== ORU Analyzer S2I Run Script ==="
|
||||
echo "Starting ORU Analyzer application..."
|
||||
|
||||
# Change to application directory
|
||||
cd /opt/app-root/src
|
||||
|
||||
# Set environment variables
|
||||
export PYTHONPATH=/opt/app-root/src
|
||||
export PYTHONUNBUFFERED=1
|
||||
|
||||
# Start the application
|
||||
echo "Launching ORU Analyzer..."
|
||||
exec /opt/app-root/src/start.sh
|
||||
35
.s2i/environment
Normal file
35
.s2i/environment
Normal file
@@ -0,0 +1,35 @@
|
||||
# S2I Environment Configuration for ORU Analyzer
|
||||
# OpenShift Source-to-Image configuration
|
||||
|
||||
# Python Configuration
|
||||
PYTHON_VERSION=3.11
|
||||
PIP_INDEX_URL=https://pypi.org/simple
|
||||
|
||||
# Application Configuration
|
||||
APP_NAME=oru-analyzer
|
||||
APP_VERSION=2.0.0
|
||||
|
||||
# FastAPI Configuration
|
||||
HOST=0.0.0.0
|
||||
PORT=8080
|
||||
WORKERS=1
|
||||
|
||||
# OpenShift Specific
|
||||
OPENSHIFT_BUILD_NAME=oru-analyzer
|
||||
OPENSHIFT_BUILD_NAMESPACE=resource-governance
|
||||
|
||||
# Resource Configuration
|
||||
CPU_REQUEST=100m
|
||||
CPU_LIMIT=500m
|
||||
MEMORY_REQUEST=256Mi
|
||||
MEMORY_LIMIT=1Gi
|
||||
|
||||
# Health Check Configuration
|
||||
HEALTH_CHECK_PATH=/health
|
||||
HEALTH_CHECK_INTERVAL=30s
|
||||
HEALTH_CHECK_TIMEOUT=10s
|
||||
HEALTH_CHECK_RETRIES=3
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL=INFO
|
||||
LOG_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
||||
Reference in New Issue
Block a user