Use IPFS CID as primary output_cid instead of cache_id hash
This commit is contained in:
@@ -1025,11 +1025,12 @@ def execute_recipe(self, recipe_sexp: str, input_hashes: Dict[str, str], run_id:
|
|||||||
output_cid = None
|
output_cid = None
|
||||||
output_ipfs_cid = None
|
output_ipfs_cid = None
|
||||||
output_path = None
|
output_path = None
|
||||||
|
output_cache_id = None # Keep track of cache_id separately
|
||||||
|
|
||||||
if output_step:
|
if output_step:
|
||||||
output_result = step_results.get(output_step.step_id, {})
|
output_result = step_results.get(output_step.step_id, {})
|
||||||
output_cid = output_result.get("cid") or output_result.get("cache_id")
|
output_cache_id = output_result.get("cache_id")
|
||||||
output_ipfs_cid = output_result.get("ipfs_cid")
|
output_ipfs_cid = output_result.get("cid") # cid should be IPFS CID now
|
||||||
output_path = output_result.get("path")
|
output_path = output_result.get("path")
|
||||||
|
|
||||||
# Upload final output to IPFS if not already there
|
# Upload final output to IPFS if not already there
|
||||||
@@ -1043,6 +1044,9 @@ def execute_recipe(self, recipe_sexp: str, input_hashes: Dict[str, str], run_id:
|
|||||||
else:
|
else:
|
||||||
logger.error(f"Failed to upload output to IPFS: {output_path}")
|
logger.error(f"Failed to upload output to IPFS: {output_path}")
|
||||||
|
|
||||||
|
# Use IPFS CID as the primary output identifier
|
||||||
|
output_cid = output_ipfs_cid
|
||||||
|
|
||||||
# Fail if output couldn't be uploaded to IPFS
|
# Fail if output couldn't be uploaded to IPFS
|
||||||
if not output_ipfs_cid:
|
if not output_ipfs_cid:
|
||||||
logger.error(f"Recipe failed: Could not upload output to IPFS! output_cid={output_cid}, output_path={output_path}")
|
logger.error(f"Recipe failed: Could not upload output to IPFS! output_cid={output_cid}, output_path={output_path}")
|
||||||
|
|||||||
Reference in New Issue
Block a user