Build a Stack

In this guide we will build a stack, which is basically a template for installing and configuring virtual servers and configure the associated storage, networking etc. – all in order to provide a given service. Once this template is built, you can install the same service multiple times.

Objectives

  • Build a Stabile stack ready for installation

Prerequisites

  • A working Stabile installation

Build a stack

A Stabile Stack consists of a virtual image in qcow2 format and optionally a simple text file with the suffix “.meta” describing the preferred ressources (storage/vCPUS/memory/etc.) your stack requires as well as default backup and monitoring policies. The virtual image has your software pre-installed. This image (which we call a “master image”) is cloned every time your stack is installed.

A Stabile Stack is built using a small helper utility called “stackbuilder”. The software you want to include in your stack as well as specifications for the default amount of memory etc. your stack should be installed with, is described in a small text file (usually with the suffix “.stack”). To see an example, click here.

If you build your stack in a VM running in a Stabile environment, your stack is automatically published to the Stabile Registry, but can only be seen and installed by you. If you think your stack is ready to be used by others, you may contact Origo, and ask to have you stack made avaible to everyone.

If you build your stack in one of the standard Linux stacks distributed with Stabile, the necessary support software and libraties should be installed. If not, you will probable have to install a bit of stuff yourself.

Below is a step-by-step description of how to build one of our standard stacks.

How to build the Codiad stack:

Step 1: Prepare your software

Stackbuilder can fetch your software directly from Github, so if your software is already published on Github, the build process is simple. For this example, we have chosen a web based IDE, Codiad, which together with a regular Ubuntu server is a nice package for ad-hoc web development. Codiad is Open Source and is available at Github, but unfortunately, the project seems abandoned. Besides making Codiad available, our stack also features a light-weight integration with the Origo API, for e.g. chaning your password through a web UI. The support files which makes this possible can be found here. Since Codiad is already on Gihub, there is nothing to do in this step.

Step 2: Install a standard Ubuntu server

You need a virtual server for building your stack. The easiest choice is to use the standard Ubuntu Bionic, which comes with all the necessary tools. Install the server, and use the management UI to set a password for the “stabile” user.

Step 3: Start a terminal

In the upper right corner of the management UI, click the drop-down menu with the title “Go” and then click “to the online terminal”, to launch a terminal in a new tab.

Log in with username “stabile” and the password you just set.

Step 4: Mount shared storage

In order to clone your stack’s master image, it must be available on shared storage. Mount shared storage by typing the following into the terminal:

sudo stabile-helper mountpools
Step 5: Download stackbuilder

“stackbuilder” and the source for the standard stacks are available at Github. Download stackbuilder and support files by typing the following into the terminal:

cd /mnt/fuel/pool0
git clone https://gitlab.origo.io/origosys/stabile-stacks
Step 6: Build and activate your stack

You are now ready to build and activate the stack – we have named it “Develop”. Type the following into the terminal:

 cd stabile-stacks
 sudo ./stackbuilder -a develop/develop.stack
Step 7: Test your stack

If you completed the above steps successfully, your stack should now be available for use on your engine. Simply go to the dashboard in the Web Client and click on the “Install Stack…” button – your stack should be available in the drop-down menu.

Step 8: Publish your stack

If you have multiple engines (i.e. one for development and one for testing), you can make your stack available on all your engines by publishing it to the registry. Make sure your engine is linked to the registry, otherwise this will not work. Type the following into the terminal:

 sudo ./stackbuilder -p develop/develop.stack

this will publish your stack to your catalog in the Stabile Registry, available at https://stabile.io/cloud. Your other engines should automatically download your new stack, if they are also linked to the registry with the same account.

Leave a Comment

Your email address will not be published. Required fields are marked *

*






This site uses Akismet to reduce spam. Learn how your comment data is processed.