Multinode - Rapidly build distributed cloud applications in Python | Product Hunt


Ephemeral runs

An ephemeral run can be used to:

  • Create a temporary deployment of a web app backend for development and testing purposes.
  • Run a one-off task that requires dynamically-provisioned cloud resources.

An ephemeral run is performed using the multinode run command. The full syntax is:

multinode run \
  --env-file={environment-variables-file} \
  --region={cloud-region-name} \

The lifetime of an ephemeral run is tied to the terminal process. Closing the terminal or pressing CTRL+C will abort the run immediately, tearing down all provisioned resources.

During an ephemeral run, logs from all workloads will be printed directly to the console terminal.

The requirements file

It is important that the current directory contains all the source code for the project, plus a requirements.txt file. See the section on dependencies for more flexible dependency management options.

Environment variables

The environment variables file should be structured as follows.


Cloud region

The cloud region name should be a name of an AWS region. Currently, we only host deployments in the following regions:

  • us-east-1: North Virginia (Default)
  • us-west-2: Oregon
  • eu-central-1: Frankfurt
  • ap-southeast-1: Singapore

The main script

The main script should contain all decorated functions (e.g. mn.function, mn.service), or should import the scripts where they are declared.

Coming soon

We are working on extending the library to improve the experience of importing functions from other files.

Behaviour of ephemeral runs

If the code contains a service or daemon, then the run will stay alive until the terminal process is terminated.

import multinode as mn
from fastapi import FastAPI
import uvicorn

app = FastAPI()

def get():
    return "Hello"

def api()
    # Runs until you press CTRL+C

If the code does not contain a service or daemon, then the run will terminate when the top-level code in the main script finishes executing. (Terminating the terminal process will abort the run prematurely.)

import multinode as mn

def square(x):
    return x ** 2

answer =
# Terminates here, unless CTRL+C has already been pressed