Nulecule file

March 4, 2016 ยท View on GitHub

Atomic App implements version 0.0.2 of the Nulecule specification.

A Nulecule file format can either be json or yaml.

Data types

Common NametypeformatComments
integerintegerint32signed 64 bits
floatnumberfloat
stringstring
bytestringbyte
booleanboolean
datestringdateAs defined by full-date - RFC3339
dateTimestringdate-timeAs defined by date-time - RFC3339
passwordstringpasswordUsed to hint UIs the input needs to be obscured.
URLURLURLAs defined by URL - RFC3986 Section 1.1.3

Nulecule file schema

Container Application Object

This is the root object for the specification.

Field NameTypeDescription
idstringRequired. The machine readable id of the Container Application.
specversionstringRequired. The semantic version string of the Container Application Specification used to describe the app. The value MUST be "0.0.2" (current version of the spec).
metadataMetadata ObjectOptional An object holding optional metadata related for the Container Application, this may include license information or human readable information.
graphGraph ObjectRequired. A list of depending containerapps. Strings may either match a local sub directory or another containerapp-spec compliant containerapp image that can be pulled via docker.
requirementsRequirements ObjectOptional. A list of requirements of this containerapp.

Metadata Object

Metadata for the Container Application.

Fields
Field NameTypeDescription
namestringOptional. A human readable name of the containerapp.
appversionstringOptional. The semantic version string of the Container Application.
descriptionstringOptional. A human readable description of the Container Application. This may contain information for the deployer of the containerapp.
licenseLicense ObjectOptional. The license information for the containerapp.
arbitrary_datastringOptional. Arbitrary key: value pair(s) of metadata. May contain nested objects.
Metadata Object Example
metadata:
  name: myapp
  appversion: 1.0.0
  description: description of myapp
  foo: bar
  othermetadata:
    foo: bar
    files: file://path/to/local/file
...

License Object

License information for the Container Application.

Fields
Field NameTypeDescription
namestringRequired. The human readable license name used for the Container Application, no format imposed.
urlstringOptional. A URL to the license used for the API. MUST be in the format of a URL.
License Object Example
license:
  - name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html

Graph Object

The graph is a list of items (containerapps) the Container Application depends on.

Fields
Field NameTypeDescription
namestringRequired. The name of the depending Container Application.
sourcedocker://Optional. docker:// source location of the Container Application, the source MUST be prefixed by docker://. If source is present, all other fields SHALL be ignored.
paramsParams ObjectOptional. A list of Params Objects that contain provider specific information. If params is present, source field SHALL be ignored.
artifactsArtifact ObjectOptional. A list of Artifact Objects that contain provider specific information. If artifacts is present, source field SHALL be ignored.
Graph Item Object Example:
params:
  - name: mariadb-centos7-atomicapp
    source: docker://projectatomic/mariadb-centos7-atomicapp
  ...

If no artifacts are specified, then an external Atomic App is pulled and installed from the docker:// source.

Parameters Object

A list of Parameters the containerapp requires. Defaults may be set, otherwise user input is required.

Fields
Field NameTypeDescription
namestringRequired. The name of the parameter.
descriptionstringRequired. A human readable description of the parameter.
defaultstringOptional. An optional default value for the parameter.
Parameters Object Example:
params:
  - name: image
    description:  wordpress image
    default: wordpress
  ...

Requirements Object

The list of requirements of the Container Application.

Field NameTypeDescription
persistentVolumePersisent Volume ObjectOptional. An object that holds an array of persistent volumes.

Persistent Volume Object

This describes a requirement for persistent, read-only or read-write storage that should be available to the containerapp on runtime. The name of this object MUST be "persistentVolume".

Despite the name, within Kubernetes and OpenShift this acts as a PersistentVolumeClaim.

Persistent Volume is only available for the following providers: kubernetes

Fields
Field NameTypeDescription
namestringRequired. A name associated with the storage requirement.
accessModestringRequired. Must be either: ReadWriteOnce, ReadOnlyMany or ReadWriteMany.
sizeintegerRequired. Size of the volume claim.
Persistent Volume Example
requirements:
  - persistentVolume:
      name: "var-log-http"
      accessMode: "ReadWriteOnce"
      size: 4
  - persistentVolume:
      name: "var-log-https"
      accessMode: "ReadOnlyMany"
      size: 4
  ...

Artifacts Object

The Artifacts Object describes a list of provider specific artifact items. These artifact items will be used during the installation of the containerapp to deploy to the provider. Each provider key contains a list of artifacts.

Each artifact is a file location relative to the Nulecule file.

Optionally, you may inherit from another compatible provider.

Artifacts Example:
graph:
    ...
    artifacts:
      docker:
        - file://artifacts/docker/hello-apache-pod_run
      kubernetes:
        - file://artifacts/kubernetes/hello-apache-pod.json
      openshift:
        - inherit:
          - kubernetes
    ...

Full example

This is a full example of all features of the Nulecule file. This is only used as an example and does not necessarily work as intended.

---
specversion: 0.0.2
id: helloworld

metadata:
  name: Hello World
  appversion: 0.0.1
  description: Hello earth!
  license:
    - name: Apache 2.0
      url: http://www.apache.org/licenses/LICENSE-2.0.html
  foo: bar
  othermetadata:
    foo: bar
    files: file://path/to/local/file

graph:
  - name: mariadb-centos7-atomicapp
    source: docker://projectatomic/mariadb-centos7-atomicapp

  - name: helloapache-app
    params:
      - name: image
        description: The webserver image
        default: centos/httpd
      - name: hostport
        description: The host TCP port as the external endpoint
        default: 80
    artifacts:
      docker:
        - file://artifacts/docker/hello-apache-pod_run
      kubernetes:
        - file://artifacts/kubernetes/hello-apache-pod.json
      openshift:
        - inherit:
          - kubernetes
      marathon:
        - file://artifacts/marathon/helloapache.json

requirements:
  - persistentVolume:
      name: "var-log-httpd"
      accessMode: "ReadWriteOnce"
      size: 4