Check out the blog post.
-
Fork/Clone
-
Create and activate a virtualenv
-
Install the requirements
-
Add the token to your environment:
$ export DIGITAL_OCEAN_ACCESS_TOKEN=[your_token] -
Spin up four droplets and deploy Docker Swarm:
$ sh project/create.sh
-
Run the scraper:
$ NODE=$(docker service ps --format "{{.Node}}" selenium_hub) $ for i in {1..8}; do { python project/script.py ${i} $(docker-machine ip $NODE) & }; done
-
Bring down the resources:
$ sh project/destroy.sh