Commit Graph

79 Commits

Author SHA1 Message Date
Girish Ramakrishnan f42c838c4a Pull in redis image 2015-01-07 13:43:53 -08:00
Girish Ramakrishnan ae2abd9162 Add postgresql to base image 2015-01-05 21:42:03 -08:00
Girish Ramakrishnan a572914231 Install pwgen in base image required by postinstall script 2014-11-26 17:09:27 -08:00
Girish Ramakrishnan 44ad297d15 Add hack to update installer as well
Otherwise it's painful to test installer changes
2014-11-26 16:33:43 -08:00
Girish Ramakrishnan 3ebaf951f2 Simplify log filename 2014-11-26 16:28:10 -08:00
Girish Ramakrishnan b28d64dc57 Install mysql addon image 2014-11-26 14:25:23 -08:00
Girish Ramakrishnan f4f24e7347 Make installer run across reboots
The installer is run in provision-mode in the init script

The installer is run as update-mode by supervisor by postinstall

Previously, we used to run the *same* installer code, which was
part of the base image, in both modes. However, after a reboot,
the old installer code is 'gone' and thus we start running the
newer installer code. This distinction is very subtle and this change
makes it more obvious.

If we want the same installer code to run in both modes, then we
really need to split out installer into a separate repository. This
can be done if required later.

This also makes it clear that announce is a feature of the provision
mode.
2014-11-21 14:18:59 -08:00
Girish Ramakrishnan d4ee1c59f1 Use connect-lastmile in installer 2014-11-12 13:15:29 -08:00
Girish Ramakrishnan 0525ccc4a4 Disable metadata API access to non-root users
The only reason not to use the metadata completely for provisioning
is because many VPS providers do not provide it.

If we rely on a metadata API, we can pretty much remove the installer
server
2014-11-10 16:26:56 -08:00
Girish Ramakrishnan cf3e98a3f6 Start supervisor by default in the base image
This is nice to have for the update case where we can just stop
all the apps
2014-10-31 16:59:02 -07:00
Girish Ramakrishnan bb646c3c89 APPSTORE_URL is not part of image anymore
The installer now gets the appStoreUrl from the droplet metadata
2014-10-30 14:02:12 -07:00
Girish Ramakrishnan 779c9c1392 Rework provisioning
The previous provisioning scheme had issues with updates. Because,
configuration was already part of the base bootstrap, providing an
update meant creating a new image.

The key insight in this new provisioning scheme is to treat config
files used by our code as something that can always be regenerated
on demand. Every update kills the config and recreates it all over.

Current flow is thus:
1. bootstrap init code starts up install/server.js. This server merely
   listens for provision and restore calls.

2. The installer calls install.sh. This script simply checks out the
   requested revision. Note that the installer is from what is in the
   base image. Changing the installer requires a new base image. If a
   restore url is provided, this downloads the restore data.

3. The install.sh calls postinstall.sh of the requested revision.
   It setups the code calling npm install, migrates any data and creates
   configs - collectd, graphite, nginx etc. This also creates cloudron.conf.

   Because postinstall.sh is from requested revision, all the data, configs
   are all based on the requested revision.

Note that installation of new packages should be done at base image creation
time.

The changes also provide separation of announce and hearbeat calls:
    - announce is for cloudron coming up and installer running
    - heartbeat is for box server running

TODO:
    appstore url is only part of image becase installer needs to announce.
    This can be fixed by moving to user metadata

Fixes #110
2014-10-29 15:01:40 -07:00
Girish Ramakrishnan c625e7ca76 Rename bootstrap init script to cloudron-bootstrap 2014-10-26 14:38:43 -07:00
Girish Ramakrishnan 884e88d736 Remove verbose logs for npm install 2014-10-24 23:17:24 -07:00
Girish Ramakrishnan fe17cbce50 data dir is now a btrfs subvolume
This makes it snapshottable
2014-10-24 23:01:23 -07:00
Girish Ramakrishnan fae156366c Move to btrfs
The docker data as well as user (yellowtent) home is now btrfs.
This will greatly help us in backups. We simply take a btrfs
snapshot and back that up. This way we don't need to stop all
containers and simulates the same thing as a power outage.

Part of #108
2014-10-24 22:17:46 -07:00
Girish Ramakrishnan 049912c096 Sleep a couple of minutes before retrying again 2014-10-24 17:26:14 -07:00
Girish Ramakrishnan 9da9312086 Cleanup scripts 2014-10-20 16:52:33 -07:00
Girish Ramakrishnan 9f34ecdfa0 Store all data in data/ instead of .yellowtent/ in cloudrons
When run locally, it's still .yellowtent/
2014-10-20 16:44:14 -07:00
Girish Ramakrishnan 0de57a01ab Just use docker exec instead of nsenter
New in docker 1.3

