Skip to content

How to setup imgflo server and imgflo using Vagrant (Ubuntu 14.04)

automata edited this page Nov 9, 2014 · 1 revision

Install Vagrant and add the Ubuntu 14.04 box:

vagrant box add ubuntu/trusty64

You can use the following as your Vagrantfile:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.network "forwarded_port", guest: 3322, host: 3322
  config.vm.synced_folder ".", "/vagrant", disabled: true
end

Start you box and connect to it:

vagrant up
vagrant ssh

Install the following packages:

sudo apt-get update
sudo apt-get install -y git make automake intltool libglib2.0-0 libglib2.0-dev libtool curl libtiff5-dev libxml2 libxml2-dev sqlite sqlite3 libsqlite3-dev libjson-glib-1.0-0 libjson-glib-dev uuid uuid-dev libjpeg-dev libpng12-dev

Install imgflo and its deps:

git clone https://github.com/jonnor/imgflo-server.git
cd imgflo-server
git submodule update --init -r
cd runtime
git submodule update --init -r
cd dependencies
git submodule update --init -r
cd ../..
make dependencies

Setup Nodejs:

curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs libcairo2 libcairo2-dev g++
npm install

Install imgflo:

make install

Check if everything is alright:

make check

Set some env. vars before running imgflo-server:

export IMGFLO_CACHE=local
export PORT=8080
export HOSTNAME=localhost

Finally run imgflo-server:

node index.js

You should see the imgflo-server app at http://localhost:8080.

If you want to create graphs to imgflo using Flowhub, first of all discover your Flowhub USER ID going into http://app.flowhub.io then Runtimes, New Runtime (Register) and copy the User Identifier key:

cd runtime
make FLOWHUB_USER_ID=YOUR_USER_ID PREFIX=/home/vagrant/imgflo-server/install run

Imgflo will create a runtime id, something like the following will be displayed:

Runtime running on port 3569, external port 3569
No runtime id found, generating new
Registered runtime.
IMGFLO_RUNTIME_ID=e94a5111-72b2-44b2-88a4-f79c2619231d

When running imgflo in the future, use this runtime id:

make FLOWHUB_USER_ID=YOUR_USER_ID PREFIX=/home/vagrant/imgflo-server/install IMGFLO_RUNTIME_ID=e94a5111-72b2-44b2-88a4-f79c2619231d run

Back to http://app.flowhub.io and reload the Runtimes listing. A imgflo runtime should appear. Now you can click on the runtime and start using imgflo from Flowhub to create your own filters.