Trying out Kumiko#
Kumiko can be tried out by running the Docker image. For the official versions of Kumiko, please invite the bot into your guild instead. For those who want to try out the latest breaking features, using Docker is recommended.
Prerequisites#
Make sure you have set up your bot token. Refer to Bot Setup for the full guide.
- Make sure you have these installed:
curl or wget
Git
Standalone Prerequisites#
If you are running Kumiko on a standalone machine (w/o Docker Compose or using Systemd), you will need to install the following:
PostgreSQL (w/
pg_trgmextension loaded)Redis Stack (or Redis w/ RedisJSON and RedisSearch modules loaded)
Docker CLI (Standalone)#
Pull the image from either GHCR or Docker Hub
GHCR
docker pull ghcr.io/no767/kumiko:latest
Docker Hub
docker pull no767/kumiko:latest
Set up the docker ENV file
curl -o https://raw.githubusercontent.com/no767/kumiko/master/Envs/docker.env .env # Or using wget: wget -O .env https://raw.githubusercontent.com/no767/kumiko/master/Envs/docker.env
Edit the
.envfile to include any credentials needed for the bot to run# THIS IS ONLY AN EXAMPLE POSTGRES_PASSWORD=... POSTGRES_USER=... POSTGRES_URI=postgres://user:somepass@localhost:5432/somedb
Run the bot
docker run -d --env-file=.env --name Kumiko no767/kumiko:latest
Systemd (Standalone)#
Before you start, ensure that you have PostgreSQL and Redis correctly configured and is running
Ensure that the database is created and the PostgreSQL extension
pg_trgmand the RedisJSON module are loaded. Refer to the Redis docs on how to install and load the JSON module.CREATE ROLE kumiko WITH LOGIN PASSWORD 'somepass'; CREATE DATABASE kumiko OWNER kumiko; CREATE EXTENSION IF NOT EXISTS pg_trgm;
Clone the repo
git clone https://github.com/No767/Kumiko.git && cd Kumiko
Or if you have the
ghcli tool installed:gh repo clone No767/Kumiko
Note
By default, this will clone the dev branch. For stable releases, run
git checkout masterto checkout into stable releases (or checkout the latest tag)Set up the prod ENV file. During this step, please also fill your credentials in the ENV file
cp Envs/prod.env Bot/.env
Create an venv so that you can install the dependencies without polluting your system
python3 -m venv ./venv
Activate the venv, install the dependencies, run the migrations, and then deactivate it
source ./venv/bin/activate \ && pip install -r Requirements/prod.txt \ && python3 migrations-runner.py \ && deactivate
Create an systemd service file. This is an example, and you will need to edit it to point to the correct directory and user.
[Unit] Description=Kumiko After=network-online.target Requires=postgresql.service [Service] Type=simple WorkingDirectory=/your/bots/directory ExecStart=/your/bots/directory/venv/bin/python3 /your/bots/directory/Bot/kumikobot.py User=username Restart=on-failure EnvironmentFile=/your/bots/directory/Bot/.env [Install] WantedBy=multi-user.target
Test whether you have everything set up. If you have
makeinstalled, you can runmake prod-runin order to run the bot (theMakefileis found in the root of the repo). Otherwise, just runkumikobot.pyReload the system daemon
sudo systemctl daemon-reload
Run and enable the systemd service.
sudo systemctl enable --now kumiko
Docker Compose#
Clone the repo
git clone https://github.com/No767/Kumiko.git && cd Kumiko
Or if you have the
ghcli tool installed:gh repo clone No767/Kumiko
Note
By default, this will clone the dev branch. For stable releases, run
git checkout masterto checkout into stable releases (or checkout the latest tag)Copy the ENV files into the correct places
cp Envs/docker.env .env
Edit the
.envfile placed in the root of the repo to include any credentials needed for the bot to run# THIS IS ONLY AN EXAMPLE POSTGRES_PASSWORD=... POSTGRES_USER=... POSTGRES_URI=postgres://user:somepass@localhost:5432/somedb
Once everything is set, literally just fire up the whole entire Docker Compose stack. All of the database creation, and the migrations will be done automatically.
docker-compose up -d