easy_ml 0.2.0.pre.rc18 → 0.2.0.pre.rc20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -27
- data/lib/easy_ml/data/synced_directory.rb +5 -1
- data/lib/easy_ml/support/synced_file.rb +1 -1
- data/lib/easy_ml/version.rb +1 -1
- data/lib/tasks/resque.rake +6 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b638a3c3ae41b11f0c3e00c7234d72b4c9c894516477904cd624c5b7424d7a
|
4
|
+
data.tar.gz: a3cf8f09f78239281bc18600c42dcb7796a9853d3e584329597c9330c6d56769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80cae9ce9830c1500e25ef78a48a7a0265a585c258e0165aa9156bbebedc608e15252a39b0338373c4cb47cc30998b3e3a85ca922fb70be1494b4f5b72661bef
|
7
|
+
data.tar.gz: a21481353f7b9cea048fa503bb60d04eced87bb107c6a282cc69645ec5ec93cfd682f7dd506f0f7d8add7870a2bfef6aa8df5b3779111ffae57d977f2d50fb20
|
data/Rakefile
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require "sprockets/railtie"
|
4
4
|
require "bundler/gem_tasks"
|
5
5
|
require "rspec/core/rake_task"
|
6
|
-
require "resque/tasks"
|
7
6
|
|
8
7
|
RSpec::Core::RakeTask.new(:spec)
|
9
8
|
|
@@ -56,29 +55,3 @@ namespace :easy_ml do
|
|
56
55
|
Rails::Generators.invoke("easy_ml:migration", [], { destination_root: EasyML::Engine.root.join("spec/internal") })
|
57
56
|
end
|
58
57
|
end
|
59
|
-
|
60
|
-
task :environment do
|
61
|
-
# Force the application to load (Rails or standalone app setup)
|
62
|
-
require File.expand_path("config/environment", __dir__)
|
63
|
-
end
|
64
|
-
|
65
|
-
# Ensure resque:work depends on :environment
|
66
|
-
namespace :resque do
|
67
|
-
desc "Start a Resque worker"
|
68
|
-
task :easy_ml => [:preload, :setup] do
|
69
|
-
require "resque"
|
70
|
-
|
71
|
-
begin
|
72
|
-
worker = Resque::Worker.new
|
73
|
-
rescue Resque::NoQueueError
|
74
|
-
abort "set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work"
|
75
|
-
end
|
76
|
-
|
77
|
-
worker.prepare
|
78
|
-
worker.log "Starting worker #{worker}"
|
79
|
-
worker.work(ENV["INTERVAL"] || 5) # interval, will block
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
task "resque:work" => :environment
|
84
|
-
task "resque:workers" => :environment
|
@@ -3,7 +3,9 @@ require_relative "polars_reader"
|
|
3
3
|
module EasyML
|
4
4
|
module Data
|
5
5
|
class SyncedDirectory
|
6
|
-
attr_accessor :root_dir, :s3_bucket, :s3_prefix,
|
6
|
+
attr_accessor :root_dir, :s3_bucket, :s3_prefix,
|
7
|
+
:s3_access_key_id, :s3_secret_access_key,
|
8
|
+
:s3_region, :cache_for, :polars_args
|
7
9
|
|
8
10
|
def initialize(options = {})
|
9
11
|
@root_dir = options.dig(:root_dir)
|
@@ -11,6 +13,7 @@ module EasyML
|
|
11
13
|
@s3_prefix = options.dig(:s3_prefix)
|
12
14
|
@s3_access_key_id = options.dig(:s3_access_key_id)
|
13
15
|
@s3_secret_access_key = options.dig(:s3_secret_access_key)
|
16
|
+
@s3_region = options.dig(:s3_region) || EasyML::Configuration.s3_region
|
14
17
|
@cache_for = options.dig(:cache_for)
|
15
18
|
@polars_args = options.dig(:polars_args)
|
16
19
|
end
|
@@ -224,6 +227,7 @@ module EasyML
|
|
224
227
|
http_read_timeout: 30, # Timeout for reading response (in seconds))
|
225
228
|
http_wire_trace: false, # Enable verbose HTTP logging
|
226
229
|
http_idle_timeout: 0,
|
230
|
+
region: s3_region,
|
227
231
|
logger: Logger.new(STDOUT), # Logs to STDOUT; you can also set a file
|
228
232
|
)
|
229
233
|
end
|
@@ -95,7 +95,7 @@ module EasyML
|
|
95
95
|
def s3
|
96
96
|
@s3 ||= begin
|
97
97
|
credentials = Aws::Credentials.new(s3_access_key_id, s3_secret_access_key)
|
98
|
-
Aws::S3::Client.new(credentials: credentials)
|
98
|
+
Aws::S3::Client.new(credentials: credentials, region: s3_region)
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
data/lib/easy_ml/version.rb
CHANGED
data/lib/tasks/resque.rake
CHANGED
@@ -1,13 +1,8 @@
|
|
1
|
-
|
2
|
-
desc "Start resque-pool with the gem's configuration"
|
3
|
-
task :resque_pool do
|
4
|
-
require "resque"
|
5
|
-
gem_path = Gem::Specification.find_by_name("easy_ml").gem_dir
|
6
|
-
config_path = File.join(gem_path, "config", "resque-pool.yml")
|
1
|
+
require "resque/tasks"
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
exec "bundle exec resque-pool --environment #{ENV["RAILS_ENV"] || "development"} --config #{config_path}"
|
12
|
-
end
|
3
|
+
task :environment do
|
4
|
+
require File.expand_path("config/environment", Rails.root)
|
13
5
|
end
|
6
|
+
|
7
|
+
task "resque:work" => :environment
|
8
|
+
task "resque:workers" => :environment
|