[ARVADOS] updated: af2ca91daa4cb9550226be5fad80da24ee426fb7
git at public.curoverse.com
git at public.curoverse.com
Mon Oct 27 12:54:00 EDT 2014
Summary of changes:
services/api/script/crunch-dispatch.rb | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
via af2ca91daa4cb9550226be5fad80da24ee426fb7 (commit)
via 2776ad1bd8f05cf58a2bab436db932289d80549a (commit)
from 789e479916a89e57cdf1d65c49923449c4fb1bcf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit af2ca91daa4cb9550226be5fad80da24ee426fb7
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Oct 27 12:53:28 2014 -0400
4297: Rename @have_tags -> @job_tags, @have_commits -> @fetched_commits. Add comments.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index 0e05d64..44ea396 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -282,8 +282,10 @@ class Dispatcher
git = "git --git-dir=#{arvados_internal.shellescape}"
- @have_commits ||= {}
- if !@have_commits[job.script_version]
+ # @fetched_commits[V]==true if we know commit V exists in the
+ # arvados_internal git repository.
+ @fetched_commits ||= {}
+ if !@fetched_commits[job.script_version]
repo_root = Rails.configuration.git_repositories_dir
src_repo = File.join(repo_root, job.repository + '.git')
@@ -307,11 +309,14 @@ class Dispatcher
next
end
end
- @have_commits[job.script_version] = true
+ @fetched_commits[job.script_version] = true
end
- @have_tags ||= {}
- if not @have_tags[job.uuid]
+ # @job_tags[J]==V if we know commit V has been tagged J in the
+ # arvados_internal repository. (J is a job UUID, V is a commit
+ # sha1.)
+ @job_tags ||= {}
+ if not @job_tags[job.uuid]
# check if the commit needs to be tagged with this job uuid
tag_rev = `#{git} rev-list -n1 #{job.uuid.shellescape} 2>/dev/null`.chomp
if $? != 0
@@ -332,9 +337,9 @@ class Dispatcher
next
end
end
- @have_tags[job.uuid] = job.script_version
- elsif @have_tags[job.uuid] != job.script_version
- fail_job job, "Existing tag #{job.uuid} points to commit #{@have_tags[job.uuid]} but this job uses commit #{job.script_version}"
+ @job_tags[job.uuid] = job.script_version
+ elsif @job_tags[job.uuid] != job.script_version
+ fail_job job, "Existing tag #{job.uuid} points to commit #{@job_tags[job.uuid]} but this job uses commit #{job.script_version}"
end
cmd_args << crunch_job_bin
commit 2776ad1bd8f05cf58a2bab436db932289d80549a
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Oct 27 12:52:52 2014 -0400
4297: Use save! instead of save to ensure failures get logged.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index 00f3fa9..0e05d64 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -198,7 +198,7 @@ class Dispatcher
event_type: 'dispatch',
owner_uuid: job.owner_uuid,
summary: message,
- properties: {"text" => message}).save
+ properties: {"text" => message}).save!
rescue
$stderr.puts "dispatch: log.create failed"
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list