aleph-vm icon indicating copy to clipboard operation
aleph-vm copied to clipboard

Switch to using the local IPFS Kubo daemon for IPFS files

Open hoh opened this issue 8 months ago • 2 comments

IPFS Kubo is now present on all CRNs but unused.

Downloading files from this service would be more reliable than using third party and provide content integrity checks.

This bypasses the vm-connector when fetching resources from IPFS.

Related Jira tickets : ALEPH-36

Self proofreading checklist

  • [x] The new code clear, easy to read and well commented.
  • [x] New code does not duplicate the functions of builtin or popular libraries.
  • [ ] An LLM was used to review the new code and look for simplifications.
  • [x] New classes and functions contain docstrings explaining what they provide.
  • [ ] All new code is covered by relevant tests.
  • [ ] Documentation has been updated regarding these changes.
  • [ ] Dependencies update in the project.toml have been mirrored in the Debian package build script packaging/Makefile

Changes

  • Fixes how the configuration of Kubo is applied (previous version did not work anymore).
  • Adds setting IPFS_SERVER in aleph-vm.
  • Refactors relevant code to download from the IPFS gateway instead of the vm-connector

How to test

Stop the services, purge all application data, then restart the services.

sudo systemctl stop aleph-vm-supervisor
sudo systemctl stop ipfs
sudo rm -fr /var/lib/aleph/vm/ /var/cache/aleph/ /var/lib/ipfs/
sudo systemctl start ipfs
sudo systemctl start aleph-vm-supervisor

Then check that the index page of the CRN.

hoh avatar Mar 12 '25 16:03 hoh

Codecov Report

Attention: Patch coverage is 88.13559% with 7 lines in your changes missing coverage. Please review.

Project coverage is 63.41%. Comparing base (73013a2) to head (dadad88).

Files with missing lines Patch % Lines
src/aleph/vm/storage.py 84.21% 5 Missing and 1 partial :warning:
tests/supervisor/views/test_operator.py 83.33% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #779      +/-   ##
==========================================
+ Coverage   63.33%   63.41%   +0.07%     
==========================================
  Files          77       77              
  Lines        6854     6877      +23     
  Branches      576      578       +2     
==========================================
+ Hits         4341     4361      +20     
- Misses       2325     2326       +1     
- Partials      188      190       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 19 '25 10:03 codecov[bot]

@olethanh I moved the resource limits into this branch.

hoh avatar Mar 19 '25 14:03 hoh