cnvrg 1.11.14 → 1.11.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4efa915d1f57cfba945987168eb4cfd118bfee50e8d5e3fa76dd08592176e054
4
- data.tar.gz: 8f2b8cd5916f6281c25791f36791c6cc3052f0b4fe7a1094661c635f63eb1b9d
3
+ metadata.gz: 2b8064702c190a7af0e1541f7a523e950e771439caa1f68d98177c094551dbb5
4
+ data.tar.gz: 982aa81d2da514f30b45ad45e4ec4b9a12a648e22c9b60d98afe318eba30e753
5
5
  SHA512:
6
- metadata.gz: 24459de6ce2e782816f68f891e79f8b4fe75d98571983321358619be51fd718055581aea9c4db8a850aea3af97ada9b50207b8278490088c42dce60407b1dc8e
7
- data.tar.gz: 03a9f04384ddfebc7e3ee9b0eb10361d808e686286b77ba26753969284e7ae707c147aab7221325d89f9bd22151d378f2865a96c1b01d2d45657f488d2ee97ee
6
+ metadata.gz: 9f3dcc03516cbe0a3ffd8bd5fa57f976b09028568e8014f161d43581fbc4b8c4def858297b55ef1d750efcd0af276905c006e5ebe7f3e17dd1268e81ad34f084
7
+ data.tar.gz: de7a4ea731e3230c225149d345e0ab2dde8466b2dd66008aba09d90a0bc287a9d61a8fb266f755a4665ce57c27e7c97c198b7435ab15c0d1fb63977552677150
data/cnvrg.gemspec CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'rspec', '~> 3.0'
24
24
  spec.add_development_dependency 'vcr', '~> 3.0'
25
25
  spec.add_development_dependency 'aruba'
26
- spec.add_development_dependency 'pry'
27
-
26
+ spec.add_development_dependency 'pry'
27
+
28
28
  spec.add_runtime_dependency 'mimemagic', '~> 0.3.1','>=0.3.2'
29
29
  spec.add_runtime_dependency 'faraday', '~> 0.15.2'
30
30
  spec.add_runtime_dependency 'netrc', '~> 0.11.0'
data/lib/cnvrg/cli.rb CHANGED
@@ -2346,7 +2346,6 @@ module Cnvrg
2346
2346
  log_message("#{check} Project is up to date", Thor::Shell::Color::GREEN, (((options["sync"] or sync) and !direct) ? false : true))
2347
2347
  return true
2348
2348
  end
2349
- force = true
2350
2349
  end
2351
2350
 
2352
2351
  if ignore.nil? or ignore.empty?
@@ -3323,7 +3322,7 @@ module Cnvrg
3323
3322
  real: real_time
3324
3323
  }
3325
3324
  if print_log
3326
- puts line
3325
+ puts({log: line, timestamp: Time.now, exp_logs: true}.to_json)
3327
3326
  end
3328
3327
  log << cur_log
3329
3328
  if log.size >= 10
@@ -43,6 +43,8 @@ module Cnvrg
43
43
  def verify_files_exists(files)
44
44
  paths = []
45
45
  files.each do |file|
46
+ # dir shouldnt have ending slash.
47
+ file = file[0..-2] if file.end_with? '/'
46
48
  if File.exists? file
47
49
  if File.directory? file
48
50
  paths += Dir.glob("#{file}/**/*")
@@ -17,7 +17,9 @@ module Cnvrg
17
17
  count = 0
18
18
  begin
19
19
  count += 1
20
- sts = open(sts_path, {ssl_verify_mode: 0}).read rescue nil
20
+ sts_file = open(sts_path, {ssl_verify_mode: 0})
21
+ sts = sts_file.read
22
+ sts.split("\n")
21
23
  rescue => e
22
24
  backoff_time_seconds = backoff_time(count)
23
25
  sleep backoff_time_seconds
@@ -25,7 +27,6 @@ module Cnvrg
25
27
  retry if count <= 20
26
28
  raise StandardError.new("Cant access storage: #{e.message}")
27
29
  end
28
- sts.split("\n")
29
30
  end
