From: Tim Pierce Date: Wed, 1 Oct 2014 19:43:15 +0000 (-0400) Subject: Merge branch 'master' into 3782-large-job-logs X-Git-Tag: 1.1.0~2139^2~3 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/edc5e4b6645b9b983a85a892bf3d3ad1432a657d Merge branch 'master' into 3782-large-job-logs Conflicts: services/api/test/fixtures/collections.yml services/api/test/fixtures/jobs.yml --- edc5e4b6645b9b983a85a892bf3d3ad1432a657d diff --cc apps/workbench/app/controllers/collections_controller.rb index cc0b3fff5b,9882fa6a34..3606ef0c8a --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@@ -164,15 -154,15 +166,21 @@@ class CollectionsController < Applicati ext = File.extname(params[:file]) self.response.headers['Content-Type'] = Rack::Mime::MIME_TYPES[ext] || 'application/octet-stream' - self.response.headers['Content-Length'] = params[:size] if params[:size] + if params[:size] + size = params[:size].to_i + if opts[:maxbytes] + size = [size, opts[:maxbytes].to_i].min + end + self.response.headers['Content-Length'] = size.to_s + end self.response.headers['Content-Disposition'] = params[:disposition] if params[:disposition] - self.response_body = file_enumerator opts + begin + file_enumerator(opts).each do |bytes| + response.stream.write bytes + end + ensure + response.stream.close + end end def sharing_scopes diff --cc services/api/test/fixtures/collections.yml index ba95b34323,817fd5c3d0..d7b2d16f15 --- a/services/api/test/fixtures/collections.yml +++ b/services/api/test/fixtures/collections.yml @@@ -200,16 -212,26 +212,40 @@@ collection_expires_in_future manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:expired\n" name: collection_expires_in_future +# a collection with a log file that can be parsed by the log viewer +# This collection hash matches the following log text: +# 2014-01-01_12:00:01 zzzzz-8i9sb-abcdefghijklmno 0 log message 1 +# 2014-01-01_12:00:02 zzzzz-8i9sb-abcdefghijklmno 0 log message 2 +# 2014-01-01_12:00:03 zzzzz-8i9sb-abcdefghijklmno 0 log message 3 +# +real_log_collection: + uuid: zzzzz-4zz18-op4e2lbej01tcvu + owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz + created_at: 2014-09-01 12:00:00 + portable_data_hash: 3399cbb0953a7823618f3e288a85ee26+81 + manifest_text: ". b9f7e25b33844d816d8531686f8bf360+195 0:195:zzzzz-8i9sb-abcdefghijklmno.log.txt\n" + name: real_log_collection ++ + collection_in_home_project_with_same_name_as_in_aproject: + uuid: zzzzz-4zz18-12342x4u7ftabcd + portable_data_hash: ea10d51bcf88862dbcc36eb292017dfd+45 + owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz + created_at: 2014-02-03T17:22:54Z + modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr + modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f + modified_at: 2014-02-03T17:22:54Z + updated_at: 2014-02-03T17:22:54Z + manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n" + name: collection_with_same_name_in_aproject_and_home_project + + collection_in_aproject_with_same_name_as_in_home_project: + uuid: zzzzz-4zz18-56782x4u7ftefgh + portable_data_hash: ea10d51bcf88862dbcc36eb292017dfd+45 + owner_uuid: zzzzz-j7d0g-v955i6s2oi1cbso + created_at: 2014-02-03T17:22:54Z + modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr + modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f + modified_at: 2014-02-03T17:22:54Z + updated_at: 2014-02-03T17:22:54Z + manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n" + name: collection_with_same_name_in_aproject_and_home_project diff --cc services/api/test/fixtures/jobs.yml index 7c375bceb0,b84922d28e..b46cd06285 --- a/services/api/test/fixtures/jobs.yml +++ b/services/api/test/fixtures/jobs.yml @@@ -212,11 -222,4 +222,12 @@@ queued is_locked_by_uuid: ~ tasks_summary: {} runtime_constraints: {} + state: Queued + +# A job with a log collection that can be parsed by the log viewer. +job_with_real_log: + uuid: zzzzz-8i9sb-0vsrcqi7whchuil + created_at: 2014-09-01 12:00:00 + owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz + log: 3399cbb0953a7823618f3e288a85ee26+81 + script_version: 7def43a4d3f20789dda4700f703b5514cc3ed250