containers / containers/podman-compose

Support scheduling

Open
#1,454 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

I would like to have a simple solution to schedule container runs.
Podman-Compose is this solution for services, but for scheduled jobs, there is no such simple approach.
Especially for data scientists and analysts, this could be useful, since most data people are familiar with Docker and Docker-Compose, but not with Linux or the deployment of complex systems.
This could close the gap for simple solutions that don't require a Kubernetes or Apache Airflow (or alike) setup.

**Describe the solution you'd like:**

podman-compose.yml should get two additional nodes:
- jobs – similar to `services:`, is the top-level node for scheduled services. Jobs should not start on `podman compose up`, but only when they are due:
- schedule: CRON or Systemd scheduling syntax - indicates when this service should run

**Example:**

```YAML
jobs:
my_scheduled_service:
image: my_simple_data_pipeline
schedule: 'Mon..Fri 06:00:00'
```

**Describe alternatives you've considered:**

[Ofelia](https://github.com/mcuadros/ofelia)

- uses the Docker/Podman API to read labels from containers to schedule
- it's missing a simple approach to manually trigger a job run (of course, `podman run` could be used, but if secrets and environment variables are required, it's quite unhandy) ([Github Issue](https://github.com/mcuadros/ofelia/issues/198)).

[Systemd](https://github.com/containers/quadlet)

- Almost perfect, but systemd requires a lot of boilerplate.
- each service requires a unit and a timer file, which makes it not a straight forward deployment
- Services are mixed with OS services, and the separation is not as clean as with `podman compose`.
- Since Podman is already quite deeply integrated with systemd, I thought it might be possible to use its scheduling capabilities

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.