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

Per-project binary caches (or alternatives) #62

Open
dhess opened this issue Dec 23, 2021 · 4 comments
Open

Per-project binary caches (or alternatives) #62

dhess opened this issue Dec 23, 2021 · 4 comments

Comments

@dhess
Copy link

dhess commented Dec 23, 2021

We're preparing to make a few open source releases, and we'd like to provide public Cachix caches for these projects. However, we have multiple other projects that will remain private, and we'd like to push derivations to either a private S3 or private Cachix cache for these projects. As far as I can tell, Hercules CI doesn't easily support this scenario. At the moment, I believe we'd need to create one account/org for the private builds, and one for the public builds, and then partition our builders by account/org.

One way to nicely support this would be to configure binary cache outputs on a per-project level; e.g., when you add a GitHub repo to Hercules CI, you can also specify the binary cache to use for builds for that project.

Another way would be per-project agents. In this scenario you'd assign different agents to different projects, and the user would need to ensure that each agent used the correct binary cache. This seems less ideal, not only because of the configuration headaches, but also because I think it wouldn't be possible to use the same host to build both private and public projects, unless you also added support for multiple agents per host.

I don't know much about Hercules CI Effects, as I haven't used Hercules CI since these were added. Perhaps what I want to do is possible via effects?

@MatthewCroughan
Copy link

The lack of multi-project support in a single agent, or at least the ability to run multiple agents on the same machine has become a bit of a blocker for me, as running the agent in a container is not a real solution, since it is buggy in quite a few ways, namely:

@dhess
Copy link
Author

dhess commented May 14, 2022

Is it safe to say that this has been addressed by hercules-ci/hercules-ci-agent#361 (comment) ?

(If so, I suppose only for NixOS machines and not Mac builders. Any plans to make this feature available on macOS?)

@roberth
Copy link
Member

roberth commented May 14, 2022

Is it safe to say that this has been addressed by hercules-ci/hercules-ci-agent#361 (comment) ?

Only if the caches correspond exactly to github organizations.

(If so, I suppose only for NixOS machines and not Mac builders. Any plans to make this feature available on macOS?)

Can do so in the short term if this addresses your issue i.e. if you have a github organization per cache configuration.

@dhess
Copy link
Author

dhess commented May 15, 2022

Is it safe to say that this has been addressed by hercules-ci/hercules-ci-agent#361 (comment) ?

Only if the caches correspond exactly to github organizations.

I'm not exactly sure what you mean by this. We have one GitHub org, https://github.com/hackworthltd. That GitHub org has an associated Hercules CI account, and an associated Cachix account. The Cachix org account has 2 caches: one private, and one public. We'd like agents belonging to our Hercules CI account to push to the org's public cache when building public GitHub projects belonging to the organization, and to the org's private cache when building private projects belonging to the organization.

When I wrote the OP in Dec 2021, it was my understanding that this scenario wasn't supported. Quoting myself from the OP:

Another way would be per-project agents. In this scenario you'd assign different agents to different projects, and the user would need to ensure that each agent used the correct binary cache. This seems less ideal, not only because of the configuration headaches, but also because I think it wouldn't be possible to use the same host to build both private and public projects, unless you also added support for multiple agents per host.

I was hoping that now that it's possible to run multiple agents per (NixOS) host, it would also be possible to configure each agent to push to a particular Cachix cache. Then we could configure one agent to build public projects, and another to build private projects, and the built products would be pushed to the appropriate Cachix cache.

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

No branches or pull requests

3 participants