cnvrg 0.0.1426 → 0.0.14251

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cnvrg/cli.rb +10 -76
  3. data/lib/cnvrg/version.rb +1 -1
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bac7148a22a0afab03e2aff2051a5153fd02ba92
4
- data.tar.gz: 769b6e2f773a9b1a907c9030caf3731dde8c944b
3
+ metadata.gz: 134cf17967ea3f0de82d235cc8b75d3d52b10cbc
4
+ data.tar.gz: a1c913930cda66e5c6a3410303d75746a1e94edc
5
5
  SHA512:
6
- metadata.gz: d13f7de09b107fc38c5c7948613a4e3137bfff2e8ff2ca02e60902a08720b51c07dad4aa4e9cd38421966559802ad1fe20f5f80c0baca01cc5f436e2030c9fce
7
- data.tar.gz: dc65d935cbab883a70a2242bbead6151765d7431e91ed641a9e78b2f642c3227e6717fb44e479bf0475109f1b7fde84d4664ba6e50719a6a80330d8aedbe1338
6
+ metadata.gz: 121c544521943dc61cd84d022f353f29daabad1b85d0d1d1b7a1866acf8ee6dae3d1f09f2f26f574260815aed73118d63ec59fe1426263c734dbe6aa82d4b370
7
+ data.tar.gz: 36bbb86a1a319cc62a92826fbc47165638c1d2b1d33273af159a3051f0e2480b6ccb46c822e1d62331079ae158ce64f67c0a22e88a6421cbfa0bb3e3f601fe23
data/lib/cnvrg/cli.rb CHANGED
@@ -203,16 +203,12 @@ module Cnvrg
203
203
  end
204
204
  config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
205
205
  owner = config.to_h[:owner]
206
- compression_path = "#{File.expand_path('~')}/.cnvrg/tmp"
207
206
 
208
207
  say "Setting default api to be: #{url}", Thor::Shell::Color::BLUE
209
208
  if config.empty?
210
- config = {owner: "", username: "", version_last_check: get_start_day(), api: url,compression_path: compression_path }
209
+ config = {owner: "", username: "", version_last_check: get_start_day(), api: url}
211
210
  else
212
- if !config.to_h[:compression_path].nil?
213
- compression_path = config.to_h[:compression_path]
214
- end
215
- config = {owner: config.to_h[:owner], username: config.to_h[:username], version_last_check: config.to_h[:version_last_check], api: url, compression_path: compression_path}
211
+ config = {owner: config.to_h[:owner], username: config.to_h[:username], version_last_check: config.to_h[:version_last_check], api: url}
216
212
  end
217
213
  res = Cnvrg::API.request("/users/#{owner}/custom_api", 'POST', {custom_api: url})
218
214
  if Cnvrg::CLI.is_response_success(res,false)
@@ -248,9 +244,7 @@ module Cnvrg
248
244
  FileUtils.touch [home_dir+"/.cnvrg/config.yml"]
249
245
  end
250
246
  config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
251
-
252
- compression_path = "#{home_dir}/.cnvrg/tmp"
253
- config = {owner: owner, username: current_user, version_last_check: get_start_day(), api: url,compression_path:compression_path}
247
+ config = {owner: owner, username: current_user, version_last_check: get_start_day(), api: url}
254
248
  File.open(home_dir+"/.cnvrg/config.yml", "w+") { |f| f.write config.to_yaml }
255
249
  say "Done"
256
250
  rescue
@@ -325,40 +319,7 @@ module Cnvrg
325
319
  end
326
320
  end
327
321
 
328
- desc 'set_compression_path', 'set compression path'
329
- method_option :reset, :type => :boolean, :aliases => ["-r","--reset"], :default => false
330
-
331
- def set_compression_path(*compression_path)
332
- begin
333
- if (compression_path.nil? or compression_path.empty?) and options["reset"]
334
- compression_path = ["#{File.expand_path('~')}/.cnvrg/tmp"]
335
- end
336
- compression_path = compression_path.join(" ")
337
- if !Dir.exist? compression_path
338
- say "Couldn't find #{compression_path}, please make sure it exist", Thor::Shell::Color::RED
339
- exit(0)
340
- end
341
-
342
- home_dir = File.expand_path('~')
343
- path = "#{home_dir}/.cnvrg/config.yml"
344
- if !File.exist?(path)
345
- say "Couldn't find ~/.cnvrg/config.yml file, please logout and login again", Thor::Shell::Color::RED
346
-
347
- exit(0)
348
- end
349
- config = YAML.load_file(path)
350
- config_new = {owner: config.to_h[:owner], username: config.to_h[:username],
351
- version_last_check: config.to_h[:version_last_check], api: config.to_h[:api], compression_path: compression_path}
352
- File.open(home_dir+"/.cnvrg/config.yml", "w+") { |f| f.write config_new.to_yaml }
353
- checks = Helpers.checkmark
354
- say "#{checks} Done", Thor::Shell::Color::GREEN
355
-
356
- rescue SignalException
357
- say "\nAborting"
358
- exit(1)
359
- end
360
- end
361
-
322
+ map %w(--set-default-owner) => :set_default_owner
362
323
 
363
324
 
364
325
  desc 'login', 'Authenticate with cnvrg.io platform'
@@ -1221,8 +1182,7 @@ module Cnvrg
1221
1182
  say "Compressing data", Thor::Shell::Color::BLUE
1222
1183
 
1223
1184
  home_dir = File.expand_path('~')
