cnvrg 0.0.145 → 0.0.146
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 +354 -85
- data/lib/cnvrg/data.rb +26 -0
- data/lib/cnvrg/datafiles.rb +376 -0
- data/lib/cnvrg/dataset.rb +196 -0
- data/lib/cnvrg/experiment.rb +6 -4
- data/lib/cnvrg/files.rb +7 -2
- data/lib/cnvrg/version.rb +1 -1
- metadata +5 -2
data/lib/cnvrg/experiment.rb
CHANGED
@@ -9,10 +9,10 @@ module Cnvrg
|
|
9
9
|
@slug = nil
|
10
10
|
end
|
11
11
|
|
12
|
-
def start(input, platform, machine_name, start_commit, name, email_notification, machine_activity)
|
12
|
+
def start(input, platform, machine_name, start_commit, name, email_notification, machine_activity,script_path)
|
13
13
|
res = Cnvrg::API.request(@base_resource + "experiment/start", 'POST',
|
14
14
|
{input: input, platform: platform, machine_name: machine_name, start_commit: start_commit,
|
15
|
-
title: name, email_notification: email_notification, machine_activity: machine_activity})
|
15
|
+
title: name, email_notification: email_notification, machine_activity: machine_activity,script_path:script_path})
|
16
16
|
Cnvrg::CLI.is_response_success(res)
|
17
17
|
|
18
18
|
@slug = res.to_h["result"].to_h["slug"]
|
@@ -78,13 +78,15 @@ module Cnvrg
|
|
78
78
|
|
79
79
|
end
|
80
80
|
|
81
|
-
def exec_remote(command, commit_to_run, instance_type, image_slug,scheduling_query,local_timestamp, grid)
|
81
|
+
def exec_remote(command, commit_to_run, instance_type, image_slug,scheduling_query,local_timestamp, grid,path_to_cmd)
|
82
|
+
|
82
83
|
response = Cnvrg::API.request("users/#{@owner}/projects/#{@project_slug}/experiment/remote", 'POST', {command: command, image_slug: image_slug,
|
83
84
|
commit_sha1: commit_to_run,
|
84
85
|
instance_type: instance_type,
|
85
86
|
scheduling_query:scheduling_query,
|
86
87
|
local_timestamp:local_timestamp,
|
87
|
-
|
88
|
+
grid: grid,
|
89
|
+
path_to_cmd:path_to_cmd})
|
88
90
|
return response
|
89
91
|
end
|
90
92
|
|
data/lib/cnvrg/files.rb
CHANGED
@@ -5,7 +5,7 @@ require 'URLcrypt'
|
|
5
5
|
module Cnvrg
|
6
6
|
class Files
|
7
7
|
|
8
|
-
LARGE_FILE=1024*1024*
|
8
|
+
LARGE_FILE=1024*1024*5
|
9
9
|
attr_reader :base_resource
|
10
10
|
|
11
11
|
def initialize(owner, project_slug)
|
@@ -213,6 +213,8 @@ module Cnvrg
|
|
213
213
|
body = response.read_body
|
214
214
|
end
|
215
215
|
URLcrypt::key = [body].pack('H*')
|
216
|
+
puts "file_size: #{File.size(file_path).to_f}"
|
217
|
+
puts "start_time: #{Time.now}"
|
216
218
|
s3 = Aws::S3::Resource.new(
|
217
219
|
:access_key_id => URLcrypt.decrypt(upload_resp["result"]["sts_a"]),
|
218
220
|
:secret_access_key => URLcrypt.decrypt(upload_resp["result"]["sts_s"]),
|
@@ -220,9 +222,12 @@ module Cnvrg
|
|
220
222
|
:region => URLcrypt.decrypt(upload_resp["result"]["region"]))
|
221
223
|
resp = s3.bucket(URLcrypt.decrypt(upload_resp["result"]["bucket"])).
|
222
224
|
object(upload_resp["result"]["path"]+"/"+File.basename(file_path)).
|
223
|
-
upload_file(file_path)
|
225
|
+
upload_file(file_path,{:use_accelerate_endpoint=>true})
|
226
|
+
puts "end_time: #{Time.now}"
|
227
|
+
|
224
228
|
return resp
|
225
229
|
rescue =>e
|
230
|
+
puts e
|
226
231
|
return false
|
227
232
|
|
228
233
|
end
|
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.146
|
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-04-
|
12
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -330,6 +330,9 @@ files:
|
|
330
330
|
- lib/cnvrg/api.rb
|
331
331
|
- lib/cnvrg/auth.rb
|
332
332
|
- lib/cnvrg/cli.rb
|
333
|
+
- lib/cnvrg/data.rb
|
334
|
+
- lib/cnvrg/datafiles.rb
|
335
|
+
- lib/cnvrg/dataset.rb
|
333
336
|
- lib/cnvrg/experiment.rb
|
334
337
|
- lib/cnvrg/files.rb
|
335
338
|
- lib/cnvrg/helpers.rb
|