<commit_before>class ContainerOrchestrator
  module ObjectDefinition
    private

    def deployment_definition(name)
      {
        :metadata => {
          :name      => name,
          :labels    => {:app => app_name},
          :namespace => my_namespace,
        },
        :spec     => {
          :selector => {:matchLabels => {:name => name}},
          :template => {
            :metadata => {:name => name, :labels => {:name => name, :app => app_name}},
            :spec     => {
              :serviceAccountName => "#{app_name}-anyuid",
              :containers         => [{
                :name          => name,
                :env           => default_environment,
                :livenessProbe => liveness_probe
              }]
            }
          }
        }
      }
    end

    def service_definition(name, selector, port)
      {
        :metadata => {
          :name      => name,
          :labels    => {:app => app_name},
          :namespace => my_namespace
        },
        :spec     => {
          :selector => selector,
          :ports    => [{
            :name       => "#{name}-#{port}",
            :port       => port,
            :targetPort => port
          }]
        }<commit_msg>Add the provided image pull secret to deployed worker containers<commit_after>class ContainerOrchestrator
  module ObjectDefinition
    private

    def deployment_definition(name)
      {
        :metadata => {
          :name      => name,
          :labels    => {:app => app_name},
          :namespace => my_namespace,
        },
        :spec     => {
          :selector => {:matchLabels => {:name => name}},
          :template => {
            :metadata => {:name => name, :labels => {:name => name, :app => app_name}},
            :spec     => {
              :imagePullSecrets   => [{:name => ENV["IMAGE_PULL_SECRET"].to_s}],
              :serviceAccountName => "#{app_name}-anyuid",
              :containers         => [{
                :name          => name,
                :env           => default_environment,
                :livenessProbe => liveness_probe
              }]
            }
          }
        }
      }
    end

    def service_definition(name, selector, port)
      {
        :metadata => {
          :name      => name,
          :labels    => {:app => app_name},
          :namespace => my_namespace
        },
        :spec     => {
          :selector => selector,
          :ports    => [{
            :name       => "#{name}-#{port}",
            :port       => port,
            :targetPort => port
          }]
        }
{'fraction_non_alphanumeric': 0.13835511145272866, 'fraction_numerical': 0.0, 'mean_word_length': 1.2285958904109588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 69, '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': '4324831', 'n_tokens_mistral': 691, 'n_tokens_neox': 666, 'n_words': 136}