Skip to main content

Simple task runner for applications set up with docker and kubernetes

Project description


Simple task runner supports running multiple tasks in parallel.


pip install tuliptask

Basic Usage

  • Create a tulip task file:
  • Add a simple task
from tuliptask import TulipTask

@TulipTask.task("dev") # use decorator to define a task
class Dev:
    def run(self, args): # tuliptask will call `run()` function to run the task.
        print("start development")

  • run the command in terminal:
tulip dev

add arguments to the task

from tuliptask import TulipTask

class Dev:
    def setup(self, parser): # tuliptask will call `setup()` function to add arguments.
        parser.add_argument("--container") # use Python built-in `argparse` to add arguments

    def run(self, args):
        print(f"start development for container: {args.container}")


run shell command

def run(self, args):"docker build")
    # or use docker command shortcut

available command shortcuts:

  • proc.d() ="docker")
  • proc.dc() ="docker-compose")
  • proc.k() ="kubectl")
  • ="minikube")

extend base task

Tuliptask provides several base tasks for convenience.

from tuliptask import TulipTask
from tuliptask.tasks import KubeTask

class Dev(KubeTask):
    def setup(setup, parser):

    def run(self, args):
        print("start development")


base task will add base setup(), run() and other convenient functions.


  • setup(parser):
    • --context: kubernetes context
    • --namespace: kubernetes namespace
  • k(cmdstr, **kwargs): kubectl command shortcut with --context and --namespace args appended if available
  • kube_info(): print namespace and context info


When we have multiple tasks or services that do not depend on each other, it's waste of time to run them in serial. For example, if you need to build backend and frontend images, they can be run in parallel to speed up the process.

from tuliptask import TulipTask, MultiRun, proc

class Dev:
    def run(self, args):
        mr = MultiRun()
        mr.add(proc.d, args=("build api", ))
        mr.add(proc.d, args=("build ui", ))



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tuliptask, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size tuliptask-0.0.2.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page