Packaging your turrets


This section will explain how to package turrets, but only based on the python turret. But most turrets will have similar implementation

So that’s it ? You’ve written all your tests and you’re ready to start to fire at your target ? Well let’s prepare your turrets for deployement !

Auto packaging


This example only works for python based turrets. Please refer to your turret documentation if you use anything else

OCT provides a simple way to package your turrets and set them ready to fire, the oct-pack-turrets command. It generates tar files based on your configuration file. Those tar files are the turrets, ready to fire at your command.

You can use it like this :

oct-pack-turrets /path/to/oct/project

A sucessful packing should return the following output :

Added config.json
Added test_scripts/
Archive ./navigation.tar created
Added config.json
Added test_scripts/
Archive ./random.tar created

In addition if some optionnal keys of the configuration are not set, you could see something like that :

WARNING: hq_address configuration key not present, the value will be set to default value

You will see a WARNING line per missing key. Also if a required key is not set the command will throw an exception like that :

oct.core.exceptions.OctConfigurationError: Error: the required configuration key <key> is not define

Where <key> is the missing key

Installing and starting the turrets

Now that your turrets are packaged, you can install them using pip for example :

pip install navigation.tar

This command will install all required packages listed under the turrets_requirements configuration key, plus the oct-turrets package itself.

Once the installation is finished you can start your turret using the oct-turrets-start like that :

oct-turrets-start --tar navigation.tar

And if everything is fine you should see this message :

[2015-12-21 18:02:09,295: INFO | oct_turrets.turret] starting turret

You are now ready to fire at the target !