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 functionality to ensure the control host-only interface (vboxnet0) with a configured DHCP server exists before proceeding to deploy a virtualbox. Create the interface and the DHCP servers as needed. Added unittests #202

Closed
wants to merge 5 commits into from

Conversation

goodwillcoding
Copy link

No description provided.

@edolstra
Copy link
Member

Hm, this is a lot of code for what I assume would just be a one-line call to VBoxManage hostonlyif create... I mean, the VirtualBox backend is currently ~1300 lines, and this adds almost a thousand lines just for this feature.

@goodwillcoding
Copy link
Author

@edolstra

It only looks big
Its 104 lines of code, 78 if I remove the "fit with the screen formatting" thats there for readability.

There rest is unittests (in its own file), comments and docstrings,

Just for clarity, the funcitonality is as follows:

  • create a "vboxnet0" interface with a DHCP server if one does not exist, after asking the user
  • if "vboxnet0" exists but does not have a DHCP server, create it and attach it to "vboxnet0" after asking the user
  • if "vboxnet0" exists but does but its DHCP server is disabled, enable it after asking the user
  • if Host-Only interface is not "vboxnet0" then throw some errors. This last part is in prep to make the interface configurable via nix expressions. I talked to @shlevy about it and looking into how it can be done in a coherent manner.

The unittests are larger because of need to monkeypatch some bits to test the functionality in isolation. I am open to suggestions on this, but there were no current unittests for most of this code for me to really model it well

@domenkozar
Copy link
Member

@goodwillcoding are you still interested into this change?

@goodwillcoding
Copy link
Author

It's been awhile and I forgot about this. It's definately useful functionality cause I did not have vboxnet0 on my machines. Any concern about merging it?

@grahamc
Copy link
Member

grahamc commented Mar 26, 2020

Hello!

Thank you for this PR.

In the past several months, some major changes have taken place in
NixOps:

  1. Backends have been removed, preferring a plugin-based architecture.
    Here are some of them:

  2. NixOps Core has been updated to be Python 3 only, and at the
    same time, MyPy type hints have been added and are now strictly
    required during CI.

This is all accumulating in to what I hope will be a NixOps 2.0
release
. There is a tracking issue for that:
#1242 . It is possible that
more core changes will be made to NixOps for this release, with a
focus on simplifying NixOps core and making it easier to use and work
on.

My hope is that by adding types and more thorough automated testing,
it will be easier for contributors to make improvements, and for
contributions like this one to merge in the future.

However, because of the major changes, it has become likely that this
PR cannot merge right now as it is. The backlog of now-unmergable PRs
makes it hard to see which ones are being kept up to date.

If you would like to see this merge, please bring it up to date with
master and reopen it
. If the or mypy type checking fails, please
correct any issues and then reopen it. I will be looking primarily at
open PRs whose tests are all green.

Thank you again for the work you've done here, I am sorry to be
closing it now.

Graham

@grahamc grahamc closed this Mar 26, 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.

5 participants