APPENDIX

The paragraphs below presents the configuration of nomad and consul in client/server mode.

NOMAD configuration

The configuration below corresponds to the case where the instrument and the eltGW run on different machines in a nomad cluster, the instrument WS hosting a nomad client and the eltGW WS hosting a nomad server. In the case where both run on the same machine, you can skip Nomad client configuration (instrument) and go directly to Nomad server configuration (eltGW).

Nomad client configuration (instrument)

Below an example of nomad configuration in client mode. Nomad instances running on instrument will be in client mode. The eltgw_root keyword in the meta stanza shall point to the directory where evltgw libraries and include files are installed. It is assumed that the nomad server is running on a host with IP 192.168.56.30 whereas the local client nomad runs on a machine with IP 192.168.56.10. The location of the consul registry is 192.168.56.10:

# Specifies the region the Nomad agent is a member of. A region typically maps to a geographic region.
region = "ESO"

# Specifies the data center of the local agent.
datacenter = "dc1"

# Specifies a local directory used to store agent state.
data_dir = "/opt/nomad/var"

# Specifies which address the Nomad agent should bind to for network services.
bind_addr = "192.168.56.10"

# Specifies the advertise address for individual network services.
advertise {
  http = "192.168.56.10"
  rpc  = "192.168.56.10"
  serf = "192.168.56.10"
}

# Specifies configuration which is specific to the Nomad client.
client {
  # Specifies if client mode is enabled.
  enabled = true

  meta {
    eltgw_root = "/elt/eltgw"
  }

  # Specifies an array of addresses to the Nomad servers this client should join.
  servers = ["192.168.56.30:4647"]

  # Specifies a key-value mapping of internal configuration for clients.
  options = {
    # Specifies whether the driver should be enabled or disabled.
    "driver.raw_exec.enable" = "1"
  }

  # Specifies controls on the behavior of task template stanzas.
  template = {
    # Allows templates access to arbitrary files on the client host via the file function.
    "disable_file_sandbox" = true
  }

  # network interface to interfact with consul services
  network_interface="enp0s8"

}

# Specifies the location of the consul server
consul {
     address = "192.168.56.10:8500"
}

Nomad server configuration (eltGW)

Below and example of nomad configuration in client/server mode running on machine with IP 192.168.56.30. The host_type parameter in the meta stanza allows to control the location of the eltGW and the eltgw_root parameter shall point to the elt gateway directory where template configuration files and startup scripts are installed. A nomad server will be deployed on the eltGW:

# Specifies the region the Nomad agent is a member of. A region typically maps to a geographic region.
region = "ESO"

datacenter  = "dc1"

# Specifies a local directory used to store agent state.
data_dir = "/opt/nomad/var"

# Specifies which address the Nomad agent should bind to for network services.
bind_addr = "192.168.56.30"

# Specifies the advertise address for individual network services.
advertise {
  http = "192.168.56.30"
  rpc  = "192.168.56.30"
  serf = "192.168.56.30"
}

client {
  # Specifies if client mode is enabled.
  enabled = true

  # eltGW specific, Specifies the location of the INTROOT directory
  meta {
     host_type = "eltgw"
     eltgw_root = "/elt/eltgw"
  }

  # Specifies an array of addresses to the Nomad servers this client should join.
  servers = ["192.168.56.30:4647"]

  # Specifies a key-value mapping of internal configuration for clients.
  options = {
    # Specifies whether the driver should be enabled or disabled.
    "driver.raw_exec.enable" = "1"
  }

  # Specifies controls on the behavior of task template stanzas.
  template = {
    # Allows templates access to arbitrary files on the client host via the file function.
    "disable_file_sandbox" = true
  }
}

# Specifies configuration which is specific to the Nomad server.
server {
  # Specifies the number of server nodes to wait for before bootstrapping.
  bootstrap_expect = 1

  # Specifies if this agent should run in server mode.
  enabled = true
}


consul {
  address = "192.168.56.30:8500"
}

CONSUL CONFIGURATION

The configuration below corresponds to the case where the instrument and the eltGW run on different machines in a consul cluster, the instrument WS hosting a consul client and the eltGW WS hosting a consul server. In the case where both run on the same machine, you can skip Consul client configuration (instrument) and go directly to Consul server configuration (eltGW).

Consul client configuration (instrument)

Below an example of consul configuration in client mode on a machine with IP 192.168.56.10:

# controls the datacenter in which the agent is running.
datacenter = "dc1"

# A data directory for the agent to store state.
data_dir = "/opt/consul/var"

# Controls if an agent is in server.
server = false

# Enables the built-in web UI server and the required HTTP routes.
ui = false

# Address of another agent to join upon starting up.
retry_join = ["eltins"]

# This is a nested object that allows setting bind addresses.
addresses = {
  "http" = "192.168.56.10"
  "grpc" = "192.168.56.10"
  "https" = "192.168.56.10"
  "dns" = "192.168.56.10"
}

# The advertise address is used to change the address that we advertise to other nodes in the cluster.
advertise_addr = "192.168.56.10"

bind_addr = "192.168.56.10"

Consul server configuration (eltGW)

Below an example of a consul configuration in server mode:

# controls the datacenter in which the agent is running.
datacenter = "dc1"

# A data directory for the agent to store state.
data_dir = "/opt/consul/var"

# Controls if an agent is in server.
server = true

# Enables the built-in web UI server and the required HTTP routes.
ui = true

# Address of another agent to join upon starting up.
retry_join = ["192.168.56.30"]

# This is a nested object that allows setting bind addresses.
addresses = {
  "http" = "192.168.56.30"
  "grpc" = "192.168.56.30"
  "https" = "192.168.56.30"
  "dns" = "192.168.56.30"
}

# The advertise address is used to change the address that we advertise to other nodes in the cluster.
advertise_addr = "192.168.56.30"

# This flag is used to control if a server is in "bootstrap" mode.
bootstrap = true

# This flag provides the number of expected servers in the datacenter.
bootstrap_expect = 1

Environment variable

To allow for the command line tool geturi to query the consul server, the environment variable CONSUL_HTTP_ADDR shall set to the local consul instance, e.g. 192.168.56.30:8500 for the server and 192.168.56.10:8500 for the client (if any).