victorb / arch-mirror

IPFS mirror of pacman repositories
32 stars 5 forks source link

Only pin the latest repository tree #5

Open fazo96 opened 6 years ago

fazo96 commented 6 years ago

Hello, very nice project! I have a VPS with enough free resources to run this so here it is! I am updating it once a day.

https://ipfs.trippy.pizza/ipns/QmS7Xi8HJc9J8tWBErgDra1efVhr5E73yVyUP5giE8Yayy

I noticed that the IPFS add command does not use --pin=false so the whole thing gets pinned. This makes sense, but when you update it you will pin the new versions of packages without unpinning the old ones.

There is a command ipfs pin update <from> <to> that we can use to update the pin: old versions of packages will get unpinned and will be deleted when running ipfs repo gc.

Without this, the size of it will just grow indefinitely. I might try this on my machine, what do you think?

victorb commented 6 years ago

Ah, ipfs pin update $oldRoot $newRoot seems a lot better. Try it out and let me know how it works. Currently I'm just keeping all old packages as well, doesn't seem to take too much space. The mirror itself is 71G while the IPFS repository is 54G, and I have not run any GC so far, so doesn't seem too bad at the moment.

victorb commented 6 years ago

Unrelated, but are you still mirroring once per day? Guessing you're also using it for updating your system, how has it been working so far? Any problems?

fazo96 commented 6 years ago

I actually forgot to use it from my machines... I'll turn it on now

However I use it when updating the server that's hosting the mirror, it works great. I set up my systemd timer to run once per day and it has never failed

I'll try the pin update and I'll send a PR if it works

NiKiZe commented 6 years ago

I've implemented ipfs pin update logic in NiKiZe/Gentoo-distfiles-IPFS#2 Having some issues with the repo to test this properly, but hopefully it is easy to reuse and test for Arch as well.