Skip to content

Deployment Guide

mirazola-ik edited this page Dec 9, 2025 · 2 revisions

Deployment Guide

This guide provides step-by-step instructions for setting up and running the Serverless Runtime on a host machine.


Prerequisites

Before you begin, ensure you have the following software installed on your system:

  • Python 3.10
  • pip (the Python package installer)
  • virtualenv (for creating isolated Python environments)

If you do not have virtualenv installed, you can install it using pip:

pip install virtualenv

Environment Setup

It is highly recommended to use a virtual environment to manage the project's dependencies and avoid conflicts with system-wide packages.

  1. Clone the Repository First, clone the serverless-runtime repository to your local machine:

    git clone https://github.com/SovereignEdgeEU-COGNIT/serverless-runtime.git
    cd serverless-runtime
  2. Create and Activate a Virtual Environment Create a new virtual environment using Python 3.10.

    python3.10 -m venv serverless-env
    source serverless-env/bin/activate

    Your command prompt should now be prefixed with (serverless-env), indicating that the virtual environment is active.

  3. Install Dependencies Install all the required Python packages using the requirements.txt file.

    pip install -r requirements.txt

Running the Serverless Runtime

Once the environment is set up, you can start the application. The runtime is a FastAPI application run with Uvicorn, a high-performance ASGI server.

  1. Navigate to the Application Directory The main application file (main.py) is located in the app/ directory.

    cd app
  2. Start the Server Use uvicorn to run the application. The server will listen for incoming requests on all network interfaces (0.0.0.0) on port 8000.

    uvicorn main:app --host 0.0.0.0 --port 8000 --broker "$COGNIT_BROKER" --flavour "$COGNIT_FLAVOUR"
  3. Verify the Service If the server starts successfully, you will see output similar to this:

    INFO:     Started server process [12345]
    INFO:     Waiting for application startup.
    INFO:     Application startup complete.
    INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
    

    You can now send a request to the health check endpoint (http://<your-host-ip>:8000/) to confirm it is running.

Clone this wiki locally