WIP: Use hut as binary cache #89

Draft
abonerib wants to merge 4 commits from abonerib/jungle:77-hut-cache into master
Collaborator

This fixes the ngnix path to the binary cache and adds https://jungle.bsc.es/cache as a substituter to other nodes.

closes #77

TODOs

  • Bypass nginx, bind nix-serve to 0.0.0.0 and use http://xeon07:5000?
  • Consider using a replacement for nix-serve:
    • nix-serve-ng (haskell, drop-in replacement, they claim to outperform harmonia)
    • harmonia (rust, more active, but requires separate configuration)
  • Add post build hook to upload builds to cache?

Links:

This fixes the ngnix path to the binary cache and adds `https://jungle.bsc.es/cache` as a substituter to other nodes. closes #77 ### TODOs - [ ] Bypass nginx, bind `nix-serve` to `0.0.0.0` and use `http://xeon07:5000`? - [ ] Consider using a replacement for [nix-serve](https://github.com/edolstra/nix-serve): - [nix-serve-ng](https://github.com/aristanetworks/nix-serve-ng) (haskell, drop-in replacement, they claim to outperform harmonia) - [harmonia](https://github.com/nix-community/harmonia) (rust, more active, but requires separate configuration) - [ ] Add post build hook to upload builds to cache? --- Links: - https://nix.dev/guides/recipes/add-binary-cache#custom-binary-cache - https://nix.dev/tutorials/nixos/binary-cache-setup - https://nix.dev/guides/recipes/post-build-hook#post-build-hooks
abonerib added the
config
nix
labels 2025-02-26 16:51:45 +01:00
abonerib added 3 commits 2025-02-26 16:51:46 +01:00
`nix-serve` does not handle duplicates in the path:
```
hut$ curl http://127.0.0.1:5000/nix-cache-info
StoreDir: /nix/store
WantMassQuery: 1
Priority: 30
hut$ curl http://127.0.0.1:5000//nix-cache-info
File not found.
```

This meant that the cache was not accessible via:
`curl https://jungle.bsc.es/cache/nix-cache-info` but
`curl https://jungle.bsc.es/cachenix-cache-info` worked.
abonerib force-pushed 77-hut-cache from b26aa2aa23 to 982fc647cf 2025-02-26 16:52:08 +01:00 Compare
Owner

This fixes the ngnix path to the binary cache and adds https://jungle.bsc.es/cache as a substituter to other nodes.

Thanks, let's wait until the temperature situation is under control to test this.

closes #77

TODOs

  • Bypass nginx, bind nix-serve to 0.0.0.0 and use http://xeon07:5000?

Yeah, but use hut as xeon07 is the old name. We still need the nginx forward to use it from the outside (replit).

  • Consider using a replacement for nix-serve:
    • nix-serve-ng (haskell, drop-in replacement, they claim to outperform harmonia)
    • harmonia (rust, more active, but requires separate configuration)

I don't mind much, but I would wait for it to be a problem, and hopefully something that doesn't bring a gigantic closure.

  • Add post build hook to upload builds to cache?

I would say not for now.

Can we also add the cache entry in the hut website page? So other users can add it to their local config.

> This fixes the ngnix path to the binary cache and adds `https://jungle.bsc.es/cache` as a substituter to other nodes. Thanks, let's wait until the temperature situation is under control to test this. > > closes #77 > > ### TODOs > > - [ ] Bypass nginx, bind `nix-serve` to `0.0.0.0` and use `http://xeon07:5000`? Yeah, but use `hut` as xeon07 is the old name. We still need the nginx forward to use it from the outside (replit). > - [ ] Consider using a replacement for [nix-serve](https://github.com/edolstra/nix-serve): > - [nix-serve-ng](https://github.com/aristanetworks/nix-serve-ng) (haskell, drop-in replacement, they claim to outperform harmonia) > - [harmonia](https://github.com/nix-community/harmonia) (rust, more active, but requires separate configuration) I don't mind much, but I would wait for it to be a problem, and hopefully something that doesn't bring a gigantic closure. > - [ ] Add post build hook to upload builds to cache? I would say not for now. Can we also add the cache entry in the hut website page? So other users can add it to their local config.
abonerib added 1 commit 2025-02-26 18:22:49 +01:00
abonerib force-pushed 77-hut-cache from 05d57602c4 to 5cd8372c4c 2025-02-26 18:26:00 +01:00 Compare
Author
Collaborator

Yeah, but use hut as xeon07 is the old name. We still need the nginx forward to use it from the outside (replit).

Seems that raccoon can't access hut directly, I'll leave it as jungle.bsc.es for now.

raccoon$ ssh hut
ssh: Could not resolve hostname hut: Name or service not known

Can we also add the cache entry in the hut website page? So other users can add it to their local config.

I have added it in a separate file and referenced it in the hut page. I have added the page in /cache which may conflict with the nginx proxy, I'll have to test it.

> Yeah, but use hut as xeon07 is the old name. We still need the nginx forward to use it from the outside (replit). Seems that raccoon can't access `hut` directly, I'll leave it as `jungle.bsc.es` for now. ``` raccoon$ ssh hut ssh: Could not resolve hostname hut: Name or service not known ``` > Can we also add the cache entry in the hut website page? So other users can add it to their local config. I have added it in a separate file and referenced it in the hut page. I have added the page in `/cache` which may conflict with the nginx proxy, I'll have to test it.
This pull request is marked as a work in progress.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 77-hut-cache:abonerib-77-hut-cache
git checkout abonerib-77-hut-cache
Sign in to join this conversation.
No reviewers
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: rarias/jungle#89
No description provided.