<commit_before>require 'construi/config'
require 'construi/container'
require 'construi/image'

require 'docker'
require 'yaml'

module Construi

  class Runner
    def initialize(config)
      @config = config
    end

    def run(targets)
      Docker.validate_version!
      Docker.options[:read_timeout] = 60
      Docker.options[:chunk_size] = 8

      initial_image = Image.create(@config.image) { |s| puts s }

      commands = targets.map { |t| @config.target(t).commands }.flatten

      final_image = commands.reduce(IntermediateImage.seed(initial_image)) do |image, command|
        image.run(command)
      end

      final_image.delete
    end
  end

  def self.run(targets)
    Runner.new(Config.load('construi.yml')).run(targets)
  end

end<commit_msg>Add debug output for Docker.url<commit_after>require 'construi/config'
require 'construi/container'
require 'construi/image'

require 'docker'
require 'yaml'

module Construi

  class Runner
    def initialize(config)
      @config = config
    end

    def run(targets)
      puts "Docker running at #{Docker.url}"

      Docker.validate_version!
      Docker.options[:read_timeout] = 60
      Docker.options[:chunk_size] = 8

      initial_image = Image.create(@config.image) { |s| puts s }

      commands = targets.map { |t| @config.target(t).commands }.flatten

      final_image = commands.reduce(IntermediateImage.seed(initial_image)) do |image, command|
        image.run(command)
      end

      final_image.delete
    end
  end

  def self.run(targets)
    Runner.new(Config.load('construi.yml')).run(targets)
  end

end
{'fraction_non_alphanumeric': 0.11076345431789737, 'fraction_numerical': 0.0037546933667083854, 'mean_word_length': 3.2189973614775726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '755436', 'n_tokens_mistral': 541, 'n_tokens_neox': 509, 'n_words': 110}