Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

om health: check access to private caches #315

Open
shivaraj-bh opened this issue Jan 4, 2024 · 4 comments
Open

om health: check access to private caches #315

shivaraj-bh opened this issue Jan 4, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@shivaraj-bh
Copy link
Member

As of now we verify the presence of the cache in nix config’s substituters. But the presence alone is not enough to verify this for private caches.

@srid srid added the enhancement New feature or request label Jan 4, 2024
@srid
Copy link
Member

srid commented Jan 4, 2024

How do we do the verification?

@srid srid transferred this issue from juspay/omnix Apr 5, 2024
@srid srid transferred this issue from juspay/nix-health Oct 14, 2024
@srid srid changed the title nix-health: check access to private caches om health: check access to private caches Oct 14, 2024
@shivaraj-bh
Copy link
Member Author

This is actually simple to do by checking the exit-code of running nix store ping --store <cache-url>. If it is a private cache, it just fails with error: '<cache-url>' does not appear to be a binary cache. It could also mean that the user might have entered incorrect url, but if we ignore that, this seems to be the simplest way to verify.

@shivaraj-bh
Copy link
Member Author

Note: Implementing the above would also mean we would be running more nix commands in the om develop preShell.

@srid
Copy link
Member

srid commented Dec 3, 2024

That makes sense. Currently, we only test trusted-substituters, and not if the cache is actually accessible (requires netrc for private cache).

So the solution is to check for both trusted-substituters and whether the cache can be accessed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants