Skip to content

Commit

Permalink
Merge pull request #115 from theablefew/feature/rake_helpers
Browse files Browse the repository at this point in the history
Fix double load of stretchy.rake and add tasks for ml nodes
  • Loading branch information
esmarkowski authored Mar 30, 2024
2 parents 1558e01 + d23431e commit 0f1190f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/stretchy/rails/tasks/stretchy.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 0f1190f

Please sign in to comment.