Metadata-Version: 2.4
Name: astronomer-orbis
Version: 0.9.0rc5
Summary: A tool for generating astronomer software deployment compute reports
Project-URL: Homepage, https://github.com/astronomer/orbis
Project-URL: Bug Tracker, https://github.com/astronomer/orbis/issues
Author-email: Astronomer <humans@astronomer.io>, Abhishek Bhakat <abhishek.bhakat@astronomer.io>, Indraneel Dongaonkar <indraneel.dongaonkar@astronomer.io>, Sudarshan Chaudhari <sudarshan.chaudhari@astronomer.io>
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: click==8.2.1
Requires-Dist: jinja2==3.1.6
Requires-Dist: kaleido==1.0.0
Requires-Dist: kubernetes==33.1.0
Requires-Dist: pendulum==3.1.0
Requires-Dist: pillow==11.3.0
Requires-Dist: plotly==6.2.0
Requires-Dist: polars==1.31.0
Requires-Dist: python-docx==1.2.0
Requires-Dist: python-dotenv==1.1.1
Requires-Dist: pyyaml==6.0.2
Requires-Dist: requests==2.32.4
Provides-Extra: dev
Requires-Dist: hatch==1.14.1; extra == 'dev'
Requires-Dist: pre-commit==4.2.0; extra == 'dev'
Requires-Dist: pytest-asyncio==1.0.0; extra == 'dev'
Requires-Dist: pytest-cov==6.2.1; extra == 'dev'
Requires-Dist: pytest-mock==3.14.1; extra == 'dev'
Requires-Dist: pytest==8.4.1; extra == 'dev'
Requires-Dist: ruff==0.12.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-awesome-pages-plugin==2.9.3; extra == 'docs'
Requires-Dist: mkdocs-git-revision-date-localized-plugin==1.3.0; extra == 'docs'
Requires-Dist: mkdocs-glightbox==0.4.0; extra == 'docs'
Requires-Dist: mkdocs-macros-plugin==1.3.7; extra == 'docs'
Requires-Dist: mkdocs-material==9.6.15; extra == 'docs'
Requires-Dist: mkdocs-minify-plugin==0.8.0; extra == 'docs'
Requires-Dist: mkdocs-redirects==1.2.1; extra == 'docs'
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
Requires-Dist: mkdocstrings-python==1.16.12; extra == 'docs'
Requires-Dist: mkdocstrings==0.29.1; extra == 'docs'
Description-Content-Type: text/markdown

# Orbis
<div style="text-align:center">
   <img src="docs/assets/orbis_logo.svg" width="50%" alt="Orbis Logo">
</div>

Orbis is a deployment compute report generator tool developed by RDC Team. It analyzes data from Prometheus to provide insights into deployment metrics and resource utilization for Astronomer Software platforms.

## Docs

- Internal Docs : https://potential-waffle-pl91nlj.pages.github.io/
- External Docs : https://astronomer.github.io/orbis-docs/

## Features

- Generates comprehensive deployment compute reports
- Analyzes CPU, memory, and pod count metrics
- Supports both Kubernetes and Celery executors
- Creates visualizations for easy data interpretation
- Exports reports in DOCX, JSON, and CSV formats
- Supports resume functionality for interrupted report generation
- Diagnostic scanner for collecting cluster support bundles
- APC 1.x multi-cluster CP/DP support with topology discovery, incremental collection, and auto-merge
- Session-based resume workflow for collecting across separate cloud accounts

## Flow Diagram
![Alt text](docs/assets/flow_diagram.png)

## Installation

To install Orbis, follow these steps:

1. Download the distributions from [Releases](https://github.com/astronomer/orbis/releases)

2. Create and activate a virtual environment:
   ```
   python -m venv venv
   source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
   ```

3. Install the package:
   ```
   pip install orbis-0.4.0-py3-none-any.whl
   ```

## Configuration

Before running Orbis reporting, generate a system admin API token and export it as `ASTRO_SOFTWARE_API_TOKEN`.

```bash
export ASTRO_SOFTWARE_API_TOKEN=<your-token>
```

## Reporting

Run reporting with a local Orbis install:

```bash
orbis reporting \
  -s <start-date> -e <end-date> \
  -b <base-domain> \
  --version <platform-version> -vvv -r -p -z
```

Run reporting with Podman:

```bash
podman run --rm -it \
  -e ASTRO_SOFTWARE_API_TOKEN=<your-token> \
  -v $(pwd)/output:/app/output \
  quay.io/astronomer/orbis:<orbis-version> \
  reporting \
  -s <start-date> -e <end-date> \
  -b <base-domain> \
  --version <platform-version> -vvv -r -p -z
```

## Scanner

Run scanner with a local Orbis install:

```bash
orbis scanner create \
  -n <platform-namespace> \
  --kubeconfig <path-to-unified-kubeconfig> \
  -d <base-domain> \
  --image quay.io/astronomer/orbis:<orbis-version> \
  --log-level debug \
  --no-cleanup
```

Run scanner with Podman:

```bash
podman run --rm -it \
  -v ~/path/to/unified-kubeconfig:/kubeconfigs/unified_kubeconfig:ro \
  -v $(pwd)/output:/app/output \
  -v ~/.aws:/home/nonroot/.aws:ro \
  -e AWS_PROFILE \
  quay.io/astronomer/orbis:<orbis-version> \
  scanner create \
  -n <platform-namespace> \
  --kubeconfig /kubeconfigs/unified_kubeconfig \
  -d <base-domain> \
  --image quay.io/astronomer/orbis:<orbis-version> \
  --log-level debug \
  --no-cleanup
```

See [docs/reporting/generate-report.md](docs/reporting/generate-report.md) and [docs/scanner/create-support-bundle.md](docs/scanner/create-support-bundle.md) for the full command list.

## Output

Orbis generates:

1. A comprehensive deployment compute report in DOCX format
2. A JSON report for automation purposes
3. A CSV report for automation purposes

## Development

To set up the development environment:

1. Clone the repository

2. Install development dependencies:
   ```
   pip install -e ".[dev]"
   ```

3. Install pre-commit hooks:
   ```
   pre-commit install
   ```

4. Run tests:
   ```
   pytest tests/
   ```

### Debugging

Create a `.vscode` folder and add `launch.json` file with the following contents:
```json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Orbis",
            "type": "debugpy",
            "request": "launch",
            "module": "orbis.cli",
            "console": "integratedTerminal",
            "args": [
                "sizing",
                "-o",
                "<org_id>",
                "-s",
                "2024-07-03",
                "-e",
                "2024-07-04"
            ]
        }
    ]
}
```

### Using pre-commit

Pre-commit is used to maintain code quality. Here's how to use it:

1. Run pre-commit on all files:
   ```
   pre-commit run --all-files
   ```

2. Run pre-commit on staged files:
   ```
   pre-commit run
   ```

3. Run a specific hook:
   ```
   pre-commit run <hook_id>
   ```
   Replace `<hook_id>` with the ID of the specific hook you want to run (e.g., `ruff`).

4. To bypass pre-commit hooks when committing:
   ```
   git commit -m "Your commit message" --no-verify
   ```

Pre-commit will run automatically before each commit once the hooks are installed.
