Install sc_pack

To manage the edge servers running ShimmerCat Accelerator, we install a "pack" of programs called sc_pack. The installation consists of two steps: first you need to install sc_pack itself, and then you need to ask sc_pack to prepare the hierarchy of directories.

1. Installation

You will need to have installed: python3, python3-dev, virtualenv and git on the server. You can install them by executing:

$ sudo apt-get install python3 python3-dev virtualenv git

We highly recommend that you use a Python 3 virtualenv for all of this. This virtualenv will contain an isolated copy of Python 3, sc_pack, supervisord and the libraries we need with these tools and with the celery worker. Because it's so tied to sc_pack, we recommend you create the virtualenv as a subdirectory of the hierarchy we mentioned before, the so called <venv> directory. You can have all of this by doing:

$ virtualenv /path/to/install_dir/venv -p python3

(don't forget to replace /path/to/install_dir/ with the actual thing) and then to activate it:

$ source /path/to/install_dir/venv/bin/activate

You will need the sc_pack distributable to install, and you a version here: https://accelerator.shimmercat.com/presentation-api/v1/download/sc_pack/. Download it to your server, and with the venv activated do:

$ pip install /path/to/<sc_pack-version>.whl

Now it should be installed. To verify that it is properly installed run:

$ sc_pack -h

2. Prepare the directory hierarchy

The programs need a directory as the top of the hierarchy, and some configuration information. Of that information, some of them are secrets needed for the programs to send and receive data from our cloud service, and other are configuration details that you should edit to your needs.

All of it is structured as a YAML file, which has nesting levels. In the rest of this documentation, we sometimes refer to a nested field by using a /, for example shimmercat/root-dir refers to the field root-dir under the object shimmercat.

There is an example file inside the sc_pack redistributable, that can be obtained by executing:

$ sc_pack extract example.sc_pack.conf.yaml

Copy the content that appears in the terminal and create a file with extension yaml, eg. my_sc_pack_conf.yaml.

In the configuration file, you need to edit the following:

Once the configuration file is ready, it's time to setup the directory hierarchy:

    $ sudo sc_pack create -f configuration/file/path/sc_pack.conf.yaml

or

    $ sudo sc_pack create

...if you have already a file called sc_pack.conf.yaml on the directory from where you are running that command.

You can get a copy of the config template content the sc_pack has by typing:

    $ sc_pack extract example.sc_pack.conf.yaml

You can then copy and paste that content on a file called sc_pack.conf.yaml and then run the create command without arguments. Subject to the same rule, it's possible to omit the -f in many sc_pack sub-commands. E.g, if the current dir is /srv/www.example.com and the file /srv/www.example.com/sc_pack.conf.yaml and you run sc_pack create, the configuration file taken is /srv/www.example.com/sc_pack.conf.yaml.

We recommend running the command above with root privileges so that shimmercat can be authorized to bind to port 443, without running ShimmerCat itself as root.

The sc_pack ... create command also creates an example devlove.yaml, which is ShimmerCat's configuration file with domains and such. The format of that file is documented elsewhere, but this is a good moment to either edit it by hand or to request our cloud service to send you a version.

3. Deploy and setup sc_pack

To setup and deploy your sc_pack configuration, see Setup sc_pack