Class: Lemans::Bench::Environment
- Defined in:
- lib/lemans/bench.rb
Overview
The environment block: the one machine a trial runs on. The agent
works in it, and the verifier verifies in it.
Constant Summary collapse
- VALIDATED =
%i[image workdir resources build_timeout_sec network setup].freeze
Instance Method Summary collapse
- #build_timeout_sec ⇒ Object
-
#image ⇒ Object
A bench that names no image builds one per task from each task's own Dockerfile.
-
#initialize(config) ⇒ Environment
constructor
A new instance of Environment.
- #network ⇒ Object
- #resources ⇒ Object
- #setup ⇒ Object
- #workdir ⇒ Object
Methods inherited from Section
Constructor Details
#initialize(config) ⇒ Environment
Returns a new instance of Environment.
116 |
# File 'lib/lemans/bench.rb', line 116 def initialize(config) = super(config, "environment") |
Instance Method Details
#build_timeout_sec ⇒ Object
132 |
# File 'lib/lemans/bench.rb', line 132 def build_timeout_sec = seconds("build_timeout", default: "10m") |
#image ⇒ Object
A bench that names no image builds one per task from each task's own Dockerfile.
119 |
# File 'lib/lemans/bench.rb', line 119 def image = self["image"] |
#network ⇒ Object
134 |
# File 'lib/lemans/bench.rb', line 134 def network = policy |
#resources ⇒ Object
128 129 130 |
# File 'lib/lemans/bench.rb', line 128 def resources Resources.from_config(self["resources"] || {}, field: dotted("resources"), defaults: DEFAULT_RESOURCES) end |
#setup ⇒ Object
136 |
# File 'lib/lemans/bench.rb', line 136 def setup = commands("setup") |
#workdir ⇒ Object
121 122 123 124 125 126 |
# File 'lib/lemans/bench.rb', line 121 def workdir fetch("workdir", "/app").tap do |dir| raise ConfigError, "#{dotted("workdir")} must be an absolute path, got #{dir.inspect}" unless dir.start_with?("/") end end |