GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ionelmc/python-holdup: A tool to wait for services and execute command. Useful in Docker containers.

BranchesTags
Open more actions menu

Latest commit

 

History

185 Commits
185 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
ci
ci
 
 
docs
docs
 
 
src/holdup
src/holdup
 
 
tests
tests
 
 
.bumpversion.cfg
.bumpversion.cfg
 
 
.cookiecutterrc
.cookiecutterrc
 
 
.coveragerc
.coveragerc
 
 
.dockerignore
.dockerignore
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.readthedocs.yml
.readthedocs.yml
 
 
AUTHORS.rst
AUTHORS.rst
 
 
CHANGELOG.rst
CHANGELOG.rst
 
 
CONTRIBUTING.rst
CONTRIBUTING.rst
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.rst
README.rst
 
 
holdup.spec
holdup.spec
 
 
pyinstaller.Dockerfile
pyinstaller.Dockerfile
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Overview

docs Documentation Status
tests GitHub Actions Build Status Coverage Status
package PyPI Package latest release PyPI Wheel Supported versions Supported implementations Commits since latest release

A tool to wait for services and execute command. Useful for Docker containers that depend on slow to start services (like almost everything).

  • Free software: BSD 2-Clause License

Installation

Currently holdup is only published to PyPI and hub.docker.com.

To install from PyPI:

pip install holdup

It has no dependencies except the optional PostgreSQL check support, which you'd install with:

pip install 'holdup[pg]'

You can also install the in-development version with:

pip install https://github.com/ionelmc/python-holdup/archive/master.zip

Alternate installation (Docker image)

Example:

docker run --rm ionelmc/holdup tcp://foobar:1234

Note that this will have some limitations:

  • executing the command is pretty pointless because holdup will run in its own container
  • you'll probably need extra network configuration to be able to access services
  • you won't be able to use docker run inside a container without exposing a docker daemon in said container

Usage

usage: holdup [-h] [-t SECONDS] [-T SECONDS] [-i SECONDS] [-n] service [service ...] [-- command [arg [arg ...]]]

Wait for services to be ready and optionally exec command.

positional arguments:
service
A service to wait for. Supported protocols: "tcp://host:port/", "path:///path/to/something", "unix:///path/to/domain.sock", "eval://expr", "pg://user:password@host:port/dbname" ("postgres" and "postgresql" also allowed), "http://urn", "https://urn", "https+insecure://urn" (status 200 expected for http*). Join protocols with a comma to make holdup exit at the first passing one, eg: "tcp://host:1,host:2" or "tcp://host:1,tcp://host:2" are equivalent and mean any that pass.
command
An optional command to exec.
optional arguments:
-h, --help show this help message and exit
-t SECONDS, --timeout SECONDS
 Time to wait for services to be ready. Default: 60.0
-T SECONDS, --check-timeout SECONDS
 Time to wait for a single check. Default: 1.0
-i SECONDS, --interval SECONDS
 How often to check. Default: 0.2
-v, --verbose Verbose mode.
--verbose-passwords
 Disable PostgreSQL/HTTP password masking.
-n, --no-abort Ignore failed services. This makes holdup return 0 exit code regardless of services actually responding.
--insecure Disable SSL Certificate verification for HTTPS services.
--version display the version of the holdup package and its location, then exit.

Example:

holdup tcp://foobar:1234 -- django-admin ...

Documentation

https://python-holdup.readthedocs.io/

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox

About

A tool to wait for services and execute command. Useful in Docker containers.

Topics

dockerdockerizehealthcheckholduphttppythontcpwait-for-it

Resources

Readme
BSD-2-Clause license

Contributing

Contributing
Activity

Stars

35 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.