This repository contains the scripts necessary to deploy and update all PTero services.
The /allinone directory contains a Vagrantfile for spinning up a complete set
of PTero services in a single VM.
- Describe deployment architecture
- single points of failure?
- particular areas to monitor?
- Deployment technologies
- heat
- puppet
- fabric
- Install tool requirements with
pip install -r requirements.txt. - Setup OpenStack credentials (see below).
- Configure staging and production stacks in
config.yaml(see below). - Deploy and test a staging environment with
fab deploy:name=staging,tag=<branch_or_tag>. - Destroy
<environment>environment withfab stack.delete:<environment>. - Deploy and test a production environment with
fab deploy:name=production,tag=<branch_or_tag>.
fab deploy:name=<environment>,tag=<branch_or_tag> when no such stack is
deployed is equivalent to:
- Build and upload new images if needed with
fab images.build_and_upload:tag=<new_tag> - Deploy a
<environment>environment withfab stack.create:name=<environment>,tag=<branch_or_tag>. - Test
<environment>deployment withfab tests.fast:<environment>.
- Deploy and test a staging environment with
fab deploy:name=staging,tag=<old_tag>. - Apply update to staging environment and test the update with
fab deploy:name=staging,tag=<new_tag>. - Destroy staging environment with
fab stack.delete:staging. - Apply update to staging environment and test the update with
fab deploy:name=production,tag=<new_tag>.
fab deploy:name=<environment>,tag=<new_tag> when a stack is deployed is
equivalent to:
- Build and upload new images if needed with
fab images.build_and_upload:tag=<new_tag> - Initiate long-running test with
fab tests.slow:name=<environment>,tag=<old_tag> &. - Apply update to
<environment>environment withfab stack.update:name=<environment>,tag=<new_tag>. - Test
<environment>environment withfab tests.fast:name=<environment>,tag=<new_tag>. - Wait for long-running test to succeed.
- Apply the update to the stack with
fab rollback:name=production
fab rollback:name=production is equivalent to:
- Apply rollback to production environment with
fab stack.update:name=production,tag=<old_tag>. - Test production environment with
fab tests.fast:name=production,tag=<old_tag>.
Delete old service images using fab images.delete:<ancient_tag>.
Destroy the production environment with fab stack.delete:production.
Credentials needed by the OpenStack client libraries should be specified in environment:
OS_USERNAME=auser
OS_PASSWORD=apass
OS_PROJECT_NAME=aproject
OS_AUTH_URL=http://openstack.example.com/v3
Heat template parameters used for various stacks, including common
parameters are contained in config.yaml. For example:
images:
build:
build_machine_image: some-vm-image
base_image_urls:
default: http://some.place/with/some/image
shell-command:
worker: http://another.place/with/a/different/image
stacks:
common:
public_net_id: some-uuid
staging:
stack_name: ptero-staging
default_shell_command_worker_instances: 1
production:
stack_name: ptero-production
default_shell_command_worker_instances: 4