30
31
 
31
32
  def cut_prefix(prefix, file)
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.download_multpile_files_s3(res['result'], @project_home, postfix: postfix, progress: progress, threads: threads)
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,7 @@ module Cnvrg
750
750
  conflicted.each{|file| self.delete_conflict(file); progress.progress += 1 if progress.present?}
751
751
  end
752
752
 
753
- def download_multpile_files_s3(files, project_home, postfix: '', progress: nil, threads: 15)
753
+ def download_multiple_files_s3(files, project_home, postfix: '', progress: nil, threads: 15)
754
754
  cli = Cnvrg::CLI.new()
755
755
  begin
756
756
  props = {}
@@ -779,14 +779,15 @@ module Cnvrg
779
779
  if download_dir(file_path, file_path, project_home)
780
780
  download_succ_count += 1
781
781
  else
782
- raise SignalException.new("Could not create directory #{file_path}.")
782
+ raise StandardError.new("Could not create directory #{file_path}.")
783
783
  end
784
784
  rescue => e
785
- cli.log_info("Could not create directory #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
785
+ cli.log_message("Could not create directory #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
786
786
  raise e
787
787
  end
788
788
  else
789
789
  file_path += postfix
790
+
790
791
  # blob
791
792
  begin
792
793
  if not File.exists?(project_home+"/"+File.dirname(file_path))
@@ -795,12 +796,19 @@ module Cnvrg
795
796
  local_path = project_home+"/"+file_path
796
797
  storage_path = f["path"]
797
798
  @client.safe_download(storage_path, local_path)
798
- progress.progress += 1 if progress.present?
799
- download_succ_count += 1
800
799
  rescue => e
801
- cli.log_info("Could not download file #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
800
+ cli.log_message("Could not download file #{file_path}. error: #{e.message}", Thor::Shell::Color::RED)
802
801
  raise e
803
802
  end
803
+
804
+ # progressbar can throw an exception so we no longer trust it!
805
+ begin
806
+ progress.progress += 1 if progress.present?
807
+ rescue
808
+ nil
809
+ ensure
810
+ download_succ_count += 1
811
+ end
804
812
  end
805
813
  end
806
814
  if download_succ_count == files["keys"].size
data/lib/cnvrg/flow.rb CHANGED
@@ -62,7 +62,7 @@ module Cnvrg
62
62
  resp = Cnvrg::API.request(url, 'POST', {flow_version: recipe.to_json}) || {}
63
63
  if resp["status"] == 200
64
64
  return [Flows.new(resp["flow_version"]["flow_id"], project: project), resp["flow_version"]["id"]]
65
- elsif resp["status"] == 400
65
+ elsif resp["status"].between?(400,499)
66
66
  raise StandardError.new(resp["message"])
67
67
  end
68
68
  raise StandardError.new("Can't create new flow")
data/lib/cnvrg/project.rb CHANGED
@@ -448,8 +448,8 @@ module Cnvrg
448
448
  next
449
449
  end
450
450
  if File.directory? e
451
-
452
- tree_idx[label + "/"] = nil
451
+ dir_name = (label.ends_with? "/") ? label : (label + "/")
452
+ tree_idx[dir_name] = nil
453
453
  else
454
454
  file_in_idx = old_idx[:tree][label] rescue nil
455
455
  last_modified = File.mtime(e).to_f
@@ -513,10 +513,11 @@ module Cnvrg
513
513
  #upload
514
514
  local_idx = self.generate_idx(deploy: deploy, files: specific_files)
515
515
  end
516
+
516
517
  commit = local_idx[:commit]
517
518
  tree = local_idx[:tree]
518
519
  ignore_list = self.send_ignore_list()
519
- if force or specific_files.present?
520
+ if force
520
521
  added = []
521
522
  if tree.present?
522
523
  added += local_idx[:tree].keys
data/lib/cnvrg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cnvrg
2
- VERSION = '1.11.14'
2
+ VERSION = '1.11.23'
3
3
  end
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.14
4
+ version: 1.11.23
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-22 00:00:00.000000000 Z
13
+ date: 2021-02-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler