Skip to content

Commit

Permalink
Fix double load of stretchy.rake and add tasks for ml nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
esmarkowski committed Mar 29, 2024
1 parent 1558e01 commit 0f28a39
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/stretchy/rails/tasks/stretchy.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'tty-spinner'
JUSTIFICATION = 90 unless defined?(JUSTIFICATION)

path = File.expand_path(__dir__)
Dir.glob("#{path}/**/*.rake").each { |f| import f }
Dir.glob("#{path}/tasks/*.rake").each { |f| import f }
namespace :stretchy do
desc "Create all indexes, pipelines and deploy all models"
task up: :environment do
Expand All @@ -21,4 +21,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 0f28a39

Please sign in to comment.