cnvrg 1.10.12 → 1.10.15
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 +7 -5
- data/lib/cnvrg/data.rb +9 -9
- data/lib/cnvrg/datafiles.rb +7 -6
- data/lib/cnvrg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d377618af4c931ec6553e946bb1f32c25bbb7bccd538f040309f4318c20e3bd
|
4
|
+
data.tar.gz: 744a798d06c8c562991be9b68cf6b8258870e657a93e2125ff3bc3c76bd7b2b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e52939b069a7ef45d69a0ae8a086291245db90602a13039c7981ac9a3c85913cf3c3b105198a149cc2913668a5fcf59288266ada60d71b5c327b3b90bc3c594a
|
7
|
+
data.tar.gz: 03d8880d00c707ab6afcb3509da1e02c4f01aeaf5e378b49a3ec7c651b2b00176b01be5de9320da652173480279bf1d820cf9e2a255ec1e21217e361c65fd375
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -1208,12 +1208,14 @@ module Cnvrg
|
|
1208
1208
|
log_message("Uploading #{@files.size} files", Thor::Shell::Color::GREEN)
|
1209
1209
|
number_of_chunks = (@files.size.to_f / chunk_size).ceil
|
1210
1210
|
if commit.blank?
|
1211
|
+
Cnvrg::Logger.info("Creating commit")
|
1211
1212
|
response = @datafiles.start_commit(false, force, chunks: number_of_chunks, message: message )
|
1212
1213
|
unless response #means we failed in the start commit.
|
1213
1214
|
raise SignalException.new(1, "Cant put files into dataset, check the dataset id")
|
1214
1215
|
end
|
1215
1216
|
@commit = response['result']['commit_sha1']
|
1216
1217
|
elsif commit.eql? "latest"
|
1218
|
+
Cnvrg::Logger.info("Put files in latest commit")
|
1217
1219
|
response = @datafiles.last_valid_commit()
|
1218
1220
|
unless response #means we failed in the start commit.
|
1219
1221
|
raise SignalException.new(1, "Cant put files into commit:#{commit}, check the dataset id and commitc")
|
@@ -1233,15 +1235,15 @@ module Cnvrg
|
|
1233
1235
|
override: override,
|
1234
1236
|
chunk_size: chunk_size,
|
1235
1237
|
prefix: dir,
|
1236
|
-
threads: threads
|
1238
|
+
threads: threads,
|
1237
1239
|
)
|
1238
|
-
|
1240
|
+
Cnvrg::Logger.info("Finished upload files")
|
1239
1241
|
# This is for backwards compatibility only and should be removed in future versions:
|
1240
1242
|
res = @datafiles.put_commit(@commit)
|
1241
1243
|
unless res.is_success?
|
1242
1244
|
raise SignalException.new(1, res.msg)
|
1243
1245
|
end
|
1244
|
-
|
1246
|
+
Cnvrg::Logger.info("Saving commit on server")
|
1245
1247
|
res = @datafiles.end_commit(@commit,force, success: true, commit_type: "put")
|
1246
1248
|
msg = res['result']
|
1247
1249
|
response = Cnvrg::Result.new(Cnvrg::CLI.is_response_success(res, true), msg)
|
@@ -5301,8 +5303,8 @@ module Cnvrg
|
|
5301
5303
|
count += 1
|
5302
5304
|
end
|
5303
5305
|
if File.exist? logfile_old
|
5304
|
-
|
5305
|
-
|
5306
|
+
#@files = Cnvrg::Files.new(Cnvrg::CLI.get_owner, "")
|
5307
|
+
#@files.upload_log_file(logfile_old, "log_#{date}.log", yesterday)
|
5306
5308
|
FileUtils.remove logfile_old
|
5307
5309
|
end
|
5308
5310
|
|
data/lib/cnvrg/data.rb
CHANGED
@@ -232,15 +232,15 @@ module Cnvrg
|
|
232
232
|
threads = options[:threads]
|
233
233
|
chunk_size = options[:chunk_size]
|
234
234
|
cli.data_put(
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
235
|
+
dataset_url,
|
236
|
+
files: files,
|
237
|
+
dir: dir,
|
238
|
+
commit: commit,
|
239
|
+
force: force,
|
240
|
+
override: override,
|
241
|
+
threads: threads,
|
242
|
+
chunk_size: chunk_size,
|
243
|
+
message: message
|
244
244
|
)
|
245
245
|
end
|
246
246
|
|
data/lib/cnvrg/datafiles.rb
CHANGED
@@ -376,16 +376,16 @@ module Cnvrg
|
|
376
376
|
|
377
377
|
if uploaded_files.size == chunk_size or progressbar.finished?
|
378
378
|
refresh_storage_token
|
379
|
-
|
380
|
-
# puts "files: #{file_queue.length}"
|
379
|
+
Cnvrg::Logger.info("Finished upload chunk of #{chunk_size} files")
|
381
380
|
Cnvrg::Logger.info("Sending Upload files save")
|
382
381
|
blob_ids = uploaded_files.map {|f| f['bv_id']}
|
382
|
+
Cnvrg::Logger.info("Sending chunk to server")
|
383
383
|
upload_resp = Cnvrg::API.request(@base_resource + "upload_files_save", "POST", {commit: commit_sha1, blob_ids: blob_ids, dirs: dirs})
|
384
384
|
unless Cnvrg::CLI.is_response_success(upload_resp, false)
|
385
385
|
Cnvrg::Logger.log_method(bind: binding)
|
386
386
|
raise Exception.new("Got an error message from server, #{upload_resp.try(:fetch, "message")}")
|
387
387
|
end
|
388
|
-
|
388
|
+
Cnvrg::Logger.info("Chunk saved on server")
|
389
389
|
uploaded_files = []
|
390
390
|
dirs = []
|
391
391
|
end
|
@@ -394,7 +394,7 @@ module Cnvrg
|
|
394
394
|
end
|
395
395
|
|
396
396
|
if progressbar.finished?
|
397
|
-
|
397
|
+
Cnvrg::Logger.info("Progress bar finished closing queues")
|
398
398
|
file_queue.close()
|
399
399
|
progress_queue.close()
|
400
400
|
Thread.exit
|
@@ -405,8 +405,9 @@ module Cnvrg
|
|
405
405
|
file_chunks = files.each_slice(chunk_size).to_a
|
406
406
|
# Fetch the required files from the server:
|
407
407
|
Parallel.map((file_chunks), in_threads: 10) do |files_chunk|
|
408
|
-
|
408
|
+
Cnvrg::Logger.info("Generating chunk idx")
|
409
409
|
tree = @dataset.generate_chunked_idx(files_chunk, prefix: prefix, threads: threads)
|
410
|
+
Cnvrg::Logger.info("Getting files info from server")
|
410
411
|
results = request_upload_files(commit_sha1, tree, override, new_branch, partial_commit)
|
411
412
|
|
412
413
|
if results['files'].blank?
|
@@ -430,7 +431,7 @@ module Cnvrg
|
|
430
431
|
file_queue.push tree[key].merge(files_to_upload[key])
|
431
432
|
end
|
432
433
|
end
|
433
|
-
|
434
|
+
Cnvrg::Logger.info("Finishing sub processes of datasets' upload")
|
434
435
|
progress_thread.join()
|
435
436
|
worker_threads.each(&:join)
|
436
437
|
|
data/lib/cnvrg/version.rb
CHANGED