Job

A Job in Maand is a deployable folder containing configuration and execution logic. Jobs are assigned to workers based on matching labels.


Job Structure

A job folder must include:

  1. manifest.json
    • Defines the labels the job applies to.
  2. Makefile
    • Includes targets (start, stop, restart) that define the job's lifecycle operations.

Job Allocation


Makefile Targets

Maand expects the following targets in the job's Makefile:

  1. start
    Defines the logic to initialize/start or run the job.
  2. stop
    Handles stopping/cleaning up the job.
  3. restart
    Combines the stop and start targets for job restarts.

Important Note:


Workflow

  1. Build Configuration:

    $ maand build
    
    • Generates variables for agents based on roles and updates the KV database.
  2. Deploy Job:

    $ maand deploy
    
    • Allocates the jobs to matching workers and replaces variables in the configuration with actual values.