cnvrg 1.6.0.9 → 1.6.0.13
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 +18 -6
- data/lib/cnvrg/experiment.rb +5 -2
- data/lib/cnvrg/project.rb +6 -1
- data/lib/cnvrg/version.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 345b4c6497b1f7621f04a5d5ec4fb7d51d1939da11cb59e70ba5fda466dd8755
|
4
|
+
data.tar.gz: e8321196067449dac95a2e12d2adf74853ebde8f4eda0f0783337a6b5854ea88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b89ffd39a4a95a583de590188708036ca82cf364c058b7de40b9b95f622daa289f44481a5afa880753f26446495ee5a731a3136441ab2626ecdef33a206e457
|
7
|
+
data.tar.gz: baf172073f91d7d29495d4cb3fcbadef8b396ea7e8b066c11fcd692e01daeb2be9dbb60e9db8fa619b7294ce00be2a9ad1e4fd156ba2f067eacbcf78aa32e1b2
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -2854,14 +2854,15 @@ module Cnvrg
|
|
2854
2854
|
method_option :job_type, :type => :string, :aliases => ["-jt", "--job_type"], :default => nil
|
2855
2855
|
method_option :files, :type => :string, :aliases => ["--files"], :default => nil
|
2856
2856
|
method_option :output_dir, :type => :string, :aliases => ["--output_dir"], :default => nil
|
2857
|
-
def
|
2857
|
+
def sync(direct = true)
|
2858
2858
|
verify_logged_in(true) if direct
|
2859
2859
|
@project = Project.new(get_project_home)
|
2860
2860
|
log_start(__method__, args, options)
|
2861
2861
|
log_message('Checking for new updates from remote version', Thor::Shell::Color::BLUE, options["verbose"])
|
2862
2862
|
log_message('Syncing project', Thor::Shell::Color::BLUE, !options["verbose"])
|
2863
|
-
job_slug = options['job_slug']
|
2864
|
-
job_type = options['job_type']
|
2863
|
+
job_slug = options['job_slug'] || ENV['CNVRG_JOB_ID']
|
2864
|
+
job_type = options['job_type'] || ENV['CNVRG_JOB_TYPE']
|
2865
|
+
is_git = ENV['CNVRG_GIT_PROJECT'] == "true" || @project.is_git
|
2865
2866
|
in_exp = options["in_exp"] || (job_slug.present? and job_type.present?)
|
2866
2867
|
in_exp = false if job_type.present? and job_type == "NotebookSession"
|
2867
2868
|
run_download = true
|
@@ -2913,6 +2914,8 @@ module Cnvrg
|
|
2913
2914
|
method_option :local_folders, :type => :string, :aliases => ["--local_folders"], :default => nil
|
2914
2915
|
method_option :prerun, :type => :boolean, :aliases => ["-p", "--prerun"], :default => true
|
2915
2916
|
method_option :requirements, :type => :boolean, :aliases => ["-r", "--requirements"], :default => true
|
2917
|
+
method_option :notify_on_error, :type => :boolean, :aliases => ["-noe", "--notify_on_error"], :default => nil
|
2918
|
+
method_option :notify_on_success, :type => :boolean, :aliases => ["-nos", "--notify_on_success"], :default => nil
|
2916
2919
|
|
2917
2920
|
def run(*cmd)
|
2918
2921
|
verify_logged_in(true)
|
@@ -2944,6 +2947,8 @@ module Cnvrg
|
|
2944
2947
|
local_folders = options["local_folders"]
|
2945
2948
|
prerun = options["prerun"]
|
2946
2949
|
requirements = options["requirements"]
|
2950
|
+
email_notification_error = options["notify_on_error"]
|
2951
|
+
email_notification_success = options["notify_on_success"]
|
2947
2952
|
|
2948
2953
|
if !data.present? and data_query.present?
|
2949
2954
|
log_message("Please provide data with data_query", Thor::Shell::Color::RED)
|
@@ -2993,7 +2998,8 @@ module Cnvrg
|
|
2993
2998
|
:max_time => max_time,
|
2994
2999
|
:periodic_sync => periodic_sync, :dataset_only_tree=> dataset_only_tree,
|
2995
3000
|
:output_dir=>output_dir, :data_query=>data_query, :git_commit =>git_commit, :git_branch=> git_branch,
|
2996
|
-
:restart_if_stuck =>restart_if_stuck, :local_folders => local_folders, :datasets => datasets, :prerun => prerun, :requirements => requirements
|
3001
|
+
:restart_if_stuck =>restart_if_stuck, :local_folders => local_folders, :datasets => datasets, :prerun => prerun, :requirements => requirements,
|
3002
|
+
:email_notification_error => email_notification_error, :email_notification_success => email_notification_success
|
2997
3003
|
return
|
2998
3004
|
end
|
2999
3005
|
|
@@ -3299,6 +3305,8 @@ module Cnvrg
|
|
3299
3305
|
method_option :datasets, :type => :string, :aliases => ["--datasets"], :default => nil
|
3300
3306
|
method_option :prerun, :type => :boolean, :aliases => ["-p", "--prerun"], :default => true
|
3301
3307
|
method_option :requirements, :type => :boolean, :aliases => ["-r", "--requirements"], :default => true
|
3308
|
+
method_option :email_notification_error, :type => :boolean, :aliases => ["--email_notification_error"], :default => true
|
3309
|
+
method_option :email_notification_success, :type => :boolean, :aliases => ["--email_notification_success"], :default => true
|
3302
3310
|
|
3303
3311
|
def exec_remote(*cmd)
|
3304
3312
|
|
@@ -3318,6 +3326,8 @@ module Cnvrg
|
|
3318
3326
|
force = options["force"]
|
3319
3327
|
prerun = options["prerun"]
|
3320
3328
|
requirements = options["requirements"]
|
3329
|
+
email_notification_error = options["email_notification_error"]
|
3330
|
+
email_notification_success = options["email_notification_success"]
|
3321
3331
|
max_time = options["max_time"]
|
3322
3332
|
if !max_time.nil? and !max_time.empty?
|
3323
3333
|
max_time = max_time.to_i
|
@@ -3356,7 +3366,8 @@ module Cnvrg
|
|
3356
3366
|
local_folders_options = options["local_folders"]
|
3357
3367
|
options_hash.except!("schedule", "recurring", "machine_type", "image", "upload_output", "grid", "data", "data_commit", "title",
|
3358
3368
|
"local", "small", "medium", "large", "gpu", "gpuxl", "gpuxxl","max_time","dataset_only_tree",
|
3359
|
-
"data_query", "git_commit","git_branch", "restart_if_stuck","local_folders","output_dir", "commit", "datasets", "requirements", "prerun"
|
3369
|
+
"data_query", "git_commit","git_branch", "restart_if_stuck","local_folders","output_dir", "commit", "datasets", "requirements", "prerun",
|
3370
|
+
"email_notification_error", "email_notification_success")
|
3360
3371
|
exec_options = options_hash.map {|x| "--#{x[0]}=#{x[1]}"}.flatten.join(" ")
|
3361
3372
|
command = "#{exec_options} #{remote} #{upload_output_option} #{cmd.flatten.join(" ")}"
|
3362
3373
|
commit_to_run = options["commit"] || nil
|
@@ -3427,7 +3438,8 @@ module Cnvrg
|
|
3427
3438
|
|
3428
3439
|
res = exp.exec_remote(command, commit_to_run, instance_type, image, schedule, local_timestamp, grid, path_to_cmd, data, data_commit,
|
3429
3440
|
periodic_sync, sync_before_terminate, max_time, ds_sync_options,output_dir,
|
3430
|
-
data_query, git_commit, git_branch, restart_if_stuck,local_folders_options, title, datasets, prerun: prerun, requirements: requirements, recurring: recurring
|
3441
|
+
data_query, git_commit, git_branch, restart_if_stuck,local_folders_options, title, datasets, prerun: prerun, requirements: requirements, recurring: recurring,
|
3442
|
+
email_notification_error: email_notification_error, email_notification_success: email_notification_success)
|
3431
3443
|
if Cnvrg::CLI.is_response_success(res)
|
3432
3444
|
check = Helpers.checkmark()
|
3433
3445
|
str = "#{check} Experiment's is on: #{Cnvrg::Helpers.remote_url}/#{project.owner}/projects/#{project.slug}/experiments/#{res["result"]["exp_url"]}"
|
data/lib/cnvrg/experiment.rb
CHANGED
@@ -107,7 +107,8 @@ module Cnvrg
|
|
107
107
|
|
108
108
|
def exec_remote(command, commit_to_run, instance_type, image_slug,schedule,local_timestamp, grid,path_to_cmd,data, data_commit,periodic_sync,
|
109
109
|
sync_before_terminate, max_time, ds_sync_options=0,output_dir=nil,data_query=nil,
|
110
|
-
git_commit=nil, git_branch=nil, restart_if_stuck=nil, local_folders=nil,title=nil, datasets=nil, prerun: true, requirements: true, recurring: nil
|
110
|
+
git_commit=nil, git_branch=nil, restart_if_stuck=nil, local_folders=nil,title=nil, datasets=nil, prerun: true, requirements: true, recurring: nil,
|
111
|
+
email_notification_error: false, email_notification_success: false)
|
111
112
|
response = Cnvrg::API.request("users/#{@owner}/projects/#{@project_slug}/experiment/remote", 'POST', {command: command, image_slug: image_slug,
|
112
113
|
commit_sha1: commit_to_run,
|
113
114
|
instance_type: instance_type,
|
@@ -121,7 +122,9 @@ module Cnvrg
|
|
121
122
|
dataset_sync_options:ds_sync_options,output_dir:output_dir,
|
122
123
|
dataset_query:data_query,git_commit:git_commit,git_branch:git_branch,
|
123
124
|
restart_if_stuck:restart_if_stuck, local_folders: local_folders, title:title,
|
124
|
-
prerun: prerun, requirements: requirements, recurring: recurring
|
125
|
+
prerun: prerun, requirements: requirements, recurring: recurring,
|
126
|
+
email_notification_error: email_notification_error,
|
127
|
+
email_notification_success: email_notification_success})
|
125
128
|
|
126
129
|
return response
|
127
130
|
end
|
data/lib/cnvrg/project.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
|
2
5
|
module Cnvrg
|
3
6
|
class Project
|
4
7
|
attr_reader :slug, :owner, :title, :local_path, :working_dir, :is_git, :is_branch, :machines
|
@@ -426,8 +429,10 @@ module Cnvrg
|
|
426
429
|
end
|
427
430
|
list_ignore_new = list_ignore.map{|x| x.gsub("//","/")} rescue []
|
428
431
|
# list.each do |e|
|
432
|
+
project_root = Pathname.new(self.local_path)
|
429
433
|
Parallel.map(list, in_threads: IDXParallelThreads) do |e|
|
430
|
-
|
434
|
+
relative_path = Pathname.new(File.expand_path(e))
|
435
|
+
label = relative_path.relative_path_from(project_root)
|
431
436
|
if not Cnvrg::Files.valid_file_name?(label)
|
432
437
|
raise StandardError.new("#{label} is not a valid file name")
|
433
438
|
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: 1.6.0.
|
4
|
+
version: 1.6.0.13
|
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:
|
13
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -477,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
477
477
|
- !ruby/object:Gem::Version
|
478
478
|
version: '0'
|
479
479
|
requirements: []
|
480
|
-
rubygems_version: 3.0.
|
480
|
+
rubygems_version: 3.0.3
|
481
481
|
signing_key:
|
482
482
|
specification_version: 4
|
483
483
|
summary: A CLI tool for interacting with cnvrg.io.
|