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

add DragonFlyBSD support #904

Merged
merged 7 commits into from
Jun 14, 2021

Conversation

goneri
Copy link
Contributor

@goneri goneri commented May 17, 2021

  • Mostly based on FreeBSD, the main exception is that
    find_devs_with_on_freebsd does not work.
  • Since we cannot get the CDROM or the partition labels,
    find_devs_with_on_dragonflybsd() has a more naive approach and
    returns all the block devices.
  • Support for growpart (GPT only)
  • Support for resizefs

@goneri goneri force-pushed the add-DragonFlyBSD-support_24047 branch 3 times, most recently from 545a40d to abfe17e Compare May 17, 2021 00:55
@goneri
Copy link
Contributor Author

goneri commented May 17, 2021

Note: you can try the DragonFly BSD 6.0.0 image from https://bsd-cloud-image.org/

@goneri goneri force-pushed the add-DragonFlyBSD-support_24047 branch 2 times, most recently from d3a9a46 to b3754c5 Compare May 18, 2021 21:35
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Hey @goneri , thanks for this addition. Overall, this looks very good. I left some comments inline along with some comments for additions and testing here.

Should we add dragonfly here?
https://github.com/canonical/cloud-init/blob/master/cloudinit/distros/__init__.py#L47
and here?
https://github.com/canonical/cloud-init/blob/master/tools/render-cloudcfg#L7

Additionally, we would like some unit testing to go along with this addition.

Can we get unit testing to make sure it is detected correctly? Similar to:
https://github.com/canonical/cloud-init/blob/master/cloudinit/tests/test_util.py#L464

Along with testing for the new find_devs implementation? Simlar to:
https://github.com/canonical/cloud-init/blob/master/tests/unittests/test_util.py#L890
or perhaps:
https://github.com/canonical/cloud-init/blob/master/tests/unittests/test_datasource/test_nocloud.py#L292

cloudinit/distros/freebsd.py Outdated Show resolved Hide resolved
cloudinit/distros/freebsd.py Outdated Show resolved Hide resolved
cloudinit/distros/freebsd.py Outdated Show resolved Hide resolved
config/cloud.cfg.tmpl Outdated Show resolved Hide resolved
config/cloud.cfg.tmpl Outdated Show resolved Hide resolved
cloudinit/distros/dragonflybsd.py Outdated Show resolved Hide resolved
@TheRealFalcon TheRealFalcon self-assigned this May 21, 2021
@goneri goneri force-pushed the add-DragonFlyBSD-support_24047 branch from 8b110fd to 2635885 Compare June 2, 2021 00:48
@goneri goneri requested a review from TheRealFalcon June 2, 2021 00:49
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my inline comments. Did you see my overall comments on the review though? It looks like they still need to be addressed. We still need a couple unit tests, and there might be a place or two you would want to add the distro.

Previous comment:

Should we add dragonfly here?
https://github.com/canonical/cloud-init/blob/master/cloudinit/distros/__init__.py#L47
and here?
https://github.com/canonical/cloud-init/blob/master/tools/render-cloudcfg#L7

Additionally, we would like some unit testing to go along with this addition.

Can we get unit testing to make sure it is detected correctly? Similar to:
https://github.com/canonical/cloud-init/blob/master/cloudinit/tests/test_util.py#L464

Along with testing for the new find_devs implementation? Simlar to:
https://github.com/canonical/cloud-init/blob/master/tests/unittests/test_util.py#L890
or perhaps:
https://github.com/canonical/cloud-init/blob/master/tests/unittests/test_datasource/test_nocloud.py#L292

@goneri
Copy link
Contributor Author

goneri commented Jun 2, 2021

Oh indeed, I totally missed the comment. I will work on that. Thank you for the review!

@goneri
Copy link
Contributor Author

goneri commented Jun 5, 2021

Should we add dragonfly here?
https://github.com/canonical/cloud-init/blob/master/cloudinit/distros/__init__.py#L47

I see I also need to add OpenBSD and NetBSD. Can I do that in another iteration?

and here?
https://github.com/canonical/cloud-init/blob/master/tools/render-cloudcfg#L7

I use freebsd variant for now and tools/build-on-freebsd works fine.

I'm working on the unit-tests.

@goneri goneri force-pushed the add-DragonFlyBSD-support_24047 branch from 6345d85 to fd8c5e0 Compare June 6, 2021 22:05
@TheRealFalcon
Copy link
Member

Hey @goneri , I noticed some new commits. Are you looking for a re-review yet?

@goneri
Copy link
Contributor Author

goneri commented Jun 7, 2021

I've yet to add a test in test_nocloud.py. But yes, an early feedback is welcome.

goneri added 7 commits June 13, 2021 16:08
- Mostly based on FreeBSD, the main exception is that
  `find_devs_with_on_freebsd` does not work.
- Since we cannot get the CDROM or the partition labels,
  `find_devs_with_on_dragonflybsd()` has a more naive approach and
  returns all the block devices.
Grow GPT partition and resize the hammer2 FS.

You need to include a growpart script like this one in the image:
https://github.com/virt-lightning/dragonflybsd-cloud-images/blob/master/growpart
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
@goneri goneri force-pushed the add-DragonFlyBSD-support_24047 branch from c4a1fd2 to b2930e7 Compare June 13, 2021 20:08
@goneri
Copy link
Contributor Author

goneri commented Jun 13, 2021

Regarding nocloud, I don't think we need any special unittest since 72f6eb0. They current code base relies on cloudinit.util which is tested.

@goneri goneri requested a review from TheRealFalcon June 13, 2021 20:42
@TheRealFalcon TheRealFalcon merged commit 59a848c into canonical:master Jun 14, 2021
@goneri
Copy link
Contributor Author

goneri commented Jun 14, 2021

Thank you @TheRealFalcon!

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