ecsjobs
Documentation: https://jantman.github.io/ecsjobs/
Package: ecsjobs on PyPI
Docker image:
ghcr.io/jantman/ecsjobson the GitHub Container Registry
A scheduled job wrapper for ECS, focused on email reporting and adding docker exec and local command abilities.
This is a very, very esoteric project with a really niche use case.
I’ve migrated my very small personal AWS infrastructure to a single t2.micro ECS instance. I’m also trying to migrate some of
my personal stuff from my desktop computer to that instance. I need a way to run scheduled tasks and report on their success
or failure, and maybe some output (I have a cron wrapper script that does this on my desktop). But my AWS spend is about $15/month
and I don’t want to go over that just because of a bunch of CloudWatch alarms. Also, sometimes the scheduled things I want
to run are really docker exec into existing task containers.
This is a Python project (distributed as an ECS-ready Docker image) that aims to handle running scheduled things and then sending an email report on their success or failure. The main shortcomings this intends to address are the lack of simple built-in failure monitoring for Scheduled ECS Tasks, the lack of a built-in way to execute a command in a running (ECS Service) container, and the lack of useful email reports.
The generated email reports look like (this one for exampleconfig.yml):
Upgrading to 2.0
The package requires Python 3.8 or newer and is tested on Python 3.8 through 3.14. The Docker image is built on Python 3.14 (see below).
The Docker image is now published only to the GitHub Container Registry as
ghcr.io/jantman/ecsjobs(tags<version>andlatest); thejantman/ecsjobsimage on Docker Hub is no longer updated. The image is built on current Alpine and Python 3.14 (previously 3.9), which matters for any Python scripts your jobs run inside it.The AWS CLI in the Docker image is now version 2 (Alpine’s
aws-clipackage) instead of version 1. Check job scripts for commands that changed between the two, such as the removedaws ecr get-loginand the new default output pager and binary format.The Docker image’s
git_commit,git_url,build_timeandmaintainerlabels are replaced by standardorg.opencontainers.image.*labels.The
commandarray ofLocalCommand,DockerExecandEcsDockerExecjobs is now validated so that every element must be a string; previously only the first element was checked.Configuration YAML is loaded with
yaml.safe_load.Unknown keys in the
globalsection or in a job now fail validation; previously they were silently ignored. Check your configuration (for example, for misspelled option names) before upgrading.A
failure_commandwith arguments now works; previously any command with arguments raised an error.
Contents
Release Notes
Release notes for each version are published as GitHub releases.