OptScale Documentation

repository·integration·Indexed 22 days ago

https://github.com/hystax/optscale

An open-source FinOps and cloud cost optimization platform for multi-cloud (AWS, Azure, GCP, Alibaba) and Kubernetes environments. This documentation covers development setup for the ngui monorepo (Apollo Server and React/Vite), Jira integration UI configuration, internationalization (i18n) using react-intl, and the Vite-based Theme Resolver Plugin for brand-specific file overrides.

Tokens
139.8K
Snippets
535
Records
1.5K
Agent score
80%

What's inside OptScale

  1. What is OptScale?

    integration

    OptScale is an open-source FinOps and cloud cost optimization platform designed to help engineering and finance teams control and reduce cloud spend. It provides visibility into infrastructure costs, automated optimization recommendations, and governance tools across multiple cloud providers and Kubernetes clusters.

    Supported Cloud Providers

    • AWS
    • Microsoft Azure
    • Google Cloud (GCP)
    • Alibaba Cloud
    • Kubernetes clusters

    Supported Data & AI/ML Technologies

    • Databricks
    • Amazon S3
    • Amazon Redshift
    • MLflow, PyTorch, TensorFlow, Spark, Kubeflow
  2. Use the Home page for cost and governance monitoring

    integration

    The Home page serves as a central dashboard for monitoring your organization's cloud spending and governance status. Use it to:

    • Monitor Spending: View current spending and projected expenses for the upcoming month.
    • Identify Cost Drivers: See the top 6 resources by cost.
    • Check Governance: Review resource policy violations.
    • Find Savings: Identify potential monthly savings.
    • Track Budgets: Monitor pools that have exceeded their budget limits.
  3. Key Features of OptScale

    integration

    OptScale provides capabilities across four main domains:

    Cost Optimization

    • Unused/Idle Resource Detection: Identifies idle VMs, volumes, databases, and other resources.
    • Rightsizing: Provides recommendations for overprovisioned instances and workloads.
    • Power Management: Automatically stops non-production R&D environments outside of working hours.
    • Commitment Analysis: Analyzes utilization for Reserved Instances, Savings Plans, and Spot Instances.

    FinOps and Governance

    • Dashboards: Specialized views for engineering, finance, and product teams.
    • Budgeting & Alerting: Monitors for cost anomalies, spikes, and budget overruns.
    • Cost Attribution: Uses tagging and ownership visibility to attribute costs to specific teams, projects, or environments.
    • Governance: Policy-driven automation controls.

    Data and AI/ML Workloads

    • Databricks Analytics: Detailed visibility into cluster usage and idle time.
    • Object Storage Optimization: Recommendations for S3/object storage lifecycle, unused buckets, and storage classes.

    Kubernetes and Multi-cloud

    • Kubernetes Cost Allocation: Visibility per namespace, workload, and label.
    • Unified Multi-cloud Management: Manage AWS, Azure, GCP, and Alibaba Cloud from a single instance.
  4. View cloud account expense summaries and forecasts

    integration

    The Data Source interface provides several ways to visualize your cloud spending and limits:

    • Summary Cards: Provides an at-a-glance overview of total expenses.
    • Quick Overview Diagram: A visual representation showing total expenses, forecasts, and accessible limits. You can hover over the diagram to view specific data in a tooltip.
    • Details View: Provides granular monitoring of billing data, specifically current expenses and future forecasts.
  5. How runtime language switching works in NGUI

    integration

    NGUI implements internationalization (i18n) using react-intl. The system uses English (en-US) as the canonical source of truth. Other locales are treated as partial overrides: when a locale is selected, the application merges the English messages with the specific locale's messages, ensuring that any missing keys in the secondary locale fall back to English.

    Key Components:

    • LocaleContext: Manages the current locale state.
    • LocaleContextProvider: Wraps the app root and provides the IntlProvider configured via getConfigForLocale(locale).
    • LanguageSwitcher: A UI component in the header that uses setLocale to change the language based on the SUPPORTED_LOCALES registry.

    Fallback Logic:

    messages: { ...messagesEnUS, ...getMessagesForLocale(locale) }
  6. Privileges for Cluster Type management

    integration

    Access to cluster type management is role-based:

    • Standard Users: Can monitor the list of cluster types.
    • Organization Managers: Have extended privileges, including viewing an extended table of cluster types and accessing all management actions (Add, Prioritize, Promote, Demote, Deprioritize, Delete, and Re-apply).
  7. Best practices for cloud resource optimization

    integration

    To maintain an efficient and cost-effective cloud environment using OptScale, follow these operational patterns:

    • Implement Cost Monitoring: Regularly monitor and analyze cloud resource usage and costs to identify and eliminate unnecessary expenses.
    • Regular Audits and Optimization: Conduct periodic audits of cloud resources to identify underutilized or idle resources. Use these findings to optimize or decommission resources to ensure efficient utilization.
  8. How the Theme Resolver Plugin works

    integration

    The Theme Resolver Plugin is a Vite plugin designed to handle per-brand or per-theme file overrides. It allows you to maintain canonical source files in src/ while providing specific overrides in a themes/<theme-name>/ directory.

    When an import is encountered during the Vite build process, the plugin:

    1. Resolves the original file.
    2. Checks if the file is absolute and has a supported extension.
    3. Looks for a corresponding file in the active theme directory (stripping the leading src/ from the path).
    4. If a themed override exists, it redirects the import to that file; otherwise, it falls back to the original file.

    Key Mental Model:

    • Canonical Source: src/path/to/file.ext
    • Theme Override: src/themes/<theme-name>/path/to/file.ext
    • Resolution: An import of src/path/to/file.ext will resolve to the theme version if the VITE_APP_THEME environment variable matches the folder name in src/themes/.
  9. Best practices for cost optimization in OptScale

    integration

    To effectively manage cloud spend using OptScale, follow these two primary strategies:

    1. Real-time Monitoring & Alerting: Monitor spending in real-time and configure alerts to notify you when budget limits are exceeded.
    2. Resource Right-Sizing: Regularly review cloud resources to ensure they match actual usage. Prevent over-provisioning by scaling down underutilized services and selecting the most cost-effective instance types.
  10. Quickstart OptScale via Docker Compose (Try Mode)

    integration

    You can spin up a near-full OptScale instance on a single machine for evaluation and development using Docker Compose. Note that this deployment is not intended for production.

    Prerequisites

    • Docker Engine: 24+
    • Docker Compose: v2.20+
    • CPU: 8 cores
    • RAM: 16 GB (32 GB recommended)
    • Disk: 40 GB free

    Installation Steps

    1. Prepare environment: Navigate to optscale-deploy/compose and create your .env file from the example.
    2. Pull images: Run the provided ./pull.sh script to pull images sequentially. This prevents hitting Docker Hub rate limits, as the stack contains over 60 services.
    3. Start services: Run docker compose up -d.
    4. Bootstrap: Wait for the configurator container to finish bootstrapping (typically 1-2 minutes). You can monitor progress with docker compose logs -f configurator.
    5. Access: Once the configurator exits successfully, all services will start. Open http://localhost in your browser.
    cd optscale-deploy/compose
    
    # 1. Create your environment file
    cp .env.example .env
    
    # 2. Pull images sequentially
    ./pull.sh
    
    # 3. Start OptScale
    docker compose up -d
    
    # 4. Wait for the configurator to finish bootstrapping
    docker compose logs -f configurator
  11. Compare cloud provider instance variants

    integration

    To perform a side-by-side comparison of cloud instances in OptScale:

    1. Filter Results: Enter values in the filter fields and click the FILTER button to narrow down the available options.
    2. Select Instances: Click the Add to comparison button (located next to the cloud icon in the results table) for each instance you wish to evaluate.
    3. Execute Comparison: Click the COMPARE button to open a side modal. This modal displays comparisons across several dimensions:
      • CPU
      • RAM
      • Cost
      • Location
      • Instance family
    4. Manage Selection:
      • To remove a specific instance, click Remove from comparison next to its cloud icon.
      • To clear all selected items at once, click CLEAR SELECTION.