RETIRED, Function as a Service for OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.4 KiB

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "ubuntu/xenial64"
config.vm.hostname = "qinling" "private_network", ip: "" "forwarded_port", guest: 7070, host: 7070
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
vb.gui = false
config.vm.provision "shell", privileged: false, inline: <<-SHELL
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python-dev python-setuptools libffi-dev \
libxslt1-dev libxml2-dev libyaml-dev libssl-dev rabbitmq-server git
# Install mysql and initialize database.
echo mysql-server-5.5 mysql-server/root_password password password | sudo debconf-set-selections
echo mysql-server-5.5 mysql-server/root_password_again password password | sudo debconf-set-selections
echo mysql-server-5.5 mysql-server/start_on_boot boolean true | sudo debconf-set-selections
sudo apt-get -y install mysql-server python-mysqldb
sudo sed -i 's/' /etc/mysql/my.cnf
sudo sed -i '44 i skip-name-resolve' /etc/mysql/my.cnf
sudo service mysql restart
create_db_sql="create database IF NOT EXISTS ${DBNAME}"
mysql -h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} -e "${create_db_sql}"
# Change rabbitmq credential.
sudo rabbitmqctl change_password guest password
# Install pip.
curl -O && sudo python
sudo pip install httpie
# Install Qinling.
git clone
cd qinling
sudo pip install -e .
# Initialize Qinling configuration.
sudo mkdir -p /vagrant/etc/qinling
sudo mkdir -p /vagrant/log
sudo mkdir -p /opt/qinling/funtion
sudo chown ubuntu:ubuntu /opt/qinling/funtion
cp /vagrant/qinling.conf.sample /vagrant/etc/qinling/qinling.conf
# Qinling db migration.
qinling-db-manage --config-file /vagrant/etc/qinling/qinling.conf upgrade head
# Start Qinling service.
python qinling/cmd/ --server api,engine --config-file /vagrant/etc/qinling/qinling.conf &