[ARVADOS] updated: fbcc5ab5e7a5ad65b81e3965f93b1679d1b1e06f

git at public.curoverse.com git at public.curoverse.com
Fri May 22 15:40:52 EDT 2015


Summary of changes:
 sdk/cli/bin/crunch-job | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

       via  fbcc5ab5e7a5ad65b81e3965f93b1679d1b1e06f (commit)
      from  b4c2a96ed66c98cb5a07bd06138f755ae5675fb7 (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 fbcc5ab5e7a5ad65b81e3965f93b1679d1b1e06f
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri May 22 15:40:29 2015 -0400

    6094: Consider arvados_sdk_version (not just script_version) when
    deciding there's no need to extract or install anything.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index ae9d1e2..d76bbd9 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -597,6 +597,7 @@ else {
   my @execargs = ("sh", "-c",
                   "mkdir -p $ENV{CRUNCH_INSTALL} && cd $ENV{CRUNCH_TMP} && perl -");
 
+  $ENV{"CRUNCH_GIT_ARCHIVE_HASH"} = md5_hex($git_archive);
   my $installpid = fork();
   if ($installpid == 0)
   {
@@ -1888,7 +1889,7 @@ use constant TASK_TEMPFAIL => 111;
 my %SDK_ENVVARS = ("perl/lib" => "PERLLIB", "ruby/lib" => "RUBYLIB");
 
 my $destdir = $ENV{"CRUNCH_SRC"};
-my $commit = $ENV{"CRUNCH_SRC_COMMIT"};
+my $archive_hash = $ENV{"CRUNCH_GIT_ARCHIVE_HASH"};
 my $repo = $ENV{"CRUNCH_SRC_URL"};
 my $install_dir = $ENV{"CRUNCH_INSTALL"} || (getcwd() . "/opt");
 my $job_work = $ENV{"JOB_WORK"};
@@ -1981,8 +1982,9 @@ if (@ARGV) {
 ### Installation mode
 open L, ">", "$destdir.lock" or die "$destdir.lock: $!";
 flock L, LOCK_EX;
-if (readlink ("$destdir.commit") eq $commit && -d $destdir) {
-  # This version already installed -> nothing to do.
+if (readlink ("$destdir.archive_hash") eq $archive_hash && -d $destdir) {
+  # This exact git archive (source + arvados sdk) is already installed
+  # here, so there's no need to reinstall it.
 
   # We must consume our DATA section, though: otherwise the process
   # feeding it to us will get SIGPIPE.
@@ -1992,7 +1994,7 @@ if (readlink ("$destdir.commit") eq $commit && -d $destdir) {
   exit(0);
 }
 
-unlink "$destdir.commit";
+unlink "$destdir.archive_hash";
 mkdir $destdir;
 
 if (!open(TARX, "|-", "tar", "-xC", $destdir)) {
@@ -2041,10 +2043,10 @@ if (-e "$destdir/crunch_scripts/install") {
     shell_or_die (undef, "./install.sh", $install_dir);
 }
 
-if ($commit) {
-    unlink "$destdir.commit.new";
-    symlink ($commit, "$destdir.commit.new") or die "$destdir.commit.new: $!";
-    rename ("$destdir.commit.new", "$destdir.commit") or die "$destdir.commit: $!";
+if ($archive_hash) {
+    unlink "$destdir.archive_hash.new";
+    symlink ($archive_hash, "$destdir.archive_hash.new") or die "$destdir.archive_hash.new: $!";
+    rename ("$destdir.archive_hash.new", "$destdir.archive_hash") or die "$destdir.archive_hash: $!";
 }
 
 close L;

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list