App

Manifest

A tutorial on using the app manifest to specify execution environment.

An application that runs on the Nextmv Platform must contain a file named app.yaml which is known as the app manifest. This file is used to specify the execution environment for the app.

Additionally, the app must be executed from an entrypoint. The entrypoint of the app should be:

  • main for Go
  • main.py for Python
  • main.jar for Java

You can port any custom app into the Nextmv Platform. You just need the app.yaml manifest in the root of the project with the appropriate attributes and an adequate entrypoint.

Mandatory attributes

The app.yaml manifest must contain the following attributes:

  • type: the language type to use for the app.

    • go for Go
    • python for Python
    • java for Java
  • runtime: the runtime to use for the app.

  • files: the files to include (or exclude) in the app. Globbing is supported so you may specify individual files or whole directories. Include the entrypoint of the app here. Some examples of supported glob patterns:

    • **/*.py: all Python files recursively
    • !**/*.pyc: exclude all Python compiled files
    • app/**/*.py: all Python files in the app directory.

    Patterns are applied in order as they are defined.

Optional attributes

The app.yaml manifest may contain the following optional attributes:

  • build: contains build-specific attributes.
    • command: the command to run to build the app. This command will be executed without a shell, i.e., directly. The command must exit with a status of 0 to continue the push process of the app to Nextmv Cloud. This command is executed prior to the pre-push command.
    • environment: environment variables to set when running the build command given as key-value pairs. E.g. GOOS: linux.
  • pre-push: a command to run before the app is pushed to the Nextmv Cloud. This command can be used to compile a binary, run tests or similar tasks. One difference with what is specified under build, is that the command will be executed via the shell (i.e., bash -c on Linux & macOS or cmd /c on Windows). The command must exit with a status of 0 to continue the push process. This command is executed just before the app gets bundled and pushed (after the build command).
  • python (only for Python apps): contains further Python-specific attributes.
    • pip-requirements: path to a requirements.txt file containing (additional) Python dependencies that will be bundled with the app.

Examples

Find basic examples of app.yaml manifests for different languages below.

type: go
# We use the default runtime as the app gets compiled into a binary
runtime: ghcr.io/nextmv-io/runtime/default:latest
# We build the app for linux and arm64 (the default runtime)
# and call it "main" (the default entrypoint)
build:
  command: go build -o main .
  environment:
    GOOS: linux
    GOARCH: arm64
# We only need to include the resulting binary "main"
files:
  - main
Copy

Furthermore, there are various examples of manifests in the context of complete apps from our community apps for all supported languages. Find the manifests themselves as a reference below.

go apps

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: go
runtime: ghcr.io/nextmv-io/runtime/default:latest

# Directives to build a Go binary from the app.
build:
  command: go build -o main .
  environment:
    GOOS: linux
    GOARCH: arm64

# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main
Copy

python apps

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/python:3.11
python:
  # All listed packages will get bundled with the app.
  pip-requirements: requirements.txt

# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.py
Copy

java apps

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: java
runtime: ghcr.io/nextmv-io/runtime/java:latest

# Directives to compile a binary from the app.
pre-push: mvn package

# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.jar
Copy

Page last updated

Go to on-page nav menu