cnvrg 1.5.6 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +4 -0
- data/lib/cnvrg/helpers/executer.rb +16 -4
- data/lib/cnvrg/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 773594ee55ab2260bc979dea185389b81838ebe9fe735ca8f632ddd3e81e76d9
|
4
|
+
data.tar.gz: 31bf3acaccd8064830b7323ad3eb8501a3a9c831c4942b10e8c121904d692ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61332fdcfd42e7d2f43dbc80c9d186f2e7bfe287c960998f4a8f55d7bf0b2705aff6cfca8737a8989ea86d38683f04498975ab7f24fbe1b60c940d1df656c94f
|
7
|
+
data.tar.gz: 93c4069fff847e2308e34b435fe4adbfa66a61b6487c64f83d400210831c7afb037d1e71241bb8f26da3f8397c20e43fc9465f42dc6a32131cef117f441d4ef3
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -870,6 +870,7 @@ module Cnvrg
|
|
870
870
|
if query.present?
|
871
871
|
return clone_data_query(dataset_url, query)
|
872
872
|
end
|
873
|
+
@executer = Cnvrg::Helpers::Executer.get_executer
|
873
874
|
|
874
875
|
url_parts = dataset_url.split("/")
|
875
876
|
project_index = Cnvrg::Helpers.look_for_in_path(dataset_url, "datasets")
|
@@ -920,6 +921,7 @@ module Cnvrg
|
|
920
921
|
progressbar.finish
|
921
922
|
if downloaded_files == files_count
|
922
923
|
Dataset.verify_cnvrgignore_exist(dataset_name, false)
|
924
|
+
@executer.set_dataset_status(dataset: @dataset.slug, status: "cloned") if @executer
|
923
925
|
if !read
|
924
926
|
@dataset.write_idx(nil, commit) #nil means, generate idx
|
925
927
|
end
|
@@ -945,6 +947,7 @@ module Cnvrg
|
|
945
947
|
def clone_data_query(dataset_url,query=nil)
|
946
948
|
begin
|
947
949
|
verify_logged_in(false)
|
950
|
+
@executer = Cnvrg::Helpers::Executer.get_executer
|
948
951
|
log_start(__method__, args, options)
|
949
952
|
query = options["query"] || query
|
950
953
|
if !query.present?
|
@@ -1000,6 +1003,7 @@ module Cnvrg
|
|
1000
1003
|
end
|
1001
1004
|
|
1002
1005
|
end
|
1006
|
+
@executer.set_dataset_status(dataset: @dataset.slug, status: "cloned") if @executer.present?
|
1003
1007
|
rescue Interrupt
|
1004
1008
|
log_message("Couldn't download", Thor::Shell::Color::RED)
|
1005
1009
|
exit(1)
|
@@ -1,14 +1,22 @@
|
|
1
1
|
class Cnvrg::Helpers::Executer
|
2
2
|
def initialize(project: nil, job_type: nil, job_id: nil)
|
3
|
-
@project = project
|
4
|
-
@job_type = job_type
|
5
|
-
@job_id = job_id
|
6
|
-
if job_id.blank?
|
3
|
+
@project = project || Cnvrg::Project.new(owner: ENV['CNVRG_OWNER'], slug: ENV['CNVRG_PROJECT'])
|
4
|
+
@job_type = job_type || ENV['CNVRG_JOB_TYPE']
|
5
|
+
@job_id = job_id || ENV['CNVRG_JOB_ID']
|
6
|
+
if @job_id.blank?
|
7
7
|
Cnvrg::CLI.log_message("Cant find job, exiting.", 'red')
|
8
8
|
exit(1)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
|
13
|
+
def self.get_executer
|
14
|
+
if ENV["CNVRG_JOB_ID"].blank?
|
15
|
+
return
|
16
|
+
end
|
17
|
+
self.new
|
18
|
+
end
|
19
|
+
|
12
20
|
def fetch_commands(block: nil, key: nil)
|
13
21
|
resp = Cnvrg::API.request("#{base_url}/commands", "GET", {block: block})
|
14
22
|
commands = decrypt_commands(resp["commands"], resp["key"], resp["iv"])
|
@@ -73,6 +81,10 @@ class Cnvrg::Helpers::Executer
|
|
73
81
|
commands.map{|k| k.with_indifferent_access}
|
74
82
|
end
|
75
83
|
|
84
|
+
def set_dataset_status(dataset: nil, status: nil)
|
85
|
+
Cnvrg::API.request("#{base_url}/datasets/#{dataset}", "PUT", {status: status})
|
86
|
+
end
|
87
|
+
|
76
88
|
private
|
77
89
|
def execute_helper(cmd)
|
78
90
|
case cmd[:type]
|
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.5.
|
4
|
+
version: 1.5.7
|
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: 2019-08-
|
13
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -432,8 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
432
432
|
- !ruby/object:Gem::Version
|
433
433
|
version: '0'
|
434
434
|
requirements: []
|
435
|
-
|
436
|
-
rubygems_version: 2.7.9
|
435
|
+
rubygems_version: 3.0.3
|
437
436
|
signing_key:
|
438
437
|
specification_version: 4
|
439
438
|
summary: A CLI tool for interacting with cnvrg.io.
|