easy_ml 0.2.0.pre.rc94 → 0.2.0.pre.rc96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/frontend/pages/SettingsPage.tsx +28 -1
- data/app/models/easy_ml/concerns/versionable.rb +13 -4
- data/app/models/easy_ml/dataset.rb +9 -4
- data/app/models/easy_ml/feature.rb +3 -3
- data/app/models/easy_ml/model.rb +2 -0
- data/app/serializers/easy_ml/settings_serializer.rb +18 -0
- data/lib/easy_ml/feature_store.rb +8 -14
- data/lib/easy_ml/version.rb +1 -1
- data/public/easy_ml/assets/.vite/manifest.json +1 -1
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-KENNRQpC.js → Application.tsx-BXwsBCuQ.js} +58 -58
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-KENNRQpC.js.map → Application.tsx-BXwsBCuQ.js.map} +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86ad2fdcb22b78a52793bcb4872563a52d7bac3b923d2fbccf990aa057e2955c
|
4
|
+
data.tar.gz: dd8f47b3f99edb720ad3255dfb0e8774a689dd5b780730a9dd01a0605f314e26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca4fe8d77662e99558351d4b2fffe259097248ad5c3272c8e42d8e20643745e4e3ccfa717c4028918fc1b658ffb7cf79661d9fb359c772ec2c10c30e87959ed1
|
7
|
+
data.tar.gz: c9cb19869c2f804b0223679c493e4ed1c30d317c0b1e06c051a267c123e37cc40a16d48ea574459d0f54c3280d208f35c85fa5c4e89014c402a211401075e4cb
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { usePage } from '@inertiajs/react'
|
3
3
|
import { useInertiaForm } from 'use-inertia-form';
|
4
|
-
import { Settings2, Save, AlertCircle, Key, Globe2, Database } from 'lucide-react';
|
4
|
+
import { Settings2, Save, AlertCircle, Key, Globe2, Database, GitBranch } from 'lucide-react';
|
5
5
|
import { PluginSettings } from '../components/settings/PluginSettings';
|
6
6
|
|
7
7
|
interface Settings {
|
@@ -9,6 +9,8 @@ interface Settings {
|
|
9
9
|
timezone: string;
|
10
10
|
s3_bucket: string;
|
11
11
|
s3_region: string;
|
12
|
+
git_sha: string;
|
13
|
+
version: string;
|
12
14
|
}
|
13
15
|
}
|
14
16
|
|
@@ -156,6 +158,31 @@ export default function SettingsPage({ settings: initialSettings }: { settings:
|
|
156
158
|
</div>
|
157
159
|
</div>
|
158
160
|
|
161
|
+
{/* Deployment Information */}
|
162
|
+
<div className="space-y-4">
|
163
|
+
<div className="flex items-center gap-2 mb-4">
|
164
|
+
<GitBranch className="w-5 h-5 text-gray-500" />
|
165
|
+
<h3 className="text-lg font-medium text-gray-900">Deployment Information</h3>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div className="bg-gray-50 rounded-lg p-4">
|
169
|
+
<div className="space-y-1">
|
170
|
+
<div className="flex items-center gap-2">
|
171
|
+
<span className="text-sm font-medium text-gray-700">Git SHA</span>
|
172
|
+
<span className="text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600">
|
173
|
+
{initialSettings?.settings?.git_sha || 'Not available'}
|
174
|
+
</span>
|
175
|
+
</div>
|
176
|
+
<div className="flex items-center gap-2">
|
177
|
+
<span className="text-sm font-medium text-gray-700">EasyML Version</span>
|
178
|
+
<span className="text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600">
|
179
|
+
{initialSettings?.settings?.version || 'Not available'}
|
180
|
+
</span>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
159
186
|
<div className="pt-6 border-t flex items-center justify-between">
|
160
187
|
{saved && (
|
161
188
|
<div className="flex items-center gap-2 text-green-600">
|
@@ -4,14 +4,23 @@ module EasyML
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
+
STRING_FORMAT = "%Y_%m_%d_%H_%M_%S".freeze
|
8
|
+
|
7
9
|
def bump_version(force: false)
|
8
10
|
return version if version.present? && !force
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
tz = ActiveSupport::TimeZone.new(EasyML::Configuration.timezone)
|
13
|
+
orig_version = version
|
14
|
+
prev_version = tz.parse(version.gsub(/_/, "")) if version
|
15
|
+
timestamp = Time.current.in_time_zone(EasyML::Configuration.timezone)
|
16
|
+
timestamp = (prev_version + 1.second) if prev_version && compare_versions(timestamp, prev_version)
|
17
|
+
|
18
|
+
self.version = timestamp.strftime(STRING_FORMAT)
|
19
|
+
end
|
13
20
|
|
14
|
-
|
21
|
+
def compare_versions(version1, version2)
|
22
|
+
tz = ActiveSupport::TimeZone.new(EasyML::Configuration.timezone)
|
23
|
+
tz.parse(version1.strftime(STRING_FORMAT).gsub(/_/, "")) <= tz.parse(version2.strftime(STRING_FORMAT).gsub(/_/, ""))
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|
@@ -114,6 +114,10 @@ module EasyML
|
|
114
114
|
write_attribute(:root_dir, value)
|
115
115
|
end
|
116
116
|
|
117
|
+
def dir
|
118
|
+
root_dir
|
119
|
+
end
|
120
|
+
|
117
121
|
def set_root_dir
|
118
122
|
bump_version
|
119
123
|
write_attribute(:root_dir, default_root_dir)
|
@@ -211,12 +215,13 @@ module EasyML
|
|
211
215
|
end
|
212
216
|
|
213
217
|
def bump_versions(version)
|
218
|
+
original_version = self.version
|
214
219
|
self.version = version
|
215
220
|
|
216
|
-
@raw = raw.cp(version)
|
217
|
-
@processed = processed.cp(version)
|
221
|
+
@raw = raw.cp(dir.gsub(original_version, version))
|
222
|
+
@processed = processed.cp(dir.gsub(original_version, version))
|
218
223
|
save.tap do
|
219
|
-
features.each(
|
224
|
+
features.each { |feature| feature.bump_version(original_version, version) }
|
220
225
|
EasyML::Feature.import(features.to_a, on_duplicate_key_update: [:version])
|
221
226
|
end
|
222
227
|
end
|
@@ -750,7 +755,7 @@ module EasyML
|
|
750
755
|
split_type.new(**args)
|
751
756
|
when EasyML::Data::Splits::FileSplit.to_s
|
752
757
|
split_type.new(**args.merge(
|
753
|
-
dir: Pathname.new(root_dir).
|
758
|
+
dir: Pathname.new(root_dir).join("files/splits/#{type}").to_s,
|
754
759
|
))
|
755
760
|
end
|
756
761
|
end
|
@@ -433,9 +433,9 @@ module EasyML
|
|
433
433
|
end
|
434
434
|
end
|
435
435
|
|
436
|
-
def bump_version
|
437
|
-
feature_store.bump_version(version)
|
438
|
-
write_attribute(:version, version + 1)
|
436
|
+
def bump_version(original_version, version)
|
437
|
+
feature_store.bump_version(original_version, version)
|
438
|
+
write_attribute(:version, self.version + 1)
|
439
439
|
self
|
440
440
|
end
|
441
441
|
|
data/app/models/easy_ml/model.rb
CHANGED
@@ -203,6 +203,7 @@ module EasyML
|
|
203
203
|
|
204
204
|
def unlock!
|
205
205
|
Support::Lockable.unlock!(lock_key)
|
206
|
+
EasyML::Deploy.new(model: self).unlock!
|
206
207
|
end
|
207
208
|
|
208
209
|
def lock_model
|
@@ -558,6 +559,7 @@ module EasyML
|
|
558
559
|
dataset.upload_remote_files
|
559
560
|
model_snapshot = snapshot
|
560
561
|
|
562
|
+
Thread.current[:deploying] = true
|
561
563
|
# Prepare the model to be retrained (reset values so they don't conflict with our snapshotted version)
|
562
564
|
bump_version(force: true)
|
563
565
|
dataset.bump_versions(version)
|
@@ -5,5 +5,23 @@ module EasyML
|
|
5
5
|
include JSONAPI::Serializer
|
6
6
|
|
7
7
|
attributes *EasyML::Settings.configuration_attributes
|
8
|
+
|
9
|
+
attribute :version do |object|
|
10
|
+
EasyML::VERSION
|
11
|
+
end
|
12
|
+
|
13
|
+
attribute :git_sha do |object|
|
14
|
+
# Get git SHA of the main app
|
15
|
+
if Rails.root.join('.git').exist?
|
16
|
+
sha = `cd #{Rails.root} && git rev-parse HEAD`.strip
|
17
|
+
sha.presence || "Git SHA unavailable"
|
18
|
+
elsif ENV["GIT_REVISION"]
|
19
|
+
ENV["GIT_REVISION"]
|
20
|
+
else
|
21
|
+
"Not a git repository"
|
22
|
+
end
|
23
|
+
rescue
|
24
|
+
"Error determining git SHA"
|
25
|
+
end
|
8
26
|
end
|
9
27
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module EasyML
|
2
2
|
class FeatureStore < EasyML::Data::DatasetManager
|
3
|
-
attr_reader :feature
|
3
|
+
attr_reader :feature, :dataset
|
4
4
|
|
5
5
|
def initialize(feature)
|
6
6
|
@feature = feature
|
7
|
+
@dataset = feature&.dataset
|
7
8
|
|
8
9
|
datasource_config = feature&.dataset&.datasource&.configuration
|
9
10
|
if datasource_config
|
@@ -27,11 +28,11 @@ module EasyML
|
|
27
28
|
files.any?
|
28
29
|
end
|
29
30
|
|
30
|
-
def bump_version(version)
|
31
|
+
def bump_version(original_version, version)
|
31
32
|
compact
|
32
33
|
cp(
|
33
|
-
|
34
|
-
|
34
|
+
feature_dir.gsub(version, original_version),
|
35
|
+
feature_dir,
|
35
36
|
)
|
36
37
|
end
|
37
38
|
|
@@ -41,21 +42,14 @@ module EasyML
|
|
41
42
|
@batch_size ||= feature.batch_size || 10_000
|
42
43
|
end
|
43
44
|
|
44
|
-
def
|
45
|
+
def feature_dir
|
45
46
|
File.join(
|
46
|
-
|
47
|
-
"easy_ml/datasets",
|
48
|
-
feature&.dataset&.name&.parameterize&.gsub("-", "_"),
|
47
|
+
dataset.dir,
|
49
48
|
"features",
|
50
|
-
feature&.name&.parameterize&.gsub("-", "_")
|
51
|
-
version.to_s
|
49
|
+
feature&.name&.parameterize&.gsub("-", "_")
|
52
50
|
)
|
53
51
|
end
|
54
52
|
|
55
|
-
def feature_dir
|
56
|
-
feature_dir_for_version(feature.version)
|
57
|
-
end
|
58
|
-
|
59
53
|
def s3_prefix
|
60
54
|
File.join("datasets", feature_dir.split("datasets").last)
|
61
55
|
end
|
data/lib/easy_ml/version.rb
CHANGED