Lifecycle management

This guide explains the Makefile targets available for managing the Oracle AI Database Private Agent Factory project. The Makefile provides convenient shortcuts for common commands, simplifying the application’s entire lifecycle from building and deployment to uninstallation.

Configuration variables

These variables control the behavior of the Makefile targets. You can override their default values directly from the command line.

Variable Default value Description
PROJECT_NAME applied-ai-studio The prefix used for naming Podman containers and images.
COMPOSE_FILE_PROD podman-compose-prod.yaml The source compose file for production deployments.
COMPOSE_FILE_QUICKSTART podman-compose-quickstart.yaml The source compose file for quickstart or development deployments.
COMPOSE_FILE_ACTIVE podman-compose.yaml The active compose file used by most targets. It is typically created and managed by the deploy.sh script.
AAI_CONTAINER_NAME oracle-applied-ai-label The specific container name used by the logsaai and start targets.

Example Override:

make PROJECT_NAME=my-project up

Makefile Targets

Targets are commands you can run with make. To execute a target, use the following syntax:

make PROJECT_NAME=my-project up

Note: All make commands described below must be executed from the Staging directory of the application.

Summary of Targets

Here is a quick overview of all available targets.

Category Target Description
Lifecycle up Starts the application by running the main deployment script (deploy.sh).
Lifecycle deploy Deploys the application using the active compose file (podman-compose.yaml).
Lifecycle down Stops and removes all application containers.
Lifecycle start Starts previously stopped containers without recreating them.
Lifecycle stop Stops running containers without removing them.
Lifecycle restart Stops and then starts the containers.
Lifecycle clean Stops containers and removes the main project image.
Lifecycle uninstall Runs a script to completely uninstall the application.
Build build Builds all required container images via a script.
Build buildaai Builds only the AAI service image.
Build buildollama Builds only the Ollama service image.
Build build23ai Builds only the Oracle Database 26ai Free image (db23aifree).
Diagnostics logs Tails the logs from all running services.
Diagnostics logsaai Tails the logs from the AAI service container only.
Diagnostics diagnose Runs a diagnostic script to check the deployment health.

Detailed Target Descriptions

Application Lifecycle Targets

all

The default target. It simply runs make up to start the application.

make all

up

Starts the entire application stack by executing the deploy.sh script. This script handles the logic for choosing a deployment mode and setting up the environment.

make up

deploy

A lower-level target that runs podman-compose up using COMPOSE_FILE_ACTIVE (podman-compose.yaml). You typically do not need to run this directly; use make up instead.

down

Stops and removes all containers, networks, and volumes defined in the active compose file. This is a clean way to shut down the application.

Note: This target does not remove the DB schema. It is recommended to use make uninstall for a full cleanup.

make down

start

Starts containers that were previously created but are currently stopped (e.g., after using make stop). It also executes a command to ensure the crond service is running inside the AAI container.

make start

stop

Stops all running containers without removing them. Your data and container state are preserved. Use make start to resume.

make stop

restart

A convenient shortcut that runs make stop followed by make start.

make restart

clean

Performs a partial cleanup. It first runs make down to stop and remove containers, then attempts to remove the main project container image (e.g., applied-ai-studio).

Note: This target does not remove other images like Ollama or the database. For a full cleanup, use make uninstall.

make clean

uninstall

Executes the uninstall.sh script to perform a complete removal of the application. This is the most thorough way to clean your environment.

Warning: This is a destructive operation that may remove all containers, images, and clears the database schema. Please enter Y in order to clean the DB schema.

make uninstall

Image build targets

build

Builds all necessary service images by executing the build-image.sh script. This will build the AAI, Ollama, and database images.

make build

buildaai / buildollama / build26ai

Builds a specified service image individually by calling the build-image.sh script with the correct parameter (e.g., aai, ollama, or db26aifree).

make buildaai

Diagnostics and logging targets

diagnose

Runs the diagnose.sh script to help troubleshoot common issues with your deployment. This creates a zip that contains logs and configuration details for further analysis.

make diagnose

logs

Streams the logs from all running services defined in the active compose file. Press Ctrl+C to exit.

make logs

logsaai

Streams the logs for only the AAI container (oracle-applied-ai-label) using a direct podman logs command. Press Ctrl+C to exit.

make logsaai