cnvrg 2.0.13 → 2.0.18

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
  SHA256:
3
- metadata.gz: 0e2e22e961bc723442ec80d457f0dde2b982f1c75beb2e859bb5523e83682fbe
4
- data.tar.gz: 645a4add593bcf3a63be4d64b4ccb45000e39447e7e11b9fd674347856e2bf97
3
+ metadata.gz: 30e82404c79b7780d736c0f4996ab1173cbbbfbc13a68c58a0dc0364775c7d5d
4
+ data.tar.gz: 6a846acb27781403e27c39ffd36f2b2149b771307b49375356cabd8f769fafba
5
5
  SHA512:
6
- metadata.gz: 2af7a28b7b428f8b4066a1b3f01bada7273eaa93ea847f87badc253aea2123244ad27ab3804cda5f4cdcee91cc2cc0ed7dd168b347839f59a6c183a702438167
7
- data.tar.gz: dc151c1ab54d54a86648b9f1341d402d0eb6fb8d578cc0a01f2594a28a34bfb8d97676d07aa389a8b1155fa466845f87be9b1dffbfcc2bcda33376937ecef418
6
+ metadata.gz: af34ebd4026b57c3111686f066f5c88cda3851ba27fe13a8273848274b614ba088d055ba1334c85842aea1142a113701e1de63ddf0ca5dc141c891762678dcac
7
+ data.tar.gz: 79fe82877378207d25a7ab4a7f73414fde0d90a5df128e4c1bd513a3f441822e5a67f9d8f04986b266ee111a66084875008a862926e285f94960cb2a90b49198
data/Readme.md CHANGED
@@ -59,4 +59,19 @@
59
59
  * DEV-11544 - Sub-bug: local experiment is failing to run
60
60
  ## Version v2.0.13
61
61
  2021-10-27
62
- * DEV-11054 - Task: Create organization and user by default
62
+ * DEV-11054 - Task: Create organization and user by default
63
+ ## Version v2.0.14
64
+ 2021-11-11
65
+ * DEV-11834 - Sub-task: add device name to hpu metrics
66
+ ## Version v2.0.15
67
+ 2021-12-12
68
+ * DEV-12316 - Improvement: cli login should identify saas users automatically
69
+ ## Version v2.0.16
70
+ 2021-12-16
71
+ * DEV-12316 - Improvement: cli login should identify saas users automatically
72
+ ## Version v2.0.17
73
+ 2021-12-19
74
+ * DEV-10581 - Bug: CLI - getting 404 response in "cnvrg set_default_owner"
75
+ ## Version v2.0.18
76
+ 2022-01-31
77
+ * DEV-12637 - Bug: Dataset - creating file from CLI/SDK in a folder with + sign, replaces + with space AND creates 2 folders
data/lib/cnvrg/cli.rb CHANGED
@@ -363,7 +363,7 @@ module Cnvrg
363
363
  config = YAML.load_file(path)
364
364
 
365
365
  username = config.to_h[:username]
366
- res = Cnvrg::API.request("/users/#{username}/get_possible_owners", 'GET')
366
+ res = Cnvrg::API.request("/api/v1/users/#{username}/get_possible_owners", 'GET')
367
367
  if Cnvrg::CLI.is_response_success(res)
368
368
  owner = username
369
369
  result = res["result"]
@@ -372,7 +372,6 @@ module Cnvrg
372
372
  choose_owner = result["username"]
373
373
  if owners.empty?
374
374
  else
375
- owners << choose_owner
376
375
  chosen = false
377
376
  while !chosen
378
377
  owners_id = owners.each_with_index.map {|x, i| "#{i + 1}. #{x}"}
@@ -517,6 +516,8 @@ module Cnvrg
517
516
  exit(0)
518
517
  end
519
518
  @email = ask("Enter your email:")
519
+ url = Cnvrg::API.endpoint_uri()
520
+ use_token = true if url.include?("cloud.cnvrg.io")
520
521
  if use_token
521
522
  @token = cmd.ask("Enter your token (hidden):") {|q| q.echo = "*"}
522
523
  netrc[Cnvrg::Helpers.netrc_domain] = @email, @token
@@ -4711,6 +4712,7 @@ module Cnvrg
4711
4712
  data_result.each_with_index do |res, i|
4712
4713
  timestamp, value = res["value"]
4713
4714
  uuid = res["metric"]["UUID"].presence || i
4715
+ uuid = res["metric"]["device"] if query_name == "gaudi"
4714
4716
  stat_value = value.present? ? ("%.2f" % value) : 0 # converting 34.685929244444445 to 34.69
4715
4717
  stat_value = stat_value.to_i == stat_value.to_f ? stat_value.to_i : stat_value.to_f # converting 34.00 to 34
4716
4718
  if query_name.include? 'block'
@@ -8,7 +8,7 @@ require 'fileutils'
8
8
  module Cnvrg
9
9
  class Datafiles
10
10
  ParallelThreads ||= Cnvrg::Helpers.parallel_threads
11
-
11
+ DIRECTORY_REGEX = /^[a-zA-Z0-9_\/-]+$/
12
12
  LARGE_FILE=1024*1024*5
13
13
  MULTIPART_SPLIT=10000000
14
14
  RETRIES = ENV['UPLOAD_FILE_RETRIES'].try(:to_i) || 10
@@ -56,9 +56,19 @@ module Cnvrg
56
56
  end
57
57
  raise SignalException.new(1, "Cant find file #{file}") unless File.exists? "#{Dir.pwd}/#{file}"
58
58
  end
59
+ is_valid_directory?(paths)
59
60
  paths
60
61
  end
61
62
 
63
+ def is_valid_directory?(paths)
64
+ paths.each do |path|
65
+ path = path.gsub('./', '')
66
+ if !path.match(DIRECTORY_REGEX) and File.directory? path
67
+ raise SignalException.new(1, "#{path} is invalid directory name, should contain letters, numbers, '_' , '-'")
68
+ end
69
+ end
70
+ end
71
+
62
72
  def get_files_and_folders(paths)
63
73
  files_and_folders = {}
64
74
  paths.each do |file|
data/lib/cnvrg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cnvrg
2
- VERSION = '2.0.13'
2
+ VERSION = '2.0.18'
3
3
  end
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.13
4
+ version: 2.0.18
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-10-27 00:00:00.000000000 Z
13
+ date: 2022-01-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -488,7 +488,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
488
488
  - !ruby/object:Gem::Version
489
489
  version: '0'
490
490
  requirements: []
491
- rubygems_version: 3.2.22
491
+ rubygems_version: 3.0.3
492
492
  signing_key:
493
493
  specification_version: 4
494
494
  summary: A CLI tool for interacting with cnvrg.io.