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

Rewrite hydra.rst to mention RunCommand hooks #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antifuchs
Copy link

This provides an alternative configuration for hydra jobs pushing to cachix (namely, the configuration that I ended up using (-:).

Hope this is useful to somebody else, too.

This provides an alternative configuration for hydra jobs pushing to cachix.
@domenkozar
Copy link
Member

What's the benefit over the hooks?

@antifuchs
Copy link
Author

The benefit is that the system building the derivation doesn't have to be modified to upload everything to cachix and that you can choose what jobs to do the cachix-uploading for (this machine for instance also builds a bunch of docker images from nix that definitely shouldn't be cached).

@domenkozar
Copy link
Member

Is there any reason to support the post-build-hook then? If not, we should just document the runCommand option.

@antifuchs
Copy link
Author

I think that might work - but there are some things I'm not sure about re. this vs. the post-build hook (I'm a hydra newbie and am running it with only one build host, the one that the hydra service runs on): mainly, when one job is done, is it the same node that runs the post-build script? I'm not sure: that would be effectively guaranteed with the hook.

runtimeInputs = [pkgs.jq pkgs.cachix];
text = ''
set -xeu
jq -r '.outputs[].path' "$HYDRA_JSON" | xargs cachix --config ${config.age.secrets.hydra-ci.path} push mycache
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need to specify here how to create the config, and mention it's advised to use some secrets manager like age.

@domenkozar
Copy link
Member

I think it's fine to just advertise the runcommand, so that the users don't need to decide between two options.

It seems like the main server does the pushing in this case, which is fine.

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

Successfully merging this pull request may close these issues.

2 participants