add compute remote uuid to compute state url
authorJoey Hess <joeyh@joeyh.name>
Tue, 25 Feb 2025 22:44:40 +0000 (18:44 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 25 Feb 2025 22:44:40 +0000 (18:44 -0400)
Otherwise, two different compute remotes that happen to take the same
input would use the same compute state url. Which seems wrong.

Command/AddComputed.hs
Remote/Compute.hs

index 0d614a1fc0ff02d4b36b4324da0e7dfbb3ea26a6..7afd23a12988d5f2e53db1da38e4922db6e6ba21 100644 (file)
@@ -147,7 +147,7 @@ perform o r program = do
                | otherwise = ingestwith $
                        ingestAdd' nullMeterUpdate (Just ld) (Just stateurlk)
          where
-               stateurl = Remote.Compute.computeStateUrl state outputfile
+               stateurl = Remote.Compute.computeStateUrl state outputfile
                stateurlk = fromUrl stateurl Nothing True
                outputfile' = tmpdir </> outputfile
                ld = LockedDown ldc $ KeySource
index 1157ac581d5775689a374bceac2d0f9de957f8c0..b6ba1dbf2e7eadb2df1cd6d974bee479e5e33aab 100644 (file)
@@ -257,9 +257,9 @@ parseComputeState k b =
                in go c' rest
 
 {- A compute: url for a given output file of a computation. -}
-computeStateUrl :: ComputeState -> OsPath -> URLString
-computeStateUrl st p = 
-       "annex-compute:" ++ fromOsPath p ++ "?" 
+computeStateUrl :: Remote -> ComputeState -> OsPath -> URLString
+computeStateUrl st p = 
+       "annex-compute:" ++ fromUUID (uuid r) ++ "/" ++ fromOsPath p ++ "?" 
                ++ decodeBS (formatComputeState' Nothing st')
   where
        -- Omit computeOutputs, so this gives the same result whether