cnvrg 1.5.8.5 → 1.5.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +8 -43
- data/lib/cnvrg/project.rb +12 -10
- data/lib/cnvrg/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 594fa00701be650fa08c0cc8e682efbe4da2eda138745903f1fc04cbe653f0ad
|
4
|
+
data.tar.gz: 23d0df95d4e59f0aa720db633f3bcc50b2b60776f1f19e52794d5d5be99d52bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7f6b9cd03596158bb0aad59dc38dda2edacc6907e466d07048609f627ba7a9301a06890e5d504409821b15d07de34f96703e0a1d80a0159e3313e4e9db6891
|
7
|
+
data.tar.gz: a31197ca8ac472412981ff0f432b11c36ef5d63467df58f08fd19bf50065234e0c46e682a17cc0e84e5c6f9a0794f17d2299f46886b087257d64a52e4c91ad1c
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -920,12 +920,11 @@ module Cnvrg
|
|
920
920
|
if downloaded_files == files_count
|
921
921
|
Dataset.verify_cnvrgignore_exist(dataset_name, false)
|
922
922
|
@executer.set_dataset_status(dataset: @dataset.slug, status: "cloned") if @executer
|
923
|
-
if !read
|
924
|
-
@dataset.write_idx(nil, commit) #nil means, generate idx
|
925
|
-
end
|
926
|
-
|
927
923
|
log_message("#{check} Clone finished successfully", Thor::Shell::Color::GREEN)
|
928
924
|
@dataset.write_success
|
925
|
+
### if read, dont generate idx (but create idx.yml) if not read, generate idx.
|
926
|
+
# TODO fix it for later... (check it in different cases)
|
927
|
+
@dataset.write_idx(read ? {} : nil, commit) #nil means, generate idx
|
929
928
|
end
|
930
929
|
else
|
931
930
|
log_message("Error: Couldn't create directory: #{dataset_name}", Thor::Shell::Color::RED)
|
@@ -1957,7 +1956,6 @@ module Cnvrg
|
|
1957
1956
|
verify_logged_in(true)
|
1958
1957
|
log_start(__method__, args, options)
|
1959
1958
|
log_message('Syncing dataset', Thor::Shell::Color::BLUE, !options["verbose"])
|
1960
|
-
|
1961
1959
|
if !force and !init
|
1962
1960
|
# w(verbose=false, new_branch=false,sync=false, commit=nil,all_files=true)
|
1963
1961
|
invoke :download_data_new,[verbose, new_branch, true, commit, all_files], :new_branch=>new_branch, :direct=>false, :force =>force
|
@@ -3109,43 +3107,6 @@ module Cnvrg
|
|
3109
3107
|
start_loop = Time.now
|
3110
3108
|
stdout, stderr = '', ''
|
3111
3109
|
begin
|
3112
|
-
|
3113
|
-
if remote
|
3114
|
-
if @exp.sync_before_terminate
|
3115
|
-
spot_status_thread = Thread.new do
|
3116
|
-
begin
|
3117
|
-
loop do
|
3118
|
-
log_message('Checking Spot Instance Status', Thor::Shell::Color::YELLOW)
|
3119
|
-
restart = @exp.restart_spot_instance()
|
3120
|
-
|
3121
|
-
if restart
|
3122
|
-
log_message('Spot instance is going to be terminated', Thor::Shell::Color::YELLOW)
|
3123
|
-
# sync
|
3124
|
-
if @project.is_git
|
3125
|
-
output_dir = @exp.output_dir
|
3126
|
-
|
3127
|
-
if output_dir.blank?
|
3128
|
-
output_dir = "output"
|
3129
|
-
end
|
3130
|
-
upload(false, false, true, ignore, true, true,output_dir,"Experiment",@exp.slug )
|
3131
|
-
else
|
3132
|
-
upload(false, false, true, ignore, true, true,nil,"Experiment",@exp.slug )
|
3133
|
-
end
|
3134
|
-
res = @exp.send_restart_request(@project.get_idx.try(:fetch, :commit))
|
3135
|
-
while !Cnvrg::CLI.is_response_success(res, false) do
|
3136
|
-
sleep(5)
|
3137
|
-
res = @exp.send_restart_request(@project.get_idx.try(:fetch, :commit))
|
3138
|
-
end
|
3139
|
-
exit(0)
|
3140
|
-
end
|
3141
|
-
sleep(10)
|
3142
|
-
end
|
3143
|
-
rescue => e
|
3144
|
-
log_error(e)
|
3145
|
-
end
|
3146
|
-
end
|
3147
|
-
end
|
3148
|
-
end
|
3149
3110
|
process_running = true
|
3150
3111
|
stats_thread = Thread.new do
|
3151
3112
|
while process_running do
|
@@ -3230,6 +3191,7 @@ module Cnvrg
|
|
3230
3191
|
end
|
3231
3192
|
|
3232
3193
|
if sync_after
|
3194
|
+
@project.job_log(["Syncing Experiment"])
|
3233
3195
|
# Sync after run
|
3234
3196
|
if @project.is_git
|
3235
3197
|
output_dir = output_dir || @exp.output_dir
|
@@ -3244,7 +3206,10 @@ module Cnvrg
|
|
3244
3206
|
end
|
3245
3207
|
|
3246
3208
|
end
|
3247
|
-
|
3209
|
+
end_commit = @project.last_local_commit
|
3210
|
+
if end_commit.present?
|
3211
|
+
@project.job_log(["Experiment end commit: #{end_commit}"])
|
3212
|
+
end
|
3248
3213
|
|
3249
3214
|
# log_thread.join
|
3250
3215
|
stats_thread.join
|
data/lib/cnvrg/project.rb
CHANGED
@@ -404,7 +404,7 @@ module Cnvrg
|
|
404
404
|
|
405
405
|
end
|
406
406
|
|
407
|
-
def generate_idx(deploy: false)
|
407
|
+
def generate_idx(deploy: false, files: [])
|
408
408
|
if File.exists? "#{self.local_path}/.cnvrg/idx.yml"
|
409
409
|
old_idx = YAML.load_file("#{self.local_path}/.cnvrg/idx.yml")
|
410
410
|
else
|
@@ -412,14 +412,19 @@ module Cnvrg
|
|
412
412
|
end
|
413
413
|
|
414
414
|
tree_idx = Hash.new(0)
|
415
|
-
|
415
|
+
|
416
|
+
### if file specified, just take them, dont calculate everything from scratch
|
416
417
|
list_ignore = self.get_ignore_list()
|
418
|
+
if files.blank?
|
419
|
+
list = Dir.glob("#{self.local_path}/**/*", File::FNM_DOTMATCH).reject {|x| (x =~ /\/\.{1,2}$/) or (x =~ /^#{self.local_path}\/\.cnvrg\/*/) or (x =~ /^#{self.local_path}\/\.git\/*/) or (x =~ /^#{self.local_path}\/\.cnvrgignore.conflict*/) and not (x =~ /^#{self.local_path}\/\.cnvrgignore/)}
|
420
|
+
else
|
421
|
+
list = files
|
422
|
+
end
|
417
423
|
if deploy
|
418
|
-
list_ignore
|
424
|
+
list_ignore += ["main.py", "main.pyc", "__init__.py", "uwsgi.ini"]
|
419
425
|
list_ignore.flatten!
|
420
426
|
end
|
421
427
|
list_ignore_new = list_ignore.map{|x| x.gsub("//","/")} rescue []
|
422
|
-
|
423
428
|
# list.each do |e|
|
424
429
|
Parallel.map(list, in_threads: IDXParallelThreads) do |e|
|
425
430
|
label = e.gsub(self.local_path + "/", "")
|
@@ -484,18 +489,15 @@ module Cnvrg
|
|
484
489
|
local_idx = self.get_idx
|
485
490
|
else
|
486
491
|
#upload
|
487
|
-
local_idx = self.generate_idx(deploy: deploy)
|
492
|
+
local_idx = self.generate_idx(deploy: deploy, files: specific_files)
|
488
493
|
end
|
489
494
|
commit = local_idx[:commit]
|
490
495
|
tree = local_idx[:tree]
|
491
496
|
ignore_list = self.send_ignore_list()
|
492
497
|
if force or specific_files.present?
|
493
498
|
added = []
|
494
|
-
if
|
495
|
-
added
|
496
|
-
elsif tree.present?
|
497
|
-
added << local_idx[:tree].keys
|
498
|
-
added.flatten!
|
499
|
+
if tree.present?
|
500
|
+
added += local_idx[:tree].keys
|
499
501
|
end
|
500
502
|
response = {"result" => {"commit" => nil, "tree" => {"added" => added,
|
501
503
|
"updated_on_server" => [],
|
data/lib/cnvrg/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cnvrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.8.
|
4
|
+
version: 1.5.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yochay Ettun
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-10-
|
13
|
+
date: 2019-10-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -446,8 +446,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
446
446
|
- !ruby/object:Gem::Version
|
447
447
|
version: '0'
|
448
448
|
requirements: []
|
449
|
-
|
450
|
-
rubygems_version: 2.7.9
|
449
|
+
rubygems_version: 3.0.3
|
451
450
|
signing_key:
|
452
451
|
specification_version: 4
|
453
452
|
summary: A CLI tool for interacting with cnvrg.io.
|