Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double load of stretchy.rake and add tasks for ml nodes #115

Merged
merged 3 commits into from
Mar 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading