class_docstr: TFX Tuner executor impl as a worker in a Google Cloud AI Platform job.
class_docstr_tok: ["TFX","Tuner","executor","impl","as","a","worker","in","a","Google","Cloud","AI","Platform","job","."]
docstr: Invoke chief oracle, and listen to the open port.
docstr_tok: ["Invoke","chief","oracle",",","and","listen","to","the","open","port","."]
code: def _run_chief_oracle(
      self,
      input_dict: Dict[str, List[types.Artifact]],
      output_dict: Dict[str, List[types.Artifact]],
      exec_properties: Dict[str, List[types.Artifact]],
  ) -> None:
      """Invoke chief oracle, and listen to the open port."""
      logging.info("chief_oracle() starting...")
  
      # Per KerasTuner's specification, configuration of chief oracle is set
      # by environment variables. This only affects the current sub-process
      # which is single-threaded, but not the main process. As such, mutation
      # of this otherwise global state is safe.
      os.environ["KERASTUNER_ORACLE_IP"] = "0.0.0.0"
      os.environ["KERASTUNER_ORACLE_PORT"] = self._master_port
      os.environ["KERASTUNER_TUNER_ID"] = "chief"
  
      logging.info(
          "Binding chief oracle server at: %s:%s",
          os.environ["KERASTUNER_ORACLE_IP"],
          os.environ["KERASTUNER_ORACLE_PORT"],
      )
  
      # For the chief process, tuner_executor.search() starts the oracle server.
      # The server keeps running till all trials are done.
      tuner = tuner_executor.search(
          input_dict=input_dict,
          exec_properties=exec_properties,
          working_dir=_WORKING_DIRECTORY,
          print_tuning_summary=True,
      )
      tuner_executor.write_best_hyperparameters(tuner, output_dict)
  
imports: import datetime
  import json
  import os
  from typing import Any, Dict, List
  from absl import logging
  from tfx import types
  from tfx.components.tuner import executor
  from tfx.dsl.components.base import base_executor
  from tfx.extensions.google_cloud_ai_platform import constants
  from tfx.extensions.google_cloud_ai_platform import runner
  from tfx.extensions.google_cloud_ai_platform.trainer import executor
  from tfx.types import standard_component_specs
  from tfx.utils import doc_controls
  from tfx.utils import json_utils
  from tfx.utils import name_utils
  import multiprocessing
label_desc: Use image node_id 1 for calling the _WorkerExecutor obj's underlying member method code with example usage: obj._run_chief_oracle(input_dict, output_dict, exec_properties) without return types