new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

FastAPI · Deployment · all subjects

deployment/startup

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Running on startup requirement for web APIs

Most web APIs should be always running and uninterrupted so clients can always access them. If using fastapi run or similar on a remote server without automatic startup handling, the process will die if the connection is lost, and the API will stay dead if the server restarts without manual intervention.

Tools to run application on startup

Tools that can ensure an application runs on startup include: Docker, Kubernetes, Docker Compose, Docker in Swarm Mode, Systemd, Supervisor, and cloud provider services.

Previous steps before starting application

Many cases require performing steps before starting the application, such as database migrations. These steps should only run once and should be performed by a single process before starting multiple worker processes. Running these steps in multiple processes simultaneously would duplicate work and could cause conflicts.

Strategies for previous steps before application startup

Strategies for running previous steps include: an Init Container in Kubernetes that runs before the app container, or a bash script that runs previous steps and then starts the application (which still requires a way to start/restart that script and detect errors).

Give your agent this brain