-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from subutai-io/dev
Dev
- Loading branch information
Showing
3 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# gorjun | ||
Gorjun is a golang replacement for Kurjun project. | ||
# Gorjun | ||
Gorjun is a golang replacement for Kurjun project. Kurjun is Subutai's CDN software. | ||
|
||
## Vagrant | ||
|
||
Use vagrant to create a multi-machine development and testing environment in an internal network. The master vm builds, configures and runs Gorjun. The cdn\[1-n] nodes are NGINX CDN cache nodes. | ||
|
||
> vagrant up | ||
> vagrant ssh master | ||
> ping cdn1.local | ||
> ping cdn2.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
BOX_IMAGE = "debian/stretch64" | ||
NODE_COUNT = 2 | ||
MASTER_RAM = 768 | ||
MASTER_CPU = 2 | ||
CDN_RAM = 384 | ||
CDN_CPU = 1 | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.define "master" do |subconfig| | ||
subconfig.vm.box = BOX_IMAGE | ||
subconfig.vm.hostname = "master" | ||
|
||
subconfig.vm.network "private_network", ip: "10.55.2.10", | ||
virtualbox__intnet: true | ||
|
||
subconfig.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
v.memory = MASTER_RAM | ||
v.cpus = MASTER_CPU | ||
end | ||
|
||
subconfig.vm.provision "shell", inline: <<-SHELL | ||
echo "Installing golang, building Gorjun, and running ..." | ||
apt-get install -y curl git | ||
curl -O https://storage.googleapis.com/golang/go1.8.4.linux-amd64.tar.gz | ||
tar -zxvf ./go1.8.4.linux-amd64.tar.gz | ||
chown -R root:root ./go | ||
mv go /usr/local | ||
rm -rf ./go1.8.4.linux-amd64.tar.gz | ||
echo 'export GOPATH=$HOME/work' >> ~vagrant/.profile | ||
echo 'export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin' >> ~vagrant/.profile | ||
su - vagrant -c 'mkdir /home/vagrant/work' | ||
su - vagrant -c 'go get github.com/subutai-io/gorjun' | ||
echo 'TODO: still need to configure and start up gorjun' | ||
echo 'TODO: lets also load some stuff into it to test' | ||
SHELL | ||
end | ||
|
||
(1..NODE_COUNT).each do |i| | ||
config.vm.define "cdn#{i}" do |subconfig| | ||
subconfig.vm.box = BOX_IMAGE | ||
subconfig.vm.hostname = "cdn#{i}" | ||
subconfig.vm.network "private_network", ip: "10.55.2.#{i + 10}", | ||
virtualbox__intnet: true | ||
|
||
subconfig.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
v.memory = CDN_RAM | ||
v.cpus = CDN_CPU | ||
end | ||
|
||
subconfig.vm.provision "shell", inline: <<-SHELL | ||
echo "Installing NGINX cdn node ..." | ||
apt-get install -y nginx | ||
echo 'TODO: still need to configure nginx and cache' | ||
SHELL | ||
end | ||
end | ||
|
||
config.vm.provision "shell", inline: <<-SHELL | ||
apt-get install -y avahi-daemon libnss-mdns net-tools | ||
SHELL | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters