Circa 2019 Chef changed their business and licensing model making habitat an unattractive option compared to OCI Containers. This page is preserved for legacy purposes, but future efforts should be focused on building OCI images.
This guide covers the steps needed to setup SPARC on a linux system using habitat packages
Habitat - https://www.habitat.sh
Assumptions
- Apache/Nginx setup is not covered. Habitat setup will give you something to reverse proxy your web server to.
- Database setup is not part of this. These instructions assume you have a database server to connect to. (It need not be populated with data)
You can use vagrant and the box configured in the sparc-request repository to do these steps if you do not have a system of your own.
Vagrant - https://www.habitat.sh
Vagrant Config File - https://github.com/ui-icts/sparc-request/blob/master/Vagrantfile
Overview
- Installing Habitat
- Install SPARC packages
- Configuration
- Run
Install Habitat
Install habitat binary using curl bash
curl https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | sudo bash
Create habitat user and group
It doesn't strictly matter how you do this, but these instructions should work on all platforms
sudo hab pkg install core/busybox
sudo hab pkg exec core/busybox addgroup hab
sudo hab pkg exec core/busybox adduser hab -G hab
Install SPARC packages
Install the package
sudo hab pkg install sparc-request/sparc-request
Configuration
Habitat will by default look to see if a user specified configuration file is available. If you are using the vagrant image then you may omit this step as the vagrant provisioner takes care of setting this up. If you are are setting up your own system, you will at least need to configure database access.
We first create the directory habitat will check for the user.toml file, and then we copy the default one from he package we installed.
sudo mkdir -p /hab/user/sparc-request/config
sudo cp $(hab pkg path sparc-request/sparc-request)/default.toml /hab/user/sparc-request/config/user.toml
You may then change configuration values as needed in user.toml.
Run
If you are starting with a blank database and would like the database to be created and set up for you
sudo mkdir -p /hab/svc/sparc-request/data
sudo touch /hab/svc/sparc-request/data/migrate
To start the server
sudo hab start sparc-request/sparc-request