compoctl: backup/restore/apply one-liner pipelines for docker-compose
Install with pip install compoctl
A wrapper for the long docker-compose command that also adds a few features that should be considered experimental, in waiting for refutation or upstream contribution - which won’t break BC because compoctl decorates docker-compose commands.
compoctl apply: the one-liner pipeline for docker-compose
Chain pull/build/down/up/logs/ps, nice to have for hacking and even more in automated deploys:
compoctl -f ./foo.yml apply # will run: docker-compose -f ./foo.yml pull docker-compose -f ./foo.yml build docker-compose -f ./foo.yml down docker-compose -f ./foo.yml up -d docker-compose -f ./foo.yml logs docker-compose -f ./foo.yml ps
compoctl backup
Backup data into ./backup.
Example configuration that makes it work as-is:
volumes: - ./backup/postgres:/backup labels: io.yourlabs.backup.cmd: pg_dumpall -U postgres -f /backup/data.dump
This will dump pg data into ./backup/postgres, and also export docker-compose running config into ./backup/docker-compose.restore.yml
It will also execute the docker-compose.backup.yml if it exists. This is were you can spawn a container that mounts ./backup and proceeds to the secure backup export over the network that you want for production.
To prevent permission issues, containers should at no time write the ./backup directory itself.
pre-POC state: waiting for an example chaining a docker-compose.backup.yml that would spawn restic and rclone to backup the backup on a remote collection (or implement retention policy feature into duplicity).
compoctl restore
Copy docker-compose.yml back from ./backup and run restore commands.
This is a destructive operation that will delete all volumes except the backup volume, up each service one by one and apply the restore command.
Example configuration that makes it work as-is:
volumes: - ./backup/postgres:/backup labels: io.yourlabs.restore.cmd: psql -U postgres -f /backup/data.dump
Note that the ./backup directory must have been provisioned with the backup command priorly.
Also, the cluster will be unusable/down during the restore operation.
Metadata
Release files for compoctl 0.2.1.post3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| compoctl-0.2.1.post3.tar.gz | 4.9 kB | Without provenance | Details for compoctl-0.2.1.post3.tar.gz |
Release files / compoctl-0.2.1.post3.tar.gz
| Download URL | compoctl-0.2.1.post3.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cb48f1f585b7b060ebe41d71b37ab806b5f0e6f25334e9dd0df154095c8e73d
|
|
BLAKE2b-256 checksum How to use checksums |
7b744d5788242401bcd0dd97e1e891622908f4be4739db295bf034fcdf506cde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Security for compoctl 0.2.1.post3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.