Set Up and Run SmokeDetector

Setting Up SmokeDetector

Basic setup

To set up SmokeDetector (SD), please execute the following commands:

git clone
cd SmokeDetector
git checkout deploy
sudo pip3 install -r requirements.txt --upgrade
pip3 install --user -r user_requirements.txt --upgrade

Next, copy config.sample to a new file called config, and edit the values required. If you are going to be running this SmokeDetector instance as a normal SD instance with metasmoke, see the “config” file with MS below.

You should now be able to run SmokeDetector.

Running SmokeDetector with metasmoke

You will need a keybase account. You will also need to have the “smoke detector runner” role on metasmoke (MS). Contact an MS admin to request the role. When given the role, you should separately be added to the “charcoal” channel on keybase.

The “config” file with MS

In the files section for the keybase “charcoal” channel, there is a “config” file. You should use that config file as a basis for the “config” file you use in your “SmokeDetector” directory.

When testing: use a “rooms_custom.yml” file

If a file “rooms_custom.yml” exists in the SD directory, then it will be used instead of the “rooms.yml” file. If you are not running a full SD instance, which is reporting into Charcoal HQ and all other rooms, you will need to create a “rooms_custom.yml” which describes the rooms in which you want SD to be reporting and accepting commands. For more information about the format used in “rooms.yml” and “rooms_custom.yml”, please see: Rooms configuration.

Run SmokeDetector

At this point, you should be able to run SmokeDetector using the instructions below.

Setting up an AWS EC2 linux instance for SmokeDetector

Using a AWS EC2 instance can be a quick way to get an SD instance up and running. Based on reports from @iBug in chat, a t2.micro instance, what’s available from the AWS Free Tier for 12 months, doesn’t have enough CPU credits for the instance to be the active SD instance full-time. It’s expected that a t3.micro, which actually costs less than a t2.micro, once past the free period, should be sufficient for a full-time active SD instance. However, a t2.micro instance does appear to be enough for SD to run as a standby instance to fill in on an irregular basis.

To set-up a t2.micro instance for SD you can do the following:

Running SmokeDetector

To run, use python3, or python3 standby (preferably in a daemon-able mode, like a screen session). You can also use python3, but then SmokeDetector will be shut down after 6 hours; when running from, will automatically be restarted. (This is to be sure that closed WebSockets, if any, are reopened.) is the controlling Python code for SmokeDetector. It runs, which is the SD instance, in a subprocess and restarts the SD instance when it stops. may stop as the result of various chat !!/ commands, or do to errors. The syntax for is: [standby] [--loglevel=(debug|info|warning|error)] [no_se_activity_scan]

The standby option starts the SD instance in standby mode.

The no_se_activity_scan option causes the SD instance not to watch the SE WebSocket for new posts, even when the instance is active. This gives you an SD instance which will listen for commands in chat, but won’t be scanning for new posts, other than ones you !!/scan or !!/report. If you are not testing something which is directly involved with scanning posts from the SE WebSocket (i.e. you don’t need to scan a large number of posts, or test/use the SE WebSocket and per-site post fetching queues), then using no_se_activity_scan will probably be quite beneficial to you, as it will allow you to focus on what you are testing without seeing large amounts of output from scanning posts.

Portions of this page were taken from