class_docstr: ``RemoteSearchRunner`` performs a search for optimal hyperparameter values,
  applying the provided ``SearchMethod`` (you will subclass ``SearchMethod`` and provide
  an instance of the derived class).
  ``RemoteSearchRunner`` executes on-cluster: it runs a meta-experiment
  using ``Core API``.
class_docstr_tok: ["``","RemoteSearchRunner","``","performs","a","search","for","optimal","hyperparameter","values",",","applying","the","provided","``","SearchMethod","``","(","you","will","subclass","``","SearchMethod","``","and","provide","an","instance","of","the","derived","class",")",".","``","RemoteSearchRunner","``","executes","on-cluster",":","it","runs","a","meta-experiment","using","``","Core","API","``","."]
docstr: Run custom search as a Core API experiment (on-cluster).
  
  Args:
      exp_config (dictionary, string): experiment config filename (.yaml) or a dict.
      model_dir (string): directory containing model definition.
      includes (Iterable[Union[str, pathlib.Path]], optional): Additional files
          or directories to include in the model definition.  (default: ``None``)
docstr_tok: ["Run","custom","search","as","a","Core","API","experiment","(","on-cluster",")",".","Args",":","exp_config","(","dictionary",",","string",")",":","experiment","config","filename","(",".yaml",")","or","a","dict",".","model_dir","(","string",")",":","directory","containing","model","definition",".","includes","(","Iterable","[","Union","[","str",",","pathlib.Path","]","]",",","optional",")",":","Additional","files","or","directories","to","include","in","the","model","definition",".","(","default",":","``","None","``",")"]
code: def run(
      self,
      exp_config: Union[Dict[str, Any], str],
      model_dir: Optional[str] = None,
      includes: Optional[Iterable[Union[str, Path]]] = None,
  ) -> int:
      """
      Run custom search as a Core API experiment (on-cluster).
  
      Args:
          exp_config (dictionary, string): experiment config filename (.yaml) or a dict.
          model_dir (string): directory containing model definition.
          includes (Iterable[Union[str, pathlib.Path]], optional): Additional files
              or directories to include in the model definition.  (default: ``None``)
      """
      logger.info("RemoteSearchRunner.run")
  
      operations: Optional[List[searcher.Operation]] = None
  
      if model_dir is None:
          model_dir = os.getcwd()
  
      if self.latest_checkpoint is not None:
          experiment_id, operations = self.load_state(
              self.latest_checkpoint
          )
          logger.info(
              f"Resuming HP searcher for experiment {experiment_id}"
          )
      else:
          logger.info("No latest checkpoint. Starting new experiment.")
          exp = client.create_experiment(
              exp_config, model_dir, includes
          )
          self.state.experiment_id = exp.id
          self.state.last_event_id = 0
          self.save_state(exp.id, [])
          experiment_id = exp.id
          # Note: Simulating the same print functionality as our CLI when making an experiment.
          # This line is needed for the e2e tests
          logger.info(f"Created experiment {exp.id}")
  
      # make sure client is initialized
      # TODO: remove typing suppression when mypy #14473 is resolved
      client._require_singleton(lambda: None)()  # type: ignore
      assert client._determined is not None
      session = client._determined._session
      self.run_experiment(experiment_id, session, operations)
  
      return experiment_id
  
file_path: determined/harness/determined/searcher/_remote_search_runner.py
imports: import logging
  import os
  import pickle
  from pathlib import Path
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import determined
  from determined import searcher
  from determined.experimental import client
label_desc: Use image node_id 2 for calling the RemoteSearchRunner obj's underlying member method code with example usage: obj.run(exp_config, model_dir, includes) and returns: experiment_id