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

Collecting systemd units execution times in NixOS tests #47883

Closed
wants to merge 1 commit into from

Conversation

nlewo
Copy link
Member

@nlewo nlewo commented Oct 4, 2018

At the end of the NixOS test, exection times of all systemd units
are collected. This is implemented by using the systemd-analyze blame command.

A new section is added to the log.html file. This section contains,
for each VM, the list of running units ordered by time to init.

Motivation for this change

This is to know why some of my tests are too slow:/

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Oct 4, 2018

Sounds useful too me.

@nlewo
Copy link
Member Author

nlewo commented Oct 5, 2018

collecting systemd units exection time
+ master: running command: systemd-analyze blame
master: 4min 58.696s kubelet-bootstrap.service
master: 6.169s docker.service

Hmm, it seems I have to work on the image sizes I load at kubelet start:/

@nlewo nlewo changed the base branch from master to staging October 30, 2018 08:49
@nlewo
Copy link
Member Author

nlewo commented Oct 30, 2018

@Mic92 I've rebased it onto staging since all NixOS tests will be rebuilt...
Do you want to ping someone else, or could we merge it ?

@Mic92
Copy link
Member

Mic92 commented Oct 30, 2018

We can merge it.

@GrahamcOfBorg test boot postgresql.postgresql100

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: tests.boot, tests.postgresql.postgresql100

Partial log (click to expand)

cannot build derivation '/nix/store/93szzfs3cifbsnk8pmx48pnym6afdywc-user-units.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/xzbccxrfmb9zbp44jalf8j399naxs475-etc.drv': 6 dependencies couldn't be built
building '/nix/store/lpsys4kd6ndxvw1wbs3jia05z7mgb1gc-install-grub.sh.drv'...
cannot build derivation '/nix/store/jqfip6gzjnaxh0mh4hrr2g43cc9134ap-nixos-system-machine-19.03.git.1bf9bcc.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/0d0aqm5sa6c712nj9z29l0gr3zh6k7mk-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/4g20zpg7sarbbhr8ldg0cvp791f9zidk-run-nixos-vm.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/15pha3zhzal3xc7b76g0pwqyh0n8cm05-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/fvr9mr4fn0671ihm2x1q0wbyjz1cpkp4-nixos-test-driver-postgresql100.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/wz601fzg126jsc9ag5fc8dgdz4qy9hnw-vm-test-run-postgresql100.drv': 1 dependencies couldn't be built
error: build of '/nix/store/wz601fzg126jsc9ag5fc8dgdz4qy9hnw-vm-test-run-postgresql100.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.boot, tests.postgresql.postgresql100

Partial log (click to expand)

cannot build derivation '/nix/store/vcj8yisfvy0l1ls9yz2rnmjq8qgvvfb0-user-units.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/x9fzbkd9132bb8fqnxvqr7p5v8jwlxba-etc.drv': 6 dependencies couldn't be built
building '/nix/store/1gjqyb8xsws2hq2x4qmqkilnq1fxp64w-install-grub.sh.drv'...
cannot build derivation '/nix/store/53lfihqvdssrggmyi56sabi2bb7xar0a-nixos-system-machine-19.03.git.caaa35c.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/1d8dcmqdkq43m17cl0n7jras7qql346h-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/474rqgm9pca68kw67hy6micfxa0nmpdv-run-nixos-vm.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/ihwsdbxk0dl5mqv98xnccnnyf65h7ahd-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/3kxhfwixhmhd642qvqi736w6d213rhy4-nixos-test-driver-postgresql100.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/k6p9d8nklx5zd1bh8b8qw8cf0p6rkhfq-vm-test-run-postgresql100.drv': 1 dependencies couldn't be built
error: build of '/nix/store/k6p9d8nklx5zd1bh8b8qw8cf0p6rkhfq-vm-test-run-postgresql100.drv' failed

At the end of the NixOS test, exection times of all systemd units
are collected. This is implemented by using the `systemd-analyze
blame` command.

A new section is added to the log.html file. This section contains,
for each VM, the list of running units ordered by time to init.
@nlewo
Copy link
Member Author

nlewo commented Nov 12, 2018

@GrahamcOfBorg test boot postgresql.postgresql100

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.boot

The following builds were skipped because they don't evaluate on x86_64-linux: tests.postgresql.postgresql100

Partial log (click to expand)

Cannot nix-instantiate `tests.postgresql.postgresql100' because:
error: attribute 'postgresql100' in selection path 'tests.postgresql.postgresql100' not found

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.boot

The following builds were skipped because they don't evaluate on aarch64-linux: tests.postgresql.postgresql100

Partial log (click to expand)

Cannot nix-instantiate `tests.postgresql.postgresql100' because:
error: attribute 'postgresql100' in selection path 'tests.postgresql.postgresql100' not found

@nlewo
Copy link
Member Author

nlewo commented Nov 12, 2018

oarf, staging seems to be broken again:/

@nlewo
Copy link
Member Author

nlewo commented Nov 12, 2018

@Synthetica9 it seems the commit 320c9c1 you introduce in staging break the evaluation of test boot:

$ git log -n1
commit 320c9c10de8489604c459127079f59a3ef4d8475 (HEAD)
Author: Patrick Hilhorst <git@hilhorst.be>
Date:   Wed Jun 6 22:04:35 2018 +0200

    make-derivation: use pname-version as default name if both are present

$ nix-instantiate nixos/tests/boot.nix
trace: version 19.03.git.320c9c1 does not appear in name nixos-version
error: assertion failed at /mnt/data/home/lewo/repos/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:189:18
(use '--show-trace' to show detailed location information)

Note this is just the result of a git bisect, so, it could be wrong:/

@Synthetica9
Copy link
Member

No, that does sound like an error introduced by that commit. I'll see what I can do to fix it.

@Synthetica9
Copy link
Member

@nlewo See: nlewo#1

@c0bw3b c0bw3b added the 6.topic: testing Tooling for automated testing of packages and modules label Apr 28, 2019
@mmahut
Copy link
Member

mmahut commented Aug 19, 2019

Are there any updates on this pull request, please?

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@Mic92
Copy link
Member

Mic92 commented Jul 23, 2020

We are about the to deprecate the perl driver. Please re-implement for the python one if you still want this feature.

@Mic92 Mic92 closed this Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos 6.topic: testing Tooling for automated testing of packages and modules 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants