fixes and docs for testing crunch jobs locally
[arvados.git] / services / api / app / models / job.rb
index f61d33c7266ec2ebda89ca2bf9f9d41e4db0345c..e2fc19e852062b4f42267f3ebf8806c1205b3de9 100644 (file)
@@ -50,6 +50,12 @@ class Job < ArvadosModel
   protected
 
   def ensure_script_version_is_commit
+    if self.is_locked_by and self.started_at
+      # Apparently client has already decided to go for it. This is
+      # needed to run a local job using a local working directory
+      # instead of a commit-ish.
+      return true
+    end
     sha1 = Commit.find_by_commit_ish(self.script_version) rescue nil
     if sha1
       self.script_version = sha1