X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/549f4a1deddb41f6abbc493a660d9fb0976da91a..2945ea907a7c35da2d03d6775574fb1ad9be2b09:/services/api/script/crunch-dispatch.rb diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb index 843fc0db66..5a990f0cb4 100755 --- a/services/api/script/crunch-dispatch.rb +++ b/services/api/script/crunch-dispatch.rb @@ -78,7 +78,7 @@ class Dispatcher # update our database (and cache) when a node's state changes if @node_state[re[1]] != re[2] @node_state[re[1]] = re[2] - node = Node.where('hostname=?', re[1]).first + node = Node.where('hostname=?', re[1]).order(:last_ping_at).last if node $stderr.puts "dispatch: update #{re[1]} state to #{re[2]}" node.info['slurm_state'] = re[2] @@ -166,6 +166,10 @@ class Dispatcher cmd_args = nil case Server::Application.config.crunch_job_wrapper when :none + if @running.size > 0 + # Don't run more than one at a time. + return + end cmd_args = [] when :slurm_immediate nodelist = nodes_available_for_job(job) @@ -226,7 +230,7 @@ class Dispatcher next end - $stderr.puts `cd #{arvados_internal.shellescape} && git fetch --no-tags #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}` + $stderr.puts `cd #{arvados_internal.shellescape} && git fetch-pack --all #{src_repo.shellescape} && git tag #{job.uuid.shellescape} #{job.script_version.shellescape}` cmd_args << crunch_job_bin cmd_args << '--job-api-token'