summaryrefslogtreecommitdiffstats
path: root/facebook_scraping/Makefile
blob: fced4273688b9e711c45c6b0dda7845cc41b56bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
SHELL=/bin/bash
HOSTS=servers.txt
USER=ubuntu
OPTIONS=-x -"F ./ssh_config"
FOPTIONS=$(OPTIONS) -h <(cut -f1 $(HOSTS))

.PHONY: deploy servers

servers_simple:
	ec2-describe-instances --region us-west-2 | grep running | cut -f4,17,18 > servers.txt

servers:
	ec2-describe-instances --region us-west-2 | grep running | cut -f4,17,18 > servers.txt
	paste <(cut -f2 servers.txt) <(cut -f28,29 survey8a.txt) > credentials.txt
	rsync credentials.txt horel.org:kdd/

servers2:
	ec2-describe-instances --region us-west-2 | grep running | cut -f4,17,18 > servers.txt
	paste <(cut -f2 servers.txt) fb_accounts2.txt > credentials.txt
	rsync credentials.txt horel.org:kdd/

uptime:
	pssh $(FOPTIONS) 'uptime'

running:
	pssh -i $(FOPTIONS) 'pgrep -f "celery worker"'

deploy:
	cd client; tar -czf facebook.tar.gz requirements.txt tasks.py
	cd client; rsync facebook.tar.gz Makefile horel.org:public_html/facebook
	pssh -i $(FOPTIONS) 'rm -rf tasks.py tasks.pyc kdd/; curl http://thibaut.horel.org/facebook/Makefile > Makefile; make boostrap'

run:
	pssh -i $(FOPTIONS) 'make run'

stop:
	pssh -i $(FOPTIONS) "make stop; killall chromedriver; killall chromium-browser; killall Xvfb; rm -f tasks.pyc"

restart:
	pssh $(FOPTIONS) "make restart"

test:
	pssh -i $(FOPTIONS) 'rm -f tasks.pyc; grep "replace" tasks.py'

deploy_server:
	rsync run.py run2.py server.py credentials.txt horel.org:kdd/