Skip to main content

TaskSquirrel

TaskSquirrel executes tasks from a Tasqfile.yml. It is similar to make or invoke. It also supports Kubernetes workflows like Argo and Airflow.

Differences from other tools are:

  • configuration is in YAML
  • it supports multiple scripts / languages
  • it supports Jinja2 templating
  • it has built-in support for executing code in Docker and on Kubernetes clusters
  • it is completely serverless: all it requires for interacting with a K8s cluster is Kubectl

TaskSquirrel is a good replacement for invoke and make even if you don't use the container-related features, but it is particularly well suited to data analysis and deep learning workflows.

Commands

  • tasq --help -- display help
  • tasq list -- list all commands
  • tasq run command -- run a command

Example

Simple replacement for invoke

tasks:
    venv:
      - doc: build the virtual environment
      - script: |
          test -d venv || virtualenv venv
          venv/bin/pip3 install -U -r requirements.txt

    newversion:
      - doc: increase the patch version number
      - python: |
          version = map(int, open("VERSION").read().strip().split("."))
          version[-1] += 1
          with open("VERSION", "w") as stream:
            stream.write(".".join(map(str, version)))

    publish:
      - doc: publish to PyPI
      - script: twine upload

Kubernetes Example

params:

  cluster: "mycluster"
  image: "mycompute"

tasks:

    image:
      docker_container: {{ image }}
        dockerfile: ./Docker
        push: tmbdev/{{ image }}
        context:
          - simple.key
          - scripts/start.sh

    kutest:
      - doc: start a job on K8s and wait for its completion
      - task: image
      - with_braceexpand: "{000..999}"
        param: shard
        tasks:
          - kubectl_apply: hello
            template_name: myjob
            params:
              id: hello-{{ shard }}
              script: |
                echo hello-{{ shard }};
                sleep 30
      - kubectl_wait:
        kind: jobs
        prefix: hello-
      - script: kubectl delete jobs --all

k8s_templates:

  myjob: |
    apiVersion: batch/v1
    kind: Job
    metadata:
      name: "{{ id }}"
    spec:
      template:
        spec:
          containers:
          - name: main
            image: "{{ image }}"
            command: ["/bin/bash", "-c", "{{ script }}"]
          restartPolicy: Never
      backoffLimit: 4

Status

It's pre-alpha.

Metadata

Release files for tasq 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tasq 0.0.3
File Size Uploaded
tasq-0.0.3.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tasq 0.0.3
File Interpreter ABI Platform
tasq-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / tasq-0.0.3.tar.gz

Download URL tasq-0.0.3.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c29204789658808ef9d0696eb274da597a3829e68f80853a9ac21e6675cd996e
BLAKE2b-256 checksum
How to use checksums
dd2e9c3d657d4d7504f48abdf1407f95143701465db691fdaad77caad1b76581
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release files / tasq-0.0.3-py3-none-any.whl

Download URL tasq-0.0.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d7d36c22b14c572bbaef56151928a211fdac34571d4c7cc925bf8cf602b7900
BLAKE2b-256 checksum
How to use checksums
52d35aa0d59481ef2026be6fcedce9fc1d468a8d65a17a0a83d54eb25baf538e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page