cnvrg 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 17942c336608306042bc9744c306d7761dc7e641
4
- data.tar.gz: 3e931700b1a8c96abf593077d585980fcb89afc1
3
+ metadata.gz: 35ef0e50784c1333f4fa375ec78a0c968d883363
4
+ data.tar.gz: b2079022aca9ff172af33f81c1b3ee66c388bd4a
5
5
  SHA512:
6
- metadata.gz: 64ae69b8efac75486edc8911f99db1c5563c84e38f2eeb33e0dcc24b75ae470782b7a3352c4b8f4e7aaf6dae3261ec71b2bd287963c396998dd1e0e876fd41d7
7
- data.tar.gz: 2fecd443628c87027559088293215ef007d144a5b9dd7aef3a1ff791f3391b33f4e4b426f2b890f32a60d31ec352f2e1c0851ef8b5c1a32fd3f671b575e8cf37
6
+ metadata.gz: 9dbe6889b455e7a302e6909dfb99e69b963260ed3baa4b7c78df0b7ab436ca8fe8134771f256965010c4e2c0807e6f81f8268d7c01ff0d0bcc69879e3993808b
7
+ data.tar.gz: d624f15e9347cdd1020c9a20db0e07161c0029047dfa0859c513e415bf4654a4b79ea80f0b32915be96e5d0d454c60020b8314e1a1deaa2137a7d2fae4b6a359
data/lib/cnvrg/cli.rb CHANGED
@@ -831,6 +831,8 @@ module Cnvrg
831
831
  if !download_res
832
832
  exit(1)
833
833
  end
834
+ Dataset.verify_cnvrgignore_exist(dataset_name,false)
835
+
834
836
 
835
837
 
836
838
  check = Helpers.checkmark
@@ -1286,7 +1288,11 @@ module Cnvrg
1286
1288
  compression_path = get_compression_path
1287
1289
  tar_path = "#{compression_path}#{@dataset.slug}_#{commit_sha1}.tar.gz"
1288
1290
  tar_files_path = "#{home_dir}/.cnvrg/tmp/#{@dataset.slug}_#{commit_sha1}.txt"
1289
- tar_files = (result["added"] + result["updated_on_local"]).join("\n")
1291
+ files_to_upload = result["added"] + result["updated_on_local"]
1292
+ if File.exist? (@dataset.local_path+"/.cnvrgignore")
1293
+ files_to_upload << ".cnvrgignore"
1294
+ end
1295
+ tar_files = (files_to_upload).join("\n")
1290
1296
  File.open(tar_files_path, 'w') { |f| f.write tar_files }
1291
1297
  ignore_files_path = nil
1292
1298
  if !ignore_list.nil?
@@ -5258,17 +5264,17 @@ module Cnvrg
5258
5264
  exit(1)
5259
5265
  end
5260
5266
 
5261
- if !Helpers.internet_connection?
5262
- wait_offline = agree "Seems like you're offline, wait until your'e back online?", Thor::Shell::Color::YELLOW
5263
- if wait_offline
5264
- say "Waiting until your'e online..", Thor::Shell::Color::BLUE
5265
- while !Cnvrg::Helpers.internet_connection?
5266
- end
5267
- else
5268
- say "you seem to be offline, please check your internet connection", Thor::Shell::Color::RED
5269
- exit(0)
5270
- end
5271
- end
5267
+ # if !Helpers.internet_connection?
5268
+ # wait_offline = agree "Seems like you're offline, wait until your'e back online?", Thor::Shell::Color::YELLOW
5269
+ # if wait_offline
5270
+ # say "Waiting until your'e online..", Thor::Shell::Color::BLUE
5271
+ # while !Cnvrg::Helpers.internet_connection?
5272
+ # end
5273
+ # else
5274
+ # say "you seem to be offline, please check your internet connection", Thor::Shell::Color::RED
5275
+ # exit(0)
5276
+ # end
5277
+ # end
5272
5278
 
5273
5279
  config = YAML.load_file(File.expand_path('~')+"/.cnvrg/config.yml")
5274
5280
  version_date = config.to_h[:version_last_check]
data/lib/cnvrg/dataset.rb CHANGED
@@ -4,6 +4,8 @@ module Cnvrg
4
4
  attr_reader :slug, :owner, :title, :local_path, :working_dir
5
5
 
6
6
  RemoteURL ||= "https://cnvrg.io"
7
+ IDXParallelThreads ||= 15
8
+
7
9
 
8
10
  def initialize(project_home)
9
11
  begin
@@ -178,7 +180,7 @@ module Cnvrg
178
180
  url = Cnvrg::Helpers.remote_url
179
181
  "#{url}/#{self.owner}/datasets/#{self.slug}"
180
182
  end
181
- def generate_idx(list_ignore)
183
+ def generate_idx(list_ignore=nil)
182
184
  if File.exists? "#{self.local_path}/.cnvrg/idx.yml"
183
185
  old_idx = YAML.load_file("#{self.local_path}/.cnvrg/idx.yml")
184
186
  else
@@ -192,7 +194,7 @@ module Cnvrg
192
194
  list_ignore = self.get_ignore_list()
193
195
  end
194
196
 
195
- list.each do |e|
197
+ Parallel.map(list, in_threads: IDXParallelThreads) do |e|
196
198
  label = e.gsub(self.local_path + "/", "")
197
199
  if File.directory? e
198
200
  if list_ignore.include? label
data/lib/cnvrg/project.rb CHANGED
@@ -4,6 +4,8 @@ module Cnvrg
4
4
  attr_reader :slug, :owner, :title, :local_path, :working_dir
5
5
 
6
6
  RemoteURL ||= "https://cnvrg.io"
7
+ IDXParallelThreads ||= 15
8
+
7
9
 
8
10
  def initialize(project_home)
9
11
  begin
@@ -235,9 +237,8 @@ module Cnvrg
235
237
  return true
236
238
  end
237
239
  def self.verify_cnvrgignore_exist(project_name,remote)
238
- if remote
239
- path = ".cnvrgignore"
240
- else
240
+ path = ".cnvrgignore"
241
+ if !File.exist? path
241
242
  path = "#{project_name}/.cnvrgignore"
242
243
  end
243
244
  ignore_exits = File.exist? path
@@ -321,7 +322,7 @@ module Cnvrg
321
322
  tree_idx = Hash.new(0)
322
323
  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}\/\.cnvrgignore.conflict*/) and not (x =~/^#{self.local_path}\/\.cnvrgignore/) }
323
324
  list_ignore = self.get_ignore_list()
324
- list.each do |e|
325
+ Parallel.map(list, in_threads: IDXParallelThreads) do |e|
325
326
  label = e.gsub(self.local_path + "/", "")
326
327
  ignore_label = label.gsub("/","//")
327
328
  if list_ignore.include? ignore_label
data/lib/cnvrg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Cnvrg
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
4
4
 
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: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun