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

Produce Vagrant boxes #227

Closed
6 tasks
msehnout opened this issue Feb 12, 2020 · 1 comment
Closed
6 tasks

Produce Vagrant boxes #227

msehnout opened this issue Feb 12, 2020 · 1 comment

Comments

@msehnout
Copy link
Contributor

Goals

Produce Fedora and RHEL “boxes” that can be used with Vagrant [1], more specifically with vagrant-libvirt provider [2]. This means it won’t be usable with any other provider, namely Docker, Hyper-V, VMWare, or VirtualBox. In the future we might want to support at least VirtualBox to enable people running macOS to take advantage of this feature.

In the following text, whenever I refer to a “vagrant box” I mean a libvirt specific one.

Scope of the work

Vagrant box is a tarball containing [3]

  • qcow2 image
  • image.json - file containing very little amount of metadata (example here)
  • default Vagrantfile - default configuration of the box (example here)

Both files can be static and thus it is not necessary to store them directly in the pipeline.

I think the work can be divided into two parts:

  • Create the qcow2 image with required configuration [4]
  • Create the tarball.

Creation of the image

According to the documentation [4], the base image must contain a running SSH server. Additionally, it must contain a specific user with a specific SSH key and it should use a well-known root password. All of this is possible with current osbuild and osbuild-composer implementation.

It is also required to have a specific sudo configuration and sshd configuration. This would require changing a configuration file, therefore it is related to the work from Will about how to handle cases like this. [5][6]

Creation of the tarball

This part is more complicated and cannot be achieved with current osbuild implementation. It basically requires an “assembler pipeline” where we produce qcow2 image and then take the produced image and create a tarball containing it. The metadata files will be mostly or completely predefined (I think completely, but I’m not 100% sure).

We can leave this part out and use a shell script to generate a tarball out of a qcow2 image.

Proposed steps

  • Create a pipeline (json file) and metadata by hand (json and Vagrantfile), verify that it can work. This pipeline will contain script stages to configure sudo and sshd.
  • Implement SSH configuration stage
  • Implement sudo configuration stage
  • Create “vagrant-libvirt” output type here (osbuild-composer) containing all the customizations required
  • Implement vagrant-libvirt assembler in osbuild (this can copy & paste our current qemu assembler and add a tar call at the end)
  • Finish the work in osbuild-composer by using the new osbuild feature

Final note (for Open Source Contest)

It is not necessary to implement all the steps. In fact it is way to much for a single contribution, so feel free to implement only parts of it (e.g. only create the pipeline, or only implement the stages)

Sources

[1] https://www.vagrantup.com/
[2] https://github.com/vagrant-libvirt/vagrant-libvirt
[3] https://github.com/vagrant-libvirt/vagrant-libvirt/tree/master/example_box
[4] https://www.vagrantup.com/docs/boxes/base.html#creating-a-base-box-1
[5] osbuild/osbuild#181
[6] osbuild/osbuild#191

@teg
Copy link
Member

teg commented May 26, 2020

This was not done for the contest, and is no longer on the roadmap.

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

No branches or pull requests

2 participants