cnvrg 0.2.7 → 0.2.8

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: b9b8198ef7c07b5e104013d85ea8cafab151bd82
4
- data.tar.gz: 285b8c2c3213db29c8e01d8e0d0937e465ee5427
3
+ metadata.gz: 7e4fccd072cdc474ad9026a8e1e5236c46bc8499
4
+ data.tar.gz: 25b637b549743301d8f585b16e07d0cdcd34c571
5
5
  SHA512:
6
- metadata.gz: 46dc6ef133915f5db232df9452a05ad0ef7be0a210f9e3d88e8a1b484aed0ddcc30657a1ff172148b1648c11ca7d150fb44387ab8970cb087c35d26cfb2c60d7
7
- data.tar.gz: bf4085d68ce2e0b4de724b6208ea9496a11407e14b720bfcec50e909f0a87d8d6575af344d5289f29912770e39b8d92677197bc5c37c1e79d518829c29bd9085
6
+ metadata.gz: a82144ff4a9fb1dd56e43b49079ec095746e3b9a291a27e88d14b602b6366145a5a1f5d1fcc39628918f16258ef77287659014ed15e05d3c9e1f4745f23e4713
7
+ data.tar.gz: d306d2f0efba9ddb0221705b97830dd4f4ef9378a032662b83a3dc47022140620217000db1c43ee0d9ae91f937f9a45a44551ffc74c95b15fb7f63c8ea40ed65
@@ -1703,6 +1703,7 @@ module Cnvrg
1703
1703
  method_option :verbose, :type => :boolean, :aliases => ["-v"], :default => false
1704
1704
  method_option :sync, :type => :boolean, :aliases => ["-s"], :default => false
1705
1705
  method_option :force, :type => :boolean, :aliases => ["-f","--force"], :default => false
1706
+ method_option :message, :type => :string, :aliases => ["-m", "--message"], :default => ""
1706
1707
 
1707
1708
  def upload(link=false, sync=false, direct=false, ignore_list="")
1708
1709
 
@@ -1711,6 +1712,10 @@ module Cnvrg
1711
1712
  log_start(__method__, args, options)
1712
1713
 
1713
1714
  @project = Project.new(get_project_home)
1715
+ commit_msg = options["message"]
1716
+ if commit_msg.nil? or commit_msg.empty?
1717
+ commit_msg = ""
1718
+ end
1714
1719
 
1715
1720
  @files = Cnvrg::Files.new(@project.owner, @project.slug)
1716
1721
  ignore = options[:ignore] || ""
@@ -1911,7 +1916,7 @@ module Cnvrg
1911
1916
  end
1912
1917
 
1913
1918
  if update_count == update_total
1914
- res = @files.end_commit(commit_sha1,force:force)
1919
+ res = @files.end_commit(commit_sha1,force:force,message:commit_msg)
1915
1920
  if (Cnvrg::CLI.is_response_success(res, false))
1916
1921
  # save idx
1917
1922
  begin
@@ -2354,6 +2359,7 @@ module Cnvrg
2354
2359
  method_option :verbose, :type => :boolean, :aliases => ["-v"], :default => false
2355
2360
  method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :default => ""
2356
2361
  method_option :force, :type => :boolean, :aliases => ["-f","--force"], :default => false
2362
+ method_option :message, :type => :string, :aliases => ["-m", "--message"], :default => ""
2357
2363
 
2358
2364
  def sync(direct=true)
2359
2365
  verify_logged_in(true) if direct
@@ -2366,7 +2372,7 @@ module Cnvrg
2366
2372
 
2367
2373
 
2368
2374
  invoke :upload, [link=false, sync=true, direct=direct], :new_branch => options["new_branch"], :verbose => options["verbose"], :sync => true,
2369
- :ignore => options[:ignore], :force=> options[:force]
2375
+ :ignore => options[:ignore], :force=> options[:force], :message=>options[:message]
2370
2376
 
2371
2377
 
2372
2378
  end
@@ -3071,7 +3077,7 @@ module Cnvrg
3071
3077
  str = "#{check} Experiment's is on: #{Cnvrg::Helpers.remote_url}/#{project.owner}/projects/#{project.slug}/experiments/#{res["result"]["exp_url"]}"
3072
3078
 
3073
3079
  if res["result"]["grid"]
3074
- str = "Running grid search. #{Cnvrg::Helpers.remote_url}/#{project.owner}/projects/#{project.slug}/experiments?grid=#{res["result"]["exp_url"]} "
3080
+ str = "Running grid search, follow here: #{Cnvrg::Helpers.remote_url}/#{project.owner}/projects/#{project.slug}/experiments?grid=#{res["result"]["exp_url"]}"
3075
3081
  end
3076
3082
 
3077
3083
  log_message(str, Thor::Shell::Color::GREEN)
@@ -233,11 +233,37 @@ module Cnvrg
233
233
  if local_idx.nil?
234
234
  local_idx = self.generate_idx
235
235
  end
236
+ ignore_list = self.send_ignore_list()
236
237
 
237
- response = Cnvrg::API.request("users/#{self.owner}/datasets/#{self.slug}/status", 'POST', {idx: local_idx, new_branch: new_branch, current_commit: commit})
238
+ response = Cnvrg::API.request("users/#{self.owner}/datasets/#{self.slug}/status", 'POST', {idx: local_idx, new_branch: new_branch, current_commit: commit, ignore:ignore_list})
238
239
  CLI.is_response_success(response,false)
239
240
  return response
240
241
  end
242
+ def send_ignore_list()
243
+ begin
244
+ ignore_list = []
245
+ File.open(self.local_path+"/.cnvrgignore", "r").each_line do |line|
246
+ line = line.strip
247
+ if line.start_with? "#" or ignore_list.include? line or line.empty?
248
+ next
249
+ end
250
+ if line.end_with? "/"
251
+ ignore_list << line.gsub("/","")
252
+ ignore_list << line+"."
253
+ elsif line.include? "*"
254
+ line = line.gsub("*",".*")
255
+ ignore_list << line
256
+ else
257
+ ignore_list << line
258
+ end
259
+ end
260
+ return ignore_list.flatten
261
+ rescue
262
+ return []
263
+ end
264
+
265
+ end
266
+
241
267
 
242
268
 
243
269
 
@@ -567,8 +567,8 @@ module Cnvrg
567
567
  return response
568
568
  end
569
569
 
570
- def end_commit(commit_sha1,force:false)
571
- response = Cnvrg::API.request("#{base_resource}/commit/end", 'POST', {commit_sha1: commit_sha1,force:force})
570
+ def end_commit(commit_sha1,force:false,message:"")
571
+ response = Cnvrg::API.request("#{base_resource}/commit/end", 'POST', {commit_sha1: commit_sha1,force:force,message:message})
572
572
  return response
573
573
  end
574
574
 
@@ -1,4 +1,4 @@
1
1
  module Cnvrg
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
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.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yochay Ettun
@@ -416,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
416
416
  version: '0'
417
417
  requirements: []
418
418
  rubyforge_project:
419
- rubygems_version: 2.5.1
419
+ rubygems_version: 2.6.12
420
420
  signing_key:
421
421
  specification_version: 4
422
422
  summary: A CLI tool for interacting with cnvrg.io.