NodeUp Tasks

Within a model, we recognize a few well-known task names:

  • files
  • packages
  • services
  • options

When a directory is found with one of these well-known names, the items in the subtree build tasks of the corresponding types.

(TODO: Should we just prefer extensions everywhere?)

Directories which start with an underscore are tags: we only descend into those directories if the relevant tag is present.

All other directory names can be used for organization.

Alongside each task file, a file with the same name with a .meta extension will be recognized as well. It contains additional JSON options to parameterize the task. This is useful for files or templates, which otherwise have no place to put metadata.


The contents of the filesystem tree will be created, mirroring what exists under the files directory.

Directories will be created as needed. Created directories will be set to mode 0755.

Files will be created 0644 (change with meta 'fileMode')

Owner & group will be root:root

Two special extensions are recognized:

  • .asset will be sourced from assets. Assets are binaries that are made available to the installer, e.g. from a .tar.gz distributions
  • .template is a go template


Any files found will be considered packages.

The name of the file will be the package to be installed.


Any files found will be considered services.

The name of the file will be the service to be managed.

By default, the service will be restarted and set to auto-start on boot.

Order of operations

Logically, all operations are collected before any are performed, according to the tags.

Then operations are performed in the following order:

options packages files sysctls services

Ties are broken as follows

  • A task that required more tags is run after a task that required fewer tags
  • Sorted by name
  • Custom packages (install a deb) are run after OS provided packages
Expand ▾ Collapse ▴




View Source
const MaxTaskDuration = 365 * 24 * time.Hour

    MaxTaskDuration is the amount of time to keep trying for; we retry for a long time - there is not really any great fallback


    This section is empty.


    This section is empty.


    type Loader

    type Loader struct {
    	Builders []fi.ModelBuilder
    	TemplateFunctions template.FuncMap
    	// contains filtered or unexported fields

    func NewLoader

    func NewLoader(config *nodeup.Config, cluster *api.Cluster, assets *fi.AssetStore, tags sets.String) *Loader

    func (*Loader) Build

    func (l *Loader) Build(baseDir vfs.Path) (map[string]fi.Task, error)

      Build is responsible for running the build tasks for nodeup

      type NodeUpCommand

      type NodeUpCommand struct {
      	CacheDir       string
      	ConfigLocation string
      	FSRoot         string
      	ModelDir       vfs.Path
      	Target         string
      	// contains filtered or unexported fields

        NodeUpCommand the configiruation for nodeup

        func (*NodeUpCommand) Run

        func (c *NodeUpCommand) Run(out io.Writer) error

          Run is responsible for perform the nodeup process

          type TaskBuilder

          type TaskBuilder func(name string, contents string, meta string) (fi.Task, error)


          Path Synopsis