Installation Guide¶
This guide will help you install and set up FinOps Optimizer for your environment.
๐ Prerequisites¶
System Requirements¶
- Python: 3.8 or higher
- Memory: 2GB RAM minimum (4GB recommended)
- Storage: 1GB free space
- Network: Internet access for cloud provider APIs
Cloud Provider Access¶
Ensure you have access to at least one of the following cloud providers:
- AWS: Access key and secret key with appropriate permissions
- Azure: Service principal or managed identity
- GCP: Service account with billing access
- Oracle Cloud: API key and private key
๐ Quick Installation¶
Using pip¶
# Install from PyPI
pip install finopsoptimizer
# Install with all dependencies
pip install finopsoptimizer[all]
Using conda¶
# Create new environment
conda create -n finops python=3.9
conda activate finops
# Install package
pip install finopsoptimizer
From Source¶
# Clone repository
git clone https://github.com/manikantesh/finopsoptimizer.git
cd finopsoptimizer
# Install in development mode
pip install -e .
# Install development dependencies
pip install -r requirements-dev.txt
๐ง Detailed Installation¶
1. Python Environment Setup¶
Using virtualenv¶
# Create virtual environment
python -m venv finops-env
# Activate environment
# On Windows:
finops-env\Scripts\activate
# On macOS/Linux:
source finops-env/bin/activate
# Upgrade pip
pip install --upgrade pip
Using conda¶
2. Install Core Dependencies¶
# Install core package
pip install finopsoptimizer
# Install additional dependencies for specific features
pip install finopsoptimizer[web] # Web dashboard
pip install finopsoptimizer[security] # Security features
pip install finopsoptimizer[monitoring] # Monitoring features
3. Install Cloud Provider SDKs¶
AWS¶
Azure¶
GCP¶
Oracle Cloud¶
4. Install Development Dependencies¶
# Testing
pip install pytest pytest-cov pytest-mock
# Code quality
pip install flake8 black isort
# Security
pip install bandit safety
# Documentation
pip install mkdocs mkdocs-material
๐ Cloud Provider Setup¶
AWS Configuration¶
-
Create IAM User:
-
Required Permissions:
-
Environment Variables:
Azure Configuration¶
-
Create Service Principal:
-
Required Permissions:
- Cost Management Reader
- Virtual Machine Contributor
-
Monitoring Reader
-
Environment Variables:
GCP Configuration¶
-
Create Service Account:
-
Required Permissions:
- Cloud Billing Viewer
- Compute Instance Viewer
-
Monitoring Viewer
-
Download Key File:
-
Environment Variable:
Oracle Cloud Configuration¶
-
Generate API Key:
-
Required Permissions:
- Cost Management Reader
- Compute Instance Viewer
-
Monitoring Viewer
-
Configuration:
๐ง Configuration Setup¶
1. Initialize Configuration¶
2. Edit Configuration¶
# finops_config.yml
aws:
enabled: true
region: us-east-1
account_id: your-account-id
azure:
enabled: true
subscription_id: your-subscription-id
gcp:
enabled: true
project_id: your-project-id
oracle:
enabled: false
tenancy_id: null
user_id: null
fingerprint: null
private_key_path: null
region: us-ashburn-1
optimization:
cpu_utilization_threshold: 0.7
memory_utilization_threshold: 0.8
cost_savings_threshold: 0.1
min_instances: 1
max_instances: 10
scale_up_threshold: 0.8
scale_down_threshold: 0.3
performance:
max_workers: 4
cache_ttl: 3600
batch_size: 100
security:
max_login_attempts: 5
session_timeout: 3600
password_min_length: 8
output_dir: "./finops_reports"
log_level: "INFO"
3. Validate Configuration¶
๐งช Testing Installation¶
1. Run Basic Tests¶
# Test core functionality
python -c "from finops import FinOpsOptimizer; print('Installation successful!')"
# Test CLI
python cli.py --help
2. Test Cloud Providers¶
# Test AWS
python -c "import boto3; print('AWS SDK installed')"
# Test Azure
python -c "import azure.mgmt.compute; print('Azure SDK installed')"
# Test GCP
python -c "import google.cloud.compute; print('GCP SDK installed')"
# Test Oracle
python -c "import oci; print('Oracle SDK installed')"
3. Run Test Suite¶
๐ Web Dashboard Setup¶
1. Install Web Dependencies¶
2. Start Dashboard¶
3. Access Dashboard¶
- URL: http://localhost:5000
- Username: admin
- Password: admin123
๐ณ Docker Installation¶
1. Build Image¶
# Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "-m", "web.app"]
2. Build and Run¶
# Build image
docker build -t finopsoptimizer .
# Run container
docker run -p 5000:5000 finopsoptimizer
๐ Production Deployment¶
1. Install Production Dependencies¶
2. Configure Environment¶
export FINOPS_CONFIG_PATH=/path/to/config.yml
export FINOPS_SECRET_KEY=your-secret-key
export FINOPS_LOG_LEVEL=INFO
3. Start Production Server¶
# Using gunicorn
gunicorn -w 4 -b 0.0.0.0:8000 web.app:app
# Using uwsgi
uwsgi --http :8000 --module web.app:app --processes 4
๐ Security Setup¶
1. Generate Secret Key¶
2. Configure Security¶
security:
max_login_attempts: 5
session_timeout: 3600
password_min_length: 8
api_key_hash: "your-api-key-hash"
3. Set Up SSL¶
# Install SSL certificate
sudo apt-get install certbot
# Generate certificate
sudo certbot certonly --standalone -d your-domain.com
๐ Monitoring Setup¶
1. Install Monitoring Dependencies¶
2. Configure Monitoring¶
3. Start Monitoring¶
๐ Troubleshooting¶
Common Issues¶
1. Import Errors¶
# Check Python version
python --version
# Reinstall package
pip uninstall finopsoptimizer
pip install finopsoptimizer
2. Cloud Provider Errors¶
# Test AWS credentials
aws sts get-caller-identity
# Test Azure credentials
az account show
# Test GCP credentials
gcloud auth list
3. Permission Errors¶
Getting Help¶
- Documentation: GitHub Pages
- Issues: GitHub Issues
- Discussions: GitHub Discussions
โ Verification Checklist¶
- Python 3.8+ installed
- FinOps Optimizer package installed
- Cloud provider SDKs installed
- Configuration file created
- Cloud provider credentials configured
- Basic tests passing
- Web dashboard accessible
- Security settings configured
- Monitoring enabled (optional)
๐ Next Steps¶
After successful installation:
- Read the Tutorial: Tutorial Guide
- Configure Cloud Providers: Configuration Guide
- Explore the API: API Reference
- Set Up Monitoring: Performance Guide
- Review Security: Security Guide
Need help? Check our Troubleshooting Guide or open an issue.