cnvrg 1.11.12 → 1.11.17
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 +3 -3
- data/lib/cnvrg/files.rb +24 -18
- data/lib/cnvrg/version.rb +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: 7fa5b2801b29b6714aedcba33ae817bbf23e97f567d5dbb26f472c26b0483b95
|
4
|
+
data.tar.gz: 3b2993cd78a012f5252f9fd98ef2621d976c94c36b26a197557ca6c4ea6ad923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f011cb9515169650552aec66df27f5eac692f303630411ef41ae62b25975190b1411d0d02f1bd54a8afe2f7955b6bdf24a62b18201db4c875d4189dfcf5a5e75
|
7
|
+
data.tar.gz: a655213fd5f2cbd52fc772b8f4fb2249f8ba21af51f8afbd69e330f1c1f792f4bea4b133a7cf9d015f1cdff853e4dba253a3c163206ddbd4da8c425a948494d3
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -3323,7 +3323,7 @@ module Cnvrg
|
|
3323
3323
|
real: real_time
|
3324
3324
|
}
|
3325
3325
|
if print_log
|
3326
|
-
puts line
|
3326
|
+
puts({log: line, timestamp: Time.now, exp_logs: true}.to_json)
|
3327
3327
|
end
|
3328
3328
|
log << cur_log
|
3329
3329
|
if log.size >= 10
|
@@ -3382,10 +3382,10 @@ module Cnvrg
|
|
3382
3382
|
if @project.is_git
|
3383
3383
|
output_dir = output_dir || @exp.output_dir
|
3384
3384
|
if output_dir.present?
|
3385
|
-
upload(false, false, true, ignore, true,
|
3385
|
+
upload(false, false, true, ignore, true, false, output_dir, "Experiment", @exp.slug, true )
|
3386
3386
|
end
|
3387
3387
|
else
|
3388
|
-
upload(false, false, true, ignore, true,
|
3388
|
+
upload(false, false, true, ignore, true, false, nil, "Experiment", @exp.slug, true )
|
3389
3389
|
end
|
3390
3390
|
end
|
3391
3391
|
|
data/lib/cnvrg/files.rb
CHANGED
@@ -733,7 +733,7 @@ module Cnvrg
|
|
733
733
|
unless Cnvrg::CLI.is_response_success(res, false)
|
734
734
|
raise SignalException.new("Cant download files from the server.")
|
735
735
|
end
|
736
|
-
self.
|
736
|
+
self.download_multiple_files_s3(res['result'], @project_home, postfix: postfix, progress: progress, threads: threads)
|
737
737
|
end
|
738
738
|
|
739
739
|
|
@@ -750,7 +750,8 @@ module Cnvrg
|
|
750
750
|
conflicted.each{|file| self.delete_conflict(file); progress.progress += 1 if progress.present?}
|
751
751
|
end
|
752
752
|
|
753
|
-
def
|
753
|
+
def download_multiple_files_s3(files, project_home, postfix: '', progress: nil, threads: 15)
|
754
|
+
cli = Cnvrg::CLI.new()
|
754
755
|
begin
|
755
756
|
props = {}
|
756
757
|
client = props[:client]
|
@@ -774,14 +775,19 @@ module Cnvrg
|
|
774
775
|
file_path = f["name"]
|
775
776
|
if file_path.end_with? "/"
|
776
777
|
# dir
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
778
|
+
begin
|
779
|
+
if download_dir(file_path, file_path, project_home)
|
780
|
+
download_succ_count += 1
|
781
|
+
else
|
782
|
+
raise StandardError.new("Could not create directory #{file_path}.")
|
783
|
+
end
|
784
|
+
rescue => e
|
785
|
+
cli.log_message("Could not create directory #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
|
786
|
+
raise e
|
782
787
|
end
|
783
788
|
else
|
784
789
|
file_path += postfix
|
790
|
+
|
785
791
|
# blob
|
786
792
|
begin
|
787
793
|
if not File.exists?(project_home+"/"+File.dirname(file_path))
|
@@ -790,28 +796,28 @@ module Cnvrg
|
|
790
796
|
local_path = project_home+"/"+file_path
|
791
797
|
storage_path = f["path"]
|
792
798
|
@client.safe_download(storage_path, local_path)
|
793
|
-
progress.progress += 1 if progress.present?
|
794
|
-
download_succ_count += 1
|
795
799
|
rescue => e
|
796
|
-
|
797
|
-
raise
|
800
|
+
cli.log_message("Could not download file #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
|
801
|
+
raise e
|
798
802
|
end
|
799
803
|
|
800
|
-
|
801
|
-
|
804
|
+
# progressbar can throw an exception so we no longer trust it!
|
805
|
+
begin
|
806
|
+
progress.progress += 1 if progress.present?
|
807
|
+
ensure
|
808
|
+
download_succ_count += 1
|
809
|
+
end
|
802
810
|
end
|
803
811
|
end
|
804
812
|
if download_succ_count == files["keys"].size
|
805
813
|
return Cnvrg::Result.new(true,"Done.\nDownloaded #{download_succ_count} files")
|
806
814
|
end
|
807
815
|
rescue => e
|
808
|
-
|
816
|
+
cli.log_error(e)
|
817
|
+
raise e
|
809
818
|
end
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
819
|
end
|
820
|
+
|
815
821
|
def download_file(absolute_path, relative_path, project_home, conflict=false)
|
816
822
|
res = Cnvrg::API.request(@base_resource + "download_file", 'POST', {absolute_path: absolute_path, relative_path: relative_path})
|
817
823
|
Cnvrg::CLI.is_response_success(res, false)
|
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.11.
|
4
|
+
version: 1.11.17
|
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: 2021-01-
|
13
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -453,7 +453,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
453
453
|
- !ruby/object:Gem::Version
|
454
454
|
version: '0'
|
455
455
|
requirements: []
|
456
|
-
rubygems_version: 3.
|
456
|
+
rubygems_version: 3.1.2
|
457
457
|
signing_key:
|
458
458
|
specification_version: 4
|
459
459
|
summary: A CLI tool for interacting with cnvrg.io.
|