cnvrg 2.0.6 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +15 -1
- data/lib/cnvrg/cli/library_cli.rb +2 -2
- data/lib/cnvrg/cli.rb +96 -38
- data/lib/cnvrg/project.rb +5 -1
- data/lib/cnvrg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86857e06a0d107172c161467e8ff8cb04a120d8b230c97843e91ce13c826ccce
|
4
|
+
data.tar.gz: 272fe88e1e390f2887c36c49915cc89f10a6cf9947bb98ab6fd503476ac03820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c28ab54953e47843897273f8038f5e0bfc92e101e161d1edae4477250e1334b5730b5020713572ad2482c5b0c305c5c0b2c5725b8796a44c06750eccf2924e9f
|
7
|
+
data.tar.gz: 69be0cd1fc89180ce7b878aaa8e0767b5be9a00cb0c9813c504e62677c1c839831aa6cf4fbf27aeb66aa50b756f7b28f46eb721182e588bcc4b7c65544e6a41b
|
data/Readme.md
CHANGED
@@ -39,4 +39,18 @@
|
|
39
39
|
* DEV-10189 - Bug: CLI Sync -file/folder with broken symlink will cause sync to fail
|
40
40
|
## Version v2.0.6
|
41
41
|
2021-07-18
|
42
|
-
* DEV-10209 - Bug: some experiments in grid failed on cnvrg-cli commands (docker container id was missing)
|
42
|
+
* DEV-10209 - Bug: some experiments in grid failed on cnvrg-cli commands (docker container id was missing)
|
43
|
+
## Version v2.0.7
|
44
|
+
2021-07-27
|
45
|
+
* DEV-10186 - Bug: CLI/run an experiment with --local tag giver server error
|
46
|
+
## Version v2.0.8
|
47
|
+
2021-09-06
|
48
|
+
* DEV-10697 - Bug: Tensorboard not starting in workspace and experiment.
|
49
|
+
## Version v2.0.9
|
50
|
+
2021-09-12
|
51
|
+
* DEV-10502 - Bug: Periodic sync stuck
|
52
|
+
## Version v2.0.10
|
53
|
+
2021-09-12
|
54
|
+
* DEV-10502 - Bug: Periodic sync stuck
|
55
|
+
## Version v2.0.11
|
56
|
+
2021-10-21
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -3147,7 +3147,7 @@ module Cnvrg
|
|
3147
3147
|
invoke :exec, [cmd], :sync_before => sync_before, :sync_after => sync_after, :title => title,
|
3148
3148
|
:log => log, :email_notification => email_notification, :upload_output => upload_output,
|
3149
3149
|
:commit => commit, :image => image, :data => data, :data_commit => data_commit,
|
3150
|
-
:ignore => ignore, :force => force, :output_dir=>output_dir, :data_query=>data_query
|
3150
|
+
:ignore => ignore, :force => force, :output_dir=>output_dir, :data_query=>data_query, :local => local
|
3151
3151
|
return
|
3152
3152
|
end
|
3153
3153
|
else
|
@@ -3204,6 +3204,7 @@ module Cnvrg
|
|
3204
3204
|
method_option :data_query, :type => :string, :aliases => ["-q", "--query"], :default => nil
|
3205
3205
|
method_option :use_bash, :type => :boolean, :aliases => ["-b", "--use_bash"], :default => false
|
3206
3206
|
method_option :docker_stats, :type => :boolean, :aliases => ["--docker_stats"], :default => true
|
3207
|
+
method_option :local, :type => :boolean, :aliases => ["-l", "--local"], :default => false
|
3207
3208
|
|
3208
3209
|
def exec(*cmd)
|
3209
3210
|
log = []
|
@@ -3228,6 +3229,7 @@ module Cnvrg
|
|
3228
3229
|
project_home = get_project_home
|
3229
3230
|
data_query = options["data_query"]
|
3230
3231
|
docker_stats = options["docker_stats"]
|
3232
|
+
local = options[:local] || false
|
3231
3233
|
@project = Project.new(project_home)
|
3232
3234
|
if @project.is_git
|
3233
3235
|
sync_before = false
|
@@ -3323,43 +3325,49 @@ module Cnvrg
|
|
3323
3325
|
if @exp.get_cmd.present?
|
3324
3326
|
cmd = @exp.get_cmd
|
3325
3327
|
end
|
3326
|
-
|
3327
|
-
|
3328
|
-
|
3329
|
-
|
3330
|
-
|
3331
|
-
|
3332
|
-
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
|
3338
|
-
|
3339
|
-
|
3340
|
-
|
3341
|
-
|
3342
|
-
|
3343
|
-
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3353
|
-
|
3354
|
-
|
3355
|
-
|
3356
|
-
|
3357
|
-
|
3358
|
-
log
|
3359
|
-
|
3328
|
+
|
3329
|
+
if local
|
3330
|
+
exec_local(cmd)
|
3331
|
+
exit_status = $?.exitstatus
|
3332
|
+
|
3333
|
+
else
|
3334
|
+
command_slug = (0...18).map { (65 + rand(26)).chr }.join
|
3335
|
+
result_file = "/conf/result-#{command_slug}"
|
3336
|
+
data = {cmd: cmd, async: true, format: true, file_name: result_file, use_script: true, use_bash: options["use_bash"]}
|
3337
|
+
conn = Cnvrg::Helpers::Executer.get_main_conn
|
3338
|
+
response = conn.post('command', data.to_json)
|
3339
|
+
if response.to_hash[:status].to_i != 200
|
3340
|
+
exit_status = 129
|
3341
|
+
raise StandardError.new("Cant send command to slave")
|
3342
|
+
end
|
3343
|
+
t = FileWatch::Tail.new
|
3344
|
+
filename = result_file
|
3345
|
+
lines = []
|
3346
|
+
t.tail(filename)
|
3347
|
+
t.subscribe do |path, line|
|
3348
|
+
begin
|
3349
|
+
cur_log = JSON.parse(line)
|
3350
|
+
if cur_log["type"] == "endMessage"
|
3351
|
+
exit_status = cur_log["real"].to_i
|
3352
|
+
break
|
3353
|
+
else
|
3354
|
+
puts(cur_log.to_json)
|
3355
|
+
STDOUT.flush
|
3356
|
+
cur_log["time"] = Time.parse(cur_log["timestamp"])
|
3357
|
+
cur_log["message"] = cur_log["message"].to_s + "\r\n"
|
3358
|
+
log << cur_log
|
3359
|
+
end
|
3360
|
+
if log.size >= 10
|
3361
|
+
@exp.upload_temp_log(log)
|
3362
|
+
log = []
|
3363
|
+
elsif (start_time + 15.seconds) <= Time.now
|
3364
|
+
@exp.upload_temp_log(log) unless log.empty?
|
3365
|
+
log = []
|
3366
|
+
start_time = Time.now
|
3367
|
+
end
|
3368
|
+
rescue => e
|
3369
|
+
log_error(e)
|
3360
3370
|
end
|
3361
|
-
rescue => e
|
3362
|
-
log_error(e)
|
3363
3371
|
end
|
3364
3372
|
end
|
3365
3373
|
end_time = Time.now
|
@@ -5007,7 +5015,7 @@ module Cnvrg
|
|
5007
5015
|
end
|
5008
5016
|
end
|
5009
5017
|
|
5010
|
-
desc 'experiments', 'List project experiments'
|
5018
|
+
desc 'experiments', 'List project experiments', :hide => true
|
5011
5019
|
method_option :id, :type => :string, :aliases => ["--id"], :desc => "Get info for specific experiments", :default => ""
|
5012
5020
|
method_option :tag, :type => :string, :aliases => ["-t"], :desc => "Get info for specific experiment tag", :default => ""
|
5013
5021
|
|
@@ -5876,6 +5884,56 @@ module Cnvrg
|
|
5876
5884
|
end
|
5877
5885
|
end
|
5878
5886
|
|
5887
|
+
def exec_local(cmd)
|
5888
|
+
PTY.spawn(@exp.as_env, cmd) do |stdout, stdin, pid, stderr|
|
5889
|
+
begin
|
5890
|
+
stdout.each do |line|
|
5891
|
+
cur_time = Time.now
|
5892
|
+
real_time = Time.now - real
|
5893
|
+
cur_log = {time: cur_time,
|
5894
|
+
message: line,
|
5895
|
+
type: "stdout",
|
5896
|
+
real: real_time
|
5897
|
+
}
|
5898
|
+
if print_log
|
5899
|
+
puts({log: line, timestamp: Time.now, exp_logs: true}.to_json)
|
5900
|
+
end
|
5901
|
+
log << cur_log
|
5902
|
+
if log.size >= 10
|
5903
|
+
@exp.upload_temp_log(log) unless log.empty?
|
5904
|
+
log = []
|
5905
|
+
elsif (start_time + 15.seconds) <= Time.now
|
5906
|
+
@exp.upload_temp_log(log) unless log.empty?
|
5907
|
+
log = []
|
5908
|
+
start_time = Time.now
|
5909
|
+
end
|
5910
|
+
end
|
5911
|
+
if stderr
|
5912
|
+
stderr.each do |err|
|
5913
|
+
log << {time: Time.now, message: err, type: "stderr"}
|
5914
|
+
end
|
5915
|
+
end
|
5916
|
+
rescue Errno::EIO => e
|
5917
|
+
log_error(e)
|
5918
|
+
if !log.empty?
|
5919
|
+
temp_log = log
|
5920
|
+
@exp.upload_temp_log(temp_log) unless temp_log.empty?
|
5921
|
+
log -= temp_log
|
5922
|
+
end
|
5923
|
+
rescue Errno::ENOENT => e
|
5924
|
+
exp_success = false
|
5925
|
+
log_message("command \"#{cmd}\" couldn't be executed, verify command is valid", Thor::Shell::Color::RED)
|
5926
|
+
log_error(e)
|
5927
|
+
rescue => e
|
5928
|
+
res = @exp.end(log, 1, start_commit, 0, 0)
|
5929
|
+
log_message("Error occurred,aborting", Thor::Shell::Color::RED)
|
5930
|
+
log_error(e)
|
5931
|
+
exit(0)
|
5932
|
+
end
|
5933
|
+
::Process.wait pid
|
5934
|
+
end
|
5935
|
+
end
|
5936
|
+
|
5879
5937
|
end
|
5880
5938
|
end
|
5881
5939
|
|
data/lib/cnvrg/project.rb
CHANGED
@@ -661,7 +661,11 @@ module Cnvrg
|
|
661
661
|
|
662
662
|
def fetch_webapp_slugs(webapp_slug, slugs: nil)
|
663
663
|
response = Cnvrg::API_V2.request("#{self.owner}/projects/#{self.slug}/webapps/#{webapp_slug}" , 'GET')
|
664
|
-
|
664
|
+
|
665
|
+
if response.key?("experiments")
|
666
|
+
return response["experiments"]
|
667
|
+
end
|
668
|
+
return response["data"]["attributes"]["experiments"]
|
665
669
|
rescue
|
666
670
|
slugs
|
667
671
|
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: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yochay Ettun
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|