techtonik / rainforce

Automatically exported from code.google.com/p/rainforce
0 stars 0 forks source link

package Roundup for sandstorm.io #35

Open techtonik opened 8 years ago

techtonik commented 8 years ago

Install sandstorm.io SPK:

sudo apt-get install vagrant virtualbox
git clone git://github.com/sandstorm-io/vagrant-spk sandstorm
cd sandstorm
sudo ln -s $PWD/vagrant-spk /usr/local/bin

Get Roundup:

hg clone http://hg.code.sf.net/p/roundup/code roundup
techtonik commented 8 years ago

Create .sandstorm with packaging info:

cd roundup
vagrant-spk setupvm uwsgi

This creates .sandstorm directory configured as Python oriented stack with nginx and uwsgi.

techtonik commented 8 years ago

Run VM and inspect service at http://local.sandstorm.io:6080/

vagrant-spk vm up

Fail

...
Command: ["startvm", "b0467d24-2c46-4a64-9642-e1f98017faea", "--type", "headless"]

Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
techtonik commented 8 years ago

Looks like it is possible to modify Vagrantfile to turn off VT-x requirement with (--longmode off) https://github.com/sandstorm-io/sandstorm/issues/1959#issuecomment-218222198

techtonik commented 8 years ago

Setting --longmode off doesn't help:

     vb.name = VM_NAME
-    vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
+    vb.customize ["modifyvm", :id, "--nictype1", "Am79C973", "--longmode", "off"]

     override.vm.synced_folder "..", "/opt/app"

The error is the same - VERR_VMX_NO_VMX.

techtonik commented 8 years ago

Trying libvirt provider https://github.com/sandstorm-io/vagrant-spk/blob/master/HOWTO-libvirt.md

$ vagrant plugin install mutate
Installing the 'mutate' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=': undefined method `group_by' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem'
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install'
    from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin'
    from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin'
    from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
    from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
    from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each'
    from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute'
    from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli'
    from /usr/bin/vagrant:173:in `<main>'

=/

techtonik commented 8 years ago

Applying patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818237#28 allowed mutate plugin to install. Continuing..

techtonik commented 8 years ago

Converting box to use libvirt

$ vagrant box add sandstorm/debian-jessie64

Clean up from attempt to run with virtualbox

$ vagrant-spk vm destroy
$ sudo apt-get remove virtualbox
$ sudo apt-get install virt-manager

Using libvirt

$ export VAGRANT_DEFAULT_PROVIDER=libvirt
$ vagrant-spk vm up
Calling 'vagrant' 'up' in /home/techtonik/p/roundup/.sandstorm
The provider 'libvirt' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.

=/

techtonik commented 8 years ago
$ vagrant plugin install vagrant-libvirt

Complains about missing libs

$ sudo apt install libvirt-dev
$ vagrant plugin install vagrant-libvirt
$ vagrant-spk vm up
Calling 'vagrant' 'up' in /home/techtonik/p/roundup/.sandstorm
Bringing machine 'default' up with 'libvirt' provider...
Error while connecting to libvirt: Error making a connection to libvirt URI qemu:///system?no_verify=1&keyfile=/home/techtonik/.ssh/id_rsa:
Call to virConnectOpen failed: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

=/

techtonik commented 8 years ago

Rebooting seemed to help, but not much:

Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid 
argument: could not find capabilities for domaintype=kvm 

KVM is not supported

$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

Modified Vagrantfile to switch to QEMU

    libvirt.driver = "qemu"

Got

Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid 
argument: could not find capabilities for domaintype=qemu

Fixed that by installing QEMU

sudo apt install qemu

Still fails

$ vagrant-spk vm up
...
==> default: stdin: is not a tty
==> default: /opt/app/.sandstorm/global-setup.sh: line 14: /host-dot-sandstorm/caches/install.sh: Permission denied
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

=/

techtonik commented 8 years ago

Second run seems to go ok, but I don't see anything running at http://local.sandstorm.io:6080/

$ vagrant-spk vm up
Calling 'vagrant' 'up' in /home/techtonik/p/roundup/.sandstorm
Bringing machine 'default' up with 'libvirt' provider...
techtonik commented 8 years ago

virsh shows something is running

$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     roundup_sandstorm_1463038378_default running

and it is possible to login to vm with vagrant/vagrant

$ virt-viewer 1

Looks like install.sh script still needs to be run. Let's drop and recreate

$ vagrant-spk vm destroy
$ vagrant-spk vm up