tensorflowonspark.reservation module
This module contains client/server methods to manage node reservations during TFCluster startup.
- class Client(server_addr)[source]
Bases:
tensorflowonspark.reservation.MessageSocket
Client to register and await node reservations.
- Args:
- server_addr
a tuple of (host, port) pointing to the Server.
- server_addr = None
address of server
- sock = None
socket to server TCP connection
- class MessageSocket[source]
Bases:
object
Abstract class w/ length-prefixed socket send/receive functions.
- class Reservations(required)[source]
Bases:
object
Thread-safe store for node reservations.
- Args:
- required
expected number of nodes in the cluster.
- class Server(count)[source]
Bases:
tensorflowonspark.reservation.MessageSocket
Simple socket server with length-prefixed pickle messages.
- Args:
- count
expected number of nodes in the cluster.
- done = False
boolean indicating if server should be shutdown.
- get_server_ip()[source]
Returns the value of TFOS_SERVER_HOST environment variable (if set), otherwise defaults to current host/IP.
- get_server_ports()[source]
Returns a list of target ports as defined in the TFOS_SERVER_PORT environment (if set), otherwise defaults to 0 (any port).
TFOS_SERVER_PORT should be either a single port number or a range, e.g. ‘8888’ or ‘9997-9999’
- reservations = None
List of reservations managed by this server.