WIP: Cache only version #25

Draft
reynir wants to merge 1 commit from cache into main
Owner

This is a cache-only version of opam-mirror. The code is rather old and it may need some updating.

This is a cache-only version of opam-mirror. The code is rather old and it may need some updating.
reynir added 1 commit 2024-11-18 10:23:12 +00:00
Owner

I do like the idea of purely acting as a cache... but then I wonder what the advantage over a "normal" HTTP caching proxy (such as squid in the old days) is?

Basically for each HTTP request, do the HTTP request and store the result on disk, so that the next access to the same resource doesn't need to retrieve from the network?

I do like the idea of purely acting as a cache... but then I wonder what the advantage over a "normal" HTTP caching proxy (such as squid in the old days) is? Basically for each HTTP request, do the HTTP request and store the result on disk, so that the next access to the same resource doesn't need to retrieve from the network?
Owner

Ah, but maybe it is a cache that understands opam and retrieves all the needed artifacts in the cache upfront!?

Ah, but maybe it is a cache that understands opam and retrieves all the needed artifacts in the cache upfront!?
Author
Owner

Indeed, this would be like if squid could predict the endpoints and pre-warm the cache. With this you could run it on your laptop with opam.ocaml.org or opam.robur.coop as the upstream at home, let it collect the archives and then go to Morocco and enjoy having a local cache of the source archives.

It could also be a step towards a setup where you split the unikernel in two: one serving only as the cache and another only serving as the opam repository (and potentially pointing to the other unikernel as its archive-mirrors). In this setup the cache would still be usable even if the repository goes down for some reason (out of memory or some other reason) or during the initialization of the git state in the opam-mirror repository (though I guess that is less of an issue today).

Indeed, this would be like if squid could predict the endpoints and pre-warm the cache. With this you could run it on your laptop with opam.ocaml.org or opam.robur.coop as the upstream at home, let it collect the archives and then go to Morocco and enjoy having a local cache of the source archives. It could also be a step towards a setup where you split the unikernel in two: one serving only as the cache and another only serving as the opam repository (and potentially pointing to the other unikernel as its archive-mirrors). In this setup the cache would still be usable even if the repository goes down for some reason (out of memory or some other reason) or during the initialization of the git state in the opam-mirror repository (though I guess that is less of an issue today).
This pull request has changes conflicting with the target branch.
  • mirage/config.ml
  • mirage/unikernel.ml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin cache:cache
git checkout cache

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff cache
git checkout cache
git rebase main
git checkout main
git merge --ff-only cache
git checkout cache
git rebase main
git checkout main
git merge --no-ff cache
git checkout main
git merge --squash cache
git checkout main
git merge --ff-only cache
git checkout main
git merge cache
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: robur/opam-mirror#25
No description provided.