diff --git a/lib/stretchy/rails/tasks/stretchy.rake b/lib/stretchy/rails/tasks/stretchy.rake index dfd5bfb..b2cc85c 100644 --- a/lib/stretchy/rails/tasks/stretchy.rake +++ b/lib/stretchy/rails/tasks/stretchy.rake @@ -4,7 +4,10 @@ require 'tty-spinner' JUSTIFICATION = 90 unless defined?(JUSTIFICATION) path = File.expand_path(__dir__) -Dir.glob("#{path}/**/*.rake").each { |f| import f } +Dir.glob("#{path}/**/*.rake").each do |f| + import f unless f == __FILE__ +end + namespace :stretchy do desc "Create all indexes, pipelines and deploy all models" task up: :environment do @@ -21,4 +24,17 @@ namespace :stretchy do Rake::Task['stretchy:pipeline:delete'].invoke Rake::Task['stretchy:index:delete'].invoke end + + desc "Enable Machine Learning on all nodes" + task ml_on_all_nodes: :environment do + puts "Enabling Machine Learning on all nodes..." + puts Stretchy::MachineLearning::Model.ml_on_all_nodes! + end + + desc "Machine Learning on ML nodes only" + task ml_on_ml_nodes: :environment do + puts "Enabling Machine Learning on ML nodes only..." + puts Stretchy::MachineLearning::Model.ml_on_ml_nodes! + end + end \ No newline at end of file