Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Vagrantfile
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
Copy link
Member

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.

sleep 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really reliable...


cd ../tools/register
python fake_register.py --ip 127.0.0.1 &
sleep 5

curl http://127.0.0.1:8000/example

# 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

3 changes: 1 addition & 2 deletions tools/setup/05-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ sudo rm /etc/apt/apt.conf.d/02cache || true
sudo rm /etc/apt/sources.list.d/*.save || true

# Update the software
sudo apt-get --assume-yes install aptitude
sudo apt-get update
sudo apt-get --assume-yes update
sudo apt-get --assume-yes dist-upgrade
18 changes: 15 additions & 3 deletions tools/setup/30-custom-flumotion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,21 @@ fi
sudo cp -rf ../flumotion-config/fromdeb/etc/* /usr/local/etc/
sudo ln -sf /usr/local/etc/init.d/flumotion /etc/init.d/flumotion

# Create a SSL certificate used for encryption.
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /usr/local/etc/flumotion/default.pem || true
sudo chown flumotion:flumotion /usr/local/etc/flumotion/default.pem
# setup SSL certificate used for encryption.
CERT="/usr/local/etc/flumotion/default.pem"
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_DB_FALLBACK=Pipe make-ssl-cert /usr/share/ssl-cert/ssleay.cnf $CERT <<EOF
Name: make-ssl-cert/hostname
Template: make-ssl-cert/hostname
Value: $HOST
Owners: ssl-cert

Name: make-ssl-cert/title
Template: make-ssl-cert/title
Value: Flumotion Certificate
Owners: ssl-cert
EOF

sudo chown flumotion:flumotion $CERT

# Give access to the firewire ports
sudo adduser flumotion video
2 changes: 1 addition & 1 deletion tools/setup/99-remove-ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#

# Remove the ppa files as they cause problems for puppet.
rm /etc/apt/sources.list.d/*ppa*
rm /etc/apt/sources.list.d/*ppa* || true
48 changes: 48 additions & 0 deletions tools/setup/Vagrantfile
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be some type of argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure.
My primary goal is to demonstrate a sucessful install to help respond to "it wont' install." so I want to keep it simple.
Also I am not really sure how/when I would do what, but I'll keep thinking about it. I expect to have 3 or 4 of these soon.

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

11 changes: 7 additions & 4 deletions website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ third_party:

src/pip-delete-this-directory.txt: requirements.txt
$(ACTIVATE) && pip install -r requirements.txt
$(ACTIVATE) && [ -f private/requirements.txt ] && pip install -r private/requirements.txt
# $(ACTIVATE) && [ -f private/requirements.txt ] && pip install -r private/requirements.txt
$(ACTIVATE) && pip install -r private/requirements.txt || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still wrong. The line you are removing is correct.

touch -r requirements.txt src/pip-delete-this-directory.txt

install: lib/python2.6/site-packages/ez_setup.py lib/python2.6/site-packages/distribute-0.6.24-py2.6.egg-info src/pip-delete-this-directory.txt frontend/data.py
Expand All @@ -55,7 +56,10 @@ 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

lint: install
@# R0904 - Disable "Too many public methods" warning
Expand Down Expand Up @@ -85,7 +89,6 @@ upload:
$(ACTIVATE) && git-cl upload

serve: prepare-serve install
$(ACTIVATE) && python manage.py syncdb
$(ACTIVATE) && python manage.py runserver
$(ACTIVATE) && python manage.py runserver &

.PHONY : lint upload deploy serve clean config prepare-serve
2 changes: 1 addition & 1 deletion website/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BeautifulSoup4
django-live-server
distribute>=0.6.14
django-extensions
ez-setup
ez_setup
gunicorn
ordereddict
pylint
Expand Down