1224
- compression_path = get_compression_path
1225
- tar_path = "#{compression_path}#{@dataset.slug}_#{commit_sha1}.tar.gz"
1185
+ tar_path = "#{home_dir}/.cnvrg/tmp/#{@dataset.slug}_#{commit_sha1}.tar.gz"
1226
1186
  tar_files_path = "#{home_dir}/.cnvrg/tmp/#{@dataset.slug}_#{commit_sha1}.txt"
1227
1187
  tar_files = (result["added"] + result["updated_on_local"]).join("\n")
1228
1188
  File.open(tar_files_path, 'w') { |f| f.write tar_files }
@@ -1586,8 +1546,6 @@ module Cnvrg
1586
1546
  if result["added"].size > 0
1587
1547
  FileUtils.rm_rf(result["added"])
1588
1548
  end
1589
- say "Changes were removed successfully", Thor::Shell::Color::GREEN
1590
-
1591
1549
 
1592
1550
  rescue SignalException
1593
1551
  log_end(-1)
@@ -2194,6 +2152,7 @@ module Cnvrg
2194
2152
  method_option :data, :type => :string, :aliases => ["-d", "--data"], :default => ""
2195
2153
  method_option :data_commit, :type => :string, :aliases => ["-dc", "--data_commit"], :default => ""
2196
2154
  method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
2155
+
2197
2156
  def exec(*cmd)
2198
2157
 
2199
2158
  log = []
@@ -2621,8 +2580,7 @@ module Cnvrg
2621
2580
  method_option :data_commit, :type => :string, :aliases => ["--data_commit"], :default => ""
2622
2581
  method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
2623
2582
 
2624
- def
2625
- exec_remote(*cmd)
2583
+ def exec_remote(*cmd)
2626
2584
  verify_logged_in(true)
2627
2585
  log_start(__method__, args, options)
2628
2586
  working_dir = is_cnvrg_dir
@@ -3947,7 +3905,7 @@ module Cnvrg
3947
3905
  # },
3948
3906
  # }
3949
3907
 
3950
- container_id = `nvidia-docker run -itd -p #{port}:8888 -p #{tensport}:6006 -w #{app_dir} -v /usr/bin/nvidia-smi:/usr/bin/nvidia-smi #{image_name}:latest #{cmd} `
3908
+ container_id = `nvidia-docker run -itd -p #{port}:8888 -p #{tensport}:6006 -w #{app_dir} #{image_name}:latest #{cmd} `
3951
3909
  container_id = container_id.gsub("\n", "")
3952
3910
  container = Docker::Container.get(container_id)
3953
3911
  # container.start()
@@ -4444,13 +4402,7 @@ module Cnvrg
4444
4402
  if url.nil? or url.empty?
4445
4403
  url = "https://cnvrg.io/api"
4446
4404
  end
4447
- config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
4448
-
4449
- compression_path = "#{home_dir}/.cnvrg/tmp"
4450
- if !config.empty? and !config.to_h[:compression_path].nil?
4451
- compression_path = config.to_h[:compression_path]
4452
- end
4453
- config = {owner: owner, username: username, version_last_check: get_start_day(), api: url,compression_path:compression_path}
4405
+ config = {owner: owner, username: username, version_last_check: get_start_day(), api: url}
4454
4406
 
4455
4407
  File.open(home_dir+"/.cnvrg/config.yml", "w+") { |f| f.write config.to_yaml }
4456
4408
  return true
@@ -4558,19 +4510,6 @@ module Cnvrg
4558
4510
  api = config.to_h[:api]
4559
4511
  return api.gsub!("/api", "")
4560
4512
  end
4561
- def get_compression_path
4562
- home_dir = File.expand_path('~')
4563
-
4564
- config = YAML.load_file(home_dir+ "/.cnvrg/config.yml")
4565
- compression_path = config.to_h[:compression_path]
4566
- if compression_path.nil?
4567
- compression_path = "#{home_dir}/.cnvrg/tmp/"
4568
- end
4569
- if !compression_path.ends_with? "/"
4570
- compression_path = compression_path + "/"
4571
- end
4572
- return compression_path
4573
- end
4574
4513
 
4575
4514
  def get_project_home
4576
4515
  absolute_path = Dir.pwd
@@ -4920,12 +4859,7 @@ module Cnvrg
4920
4859
 
4921
4860
  def create_tar(path_in, path_out, tar_files)
4922
4861
  #The cd is meant for cases when running cnvrg data uplaod not in the main folder
4923
- begin
4924
- `cd #{path_in} && tar -czf #{path_out} -T #{tar_files}`
4925
- rescue => e
4926
- puts "Exception while compressing data: #{e.message}"
4927
- end
4928
-
4862
+ `cd #{path_in} && tar -czf #{path_out} -T #{tar_files} > /dev/null 2>&1`
4929
4863
  return $?.success?
4930
4864
  end
4931
4865
 
data/lib/cnvrg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Cnvrg
2
- VERSION = '0.0.1426'
2
+ VERSION = '0.0.14251'
3
3
 
4
4
  end
5
5
 
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.0.1426
4
+ version: 0.0.14251
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-02 00:00:00.000000000 Z
12
+ date: 2017-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -373,9 +373,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  version: '0'
374
374
  requirements: []
375
375
  rubyforge_project:
376
- rubygems_version: 2.5.1
376
+ rubygems_version: 2.6.12
377
377
  signing_key:
378
378
  specification_version: 4
379
379
  summary: A CLI tool for interacting with cnvrg.io.
380
380
  test_files: []
381
- has_rdoc: