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

Icecream support #84324

Merged
merged 3 commits into from Dec 19, 2020
Merged

Icecream support #84324

merged 3 commits into from Dec 19, 2020

Conversation

Emantor
Copy link
Member

@Emantor Emantor commented Apr 5, 2020

Motivation for this change

Icecream allows distributed compilation in an heterogeneous environment.
This adds the main icecream package and the QT5 based monitor, as well as two new NixOS modules to configure scheduler and daemon. Unfortunately I had to create a new uid for the icecream daemon, since the acceptance of other compile environments hinges on the daemon running as root, which will drop its privileges and switch to the "icecc" user, see here.
I tested this by enabling the module on the desktop and using a debian VM with ptxdist, enabling icecc in the options and using DistroKit as the BSP. A compilation of the armv7a kernel was correctly distributed to both computers running icecream.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

type = types.path;
default = "/var/tmp/icecc-daemon";
description = ''
Maximum size in Megabytes of cache used to store compile environments of compile clients.
Copy link
Member

Choose a reason for hiding this comment

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

It does not look like the right description.
Does this path really need to be customizable ? For example I expect the command will break if this contains spaces.

Copy link
Member Author

@Emantor Emantor Apr 5, 2020

Choose a reason for hiding this comment

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

Yes, I need to fix the description. Reasoning behind this was to give the user the ability to put this on a different partition, I'd be fine with removing this too. The compile environments stored there can get quite large, but size can be restricted as well. IDK, open to options.

Does this path really need to be customizable ? For example I expect the command will break if this contains spaces.

Hm, the type = types.path is not enough for that? It needs extra escaping?

Copy link
Member

Choose a reason for hiding this comment

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

There is no automatic escaping, as escaping rules are not the same for all software.

Reasoning behind this was to give the user the ability to put this on a different partition

On NixOS it is not much harder to define a bind mount of the partition you want to use on /var/run/icecc-daemon.

Anyway, you know the software better than me, so up to you.

nixos/modules/services/networking/icecream/daemon.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/icecream/daemon.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/icecream/scheduler.nix Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Oct 3, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@Emantor
Copy link
Member Author

Emantor commented Oct 3, 2020

I'd like to remove the stale label. I am currently carrying this forward and can rebase onto the master branch quickly, however it is still unclear who needs to review this change.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

This PR looks fine to me. There are a few minor issues, but aside from that I recommend rebase and merge. I'll be happy to do so once the PR is in a ready state.

Thanks for your hard work, and your patience. Sometimes things just slip by. Sometimes it can help if you make noise on IRC or discourse.

nixos/modules/services/networking/icecream/daemon.nix Outdated Show resolved Hide resolved
nixos/modules/misc/ids.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/icecream/daemon.nix Outdated Show resolved Hide resolved
nixos/modules/services/networking/icecream/daemon.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/icemon/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/icemon/default.nix Outdated Show resolved Hide resolved
pkgs/applications/networking/icemon/default.nix Outdated Show resolved Hide resolved
pkgs/servers/icecream/default.nix Show resolved Hide resolved
@Emantor
Copy link
Member Author

Emantor commented Oct 9, 2020

Thanks very much for the review @aanderse. The push should address all review comments and this should be good to go from my side.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

Looks great! Does anyone have any reason we shouldn't merge this? It looks like we should.

@Emantor
Copy link
Member Author

Emantor commented Oct 10, 2020

Thanks for the review @infinisil, I have force pushed another version which should address the review comments.

@Emantor
Copy link
Member Author

Emantor commented Oct 19, 2020

@infinisil gentle ping

This adds modules for the icecream scheduler and daemon.
Icecream can be used for distributed compilation, especially in
environments with diverse toolchains, since it sends the complete build
environment to the daemon.
Unfortunatley the daemon can't be run with DynamicUser = true, since the
daemon requires to be started as root in order to accept other build
environments, see [1].

[1]: https://github.com/icecc/icecream#using-icecream-in-heterogeneous-environments
@Emantor
Copy link
Member Author

Emantor commented Nov 12, 2020

@infinisil gentle ping

@Emantor
Copy link
Member Author

Emantor commented Dec 16, 2020

@infinisil gentle ping

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, looks good now!

@infinisil infinisil merged commit e52f705 into NixOS:master Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants