Module Structure

Introduction

The following files are created when you create an nstack module using:

$ nstack init <stack>

nstack.yaml

The nstack.yaml file describes the configuration of your nstack module. It has several required fields that describe the project and let you control the packaging of your module.

Sample nstack.yaml file:

# Module name
name: MyModule

# The language stack to use
stack: python

# Parent Image
parent: NStack.Python:0.25.0

api: |
  numChars : Text -> Integer

# (Optional) System-level packages needed
packages: []

# (Optional) Commands to run when building the module (Bash-compatible)
commands: []

# (Optional) Files/Dir to copy across into the module (can use regex/glob syntax)
files: []

name

Required

The name of the module. This is created by nstack init and uses the name of the current directory by default.

stack

Required

The base language stack to use when creating an image. Currently we support:

Name Description
python Python 3

parent

Required

The base-image your module builds from. This is typically generated by default when you create a module, but can be specified to include custom base-images which include standardised packages.

api

Required

The API which defines which functions you want to expose, and their input and output schemas. Please see idl_language for more details.

files

Optional

A list of files and directories within the project directory to include and bundle in alongside the image.

packages

Optional

A list of operating systems packages your module requires. These can be any packages installable via dnf on RHEL or Fedora.