<commit_before>require 'yaml'

# TODO: per-user temp file
CONFIG_PATH = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
CONFIG = YAML.load_file CONFIG_PATH
PID_PATH = CONFIG[:pidfile_path]

Eye.config do
  logger "#{CONFIG[:logfile_path]}/eye.log"
end

Eye.application :robot_sweatshop do
  trigger :flapping, times: 10, within: 1.minute, retry_in: 10.minutes
  check :cpu, every: 10.seconds, below: 100, times: 3
  working_dir CONFIG[:working_path]

  group 'services' do
    process :job_dictionary do
      pid_file "#{PID_PATH}/job-dictionary.pid"
      start_command "sweatshop-job-dictionary"
      daemonize true
    end
    process :payload_parser do
      pid_file "#{PID_PATH}/payload-parser.pid"
      start_command "sweatshop-payload-parser"
      daemonize true
    end
    process :conveyor do
      pid_file "#{PID_PATH}/conveyor.pid"
      start_command "sweatshop-conveyor"
      daemonize true
    end
  end

  group 'workers' do
  <% worker_count.times do |index| %>
    process :worker_<%= index %> do
      pid_file "#{PID_PATH}/worker_<%= index %>.pid"
      start_command "sweatshop-worker <%= index %>"
      daemonize true
    end
  <% end %>
  end

  process :overseer do
    pid_file "#{PID_PATH}/overseer.pid"
    start_command "sweatshop-overseer"
    daemonize true<commit_msg>Starting at 1 is more human readable<commit_after>require 'yaml'

# TODO: per-user temp file
CONFIG_PATH = File.expand_path '~/.robot_sweatshop/compiled_config.yaml'
CONFIG = YAML.load_file CONFIG_PATH
PID_PATH = CONFIG[:pidfile_path]

Eye.config do
  logger "#{CONFIG[:logfile_path]}/eye.log"
end

Eye.application :robot_sweatshop do
  trigger :flapping, times: 10, within: 1.minute, retry_in: 10.minutes
  check :cpu, every: 10.seconds, below: 100, times: 3
  working_dir CONFIG[:working_path]

  group 'services' do
    process :job_dictionary do
      pid_file "#{PID_PATH}/job-dictionary.pid"
      start_command "sweatshop-job-dictionary"
      daemonize true
    end
    process :payload_parser do
      pid_file "#{PID_PATH}/payload-parser.pid"
      start_command "sweatshop-payload-parser"
      daemonize true
    end
    process :conveyor do
      pid_file "#{PID_PATH}/conveyor.pid"
      start_command "sweatshop-conveyor"
      daemonize true
    end
  end

  group 'workers' do
  <% worker_count.times do |index| %>
    process :worker_<%= index+1 %> do
      pid_file "#{PID_PATH}/worker_<%= index+1 %>.pid"
      start_command "sweatshop-worker <%= index+1 %>"
      daemonize true
    end
  <% end %>
  end

  process :overseer do
    pid_file "#{PID_PATH}/overseer.pid"
    start_command "sweatshop-overseer"
    daemonize true
{'fraction_non_alphanumeric': 0.1099437148217636, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 3.4957841483979766, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6952588', 'n_tokens_mistral': 998, 'n_tokens_neox': 904, 'n_words': 215}