cnvrg 0.0.14252 → 0.0.14253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +70 -9
- data/lib/cnvrg/version.rb +1 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e42b6a2a440d51e52338b3a8ed9d58f5533634
|
4
|
+
data.tar.gz: f1c4bb6e33f8c5c0d41a5ca27e70a4b0e668199e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6342336d3ed35832f1af2a6dcb6866d48767b678734ae5fd301735f61d9c8b03f01aafd2c50896563da859f4aa3c00d0f587049483223b5b8f66199aaf9db443
|
7
|
+
data.tar.gz: cecc0bd1e7a4df55e4ce78290bc043289967869e764aa9615c720b4ac03a3fc90885e21d4ea2aaf508326e2c47ceb154111121b5767ee97a0a411dc0a88e818c
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -203,12 +203,16 @@ 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"
|
206
207
|
|
207
208
|
say "Setting default api to be: #{url}", Thor::Shell::Color::BLUE
|
208
209
|
if config.empty?
|
209
|
-
config = {owner: "", username: "", version_last_check: get_start_day(), api: url}
|
210
|
+
config = {owner: "", username: "", version_last_check: get_start_day(), api: url,compression_path: compression_path }
|
210
211
|
else
|
211
|
-
|
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}
|
212
216
|
end
|
213
217
|
res = Cnvrg::API.request("/users/#{owner}/custom_api", 'POST', {custom_api: url})
|
214
218
|
if Cnvrg::CLI.is_response_success(res,false)
|
@@ -244,7 +248,9 @@ module Cnvrg
|
|
244
248
|
FileUtils.touch [home_dir+"/.cnvrg/config.yml"]
|
245
249
|
end
|
246
250
|
config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
|
247
|
-
|
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}
|
248
254
|
File.open(home_dir+"/.cnvrg/config.yml", "w+") { |f| f.write config.to_yaml }
|
249
255
|
say "Done"
|
250
256
|
rescue
|
@@ -319,7 +325,40 @@ module Cnvrg
|
|
319
325
|
end
|
320
326
|
end
|
321
327
|
|
322
|
-
|
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
|
+
|
323
362
|
|
324
363
|
|
325
364
|
desc 'login', 'Authenticate with cnvrg.io platform'
|
@@ -1182,7 +1221,8 @@ module Cnvrg
|
|
1182
1221
|
say "Compressing data", Thor::Shell::Color::BLUE
|
1183
1222
|
|
1184
1223
|
home_dir = File.expand_path('~')
|
1185
|
-
|
1224
|
+
compression_path = get_compression_path
|
1225
|
+
tar_path = "#{compression_path}#{@dataset.slug}_#{commit_sha1}.tar.gz"
|
1186
1226
|
tar_files_path = "#{home_dir}/.cnvrg/tmp/#{@dataset.slug}_#{commit_sha1}.txt"
|
1187
1227
|
tar_files = (result["added"] + result["updated_on_local"]).join("\n")
|
1188
1228
|
File.open(tar_files_path, 'w') { |f| f.write tar_files }
|
@@ -1546,6 +1586,8 @@ module Cnvrg
|
|
1546
1586
|
if result["added"].size > 0
|
1547
1587
|
FileUtils.rm_rf(result["added"])
|
1548
1588
|
end
|
1589
|
+
say "Changes were removed successfully", Thor::Shell::Color::GREEN
|
1590
|
+
|
1549
1591
|
|
1550
1592
|
rescue SignalException
|
1551
1593
|
log_end(-1)
|
@@ -2152,7 +2194,6 @@ module Cnvrg
|
|
2152
2194
|
method_option :data, :type => :string, :aliases => ["-d", "--data"], :default => ""
|
2153
2195
|
method_option :data_commit, :type => :string, :aliases => ["-dc", "--data_commit"], :default => ""
|
2154
2196
|
method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
|
2155
|
-
|
2156
2197
|
def exec(*cmd)
|
2157
2198
|
|
2158
2199
|
log = []
|
@@ -2580,7 +2621,8 @@ module Cnvrg
|
|
2580
2621
|
method_option :data_commit, :type => :string, :aliases => ["--data_commit"], :default => ""
|
2581
2622
|
method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
|
2582
2623
|
|
2583
|
-
def
|
2624
|
+
def
|
2625
|
+
exec_remote(*cmd)
|
2584
2626
|
verify_logged_in(true)
|
2585
2627
|
log_start(__method__, args, options)
|
2586
2628
|
working_dir = is_cnvrg_dir
|
@@ -3905,7 +3947,7 @@ module Cnvrg
|
|
3905
3947
|
# },
|
3906
3948
|
# }
|
3907
3949
|
|
3908
|
-
container_id = `nvidia-docker run -itd -p #{port}:8888 -p #{tensport}:6006 -w #{app_dir} #{image_name}:latest #{cmd} `
|
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} `
|
3909
3951
|
container_id = container_id.gsub("\n", "")
|
3910
3952
|
container = Docker::Container.get(container_id)
|
3911
3953
|
# container.start()
|
@@ -4402,7 +4444,13 @@ module Cnvrg
|
|
4402
4444
|
if url.nil? or url.empty?
|
4403
4445
|
url = "https://cnvrg.io/api"
|
4404
4446
|
end
|
4405
|
-
config =
|
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}
|
4406
4454
|
|
4407
4455
|
File.open(home_dir+"/.cnvrg/config.yml", "w+") { |f| f.write config.to_yaml }
|
4408
4456
|
return true
|
@@ -4510,6 +4558,19 @@ module Cnvrg
|
|
4510
4558
|
api = config.to_h[:api]
|
4511
4559
|
return api.gsub!("/api", "")
|
4512
4560
|
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
|
4513
4574
|
|
4514
4575
|
def get_project_home
|
4515
4576
|
absolute_path = Dir.pwd
|
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: 0.0.
|
4
|
+
version: 0.0.14253
|
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-
|
12
|
+
date: 2017-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -373,8 +373,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
373
373
|
version: '0'
|
374
374
|
requirements: []
|
375
375
|
rubyforge_project:
|
376
|
-
rubygems_version: 2.
|
376
|
+
rubygems_version: 2.5.1
|
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:
|