cnvrg 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +33 -26
- data/lib/cnvrg/files.rb +9 -9
- data/lib/cnvrg/job.rb +0 -1
- data/lib/cnvrg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 745fd9b806d9e5d46b4ba24212e06f5a426447f3
|
4
|
+
data.tar.gz: c950e20258da5c1243765572b6b7f4c93d0cad1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f60cd3a8cbb4d9bb6c53beac4faf0b76d5db9db469e4474dabe36787985b7d601a07d0029dcb797b7ede238ec2fa3e96beaaa56497b39fc05380dd05f54981fb
|
7
|
+
data.tar.gz: 6587fe66cf021518dc9249a3c0eb936ccfb126b51b6b6cc605d1e44b09cbee30b55bb590cc7420bec05951077d63f452bb9a88a7466a78bd1281d51ccd334b1f
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -235,7 +235,14 @@ module Cnvrg
|
|
235
235
|
# docker_image_local = local_images.map{|x| x.info["RepoTags"]}.select{|y| y[0].include? docker_image}.flatten
|
236
236
|
# if docker_image_local.size == 0
|
237
237
|
# if yes? "Image wasn't found locally, pull image from cnvrg repository?"
|
238
|
-
# pull_image(docker_image)
|
238
|
+
# image = pull_image(docker_image)
|
239
|
+
# if image
|
240
|
+
# say "downloaded image: #{docker_image_local[0]}, creating a container.."
|
241
|
+
# @container = Docker::Container.create('Image' => '#{docker_image_local[0]}')
|
242
|
+
# if @container.nil?
|
243
|
+
# say "could not create container with image #{docker_image_local[0]}"
|
244
|
+
# end
|
245
|
+
# end
|
239
246
|
# else
|
240
247
|
# say "Could not create a new project with docker, image was not found", Thor::Shell::Color::RED
|
241
248
|
# exit(1)
|
@@ -243,14 +250,12 @@ module Cnvrg
|
|
243
250
|
# end
|
244
251
|
# elsif docker_image_local.size == 1
|
245
252
|
# say "found image: #{docker_image_local[0]}, creating a container.."
|
246
|
-
# container = Docker::Container.create('Image' => '#{docker_image_local[0]}')
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
253
|
+
# @container = Docker::Container.create('Image' => '#{docker_image_local[0]}')
|
254
|
+
# if @container.nil?
|
255
|
+
# say "could not create container with image #{docker_image_local[0]}"
|
256
|
+
# end
|
251
257
|
#
|
252
258
|
# end
|
253
|
-
pull_image(docker_image)
|
254
259
|
end
|
255
260
|
say "Creating #{project_name}", Thor::Shell::Color::BLUE
|
256
261
|
if Dir.exists? project_name or File.exists? project_name
|
@@ -281,7 +286,7 @@ module Cnvrg
|
|
281
286
|
exit(1)
|
282
287
|
end
|
283
288
|
end
|
284
|
-
|
289
|
+
|
285
290
|
|
286
291
|
|
287
292
|
desc 'link', 'Link current directory to a cnvrg project'
|
@@ -1158,22 +1163,23 @@ module Cnvrg
|
|
1158
1163
|
|
1159
1164
|
end
|
1160
1165
|
end
|
1161
|
-
path = Dir.pwd+"/#{
|
1166
|
+
path = Dir.pwd+"/#{image_name}.tar.gz"
|
1162
1167
|
@files = Cnvrg::Files.new(owner, "")
|
1163
1168
|
|
1164
1169
|
say "Downloading image file", Thor::Shell::Color::BLUE
|
1165
1170
|
begin
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1171
|
+
image_path = @files.download_image(path, image_id, owner)
|
1172
|
+
return image_path
|
1173
|
+
# if res
|
1174
|
+
# checks = Helpers.checkmark()
|
1175
|
+
# say "#{checks} Done", Thor::Shell::Color::GREEN
|
1176
|
+
# log_end(0)
|
1177
|
+
# return true
|
1178
|
+
# else
|
1179
|
+
# say "Couldn't download image #{image_name}", Thor::Shell::Color::RED
|
1180
|
+
# log_end(1,"can't download image")
|
1181
|
+
# return false
|
1182
|
+
# end
|
1177
1183
|
rescue Interrupt
|
1178
1184
|
log_end(-1)
|
1179
1185
|
say "The user has exited to process, aborting", Thor::Shell::Color::BLUE
|
@@ -1224,15 +1230,16 @@ module Cnvrg
|
|
1224
1230
|
verify_logged_in(false)
|
1225
1231
|
log_start(__method__,args,options)
|
1226
1232
|
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
if
|
1231
|
-
|
1233
|
+
path = download_image(image_name)
|
1234
|
+
if path
|
1235
|
+
image = Docker::Image.import(path)
|
1236
|
+
if not image.nil?
|
1237
|
+
return image
|
1232
1238
|
log_end(0)
|
1233
1239
|
else
|
1234
|
-
say
|
1240
|
+
say "Could not download image", Thor::Shell::Color::RED
|
1235
1241
|
log_end(1,loadRes)
|
1242
|
+
retunr false
|
1236
1243
|
end
|
1237
1244
|
|
1238
1245
|
end
|
data/lib/cnvrg/files.rb
CHANGED
@@ -86,15 +86,15 @@ module Cnvrg
|
|
86
86
|
path = download_resp["result"]["path"]
|
87
87
|
|
88
88
|
if Cnvrg::CLI.is_response_success(download_resp, false)
|
89
|
-
begin
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
rescue
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
return
|
89
|
+
# begin
|
90
|
+
# open(file_path_to_store, 'wb') do |file|
|
91
|
+
# file << open(path).read
|
92
|
+
# end
|
93
|
+
# rescue
|
94
|
+
# return false
|
95
|
+
# end
|
96
|
+
|
97
|
+
return path
|
98
98
|
else
|
99
99
|
return false
|
100
100
|
end
|
data/lib/cnvrg/job.rb
CHANGED
data/lib/cnvrg/version.rb
CHANGED