CoolFace
Apppublic

MeenalSinha/cloud-finops-optimizer

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
openenv.yaml164 linesDownload Raw Back to root
1name: cloud-finops-optimizer2version: "2.0.0"3description: >4  A production-grade OpenEnv environment where an AI agent acts as a Cloud5  FinOps Engineer. The agent reduces cloud costs safely using a full 3-tier6  dependency graph, SLA performance constraints, temporal action effects,7  explainability scoring, and a what-if simulation mode — without breaking8  mission-critical systems.9 10author: cloud-finops-optimizer11license: MIT12tags:13  - openenv14  - finops15  - cloud16  - cost-optimization17  - reinforcement-learning18  - dependency-graph19  - sla20  - explainability21 22# Required by openenv validate23entry_point: server.app:app24client: client.FinOpsEnv25 26tasks:27  - id: task128    name: Waste Cleanup29    difficulty: easy30    description: >31      Terminate all idle EBS/S3 resources (cpu=0, idle_hours>0).32      Dependency graph is present — do not break production chains.33    max_steps: 1234    budget_per_hour: 1.0035    score_range: [0.01, 0.99]36 37  - id: task238    name: Resource Optimization with SLA39    difficulty: medium40    description: >41      Resize over-provisioned EC2 instances (cpu<20%) without violating SLA42      cpu caps (sla_max_cpu). Resizes take 2 steps to stabilise (cooldown).43      Dependency chain: batch-workers -> api-servers -> prod-apps.44    max_steps: 1645    budget_per_hour: 0.8046    score_range: [0.01, 0.99]47 48  - id: task349    name: Strategic Planning — Full System50    difficulty: hard51    description: >52      Navigate a 10-resource environment with a 3-tier dependency chain53      (frontend->backend->db), tight SLA constraints, and permanent54      reservation commitments. Use simulate to reason before acting.55      Bring total spend below $1.00/hr without SLA breaches.56    max_steps: 2057    budget_per_hour: 1.0058    score_range: [0.01, 0.99]59 60unique_mechanics:61  - name: Dependency Graph (Upgrade 1)62    description: >63      Resources declare dependency_ids. Terminating a resource that others64      depend on triggers cascade failure (-0.20 per affected resource).65      dependency_graph and cascading_risks are exposed in every observation.66 67  - name: SLA Performance Constraints (Upgrade 2)68    description: >69      Each resource has sla_max_cpu and sla_uptime_pct. Resizing a loaded70      instance projects new CPU via capacity model; if projected CPU exceeds71      sla_max_cpu the action triggers SLA violation (-0.20) and is counted72      against the grade. Resources have sla_status: ok / at_risk / violated.73 74  - name: Temporal Action Effects (Upgrade 3)75    description: >76      Resize has a 2-step cooldown (resize_cooldown_steps). During cooldown77      the resource is marked at_risk. Reservation is permanently committed78      (reservation_committed=true) — it cannot be undone.79 80  - name: Explainability Score (Upgrade 4)81    description: >82      The agent can include a "reasoning" field in any action. The grader83      scores reasoning quality (coverage, depth, keyword relevance) and adds84      up to +0.05 bonus to the episode score. Encourages interpretable agents.85 86  - name: What-If Simulation Mode (Upgrade 5)87    description: >88      action_type "simulate" returns a SimulateResult with projected cost,89      projected reward, SLA violations, cascade risks, and a plain-English90      recommendation — all without mutating environment state. Also available91      as POST /simulate for direct HTTP access.92 93observation_space:94  type: object95  description: FinOpsObservation (Pydantic, inherits openenv Observation)96  fields:97    done: boolean98    reward: "float | null"99    resources: array[CloudResource]100    total_cost_per_hour: float101    budget_per_hour: float102    budget_remaining: float103    task_id: string104    task_description: string105    goal: string106    last_action_error: "string | null"107    dependency_graph: "dict[resource_id -> list[dependency_ids]]"108    cascading_risks:  "dict[resource_id -> list[dependent_ids]]"109    sla_violations:   "list[resource_id]"110    simulate_result:  "SimulateResult | null"111    step_count: integer112    max_steps: integer113    info: object114 115action_space:116  type: object117  description: FinOpsAction (Pydantic, inherits openenv Action)118  fields:119    action_type: "terminate | resize | reserve | simulate | noop"120    resource_id: "string | null"121    target_size: "string | null"122    simulate_action: "dict | null"123    reasoning: "string | null"124  examples:125    simulate:  '{"action_type":"simulate","simulate_action":{"action_type":"terminate","resource_id":"ebs-001"},"reasoning":"checking cascade risk"}'126    terminate: '{"action_type":"terminate","resource_id":"ebs-001","reasoning":"idle 720 hrs, no dependents"}'127    resize:    '{"action_type":"resize","resource_id":"ec2-t01","target_size":"t2.large","reasoning":"cpu 8%, sla_max 90%, safe to downsize"}'128    reserve:   '{"action_type":"reserve","resource_id":"ec2-h01","reasoning":"always-on, 70% cpu, large cost"}'129    noop:      '{"action_type":"noop","reasoning":"no safe actions remain"}'130 131reward_function:132  type: dense133  range: [-1.0, 1.0]134  components:135    - {name: cost_reduction,        value: "0.0 to +0.50",    trigger: any cost-saving action}136    - {name: idle_bonus,            value: "+0.10",            trigger: terminate cpu=0 idle resource}137    - {name: strategy_bonus,        value: "+0.10",            trigger: reserve high-utilisation instance}138    - {name: overprovisioned_bonus, value: "+0.10",            trigger: resize cpu<20% instance}139    - {name: waste_penalty,         value: "-0.15",            trigger: terminate active non-critical resource}140    - {name: sla_violation_penalty, value: "-0.20",            trigger: resize causes cpu > sla_max_cpu}141    - {name: dependency_penalty,    value: "-0.20 each",       trigger: terminate resource with live dependents}142    - {name: critical_penalty,      value: "-1.00",            trigger: terminate critical resource}143    - {name: noop_penalty,          value: "-0.02",            trigger: noop action}144    - {name: explainability_bonus,  value: "up to +0.05",      trigger: quality reasoning in grade}145 146endpoints:147  ws:       WS   /ws148  reset:    POST /reset149  step:     POST /step150  state:    GET  /state151  health:   GET  /health152  grade:    GET  /grade153  tasks:    GET  /tasks154  simulate: POST /simulate155  web:      GET  /web156  docs:     GET  /docs157 158deployment:159  platform: huggingface-spaces160  sdk: docker161  port: 7860162  hardware: cpu-basic163  environment_variables: [API_BASE_URL, MODEL_NAME, OPENAI_API_KEY, HF_TOKEN]164