Module: OSC::Reservations

Defined in:
lib/osc/reservations.rb,
lib/osc/reservations/node.rb,
lib/osc/reservations/batch.rb,
lib/osc/reservations/query.rb,
lib/osc/reservations/adapter.rb,
lib/osc/reservations/version.rb,
lib/osc/reservations/reservation.rb,
lib/osc/reservations/adapters/osc_moab.rb

Overview

The main namespace for OSC::Reservations. Provides the ability to submit and read back reservations to the local batch scheduler.

Defined Under Namespace

Modules: Adapters Classes: Adapter, Batch, Node, Query, Reservation

Constant Summary collapse

CONFIG_ROOT =

Path to batch server configuration file.

File.expand_path("../../../config", __FILE__)
VERSION =

The current version of OSC::Reservations.

"1.0.4"

Class Method Summary collapse

Class Method Details

.batch_configHash

Hash generated from reading the batch config yaml file.

Returns:

  • (Hash)

    Batch configuration generated from config yaml file.



41
42
43
# File 'lib/osc/reservations.rb', line 41

def self.batch_config
  YAML.load_file(batch_config_path)
end

.batch_config_pathString

Path to the batch config yaml file describing the batch servers for local batch schedulers.

Returns:

  • (String)

    Path to the batch config yaml file.



29
30
31
# File 'lib/osc/reservations.rb', line 29

def self.batch_config_path
  @batch_config_path ||= default_batch_config_path
end

.batch_config_path=(path) ⇒ Object

Set the path to the batch config yaml file.

Parameters:

  • path (String)

    The path to the batch config yaml file.



35
36
37
# File 'lib/osc/reservations.rb', line 35

def self.batch_config_path=(path)
  @batch_config_path = File.expand_path(path)
end

.default_batch_config_pathString

Default path to the batch config yaml file.

Returns:

  • (String)

    Path to the default batch config yaml file.



20
21
22
23
24
# File 'lib/osc/reservations.rb', line 20

def self.default_batch_config_path
  host_config = File.expand_path("#{CONFIG_ROOT}/#{Socket.gethostname}.yml")
  default_config = File.expand_path("#{CONFIG_ROOT}/batch.yml")
  File.file?(host_config) ? host_config : default_config
end