Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Latest commit

 

History

History

development

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Performance Platform development tools

The Vagrantfile in this repository contains a definition for a development virtual machine that can run all our services on one box (it's called development-1).

Virtual machine tweaks

To improve performance, users of OS X can set the nfs flag to true in the Vagrantfile. On Linux NFS seems to be more buggy; you may need to install the following packages: nfs-kernel-server nfs-common portmap.

Local overrides to Vagrant config can go in a local file.

Basic setup

  • Clone this folder onto your local machine with git clone [email protected]:alphagov/pp-puppet.git. You can do this in your ~/govuk folder if you have one or in a separate ~/performance-platform folder
  • Install dependencies with ENT_DEPS=true GOVUK_DEPS=true ./install.sh
    • Warnings about the pp-deployment repository can be safely ignored (it contains deployment secrets that you may not have access to)
  • Drop back to the root directory of this repository.
  • Run bundle install && bundle exec librarian-puppet install
  • Start the virtual machine with vagrant up development-1
  • Starting the machine should also provision it using Puppet (resulting in lots of lines beginning [bootstrap] Notice: /Stage[main]), but if it doesn't you can safely reprovision at any time with vagrant provision
  • NOTE Initial provisioning of the machine may fail with an error message of the form:
    Error: No such file or directory - /var/apps/pp-puppet/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/smarchive/archive/version/7663d0c47292d3c50eb71d008ed8a340/archive/spec/fixtures/modules/archive/files
    
    Error: Try 'puppet help module install' for usage
    
    /var/apps/pp-puppet/vendor/bundle/ruby/1.9.1/gems/librarian-puppet-0.9.13/lib/librarian/puppet/source/forge.rb:114:in `unlink': Directory not empty - /var/apps/pp-puppet/.tmp/librarian/cache/source/puppet/forge/3792e516e3ff92a0ef9f5e827f8e76eb/smarchive/archive/version/7663d0c47292d3c50eb71d008ed8a340 (Errno::ENOTEMPTY)
    
    If this happens, running vagrant provision again may fix it (issue #36).
  • When provisioning has completed successfully you should see the line: [bootstrap] pp-development/tools/bootstrap-vagrant exit success
  • SSH on to the virtual machine with vagrant ssh development-1
  • Install dependencies for each required app in /var/apps by following the instructions in their README files
  • Add the following to your hosts file -
10.0.0.100 www.development.performance.service.gov.uk
10.0.0.100 admin.development.performance.service.gov.uk
10.0.0.100 admin-beta.development.performance.service.gov.uk
10.0.0.100 stagecraft.development.performance.service.gov.uk

Running apps

  • SSH on to the machine with vagrant ssh development-1
  • Change to the development directory with cd /var/apps/pp-puppet/development
  • Start the apps individually with bowl backdrop_read or bowl spotlight, or all together with bowl performance
    • The bowl command uses groups from the Pinfile, which runs commands from the Procfile

Routing from your local machine to your VM

This only works if your platform is OS X.

Each app runs on its own local port ie 3038, 3039, 3057. From inside the VM you can access apps directly at localhost:3038. If you install vagrant-dns, you can access the VM from the host through perfplat.dev subdomains, i.e www.perfplat.dev or spotlight.perfplat.dev.