ServerSetup
Server setup
Dependencies
- bzr (to grab the branch)
- abootimg android-tools-fsutils python-gnupg fakeroot pxz (runtime dependencies)
- pep8 pyflakes python-mock (for the tests)
- apache2 (web server)
Web server setup
sudo adduser $USER www-data sudo chgrp www-data /var/www/ sudo chmod g+rwX /var/www/ sudo rm -f /var/www/index.html
Setting up the server itself
This assumes all the above was installed and done, that the code is running as an "ubuntu" user in its default home directory, on a server accessible at system-image.test.com with a valid SSL certificate on port 443.
bzr branch lp:~ubuntu-system-image/ubuntu-system-image/server system-image cd system-image tests/generate-keys tests/run cp -R tests/keys/*/ secret/gpg/keys/ bin/generate-keyrings
At this stage, you have the branch on your system, have generated some GPG keys (albeit test ones) and generated the matching keyrings. It's now time to configure the system by creating "etc/config" containing:
[global] base_path = /home/ubuntu/system-image/ channels = test gpg_key_path = secret/gpg/keys/ gpg_keyring_path = secret/gpg/keyrings/ publish_path = /var/www/ state_path = state/ public_fqdn = system-image.test.com public_http_port = 80 public_https_port = 443 [channel_test] type = auto versionbase = 1 fullcount = 15 files = ubuntu, device, custom-savilerow, keyring, version file_ubuntu = remote-system-image;https://system-image.ubuntu.com;trusty-proposed;ubuntu file_device = remote-system-image;https://system-image.ubuntu.com;trusty-proposed;device;keyring=archive-master file_custom-savilerow = http;https://jenkins.qa.ubuntu.com/job/savilerow-watch/lastSuccessfulBuild/artifact/custom.tar.xz;name=custom-savilerow,monitor=https://jenkins.qa.ubuntu.com/job/savilerow-watch/lastSuccessfulBuild/artifact/build_number file_keyring = keyring;archive-master file_version = version
You may want to look at config.example for all possible key values.
The above defines a server accessible at system-image.test.com, which listens for http on port 80 and for https on port 443, has one channel that's managed by the importer, that channel is configured to contain 5 tarballs:
ubuntu => Ubuntu root filesystem, imported as-is from system-image.ubuntu.com
device => Device tarball, imported from system-image.ubuntu.com and then repacked to swap the GPG keys
custom-savilerow => Imported from an http server (customization tarball)
keyring => Contains the GPG keys that override those from the ubuntu tarball
version => Contains the channel configuration and current build data
Now that the configuration is done, we need to actually create the channels, add a device and publish the keyrings, for that, run "bin/si-shell" and do:
pub.create_channel("test")
pub.create_device("test", "mako")
for keyring in ("archive-master", "image-master", "image-signing", "blacklist"):
pub.publish_keyring(keyring)At this point, your server is ready, all you need to do now is generate images by running: bin/import-images