Skip to content

Feature: Create Easy Deployment UI #32

@rbpotter-aws

Description

@rbpotter-aws

Deployment UI — Gradio App for Configuring and Deploying BADGERS

Description

Add a standalone Gradio application (deployment/ui/) that provides a visual interface for configuring and deploying the full BADGERS stack. Currently deployment requires manually editing config files and running shell scripts. This UI lets operators configure deployment settings, select which analyzers to deploy, tune per-analyzer model settings, and trigger deployment with live log streaming — all from a browser.

Scope

Deployment Configuration Form

  • Auto-generated deployment_id (editable, 8-char hex, matches uuid.uuid4().hex[:8] pattern from app.py)
  • deployment_tags fields as a form: application_name, application_description, environment, owner, cost_center, project_code, team, team_contact_email — pre-populated with current defaults from app.py
  • Frontend config fields from frontend-cdk-deployment-config.json: acm_certificate_arn, custom_domain, vpc_flow_logs, log_retention_days, allowed_cidrs, fargate_cpu, fargate_memory, desired_count

Analyzer Selection

  • Checkbox list of all available analyzers, auto-discovered from deployment/lambdas/code/ directories
  • Required analyzers are pre-checked and cannot be unchecked:
    • pdf_to_images_converter — utility; every vision analyzer depends on its output
    • correlation_analyzer — correlates outputs across analyzers per page; required for multi-analyzer workflows
    • full_text_analyzer — baseline text extraction; the agent's primary tool
  • Container-based analyzers (image_enhancer, remediation_analyzer) shown separately with a note that they require Docker image builds (handled by deploy_from_scratch.shbuild_container_lambdas.sh)
  • All other analyzers default to checked but can be unchecked

Per-Analyzer Configuration

  • Each selected analyzer expands to show configurable settings:
    • Model selection dropdown: Claude Sonnet, Claude Haiku, Nova Premier, Claude Opus 4.6, Claude Opus 4.5 (maps to inference profile env vars)
    • MAX_TOKENS — numeric input, default 16000
    • TEMPERATURE — numeric input (0.0–1.0), default 0.1
  • These override the defaults in LambdaAnalyzerStack.create_analyzer_function()

Deployment Execution

  • "Deploy Backend" button that runs deploy_from_scratch.sh with the configured deployment_id and streams stdout/stderr to a log panel in real-time (same pattern as the custom analyzer deploy button)
  • "Deploy Frontend" button that runs a new deploy_frontend.sh script (to be created) and streams logs similarly
  • "Deploy All" button that chains backend → frontend
  • Deployment buttons disabled while a deployment is in progress
  • Log panel with ANSI color support for the colored output from the shell scripts

Config Generation

  • Before deployment, the UI writes:
    • Updated deployment_tags dict values into a generated config (or passes them as CDK context)
    • Updated frontend-cdk-deployment-config.json with the form values
    • Analyzer selection and per-analyzer config overrides into a format consumable by the CDK stacks
  • The UI should also support a "Save Config" button that writes configs without deploying, so users can review before triggering

Architecture

Browser → Gradio UI (deployment/ui/app.py)
              │
              ├─ Configuration Form → writes frontend-cdk-deployment-config.json
              │                     → writes analyzer config (deployment_tags, analyzer selection, model overrides)
              │
              ├─ "Deploy Backend" → subprocess: deploy_from_scratch.sh
              │                      └─ streams stdout/stderr → Gradio log panel
              │
              ├─ "Deploy Frontend" → subprocess: deploy_frontend.sh (new)
              │                       └─ streams stdout/stderr → Gradio log panel
              │
              └─ "Deploy All" → chains backend → frontend sequentially

Analyzer Inventory

Required (cannot be unchecked)

Analyzer Type Why Required
pdf_to_images_converter Utility Converts PDFs to images; all vision analyzers consume its output
correlation_analyzer Correlator Correlates outputs across analyzers per page; required for multi-analyzer workflows
full_text_analyzer Vision Baseline text extraction; the agent's primary analysis tool

Container-Based (require Docker build)

Analyzer Type Purpose
image_enhancer Container Lambda ML-based image preprocessing for poor-quality scans
remediation_analyzer Container Lambda ML-based PDF remediation and correction

Optional Vision Analyzers

Analyzer Purpose
charts_analyzer Chart and graph extraction
classify_pdf_content PDF content classification
code_block_analyzer Source code block extraction
decision_tree_analyzer Decision tree/flowchart analysis
diagram_analyzer Technical diagram analysis
editorial_analyzer Editorial content analysis
edu_transcript_analyzer Educational transcript extraction
elements_analyzer Document element detection
general_visual_analysis_analyzer General visual analysis
handwriting_analyzer Handwriting recognition
keyword_topic_analyzer Keyword and topic extraction
layout_analyzer Page layout analysis
metadata_generic_analyzer Generic metadata extraction
metadata_mads_analyzer MADS metadata extraction
metadata_mods_analyzer MODS metadata extraction
page_analyzer Full page analysis
robust_elements_analyzer Robust element detection
scientific_analyzer Scientific document analysis
table_analyzer Table extraction
war_map_analyzer Historical war map analysis

Per-Analyzer Configurable Settings

Setting Type Default Description
Model Dropdown Claude Sonnet Which Bedrock model to use (maps to inference profile ARN env var)
MAX_TOKENS Integer 16000 Maximum response tokens from Bedrock
TEMPERATURE Float (0.0–1.0) 0.1 Model temperature (lower = more deterministic)

New Files

Path Purpose
deployment/ui/app.py Main Gradio application
deployment/ui/requirements.txt Python dependencies (gradio, etc.)
deployment/deploy_frontend.sh Shell script for frontend-only deployment (builds Docker image, pushes to ECR, deploys badgers-frontend CDK stack, forces ECS service update)

Out of Scope

  • Auto-scaling configuration
  • Custom analyzer creation (already handled by the existing Analyzer Creation Wizard in frontend/)
  • Cognito user management (documented in FRONTEND_DEPLOYMENT_README.md, CLI-based)
  • SSO/SAML/OIDC configuration
  • Tear-down / destroy UI

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions