340 Commits

Author SHA1 Message Date
Leo Simons
362946c52e CLOUDSTACK-7143: don't call rvm from build
It is simpler to expect that rvm setup is done outside of this build.
The buildacloud.org jenkins has rvm installed/enabled by default so
does not invoke rvm.
2014-09-22 21:38:17 +02:00
Leo Simons
a8500ed73e CLOUDSTACK-7143: survive / in branch names 2014-09-22 21:38:17 +02:00
Leo Simons
115b2cf8e7 CLOUDSTACK-7143: only archive the zipped hyperv image
Cherry-pick of d09acc44f2b36cd593ebe97ab1673b7757ea2c25.
2014-09-22 21:38:17 +02:00
Leo Simons
d56e950e85 CLOUDSTACK-7143: work on vagrant box export
Running --export creates the .ovf and the .vmdk files referenced
from that .ovf in one go. Guessing/predicting the names of the .vmdk
files is not fool-proof.
2014-09-22 21:38:17 +02:00
Ian Southam
cab4dd8258 CLOUDSTACK-7143: Fixed box file for virtualbox 2014-09-22 21:38:16 +02:00
Leo Simons
598c472b73 CLOUDSTACK-7143: remove erroneous backticks
The backticks in the Vagrantfile template were getting evaluated by bash.
This caused some harmless but confusing error messages to appear on running
the build. Easy fix is to remove them.
2014-09-22 21:38:16 +02:00
Leo Simons
35347f8350 CLOUDSTACK-7143: try to fix jenkins problems with last 2 commits
* bundle install needs to run before running the vbox cleaning scripts,
  so move prepare step before clean step
* feature branches have / in their name which is a bad character to
  put into filenames
2014-09-22 21:38:16 +02:00
Leo Simons
00b39de0f8 CLOUDSTACK-7143: more reliable support for vagrant box export
Veewee supports exporting vagrant boxes out of virtualbox, out of the box.
However, it assumes that it can export a disk if the shutdown of the vm that
is using that disk has succeeded. This assumption is not strictly always true
(see previous commit). So, we replicate the bit of logic in veewee for making
vagrant boxes.

This has the added side benefit of creating an .ovf export only once, rather
than once for vmware and then again for vagrant.
2014-09-22 21:38:16 +02:00
Leo Simons
be8b2d7c21 CLOUDSTACK-7143: more robust box cleanup
Having experimented with many edge cases of running multiple build.sh
commands in parallel / against busy virtualbox setups, the only really
reliable way to produce consistent images is to not do these commands
in parallel and to not do them while the machine is doing many other
things.

If virtualbox or the machine that hosts it is very busy, and/or it has
a lot of disks it knows/knew about, and/or its tuesday, behavior may
be a bit different.

Realizing this reality, this commit adds some scripts that try really
hard to set virtualbox back to known/healthy state before building.
2014-09-22 21:38:16 +02:00
Leo Simons
d658fc4637 CLOUDSTACK-7143: attempt to export a vagrant box 2014-09-22 21:38:16 +02:00
Leo Simons
1821f4ec06 CLOUDSTACK-7143: fix a missing apt-get update
In 8e2d06153b3d5ec1540fac1c8fbc97b5d2b58a8e I mistakenly/accidentally
a apt-get update.

As
    https://wiki.debian.org/Multiarch/HOWTO
explains, apt-get update is needed after adding a new architecture.
2014-09-22 21:38:15 +02:00
Leo Simons
91ffedb39c CLOUDSTACK-7143: a better fix for kernel upgrade disk space problems
Increase / and /boot a little bit, to the point that there is enough
space on them to do a kernel upgrade. With this I think we can
decrease total disk space usage back down to 2.5GB.

Docs for the preseed config found at
  http://anonscm.debian.org/gitweb/?p=d-i/debian-installer.git;a=blob_plain;f=doc/devel/partman-auto-recipe.txt;hb=HEAD