Fixes #109
2014-10-16 13:52:49 -07:00
Girish Ramakrishnan a8e86bbf90 Fix indentation of heredoc 2014-10-16 13:06:45 -07:00
Girish Ramakrishnan 8155a7d0b2 Retry git and npm command till it succeeds
It's fine to run them forever since after 30m the appstore
will recreate it anyway
2014-10-16 12:40:40 -07:00
Girish Ramakrishnan e8a123b439 Improve log messages in initialization script 2014-10-16 12:26:01 -07:00
Johannes Zellner bf570f6f23 Add 2gb swapfile to the base image 2014-10-09 10:59:10 -07:00
Girish Ramakrishnan 11997a4adc Logging rules must be at the very end 2014-10-08 22:03:20 -07:00
Girish Ramakrishnan 112e77dc20 Log dropped incoming packages 2014-10-08 19:35:35 -07:00
Girish Ramakrishnan 99952e5bab Firewall the box
This change firewalls everything except the internal bridge. An upcoming
change should disable icc as well but that requires us to link all the
apps with the mail container.

Part of #59
2014-10-08 19:23:15 -07:00
Girish Ramakrishnan 324011d04f Remove debugging code
Not sure how this got committed
2014-10-06 11:02:36 -07:00
Girish Ramakrishnan 480d7b9bfd Set loglevel to verbose 2014-09-29 17:21:20 -07:00
Girish Ramakrishnan 03289fb55f Add haraka mail relay server as part of base image
Part of #46
2014-09-27 13:09:01 -07:00
Girish Ramakrishnan 04ef971b83 Add girish/base:0.7
Fixes #87
2014-09-23 17:12:38 -07:00
Johannes Zellner b1f8e581bf Make bootstrap script an init script 2014-09-18 12:49:14 -07:00
Girish Ramakrishnan 7b4bca5d90 Append does not seem to work 2014-09-17 16:14:40 -07:00
Girish Ramakrishnan ffa5fa335d Add more debugs for testing 2014-09-17 16:12:29 -07:00
Girish Ramakrishnan 926dd8ae35 Escape $ since they are expanded in heredoc 2014-09-17 16:12:25 -07:00
Girish Ramakrishnan bd74a364ce Write logfiles with pid and also append
This will help confirm if the scripts are running twice for some
reason.
2014-09-17 15:05:46 -07:00
Girish Ramakrishnan 8b3ee3e0df Make bootstrap run at the very end 2014-09-17 15:02:37 -07:00
Girish Ramakrishnan 89ccfe3895 move sync into initialization script 2014-09-17 15:01:59 -07:00
Johannes Zellner 403c94e8df Only unmount aufs filesystems if there are some 2014-09-17 10:21:05 -07:00
Girish Ramakrishnan 31cf9909d7 Enable and disable collectd appropriately 2014-09-17 10:05:13 -07:00
Girish Ramakrishnan bbfe07ab91 Setup -> Install 2014-09-17 09:37:43 -07:00
Girish Ramakrishnan 77daac69c3 Update to latest graphite image 2014-09-16 16:23:38 -07:00
Girish Ramakrishnan fc8a47774b Remove girish/base:0.4 2014-09-15 22:16:04 -07:00
Girish Ramakrishnan 4e1ae532de Move graphite to separate container
Only collectd needs to run in the host
2014-09-15 20:14:57 -07:00
Girish Ramakrishnan 7bb96f3523 Add collectd and graphite support to base image 2014-09-15 02:04:23 -07:00
Girish Ramakrishnan 69c6d3a3fb Bump test image version 2014-09-12 17:19:53 -07:00
Girish Ramakrishnan c93863ef58 Create separate partition for docker images and appdata
This allows us to track their usage easily

Note that files created using dd/truncate are sparse files!
https://wiki.archlinux.org/index.php/sparse_file

Part of #72
2014-09-06 18:43:27 -07:00
Girish Ramakrishnan 0fa3f63673 Upgrade ubuntu as well 2014-09-06 18:43:27 -07:00
Girish Ramakrishnan 878b2ccfe9 Remove code that updates the box repo
This code was used previously when we used to run setup script
over and over again on same base image. This is not done anymore.
2014-09-06 18:43:27 -07:00
Girish Ramakrishnan e2ab01339d Pull in base:0.4 as well 2014-09-04 11:30:56 -07:00