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
cloud-init: 0.7.9 -> 20.2 (python3!) #95746
Conversation
|
||
checkInputs = with pythonPackages; [ contextlib2 httpretty mock unittest2 ]; | ||
disabledTests = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost all tests are running!
}; | ||
|
||
patches = [ ./add-nixos-support.patch ]; | ||
patches = [ ./0001-add-nixos-support.patch ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think about upstreaming this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should - the patch is generic enough for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! This should be included in 20.09 if possible.
@@ -72,7 +95,7 @@ diff -ruN cloud-init-0.7.6.orig/cloudinit/distros/nixos.py cloud-init-0.7.6/clou | |||
+ if not conf: | |||
+ conf = HostnameConf('') | |||
+ conf.set_hostname(your_hostname) | |||
+ util.write_file(out_fn, str(conf), 0644) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 0644 the default mode if left unspecified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will use the permission of the old file, which is .r--r--r-- 14 root 1 Jan 1970 /nix/store/g1mkk8lygngbzvm632wbmnm8xxf9dymz-etc-hostname
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. The actual line you are interested in is below.
@@ -52,6 +73,8 @@ diff -ruN cloud-init-0.7.6.orig/cloudinit/distros/nixos.py cloud-init-0.7.6/clou | |||
+ # calls from repeatly happening (when they | |||
+ # should only happen say once per instance...) | |||
+ self._runner = helpers.Runners(paths) | |||
+ self.usr_lib_exec = os.path.join(os.path.dirname(__file__), | |||
+ "../../../../../libexec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does that point to, the current-system libexec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/lib
if not overwritten. Now it points to the $out/libexec
.
owner = "canonical"; | ||
repo = "cloud-init"; | ||
rev = version; | ||
sha256 = "sha256-QeY/fdIIUSsp5oNxyRtZwpTB747Jf5KAJuYY9yiKUvc="; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are SRI hashes allowed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. nix1 was removed a while ago. We have a few of them in nixpkgs already. @edolstra or somebody else gave green light in the past. I don't remember which thread though.
@zimbatm could you give this a shot on ec2 or gcp. Or can you refer to someone else who can test it? |
maybe @rbvermaa ? |
@Mic92 I just stubled over some old work from me in January on this (which I never pushed, boo). I just rebased and pushed it to https://github.com/flokli/nixpkgs/commits/cloud-init. At least flokli@b19bcea seems to be a good addition for more test coverage, and maybe the |
@flokli feel free to push it on top. I won't get back to until 9th october. |
I was also quite busy spending time away from computers 😆 Hope you're fine - let me know if you want to pick this up. I currently don't really have any strong ties with cloud-init, but felt like it'd be a waste to just ignore these commits. |
required rebasing the patch, disabling some tests. I also changed the hash to be in conventional format - the hash mismatch in fixed-output derivation '/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-source': wanted: sha256:yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy got: sha256:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz doesn't propose SRI syntax.
Pushed my commits on top. I opted against changing the cloud-init patch to use
I also added a test checking the hostname change being successful, and bumped to 20.3 (which required some more tests to be disabled), PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)