2014-09-22 21:38:15 +02:00
Leo Simons
d5a4a2521b CLOUDSTACK-7143: fix do_signature to account for change to install_cloud_scripts
The do_signature script required a lingering cloud-scripts.tar that was no longer
there after the git export tarball fiddling magic was gone.
2014-09-22 21:38:15 +02:00
Leo Simons
25bb682cd1 CLOUDSTACK-7143: fix the fix for rvm/ruby/bundler setup on jenkins
The recommended use of --deployment goes along with the requirement to
check Gemfile.lock into source control, which I don't want to do.
2014-09-22 21:38:15 +02:00
Leo Simons
0570d37106 CLOUDSTACK-7143: initial apt-upgrade still running out of space (upgrading the kernel)
I wonder if this is due to the 7.4.0->7.6.0 needing more space. Should see if
there's more stuff that can be cleaned earlier?
2014-09-22 21:38:15 +02:00
Leo Simons
b4fceef407 CLOUDSTACK-7143: sometimes the consolidated 'apt' command runs out of space 2014-09-22 21:38:15 +02:00
Leo Simons
41ddb6b768 CLOUDSTACK-7143: make script compatible with linux mktemp 2014-09-22 21:38:15 +02:00
Leo Simons
631a3c8722 CLOUDSTACK-7143: install openssl early enough to allow generating passwords 2014-09-22 21:38:14 +02:00
Leo Simons
a56392b5e4 CLOUDSTACK-7143: attempt at a reliable way to set up rvm/bundler on jenkins 2014-09-22 21:38:14 +02:00
Leo Simons
a7d07bf3df CLOUDSTACK-7143: fix a bug where a script file rename wasn't propagated to build.sh 2014-09-22 21:38:14 +02:00
Leo Simons
634560e381 CLOUDSTACK-7143: fix a bug in the debianbase template that was referencing deleted scripts 2014-09-22 21:38:14 +02:00
Leo Simons
dd34d10159 CLOUDSTACK-7143: add tests for the appliance build
Create a new minimal 'debianbase' definition which is a veewee template
that's a lot like the systemvmtemplate, but does not have any
systemvm-ness in it. Use it to create a new test.sh which tests a few
common invocations of build.sh work as desired.

This is mainly useful for debugging whether the appliance build process
is working / consistent; in order to test a systemvm itself it should
really first be merged with systemvm.iso.
2014-09-22 21:38:14 +02:00
Leo Simons
33fd6894a0 CLOUDSTACK-7143: use shar to inject cloud-scripts from working copy
The current build downloads its script from master by fetching a cloudstack
tarball. Besides being an unneeded load on the apache git server, this is a
problem when working on a branch and wanting to inject a different set of
scripts. It also makes it pretty likely that the injected copy of the script
will not match what a production release wants, so there is very little
chance of not needing to overwrite the scripts.

