Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aiopslab/config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ qualitative_eval: false

# Flag to enable/disable printing the session
print_session: false

# Batch mode settings
batch_mode: false # Optimizes for running multiple problems sequentially:
# - Caches Docker images locally to avoid re-pulling
# - Keeps infrastructure (OpenEBS, Prometheus) running between problems
5 changes: 3 additions & 2 deletions aiopslab/orchestrator/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

"""Orchestrator class that interfaces with the agent and the environment."""

from aiopslab.service.helm import Helm
from aiopslab.service.kubectl import KubeCtl
from aiopslab.session import Session
from aiopslab.orchestrator.problems.registry import ProblemRegistry
from aiopslab.orchestrator.parser import ResponseParser
from aiopslab.utils.status import *
from aiopslab.utils.critical_section import CriticalSection
from aiopslab.service.telemetry.prometheus import Prometheus
from aiopslab.paths import config
import time
import inspect
import asyncio
Expand Down Expand Up @@ -203,7 +203,8 @@ async def start_problem(self, max_steps: int):
# if not self.session.problem.sys_status_after_recovery():
self.session.problem.app.cleanup()

if self.session.problem.namespace != "docker":
# In batch mode, keep infrastructure running between problems
if self.session.problem.namespace != "docker" and not config.get("batch_mode", False):
self.prometheus.teardown()
print("Uninstalling OpenEBS...")
self.kubectl.exec_command("kubectl delete sc openebs-hostpath openebs-device --ignore-not-found")
Expand Down
1 change: 0 additions & 1 deletion aiopslab/service/apps/flight_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from aiopslab.service.helm import Helm
from aiopslab.service.kubectl import KubeCtl
from aiopslab.service.apps.base import Application
from aiopslab.paths import TARGET_MICROSERVICES
from aiopslab.paths import FLIGHT_TICKET_METADATA


Expand Down
1 change: 0 additions & 1 deletion aiopslab/service/apps/train_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from aiopslab.service.helm import Helm
from aiopslab.service.kubectl import KubeCtl
from aiopslab.service.apps.base import Application
from aiopslab.paths import TARGET_MICROSERVICES
from aiopslab.paths import TRAIN_TICKET_METADATA


Expand Down
9 changes: 7 additions & 2 deletions aiopslab/service/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""Interface for helm operations"""

import subprocess
import time

from aiopslab.service.kubectl import KubeCtl
from aiopslab.paths import config


class Helm:
Expand All @@ -27,8 +27,13 @@ def install(**args):
chart_path = args.get("chart_path")
namespace = args.get("namespace")
version = args.get("version")
extra_args = args.get("extra_args")
extra_args = args.get("extra_args", [])
remote_chart = args.get("remote_chart", False)

# Apply batch mode if enabled
if config.get("batch_mode", False):
extra_args = extra_args or []
extra_args.append("--set global.imagePullPolicy=IfNotPresent")

if not remote_chart:
# Install dependencies for chart before installation
Expand Down
1 change: 0 additions & 1 deletion aiopslab/service/telemetry/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import json
import yaml
import time
from subprocess import CalledProcessError
from aiopslab.service.helm import Helm
from aiopslab.service.kubectl import KubeCtl
Expand Down