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

lxd: Download Alpine image instead of relying on external source #97550

Merged
merged 3 commits into from Sep 9, 2020

Conversation

Patryk27
Copy link
Member

@Patryk27 Patryk27 commented Sep 9, 2020

Motivation for this change

Fixes #97484.

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.

@Patryk27
Copy link
Member Author

Patryk27 commented Sep 9, 2020

cc @jonringer

@worldofpeace
Copy link
Contributor

Let's not have these files in nixpkgs please. We could have an admin upload these to https://tarballs.nixos.org

@worldofpeace
Copy link
Contributor

@Patryk27 I contacted @AmineChikhaoui from the infra team to upload these files to tarballs.nixos.org for you.
We should hear back with stable urls and hashes soon to use here 👍

@Patryk27
Copy link
Member Author

Patryk27 commented Sep 9, 2020

Sure, got it - thank you :-)

@AmineChikhaoui
Copy link
Member

Hey @Patryk27 , can you provide the latest stable url from uk.images.linuxcontainers.org or similar for me to use to download the tarballs first. Thanks

@AmineChikhaoui
Copy link
Member

Uploaded to the following urls:

$ nix-prefetch-url  http://tarballs.nixos.org/alpine/3.12/lxd.tar.xz
path is '/nix/store/cafixfv42cfn63g8bbg592rxkrhnsmp9-lxd.tar.xz'
1c5q9b0cmg04gc66djw51fh160bw3d9yrgv1gvm4nfk5xxl0mmyn

$ nix-prefetch-url  http://tarballs.nixos.org/alpine/3.12/rootfs.tar.xz
path is '/nix/store/z3inz6kkrwj5nzn7d46av7iyfp7j926h-rootfs.tar.xz'
084h3ffl5lmzvkxgxcz0416rgjhcg6xbnfcf5m8cp20s5aqvvdjd

@Patryk27
Copy link
Member Author

Patryk27 commented Sep 9, 2020

kk, ready - thanks :-)

@worldofpeace
Copy link
Contributor

@ofborg test lxd

@worldofpeace
Copy link
Contributor

It seems to fail on ofborg

machine: must succeed: mkdir /var/lxd-pool
machine # [   18.636334] lxd[627]: t=2020-09-09T17:36:49+0000 lvl=warn msg=" - Couldn't find the CGroup blkio.weight, I/O weight limits will be ignored"
(0.05 seconds)
machine: must succeed: cat /nix/store/64l16k960yab010xv69spwrqbvmjam72-config.yaml | lxd init --preseed
machine # Error: Failed to connect to local LXD: Get "http://unix.socket/1.0": dial unix /var/lib/lxd/unix.socket: connect: no such file or directory
machine: output:
error:
Traceback (most recent call last):
  File "/nix/store/kcy6z1kbf4qd6jvv6y9c9g43sdsxy466-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 898, in run_tests
    exec(tests, globals())
  File "<string>", line 1, in <module>
  File "<string>", line 10, in <module>
  File "/nix/store/kcy6z1kbf4qd6jvv6y9c9g43sdsxy466-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 421, in succeed
    raise Exception(
Exception: command `cat /nix/store/64l16k960yab010xv69spwrqbvmjam72-config.yaml | lxd init --preseed` failed (exit code 1)
cleaning up

@Patryk27
Copy link
Member Author

Patryk27 commented Sep 9, 2020

@worldofpeace could you try again? I've added machine.wait_for_file("/var/lib/lxd/unix.socket") to ensure that LXD's socket has been actually initialized.

nixos/tests/lxd.nix Outdated Show resolved Hide resolved
@worldofpeace
Copy link
Contributor

@ofborg test lxd

@worldofpeace worldofpeace merged commit f53e1d6 into NixOS:master Sep 9, 2020
@worldofpeace
Copy link
Contributor

Thanks @Patryk27, could you also backport this to 20.09?

@Patryk27
Copy link
Member Author

Patryk27 commented Sep 9, 2020

Sure - how do I do that? Just prepare a MR to the release-20.09 branch?

@worldofpeace
Copy link
Contributor

@Patryk27 See https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#backporting-changes

worldofpeace added a commit that referenced this pull request Sep 10, 2020
@Patryk27 Patryk27 deleted the fix-lxd-tests branch September 14, 2020 12:25
@Patryk27 Patryk27 mentioned this pull request Apr 27, 2022
13 tasks
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.

Find stable urls for lxd container tests
4 participants