[ARVADOS] updated: b4c27edb438b8aec5f055b636afb476c6ea8284c

git at public.curoverse.com git at public.curoverse.com
Mon Oct 6 23:08:06 EDT 2014


Summary of changes:
 apps/workbench/test/integration/users_test.rb |  7 +++-
 sdk/cli/bin/crunch-job                        | 49 ++++++++++++++++++---------
 services/keepproxy/keepproxy.go               | 25 ++++----------
 services/keepproxy/keepproxy_test.go          | 31 ++++++++++++++---
 4 files changed, 72 insertions(+), 40 deletions(-)

       via  b4c27edb438b8aec5f055b636afb476c6ea8284c (commit)
       via  2453adf513632740bc8a29f4d8b52789f4d8cd62 (commit)
       via  999cf322e35dfe147f7bab3204bf7c5b71e2e704 (commit)
       via  792b42b0f28f1b2595be071d0683c4872af0a6db (commit)
       via  a151775ef143f280f7ea2a3729b0b33c7b1b5944 (commit)
       via  38cc5c0a51657c6b60f3d3f32c566845988dfb6b (commit)
       via  d9166dfa6e46321e654f13fac59e8d10362ad169 (commit)
       via  aa07ac47cff1ae6428b1a7b7a993f2530afab5a3 (commit)
       via  5c1dafae8f4bb4aefac935337537c5e104e61278 (commit)
      from  6343835f8579a129cfd8cfbaa52836a7cd9a8329 (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 b4c27edb438b8aec5f055b636afb476c6ea8284c
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Oct 6 23:07:35 2014 -0400

    3775: Update comment

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index d4c8949..6af2940 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -376,9 +376,12 @@ if (!defined $git_dir && $Job->{'script_version'} =~ m{^/}) {
   $ENV{"CRUNCH_SRC"} = $Job->{'script_version'};
 }
 else {
+  # Resolve the given script_version to a git commit sha1. Also, if
+  # the repository is remote, clone it into our local filesystem: this
+  # ensures "git archive" will work, and is necessary to reliably
+  # resolve a symbolic script_version like "master^".
   $ENV{"CRUNCH_SRC"} = "$ENV{CRUNCH_TMP}/src";
 
-  # Install requested code version
   Log (undef, "Looking for version ".$Job->{script_version}." from repository ".$Job->{repository});
 
   $ENV{"CRUNCH_SRC_COMMIT"} = $Job->{script_version};

commit 2453adf513632740bc8a29f4d8b52789f4d8cd62
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Oct 6 22:16:56 2014 -0400

    3775: Update comment

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 4aecb0e..d4c8949 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -367,10 +367,11 @@ if (!defined $no_clear_tmp) {
 
 my $git_archive;
 if (!defined $git_dir && $Job->{'script_version'} =~ m{^/}) {
-  # If we're in user-land (i.e., not called from crunch-dispatch)
-  # script_version can be an absolute directory path, signifying we
-  # should work straight out of that directory instead of using a git
-  # commit.
+  # If script_version looks like an absolute path, *and* the --git-dir
+  # argument was not given -- which implies we were not invoked by
+  # crunch-dispatch -- we will use the given path as a working
+  # directory instead of resolving script_version to a git commit (or
+  # doing anything else with git).
   $ENV{"CRUNCH_SRC_COMMIT"} = $Job->{'script_version'};
   $ENV{"CRUNCH_SRC"} = $Job->{'script_version'};
 }

commit 999cf322e35dfe147f7bab3204bf7c5b71e2e704
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Oct 6 22:06:50 2014 -0400

    3775: Update perlpod. Use items_available. Be more conservative when
    using already-cached commit sha1s, expand related comment. Move "skip
    if not possible now" checks into subroutines.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 00d8389..4aecb0e 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -10,12 +10,14 @@ crunch-job: Execute job steps, save snapshots as requested, collate output.
 Obtain job details from Arvados, run tasks on compute nodes (typically
 invoked by scheduler on controller):
 
- crunch-job --job x-y-z
+ crunch-job --job x-y-z --git-dir /path/to/repo/.git
 
 Obtain job details from command line, run tasks on local machine
 (typically invoked by application or developer on VM):
 
- crunch-job --job '{"script_version":"/path/to/tree","script":"scriptname",...}'
+ crunch-job --job '{"script_version":"/path/to/working/tree","script":"scriptname",...}'
+
+ crunch-job --job '{"repository":"https://github.com/curoverse/arvados.git","script_version":"master","script":"scriptname",...}'
 
 =head1 OPTIONS
 
@@ -27,7 +29,9 @@ If the job is already locked, steal the lock and run it anyway.
 
 =item --git-dir
 
-Path to .git directory where the specified commit is found.
+Path to a .git directory (or a git URL) where the commit given in the
+job's C<script_version> attribute is to be found. If this is I<not>
+given, the job's C<repository> attribute will be used.
 
 =item --job-api-token
 
@@ -39,6 +43,11 @@ Do not clear per-job/task temporary directories during initial job
 setup. This can speed up development and debugging when running jobs
 locally.
 
+=item --job
+
+UUID of the job to run, or a JSON-encoded job resource without a
+UUID. If the latter is given, a new job object will be created.
+
 =back
 
 =head1 RUNNING JOBS LOCALLY
@@ -410,16 +419,17 @@ else {
     # repository.
     my $arv_repo_list = $arv->{'repositories'}->{'list'}->execute(
       'filters' => [['name','=',$repo]]
-        )->{'items'};
-    my $n_found = scalar @{$arv_repo_list};
+        );
+    my @repos_found = @{$arv_repo_list->{'items'}};
+    my $n_found = $arv_repo_list->{'items_available'};
     if ($n_found > 0) {
       Log(undef, "Repository '$repo' -> "
-          . join(", ", map { $_->{'uuid'} } @{$arv_repo_list}));
+          . join(", ", map { $_->{'uuid'} } @repos_found));
     }
     if ($n_found != 1) {
       croak("Error: Found $n_found repositories with name '$repo'.");
     }
-    $repo = $arv_repo_list->[0]->{'fetch_url'};
+    $repo = $repos_found[0]->{'fetch_url'};
     $repo_location = 'remote';
   }
   Log(undef, "Using $repo_location repository '$repo'");
@@ -452,11 +462,12 @@ else {
     # our local cache first, since that's cheaper. (We don't want to
     # do that with tags/branches though -- those change over time, so
     # they should always be resolved by the remote repo.)
-    if ($treeish =~ /^[0-9a-f]{3,40}$/s) {
+    if ($treeish =~ /^[0-9a-f]{7,40}$/s) {
       # Hide stderr because it's normal for this to fail:
       my $sha1 = `$gitcmd rev-list -n1 ''\Q$treeish\E 2>/dev/null`;
       if ($? == 0 &&
-          $sha1 =~ /^$treeish/ && # Don't use commit 123 @ branch abc!
+          # Careful not to resolve a branch named abcdeff to commit 1234567:
+          $sha1 =~ /^$treeish/ &&
           $sha1 =~ /^([0-9a-f]{40})$/s) {
         $commit = $1;
         Log(undef, "Commit $commit already present in $local_repo");
@@ -1433,14 +1444,15 @@ sub croak
   Log (undef, $message);
   freeze() if @jobstep_todo;
   collate_output() if @jobstep_todo;
-  cleanup() if $Job;
-  save_meta() if log_writer_is_active();
+  cleanup();
+  save_meta();
   die;
 }
 
 
 sub cleanup
 {
+  return unless $Job;
   if ($Job->{'state'} eq 'Cancelled') {
     $Job->update_attributes('finished_at' => scalar gmtime);
   } else {
@@ -1453,6 +1465,7 @@ sub save_meta
 {
   my $justcheckpoint = shift; # false if this will be the last meta saved
   return if $justcheckpoint;  # checkpointing is not relevant post-Warehouse.pm
+  return unless log_writer_is_active();
 
   my $loglocator = log_writer_finish();
   Log (undef, "log manifest is $loglocator");

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list