module OSC::Reservations

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

Constants

CONFIG_ROOT

Path to batch server configuration file.

VERSION

The current version of OSC::Reservations.

Public Class Methods

batch_config() click to toggle source

Hash generated from reading the batch config yaml file. @return [Hash] Batch configuration generated from config yaml file.

# File lib/osc/reservations.rb, line 41
def self.batch_config
  YAML.load_file(batch_config_path)
end
batch_config_path() click to toggle source

Path to the batch config yaml file describing the batch servers for local batch schedulers. @return [String] Path to the batch config yaml file.

# File lib/osc/reservations.rb, line 29
def self.batch_config_path
  @batch_config_path ||= default_batch_config_path
end
batch_config_path=(path) click to toggle source

Set the path to the batch config yaml file. @param path [String] The path to the batch config yaml file.

# File lib/osc/reservations.rb, line 35
def self.batch_config_path=(path)
  @batch_config_path = File.expand_path(path)
end
default_batch_config_path() click to toggle source

Default path to the batch config yaml file. @return [String] Path to the default batch config yaml file.

# 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