-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vagrant to demonstrate install #57
base: master
Are you sure you want to change the base?
Changes from 12 commits
38b434e
cad8e16
f2d674f
bb21c75
e7deb56
30d657c
71f99b5
5f4b44a
dbc6d46
89ee9d1
925b218
007bbaf
4f4510a
07e1fb7
69a5689
12fc4ad
b62bb12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# time to build: 160 seconds | ||
|
||
$script = <<SCRIPT | ||
|
||
apt-get --assume-yes update | ||
apt-get --assume-yes install git python-virtualenv | ||
|
||
# things to do as the user (vagrant) | ||
cat <<B2 >bootstrap2.sh | ||
#!/bin/bash -x | ||
|
||
echo User vagrant is now running $0 in: | ||
pwd | ||
|
||
cd | ||
|
||
# git clone https://github.com/timvideos/streaming-system.git | ||
git clone https://github.com/CarlFK/streaming-system.git | ||
cd streaming-system/website | ||
cp private/settings.py.example private/settings.py | ||
make serve | ||
sleep 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really reliable... |
||
|
||
cd .. | ||
cd tools/register | ||
python fake_register.py --ip 127.0.0.1 & | ||
sleep 5 | ||
|
||
curl http://127.0.0.1:8000/av?template=group | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am trying to do what the Readme says to set up a development environment. In the end these things should happen:
#3 or something like it seems like a good test to make sure #1 and #2 are Backgrounding make means the sleep needs to be long enough to wait for make btw, I pypi has been timing out and causing pip to fail about 1/2 the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Issue #58 has been fixed now. Should update your vagrant script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Adding the background to make breaks the script when run interactively. We could make the make output a sential/stamp file when it finishes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Maybe something like https://pypi.python.org/pypi/proxypypi or https://pypi.python.org/pypi/pip-accel ? |
||
|
||
# eof: bootstrap2.sh | ||
B2 | ||
chown vagrant ./bootstrap2.sh | ||
chmod u+x ./bootstrap2.sh | ||
|
||
su vagrant ./bootstrap2.sh | ||
|
||
SCRIPT | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
|
||
config.vm.box = "precise64-current" | ||
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | ||
config.vm.provision "shell", inline: $script | ||
config.vm.network "forwarded_port", guest: 8000, host: 8000, | ||
auto_correct: true | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.gui = false | ||
vb.customize ["modifyvm", :id, "--memory", "256"] | ||
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "80"] | ||
vb.customize ["modifyvm", :id, "--cpus", "1"] | ||
end | ||
|
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# 1013 seconds to build. (15min) | ||
|
||
$script = <<SCRIPT | ||
|
||
apt-get install -y git-core | ||
|
||
# things to do as the user (vagrant) | ||
cat <<B2 >bootstrap2.sh | ||
#!/bin/bash -x | ||
|
||
if [ -f /vagrant/streaming-system/tools/setup/runall.sh ]; then | ||
# for testing before pushing to github | ||
cp -av /vagrant/streaming-system . | ||
else | ||
git clone https://github.com/timvideos/streaming-system.git | ||
# git clone https://github.com/CarlFK/streaming-system.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be some type of argument? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure. |
||
fi | ||
|
||
streaming-system/tools/setup/runall.sh | ||
|
||
# eof: bootstrap2.sh | ||
B2 | ||
chown vagrant ./bootstrap2.sh | ||
chmod u+x ./bootstrap2.sh | ||
|
||
su vagrant ./bootstrap2.sh | ||
|
||
SCRIPT | ||
|
||
VAGRANTFILE_API_VERSION = "2" | ||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
|
||
config.vm.box = "precise64-current" | ||
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | ||
config.vm.provision "shell", inline: $script | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.gui = false | ||
vb.customize ["modifyvm", :id, "--memory", "256"] | ||
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "60"] | ||
vb.customize ["modifyvm", :id, "--cpus", "1"] | ||
end | ||
|
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,11 @@ frontend/data.py: eventfeed2internal.py | |
|
||
prepare-serve: install | ||
$(ACTIVATE) && python manage.py collectstatic --noinput | ||
# $(ACTIVATE) && python manage.py syncdb | ||
# createsuperuser on a seperate line | ||
# for when vagrant skips the interactive prompting. | ||
$(ACTIVATE) && python manage.py syncdb --noinput | ||
# $(ACTIVATE) && python manage.py createsuperuser || true | ||
$(ACTIVATE) && python manage.py runserver & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The runserver line should be under the serve target. |
||
|
||
lint: install | ||
@# R0904 - Disable "Too many public methods" warning | ||
|
@@ -85,7 +89,5 @@ upload: | |
$(ACTIVATE) && git-cl upload | ||
|
||
serve: prepare-serve install | ||
$(ACTIVATE) && python manage.py syncdb | ||
$(ACTIVATE) && python manage.py runserver | ||
|
||
.PHONY : lint upload deploy serve clean config prepare-serve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backgrounding should occur here not in the make file.