-
Notifications
You must be signed in to change notification settings - Fork 2k
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
packer: initial packer configuration to build virtualbox/vagrant boxes #5828
Conversation
Does this mean this is a step into the direction for fixing #5201? |
yes it certainly appears that way (: |
@cgundogan I know its the initial commit, but it would be great to have a (short) README stating how to run packer to build the box and which steps it is roughly doing. I remember one has to download packer and feed the config json into it; thats it?! Otherwise, I already confirmed that it is working as intended -> ACK from my side! Very nice tool chain, great job! |
2a6abc9
to
8e8a2fb
Compare
This is great! I've tested the online image on a linux machine. Then I built my own image with packer and used that one under linux and windows. Everything worked fine! @smlng did you try on your mac? I'm wondering if we should skip the |
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.
@cgundogan I agree with @PeterKietzmann, uploading to vagrant cloud shouldn't be part of the packer (default) process. It should simply create a box according to the recipe, if we want the CI/Murdock to generate and upload a new box the latter step should be done separately - maybe even manually on success. Otherwise this looks (very) good indeed ...
@PeterKietzmann @smlng okay, I removed the uploading post-processor. |
I just realized that this won't be build by Murdock anyway so let's merge as is. Tested ACK and go |
Packer
[1] is a tool to build virtual machine boxes from configuration files.This initial configuration builds a minimal virtualbox image based on ubuntu server 16.04, which includes all necessary toolchains et cetera to build&flash RIOT applications. For now, this box is uploaded into hashicorps cloud [2], but that's not a hard dependency.
Having all those tools baked into the image allows a simpler distribution of that image in scenarios like tutorials held in locations with bad internet connectivity / low bandwidth. In these scenarios, copying the base image (e.g. via usb) and adding it manually via
vagrant box add RIOT-VM <path to box>
is sufficient and does not require a provisioning from vagrant anymore (i.e. no internet access required).The base image can be generated with
packer build -var 'vagrant_token=<token>' -var 'box_version=<version>' riot.json
. This command also uploads the image to the RIOT user that I created at hashicorps cloud, hence the necessary token. (Currently with my private mail address, but I will change it to something more generic: riot-os mail?).@kaspar030 the configuration can be extended to support multiple ubuntu versions and also different OS'es. This might be interesting for murdock to run tests on multiple taget systems.
@kaspar030 To make everything simpler, would it be possible to build a small script for murdock that checks whether a PR contains packer configuration changes, so that a merge of such changes would re-build all virtual machine images + upload them to the cloud?
PS: to skip the
upload to vagrant cloud
step, just remove thevagrant-cloud
post-processor in theriot.json
file, this way, a vagrant box can be built without specifying a token and a version:packer build riot.json
.[1] https://www.packer.io/
[2] https://atlas.hashicorp.com/RIOT