==================================== Using Juju LXC For Local Development ==================================== Development efforts can be sped up using local juju deployments with lxc. Setting up Juju LXC =================== You'll need a .juju/environments.yaml file with a "local" entry like: .. code-block:: none default: local environments: local: type: local default-series: precise lxc-clone: true lxc-clone-aufs: true admin-secret: secret apt-http-proxy: http://10.0.3.1:8000 Install squid-deb-proxy. Then create /etc/squid-deb-proxy/mirror-dstdomain.acl.d/20-juju-local with the following contents: .. code-block:: none ppa.launchpad.net private-ppa.launchpad.net Restart the squid-deb-proxy service. All apt downloads will now be cached by the proxy server running on your local machine. Next, you will need swift credentials set up. This ensures the services still have access to object storage (Swift), virtual machine image storage (Glance), and virtual machine instantiation (Nova). An example .hpcloud-rc file should look like: .. code-block:: none # FOR SWIFT export JUJU_ENV=local export OS_USERNAME="" export OS_TENANT_NAME="" export OS_PASSWORD= export OS_AUTH_URL="https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0" export OS_REGION_NAME=region-a.geo-1 # FOR GLANCE (same credentials as above by default) export GLANCE_OS_USERNAME="$OS_USERNAME" export GLANCE_OS_AUTH_URL="$OS_AUTH_URL" export GLANCE_OS_REGION_NAME="$OS_REGION_NAME" export GLANCE_OS_TENANT_NAME="$OS_TENANT_NAME" export GLANCE_OS_PASSWORD="$OS_PASSWORD" # FOR OAUTH TOKENS export CI_LAUNCHPAD_PPA_OWNER= export CI_LAUNCHPAD_USER= export CI_OAUTH_CONSUMER_KEY="ci-airline" export CI_OAUTH_TOKEN= export CI_OAUTH_TOKEN_SECRET= .. note:: +++ Use the OAuth values generated in `OAuth setup`_ to fill these If your swift server only supports the 1.0 auth protocol (TempAuth does not support 2.0), you additionally need to set some ``$ST_*`` variables for ``python-swiftclient``, and include the tenant/project name into the user name: .. code-block:: none export OS_USERNAME="" export OS_TENANT_NAME="" export OS_PASSWORD=" 4) juju destroy-environment --force -y local; juju bootstrap 5) rm -rf tmp/ 6) ./juju-deployer/deploy.py # Or './juju-deployer/deploy.py branch-source-builder' to only deploy Branch Source Builder service 7) 8) Repeat from step 3-7 for iterative development Upgrade ======= The development effort can be further sped up using the ``--upgrade`` option in ``deploy.py``. The generic steps of upgrading are given in the `Upgrade`_ section. The following steps are specific to the local development: .. code-block:: none 1) bzr branch lp:uci-engine 2) cd uci-engine 3) 4) juju destroy-environment --force -y local; juju bootstrap 5) rm -rf tmp/ 6) ./juju-deployer/deploy.py --build-only --working-dir ./tmp 7) ./juju-deployer/deploy.py # use ./juju-deployer/deploy.py branch-source-builder for deploying only bsb serivce. 8) 9) ./juju-deployer/deploy.py --upgrade all # this will upgrade the modified charms and config 10) Repeat the steps 8-9 for fixing and testing the charms that were already deployed .. _`OAuth setup`: oauth.html .. _`Upgrade`: upgrade.html