Ideally we would just rsync over some files. However, veewee does not provide
an option to do that. In order to keep a 'cleanly veewee-only' build possible,
and work with any recent veewee version, in this change we restor to using
shar (http://en.wikipedia.org/wiki/Shar) to produce an archive which can
execute as a script, which we feed to veewee to execute.
2014-09-22 21:38:14 +02:00
Leo Simons
35ba68444b CLOUDSTACK-7143: add the ability to inject a custom SSH key
When working on the systemvm in isolation, or using vagrant or similar tools,
it can be useful to inject a custom SSH key before merging a management server
systemvm.iso into it. This option allows that. It should _not_ have effect
on management-server-managed vms which always get their SSH keys injected.
2014-09-22 21:38:13 +02:00
Leo Simons
18364216d8 CLOUDSTACK-7143: improve build.sh failure handling and recovery
In particular, this refactoring allows the use of 'set -e' to exit early on
error. Previously the script would continue for a while when encountering a
problem, stuttering sometimes to (almost) completion, producing partial or
no results.

Added a bash on EXIT trap which runs add_on_exit cleanup code in the reverse
order it was specified. Resource cleanup is now co-located with resource
definition.

Added color-coded logging.

Made most of the hypervisor-specific exports optional. This script now
works on Mac OS X.
2014-09-22 21:38:13 +02:00
Leo Simons
2832bc47e1 CLOUDSTACK-7143: improve build.sh ergonomics
Added a bunch of possible arguments / environment variables, see the new usage
function for details (or run ./build.sh help).

Creates a new template with a unique name on every invocation, resulting in a
new virtualbox instance with a unique name. This makes it possible to build
multiple boxes at the same time, in parallel (including for example on a
multiuser box), and reduces the chance of failed build results conflicting
with each other.

Inject the version given on the command line (if any) into the created image.
2014-09-22 21:38:13 +02:00
Leo Simons
de68741f60 CLOUDSTACK-7143: license headers on all the systemvm scripts 2014-09-22 21:38:13 +02:00
Leo Simons
d3ecb0099c CLOUDSTACK-7143: cleanup configure_conntrack.sh code 2014-09-22 21:38:13 +02:00
Leo Simons
44ceeabb28 CLOUDSTACK-7143: cleanup zerodisk.sh code 2014-09-22 21:38:13 +02:00
Leo Simons
f67a379a46 CLOUDSTACK-7143: tune timeouts to expect about <=~60 min build 2014-09-22 21:38:12 +02:00
Leo Simons
654c871e75 CLOUDSTACK-7143: cleanup configure_systemvm_services.sh code 2014-09-22 21:38:12 +02:00
Leo Simons
7d9e46425f CLOUDSTACK-7143: rename postinstall.sh to represent what remains 2014-09-22 21:37:19 +02:00
Leo Simons
c7e6387752 CLOUDSTACK-7143: collapse apt-get install onto one line
In theory this _could_ have changed behavior (apt coming up with a different
solution, or one of the packages configuring a new apt repository), but in my
testing, the end result is the same.
2014-09-22 21:37:19 +02:00
Leo Simons
22617e9496 CLOUDSTACK-7143: reorg of install_systemvm_packages.sh (no logic changes, yet) 2014-09-22 21:37:18 +02:00
Leo Simons
3d4e4a6e09 CLOUDSTACK-7143: consider vhdutil a software package 2014-09-22 21:37:18 +02:00
Leo Simons
06c1c16dc3 CLOUDSTACK-7143: move install_packages from postinstall.sh to its own file 2014-09-22 21:37:18 +02:00
Leo Simons
71c913c658 CLOUDSTACK-7143: cleanup configure_networking.sh code 2014-09-22 21:34:47 +02:00
Leo Simons
a533de7593 CLOUDSTACK-7143: move networking logic from postinstall.sh to configure_networking.sh 2014-09-22 21:34:47 +02:00
Leo Simons
3574dcf543 CLOUDSTACK-7143: split connection tracking config into its own file 2014-09-22 21:31:36 +02:00
Leo Simons
ed53167547 CLOUDSTACK-7143: cleanup cleanup.sh code 2014-09-22 21:31:36 +02:00
Leo Simons
3c9f2c7227 CLOUDSTACK-7143: cleanup configure_acpid.sh code 2014-09-22 21:31:36 +02:00
Leo Simons
5627b67ff3 CLOUDSTACK-7143: move fix_acpid to its own file 2014-09-22 21:31:35 +02:00
Leo Simons
6a688a0337 CLOUDSTACK-7143: cleanup configure_locale.sh code 2014-09-22 21:31:35 +02:00
Leo Simons
aa14a619a6 CLOUDSTACK-7143: split locale config into its own file 2014-09-22 21:31:35 +02:00
Leo Simons
3f8c31b0da CLOUDSTACK-7143: cleanup configure_login.sh code
Had to change various things to make this code re-entrant. In particular,
the sed-based manipulation of /etc/sudoers is gone and replaced with a
simpler, minimal (but compatible) sudoers file.

Remove the sshd_config tuning since sshd_config is overwritten when we
apply the cloud_scripts overlay (from build.sh).
2014-09-22 21:31:35 +02:00
Leo Simons
e86121db7b CLOUDSTACK-7143: split login config out from postinstall.sh 2014-09-22 21:31:35 +02:00
Leo Simons
e5a2e67551 CLOUDSTACK-7143: cleanup configure_gruh.sh code
Adding a check whether GRUB_TIMEOUT has already been set, and if it has,
skip re-running update-grub.
2014-09-22 21:31:35 +02:00
Leo Simons
29c1f91aea CLOUDSTACK-7143: add vagrant_box_build_time file that's standard with current veewee templates 2014-09-22 21:31:34 +02:00
Leo Simons
58ca92ce52 CLOUDSTACK-7143: cleanup apt_upgrade.sh code 2014-09-22 21:31:34 +02:00
Leo Simons
6641fd3a76 CLOUDSTACK-7143: move add_backports to apt_upgrade.sh 2014-09-22 21:31:34 +02:00