Configuration (oakapp.toml)
Within each app's directory, there must be aoakapp.toml
file that contains static app's metadata and build steps. Metadata includes the app's identifier and version. Build steps are commands that are executed in the container to build or run the app. Example oakapp.toml
file:Toml
1identifier = "com.luxonis.python_demo"
2entrypoint = ["bash", "-c", "python3 /app/main.py"]
3
4# (Required) Prepare container commands
5# Here is the place where you can install all the dependencies that are needed at run-time
6prepare_container = [
7 # You can use COPY command to copy files from the host to the container
8 # { type = "COPY", source = "requirements.txt", target = "requirements.txt" }
9 # { type = "RUN", command = "pip3 install -r /app/requirements.txt --break-system-packages" }
10 { type = "COPY", source = "requirements.txt", target = "requirements.txt" },
11 { type = "RUN", command = "apt-get update" },
12 { type = "RUN", command = "apt-get install -y python3-pip" },
13 { type = "RUN", command = "pip3 install -r /app/requirements.txt --break-system-packages" },
14]
15
16# (Required) Prepare build dependencies
17# Here is the place where you can install all the dependencies that are needed at build-time
18prepare_build_container = [
19 # Example: npm, gcc, ...
20]
21
22# (Required) Additional commands after all the app files are copied to the container
23build_steps = []
oakapp.toml
fields:identifier
- name of the app in Java-like format (with dots as separators)app_version
- version of the applibrary
- DepthAI library version to be installed (only for stable version available without --extra-index-url)app_dir_name
(optional; default isapp
)cwd
- (optional, default/
) current working directory for the containerentrypoint
- array of strings (a command in argv format). By default,oakapp.toml
(and all other files in the same directory) will be copied to/app
directory in the containerbuild_steps
- steps to build an application (array of strings)base_image
- base image for the container (needs to be debian based, by default it uses bookworm-slim), see example below:
Toml
1[base_image]
2api_url = "https://registry-1.docker.io" # Service https address
3service = "registry.docker.io" # Name of Image Registry Service
4oauth_url = "https://auth.docker.io/token" # address to oauth 2.0 token for this service
5auth_type = "repository" # scope type
6auth_name = "library/debian" # name of resource
7
8image_name = "library/debian"
9image_tag = "bookworm-slim"
required_mounts
,required_devices
- mounts that are required - if not present on startup of container, the app is stopped with error
Toml
1required_mounts = [
2 "/run/user/1000/pulse:/run/user/1000/pulse",
3 "/home/root/.config/pulse/cookie:/root/.config/pulse/cookie",
4]
optional_mounts
,optional_devices
- if not present of startup of container, these mounts are ignoredadditional_mounts
(source
,target
,type
,options
,required
) array of objects that are specified here (we just use target instead of destination):
Toml
1additional_mounts = [
2 { source = "/run/user/1000/pulse", target = "/run/user/1000/pulse", type = "none", options = [
3 "rbind",
4 "rw",
5 ], required = true },
6 { source = "/home/root/.config/pulse/cookie", target = "/root/.config/pulse/cookie", type = "none", options = [
7 "bind",
8 "ro",
9 ], required = true },
10]