Skip to content

Set Up Guide

Pit Buttchereit edited this page Jun 3, 2024 · 5 revisions

Set Up Guide for TracEX

Requirements

To run TracEX successfully, it is essential to obtain an OpenAI API key with adequate credits. TracEX integrates the OpenAI API to leverage Large Language Models (LLMs) for extracting relevant information from unstructured text. Without a valid API key and sufficient balance, the extraction process cannot be performed.

Installation using Docker

Option 1: Using a Pre-built Docker Image
The easiest way to run a local instance of TracEX is using the provided Docker images.

  1. Install Docker: Ensure that you have Docker installed on your system. If you haven't installed it yet, please follow the official Docker installation guide for your operating system: Docker Installation.
  2. Load the Docker Image: Open a terminal or command prompt and navigate to the directory where you downloaded the Docker image file. Run the following command to load the image: sudo docker load -i tracex.tar
  3. Note: Depending on your system configuration, you may need to run this command with sudo privileges.
  4. Run the Docker Container: After the image is successfully loaded, run the following command to start the TracEX container: sudo docker run -p 8000:8000 tracex
  5. This command will start the container and map port 8000 from the container to port 8000 on your local machine. Again, you may need to use sudo depending on your system setup.
  6. Access TracEX: Open a web browser and navigate to http://localhost:8000/. This will bring you to the TracEX application, where you can enter your OpenAI Key and start extracting event logs.

Option 2: Building the Docker Image from Source
Alternatively, you can build the Docker image from the TracEX source code.

  1. Clone the TracEX Repository: Open a terminal or command prompt and navigate to the directory where you want to clone the TracEX repository. Run the following command to clone the repository: git clone https://github.com/bptlab/TracEX
  2. Navigate to the TracEX Directory: Change your current directory to the cloned TracEX repository: cd TracEX
  3. Build the Docker Image: Run the following command to build the TracEX Docker image: sudo docker build . Note: Depending on your system configuration, you may need to run this command with sudo privileges.
  4. Run the Docker Container: After the image is successfully built, run the following command to start the TracEX container: sudo docker run -p 8000:8000 Replace with the ID of the Docker image that was just built. This command will start the container and map port 8000 from the container to port 8000 on your local machine. Again, you may need to use sudo depending on your system setup.
  5. Access TracEX: Open a web browser and navigate to http://localhost:8000/. This will bring you to the TracEX application, where you can enter your OpenAI Key and start extracting event logs.

Local Setup for Development

Download

  • Use git and run git clone https://github.com/bptlab/TracEX in the desired directory (Using e.g. Git Bash)

Installation

  • navigate to the root directory of TracEX in your terminal
  • run install-dependencies-unix.sh or install-dependencies-windows.ps1, based on your operating system (Using e.g. Terminal)
  • run python tracex_project/manage.py migrate to update the database and apply all changes stored in the migrations folder

Execution

  • Run python tracex_project/manage.py runserver in the root directory of TracEX (Using e.g. Terminal)

Pre-Commit

  • If you intend on expanding the code, please run pre-commit install in the root directory of TracEX (Using e.g. Terminal)