To run the server locally, you will need the following installed:
- Python 3.6+
- redis (strongly recommend a container)
- PostgreSQL (strongly recommend a container)
To run the containers, you will need either one of the following installed:
Run the Frontend¶
When running on your local computer, the server is made up of two parts, the frontend and the backend. The backend runs the api while the frontend hosts the UI. First, install yarn if you don’t have it already, and set up the frontend.
Many Linux distributions offer Yarn in their package repositories. Both Debian and Fedora package
Install Yarn on Fedora:
sudo dnf install -y yarnpkg
Install Yarn on Debian:
sudo apt install yarnpkg
If you don’t wnat to use the packaged version of Yarn, you can install it via
cd ibutsu-server/frontend npm install yarn
Just remember that you’ll need to specify the full path when running Yarn:
Now that Yarn is installed, use Yarn to install the frontend’s dependencies:
Then to start the development server for the frontend using yarn:
yarn run devserver
The development server features automatic reloading, so that whenever you make a change to your code, the server will rebuild your app and run the new code.
Open your browser and go to localhost:3000 to see the web UI.
Run PGSQL and Redis¶
Next you’ll need to set up a PostgreSQL server. It is easiest to just run the server in a container:
In all these examples, we use
podman, but you can substitute
docker in its place.
podman run --publish 5432:5432 --name postgres -e POSTGRES_USER=ibutsu -e POSTGRES_PASSWORD=ibutsu -e POSTGRES_DB=ibutsu -d postgres
If you don’t have redis installed locally, you’ll want to also run a redis container.
This is required for
podman run --name redis -d -p "6379:6379" redis
You’ll want to set up a virtual environment for the backend, and install the dependencies:
cd ibutsu-server/backend virtualenv .ibutsu-env --python python3 .ibutsu-env/bin/pip install -r requirements.txt
Run Celery Worker¶
Start the celery worker using the
backend/celery_worker.sh script or via:
celery worker -E -A ibutsu_server.tasks.queues:app --loglevel=info
-E is necessary to send task related events to the celery task monitor.
(Optional) Start the celery task monitor:
The task monitor checks the task queue for failures.