class_docstr: WorkerLauncher implementation for launching DASK workers in a round robin manner. See its documentation to get a list of the inherited methods and attributes.
class_docstr_tok: ["WorkerLauncher","implementation","for","launching","DASK","workers","in","a","round","robin","manner",".","See","its","documentation","to","get","a","list","of","the","inherited","methods","and","attributes","."]
docstr: Launch a single worker instance in a `Runtime` in the `RuntimeGroup`.
  
  Raises:
      NoPortsLeftError
docstr_tok: ["Launch","a","single","worker","instance","in","a","`","Runtime","`","in","the","`","RuntimeGroup","`",".","Raises",":","NoPortsLeftError"]
code: def _launch_single_worker(
      self,
      host: str,
      worker_index: int,
      master_port: int,
      working_dir: str,
      debug: bool,
  ) -> int:
      """Launch a single worker instance in a `Runtime` in the `RuntimeGroup`.
  
      Raises:
          NoPortsLeftError
      """
      if not self._ports:
          raise NoPortsLeftError()
      # 1. Get a free port based on the port list
      worker_port = self._group.get_free_port(
          self._ports
      )  # Raises NoPortsLeftError
      if self._ports:
          self._ports = _utils.get_remaining_ports(
              self._ports, worker_port
          )
      # 2. Start the worker on this port
      task = RuntimeTask("launch-dask-worker-" + str(worker_index))
      task.run_command(DaskCluster.PIP_INSTALL_COMMAND)
      task.run_command(
          self._get_launch_command(
              master_port, worker_port, working_dir
          )
      )
      self._group.execute_task(
          task, host, omit_on_join=True, debug=debug
      )
      return worker_port
  
imports: import time
  from subprocess import Popen
  from typing import List, Optional, Union
  from distributed import Client
  from lazycluster import Runtime, RuntimeGroup, RuntimeTask, _utils
  from lazycluster.cluster import MasterLauncher, MasterWorkerCluster, WorkerLauncher
  from lazycluster.cluster.exceptions import MasterStartError
  from lazycluster.exceptions import NoPortsLeftError, PortInUseError
label_desc: Use image node_id 3 for calling the RoundRobinLauncher obj's underlying member method code with example usage: obj._launch_single_worker(host, worker_index, master_port, working_dir, debug) and returns: worker_port