add compute remote uuid to compute state url

Otherwise, two different compute remotes that happen to take the same
input would use the same compute state url. Which seems wrong.
This commit is contained in:
Joey Hess 2025-02-25 18:44:40 -04:00
parent 2b8428bb17
commit e702cb94ff
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 4 deletions

View file

@ -147,7 +147,7 @@ perform o r program = do
| otherwise = ingestwith $ | otherwise = ingestwith $
ingestAdd' nullMeterUpdate (Just ld) (Just stateurlk) ingestAdd' nullMeterUpdate (Just ld) (Just stateurlk)
where where
stateurl = Remote.Compute.computeStateUrl state outputfile stateurl = Remote.Compute.computeStateUrl r state outputfile
stateurlk = fromUrl stateurl Nothing True stateurlk = fromUrl stateurl Nothing True
outputfile' = tmpdir </> outputfile outputfile' = tmpdir </> outputfile
ld = LockedDown ldc $ KeySource ld = LockedDown ldc $ KeySource

View file

@ -257,9 +257,9 @@ parseComputeState k b =
in go c' rest in go c' rest
{- A compute: url for a given output file of a computation. -} {- A compute: url for a given output file of a computation. -}
computeStateUrl :: ComputeState -> OsPath -> URLString computeStateUrl :: Remote -> ComputeState -> OsPath -> URLString
computeStateUrl st p = computeStateUrl r st p =
"annex-compute:" ++ fromOsPath p ++ "?" "annex-compute:" ++ fromUUID (uuid r) ++ "/" ++ fromOsPath p ++ "?"
++ decodeBS (formatComputeState' Nothing st') ++ decodeBS (formatComputeState' Nothing st')
where where
-- Omit computeOutputs, so this gives the same result whether -- Omit computeOutputs, so this gives the same result whether