cnvrg 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6d6742b8d329e83b4eba3acbc60dc05bd2a881d
4
- data.tar.gz: a20f65edcc1666973f12d7d8f24c4e7837cea0ae
3
+ metadata.gz: 080cd87745b468971f39517ad0f5ba066ab41b00
4
+ data.tar.gz: 7fa5794bb717f1899827784ed952c38ee400e2dd
5
5
  SHA512:
6
- metadata.gz: b1eb7c4e30a407596bbce0c8e86094a76ad417a7f8bc4003c1d4f72d6eb03c4ae8bc5bb7bb1f9baf88b2a2f31d4971a90afa67b73ee2a91e7190549805664ad0
7
- data.tar.gz: 74415b8949fc00dd752add66aa441359716e23004ad4decb3fff796e994ef309a1028a0cedd7b073fa0616f307a917344433185df9f4a7828ce233867fc17f85
6
+ metadata.gz: 3983ba01e3b2e1c8848083be9329b4ec96dacea91863e263e7acf647952bf38425cf4daf153daf6852e7a51d31b45ae293d07a89c4f301196666c6737a35531f
7
+ data.tar.gz: a8abe5f77854e51f90eee110fdc419fd4c2efd2d2e4b572fda2ae2086d489c1790d4e3ea19db4ee06ad3dbcaeba5c34b8a969b2a60a2100155e31a40d13672c7
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency 'thor', '~> 0.19.0','>=0.19.1'
34
34
  spec.add_runtime_dependency 'aws-sdk'
35
35
  spec.add_runtime_dependency 'urlcrypt', '~> 0.1.1'
36
- spec.add_runtime_dependency 'terminal-table'
37
36
 
38
37
  end
39
38
 
@@ -11,8 +11,18 @@ module Cnvrg
11
11
 
12
12
  def self.get_api
13
13
  home_dir = File.expand_path('~')
14
- config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
15
- if config.empty? or config.to_h[:api].nil?
14
+ config = ""
15
+ begin
16
+ if File.exist? home_dir+"/.cnvrg/config.yml"
17
+ config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
18
+ else
19
+ return "https://cnvrg.io/api"
20
+ end
21
+
22
+ rescue
23
+ return "https://cnvrg.io/api"
24
+ end
25
+ if !config or config.empty? or config.to_h[:api].nil?
16
26
  return "https://cnvrg.io/api"
17
27
  else
18
28
  return config.to_h[:api]
@@ -138,7 +138,8 @@ module Cnvrg
138
138
  if set_owner(choose_owner, result["username"])
139
139
  say "Setting default owner: #{choose_owner}", Thor::Shell::Color::GREEN
140
140
  else
141
- say "Setting default owenr has failed, try to run cnvrg --config-default-owner", Thor::Shell::Color::RED
141
+ say "Setting default owenr has failed, logging out", Thor::Shell::Color::RED
142
+ return logout()
142
143
  end
143
144
 
144
145
  else
@@ -871,9 +872,9 @@ module Cnvrg
871
872
 
872
873
  container_id = get_container_id
873
874
  owner = Cnvrg::CLI.get_owner()
874
- say "Commiting notebook changes to a: #{owner}/#{notebook_image_name}", Thor::Shell::Color::BLUE
875
+ say "Commiting notebook changes to: #{notebook_image_name}", Thor::Shell::Color::BLUE
875
876
 
876
- commit_res = system("#{docker_path} commit #{container_id} #{owner}/#{notebook_image_name}")
877
+ commit_res = system("#{docker_path} commit #{container_id} #{notebook_image_name}")
877
878
  if commit_res
878
879
  checker = Helpers.checkmark()
879
880
  say "#{checker} Done.", Thor::Shell::Color::GREEN
@@ -893,17 +894,16 @@ module Cnvrg
893
894
  docker_path = verify_software_installed("docker")
894
895
  owner = Cnvrg::CLI.get_owner()
895
896
  # verify image exist
896
- # owner = "cnvrgio"
897
- images = `#{docker_path} images |grep #{owner}/#{image_name}`
897
+ images = `#{docker_path} images |grep #{image_name}`
898
898
  if images.empty?
899
- say "Couldn't find any images named: #{owner}/#{image_name}", Thor::Shell::Color::RED
899
+ say "Couldn't find any images named: #{image_name}", Thor::Shell::Color::RED
900
900
  exit(1)
901
901
  end
902
902
  path = File.expand_path('~')+"/.cnvrg/#{owner}_#{image_name}.tar"
903
903
  begin
904
904
  say "Creating image file to upload", Thor::Shell::Color::BLUE
905
905
  if !(File.exist? path or File.exist? path+"gz")
906
- saveRes = system("#{docker_path} save #{owner}/#{image_name}>#{path}")
906
+ saveRes = system("#{docker_path} save #{image_name}>#{path}")
907
907
  if !saveRes
908
908
  say "Couldn't create tar file from image", Thor::Shell::Color::RED
909
909
  exit(1)
@@ -930,11 +930,11 @@ module Cnvrg
930
930
  say "Couldn't upload image", Thor::Shell::Color::RED
931
931
  end
932
932
  else
933
- say "Couldn't create image file for: #{owner}/#{image_name}", Thor::Shell::Color::RED
933
+ say "Couldn't create image file for: #{image_name}", Thor::Shell::Color::RED
934
934
  exit(1)
935
935
  end
936
936
  rescue SignalException
937
- say "Couldn't upload image file for: #{owner}/#{image_name}", Thor::Shell::Color::RED
937
+ say "Couldn't upload image file for: #{image_name}", Thor::Shell::Color::RED
938
938
  exit(1)
939
939
  end
940
940
 
@@ -1066,7 +1066,7 @@ module Cnvrg
1066
1066
  FileUtils.touch [home_dir+"/.cnvrg/config.yml"]
1067
1067
  end
1068
1068
  config = YAML.load_file(home_dir+"/.cnvrg/config.yml")
1069
- if config.empty?
1069
+ if !config or config.empty?
1070
1070
  config = {owner: owner, username: username, version_last_check: get_start_day(), api: "https://cnvrg.io/api"}
1071
1071
  else
1072
1072
  config = {owner: owner, username: username, version_last_check: get_start_day(), api: config.to_h[:api]}
@@ -1,4 +1,4 @@
1
1
  module Cnvrg
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -231,20 +231,6 @@ dependencies:
231
231
  - - "~>"
232
232
  - !ruby/object:Gem::Version
233
233
  version: 0.1.1
234
- - !ruby/object:Gem::Dependency
235
- name: terminal-table
236
- requirement: !ruby/object:Gem::Requirement
237
- requirements:
238
- - - ">="
239
- - !ruby/object:Gem::Version
240
- version: '0'
241
- type: :runtime
242
- prerelease: false
243
- version_requirements: !ruby/object:Gem::Requirement
244
- requirements:
245
- - - ">="
246
- - !ruby/object:Gem::Version
247
- version: '0'
248
234
  description: A CLI tool for interacting with cnvrg.io.
249
235
  email:
250
236
  - info@cnvrg.io