Skip to main content

Spark Networks DevOps coding challenge

Project description

Spark Networks DevOps coding challenge

https://gitlab.com/askainet/spark-networks-code-challenge

Requirements

  • Python >= 3.4

Install

From public Pypi repository:

pip install sparkd

Demo

docker build . -t sparkd

docker run -it -e RETRIES=5 sparkd demo.sh

Usage

usage: sparkd [-h] [--version] [-l LOGFILE]
              [--command-logfile COMMAND_LOGFILE] [-n NAME] [-v] [-d]
              [-r RETRIES] [-i RETRY_INTERVAL] [-c CHECK_INTERVAL]
              [command] [arguments [arguments ...]]

Run any command as a daemon and supervise it

positional arguments:
  command               The command to run as a daemon to supervise
  arguments             Arguments to the command

optional arguments:
  -h, --help            show this help message and exit
  --version             Show version
  -l LOGFILE, --logfile LOGFILE
                        Set the logfile for the Sparkd supervisor
  --command-logfile COMMAND_LOGFILE
                        Set the logfile for the command to supervise
  -n NAME, --name NAME  Set the name of this Sparkd instance
  -v, --verbose         Enable verbose logging
  -d, --debug           Enable debug logging
  -r RETRIES, --retries RETRIES
                        Number of retries to restart the process
  -i RETRY_INTERVAL, --retry-interval RETRY_INTERVAL
                        Seconds to wait between retries to restart the process
  -c CHECK_INTERVAL, --check-interval CHECK_INTERVAL
                        Seconds to wait between checking process status

Developing

Tests

Some basic tests have been added to have coverage only for the Process class, just to demonstrate how to use unittest with Python.

make test

Linting

Linting with pylint to keep a nice and healthy code.

make lint

Publish to Pypi

Package and publish to Pypi repository.

make dist

Install from source

make install

Documentation

Documentation is built using sphinx based on docstrings present in the code.

Readthedocs integration is configured to automatically generate and upload docs to https://sparkd.readthedocs.io/en/latest/ on updates to master branch.

Manual local docs generation is possible running make docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparkd-0.0.1b0.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file sparkd-0.0.1b0.tar.gz.

File metadata

  • Download URL: sparkd-0.0.1b0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for sparkd-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 1f5fcfbefeacc2586f2330f51a8078b003f0ffecc1a0412c6590760b0d1e03e4
MD5 1d998064185a76a3dcb2b4aeb815e4b1
BLAKE2b-256 4034536223496344f0c46e0d8344257b4773982a6ef0b812a20714ac5278f11f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page