Skip to main content

Bendu

linting: pylint Python 3.9.7 release passing Github vulnerabilities GitHub tag (latest by date) Github vulnerabilities Github release date visitors

"Buy Me A Coffee"

Table of Contents

Introduction

This python tool automates operations with docker containers by utilizing the Docker Remote API. This python tool implements the following:

  • Building a Docker Image from a given Dockerfile and an application (a ‘Hello world’ web application)
  • Starting a few instances of the Docker Image in different containers
  • Validating that the container instances are running
    • Validating the status of the service running inside the container (health check)
  • Monitoring the resource usage of each container (CPU, I/O, etc)
  • Consolidating the log output of all the container instances into one centralized log file.

Getting Started

Prerequisites

Please make sure you've already Python3. The tool is utilizing the Docker Remote API , the Python SDK for Docker and the python package Click. The Remote API is set up in tcp://0.0.0.0:2376. For the purpose of using the tool, you should set up the Remote API likewise. The following instructions apply to Ubuntu 16.04 and Debian 9.9 (stretch).

Install the Python SDK and Click:

apt-get install python3-pip
pip3 install docker
pip3 install click

Edit the file:

sudo nano /lib/systemd/system/docker.service

Update with:

ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376

Then, restart the docker service running below commands:

sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker

For older versions than Ubuntu 16.04 you can use the instructions in the following source, Enabling and accessing Docker Engine API on a remote docker host on Ubuntu

Usage

The tool is equipped with five commands: build, deploy, validate, stats and logging as presented below:

python3 bendu.py [build, deploy, validate, stats, logging] --help

Testing

To test the python tool follow the instructions below.

  1. First install virtual environment:
apt-get install virtualenv
  1. Then, in the same depth as the project make a folder named venv:
mkdir venv
  1. Execute the following command:
virtualenv -p python3 venv/
  1. Get up and running a virtual environment by running executing:
. venv/bin/activate
pip3 install --editable .
  1. Finally, execute the build command to build the image according the instructions that are defined in a Dockerfile:
bendu --help
bendu build -d ./data -t "alpine_hello_world:1"
  1. Exit virtual environment by invoking:
deactivate

Help

Each one of these commands has each one functionality which can be over-viewed by invoking each command followed by --hep.

Technologies

Release files for bendu 1.0.2

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

Source distribution (sdist)

Source distribution for bendu 1.0.2
File Size Uploaded
bendu-1.0.2.tar.gz 6.0 kB Details

Built distribution (wheel)

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

Total release size: 11.7 kB

Release files / bendu-1.0.2.tar.gz

Download URL bendu-1.0.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
14cfefe698ecd4e6e45149b44ff5ff1d790c3c8326587679669ba4aca72ae4cf
BLAKE2b-256 checksum
How to use checksums
5bd77da41e7cc56706d5d0a7a7020b6c18355095d56e510205563ebce19f7d96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release files / bendu-1.0.2-py3-none-any.whl

Download URL bendu-1.0.2-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0dd17157f045f8f802f257637bafb017731ebeec5047148685dd8fd2b9c60c7
BLAKE2b-256 checksum
How to use checksums
25a2fc421bad0144f781d1af7b88f3c9a71baa6d9cec536f1dea35281006faf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 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