Class: Lemans::Agents::MiniswenInstalled

Inherits:
Miniswen show all
Defined in:
lib/lemans/agents/miniswen_installed.rb

Overview

Runs the miniswen CLI inside the sandbox instead of driving the loop harness-side: the gem is installed while the network is still open, the run writes a results file, and the harness downloads it back into the same Result the shared ATIF tail already knows how to report.

Constant Summary collapse

NAME =
"miniswen-installed"
RESULTS_PATH =
"/tmp/lemans-miniswen.result.json"
RESULT_FILENAME =
"miniswen.result.json"
INSTALL_TIMEOUT_SEC =
300
EXEC_SLACK_SEC =

The CLI enforces max-time itself; the slack only covers process startup, so the results file exists before the outer exec expires.

60

Constants inherited from Miniswen

Lemans::Agents::Miniswen::OUTCOME_FOR_STATUS, Lemans::Agents::Miniswen::TRAJECTORY_FILENAME

Instance Attribute Summary

Attributes inherited from Base

#model, #profile

Instance Method Summary collapse

Methods inherited from Miniswen

#call

Methods inherited from Base

#call, #initialize, #name

Constructor Details

This class inherits a constructor from Lemans::Agents::Base

Instance Method Details

#install(environment, task:) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



21
22
23
24
25
26
27
# File 'lib/lemans/agents/miniswen_installed.rb', line 21

def install(environment, task:) # rubocop:disable Lint/UnusedMethodArgument
  environment.exec!(
    "command -v miniswen >/dev/null 2>&1 || gem install miniswen -v #{::Miniswen::VERSION} --no-document",
    timeout: INSTALL_TIMEOUT_SEC
  )
  environment.exec("miniswen --refresh-registry", timeout: INSTALL_TIMEOUT_SEC)
end