EQ Survey runner for executing and collecting survey responses.
This assumes an Ubuntu development environment, but should be portable to any linux/BSD related system.
- Ensure you have python3.4 or greater installed.
- Download pip and virtualenv (virtualenvwrapper may also be helpful)
- (Optional) for running in a Heroku like environment locally you may find
it helpful to install Heroku local toolbelt.
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
- Create a new virtualenv
- Activate the virtualenv
- Clone this repo local.
git clone git@github.com:ONSdigital/eq-survey-runner.git
- Install the dependencies using pip:
pip install -r requirements.txt
- Run the test suite to check everything is working well:
python srunner_tests.py
- Optional: to run the application locally using Heroku toolbelt, run
heroku local
To view an example survey (without having to have a running version of eq-author
), simply append the parameter: debug=True
example:
http://127.0.0.1:5000/questionnaire/1/ABCD?debug=True
Where ABCD
is the questionnaire session ID and 1
is the questionnaire ID.
Mac
- Install docker-toolkit: https://www.docker.com/toolbox
- Install Virtualbox > 4.3.28 : https://www.virtualbox.org/wiki/Downloads
- Once installed, run the following:
docker-machine create default
eval "$(docker-machine env default)"
This will create a virtual machine as your docker host and populate your
environment with the correct values to use docker as a linux system would.
Everytime you start or stop a docker-machine VM instance, you need to
re-run eval "$(docker-machine env default)"
.
AWS
The survey runner deposits submitted responses in an S3 bucket. To be able to do this it needs to know your aws details.
PIP will install the aws cli for you, however you need to run aws configure
in order to place the necessary files in
your home directory.
Ubuntu
- Run 'curl -sSL https://get.docker.com/ | sh'
- Follow the instructions here to create a docker group: https://docs.docker.com/installation/ubuntulinux/
- Install
docker-compose
using pip globally:sudo pip install -U docker-compose
- Clone this repo locally:
git clone https://github.com/onsdigital/eq-survey-runner.git
- CD into the new folder
eq-survey-runner
- Run
docker-compose up
- Go make tea / coffee / alternative while you pull down all the necessary docker images.
- You should now have two docker instances, running the survey-runner application and cassandra, linked and supporting partial saving of form data.
- In a terminal run
docker-machine ip default
and then visit that IP address on port 8080 to view the survey runner app.
NOTE: Any changes you make on your local machine to eq-survey-runner files should automatically trigger
a reload of the webserver. To inspect inside the container, grab the docker instances CONTAINER ID and run
sudo docker exec -i -t <CONTAINER_ID> bash
- "Network timed out while trying to connect to https://index.docker.io/v1/repositories/spotify/cassandra/images. You may want to check your internet connection or if you are behind a proxy." Fix:
Run the following in the commandline:
docker-machine restart default # Restart the environment
eval $(docker-machine env default) # Refresh your environment settings
Sometimes it seems docker-machine gets in a weird state. ¯_(ツ)_/¯
python srunner_tests.py