Class: OodCluster::Servers::Moab

Inherits:
OodCluster::Server show all
Defined in:
lib/ood_cluster/servers/moab.rb

Overview

This class defines a Moab server / client software installation

Instance Attribute Summary collapse

Attributes inherited from OodCluster::Server

#host

Instance Method Summary collapse

Methods inherited from OodCluster::Server

#==, #eql?, #hash

Methods included from JsonSerializer

included, #to_json

Constructor Details

#initialize(lib: "", bin: "", version:, moabhomedir: ENV['MOABHOMEDIR'], **kwargs) ⇒ Moab

Returns a new instance of Moab.

Parameters:

  • lib (#to_s) (defaults to: "")

    installation path of client software libraries

  • bin (#to_s) (defaults to: "")

    installation path of client software binaries

  • version (#to_s)

    version of client software

  • moabhomedir (#to_s) (defaults to: ENV['MOABHOMEDIR'])

    necessary environment variable

  • host (#to_s)

    host of server



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ood_cluster/servers/moab.rb', line 32

def initialize(lib: "", bin: "", version:, moabhomedir: ENV['MOABHOMEDIR'], **kwargs)
  super(kwargs)

  # installation path
  @lib = Pathname.new(lib.to_s)
  @bin = Pathname.new(bin.to_s)

  # version number
  @version = version.to_s

  # necessary moab environment variable
  @moabhomedir = Pathname.new(moabhomedir.to_s)
end

Instance Attribute Details

#binPathname (readonly)

The path to the installation location for this software’s binaries

Examples:

Locally installed Moab 8.1.1

my_software.bin.to_s #=> "/usr/local/moab/8.1.1/bin"

Returns:

  • (Pathname)

    the path to software binaries



15
16
17
# File 'lib/ood_cluster/servers/moab.rb', line 15

def bin
  @bin
end

#libPathname (readonly)

The path to the installation location for this software’s libraries

Examples:

Locally installed Moab 8.1.1

my_software.lib.to_s #=> "/usr/local/moab/8.1.1/lib"

Returns:

  • (Pathname)

    the path to software libraries



9
10
11
# File 'lib/ood_cluster/servers/moab.rb', line 9

def lib
  @lib
end

#moabhomedirPathname (readonly)

The required Moab environment variable

Examples:

my_software.moabhomedir #=> "/var/spool/batch/moab"

Returns:

  • (Pathname)

    necessary environment variable



25
26
27
# File 'lib/ood_cluster/servers/moab.rb', line 25

def moabhomedir
  @moabhomedir
end

#versionString (readonly)

The version of this software

Returns:

  • (String)

    version of software



19
20
21
# File 'lib/ood_cluster/servers/moab.rb', line 19

def version
  @version
end

Instance Method Details

#to_hHash

Convert object to hash

Returns:

  • (Hash)

    the hash describing this object



48
49
50
# File 'lib/ood_cluster/servers/moab.rb', line 48

def to_h
  super.merge lib: @lib, bin: @bin, version: @version, moabhomedir: @moabhomedir
end