Skip to main content

A simple python CLI for Play With Docker

Project description

A simple python CLI for your on-premise instance of Play With Docker

Create a 5 node Cluster Swarm in 5 seconds!

Purpose

This is a CLI that allows you to create, connecte to, view, and delete instances of Play-With-Docker.

The Goal of this project is to allow you or your users to quickly create ready to uses clusters swarm, and uses it without leaving your terminal.

Usage

You can just uses the following commands to create and use your cluster

` $ pwdc init --pwd-url=http://<your-pwd-server> `

Initialise the pwdc configuration file in ~/.pwdc. You need to update the ~/.pwdc value with the url of your PWD instance if not given the –pwd-url parameter

` $ pwdc create ` This will uses the PWD instance from your ~/.pwdc file, then : - create a PWD session - create 5 nodes - init a swarm with a master on node1 - join the swarm from the node2 to node5 - provides informations on your cluster

The Cluster is ready to uses, just point your docker CLI on the new Swarm

` $ eval $(pwdc env) $ docker info `

>From then, you can manipulaite the swarm cluster with your docker or docker-compose CLI

` $ pwdc info `

Show you the informations about your PWD session.

You can have multiple PWD session, this is manage with the –session_file parameter, which locally store your PWD session informations.

After a while, the session will be aumatically deleted, but you can also delete it manually when you are done with your session

` $ pwdc delete $ eval $(pwdc env -u) `

the last eval if to reset your docker client config

Installation

Contribution

If you’ve cloned this project, and want to install the library (and all development dependencies), the command you’ll want to run is:

$ pip install -e .[test]

If you’d like to run all tests for this project (assuming you’ve written some), you would run the following command:

$ python setup.py test

This will trigger py.test, along with its popular coverage plugin.

Lastly, if you’d like to cut a new release of this CLI tool, and publish it to the Python Package Index (PyPI), you can do so by running:

$ python setup.py sdist bdist_wheel
$ twine upload dist/*

This will build both a source tarball of your CLI tool, as well as a newer wheel build (and this will, by default, run on all platforms).

The twine upload command (which requires you to install the twine tool) will then securely upload your new package to PyPI so everyone in the world can use it!

Crédit

This Works is based on the [skele-cli](https://github.com/rdegges/skele-cli) python cli project skeleton and uses the powerfull opensource project [Play-With-Docker](https://github.com/franela/play-with-docker).

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

pwdc-0.0.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pwdc-0.0.1-py2.py3-none-any.whl (12.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pwdc-0.0.1.tar.gz.

File metadata

  • Download URL: pwdc-0.0.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pwdc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c1aea5006829127ec884fe458b6867a7a79b306f38f1e384b7cb1ccb7ba28d4e
MD5 8034a7306c6c10eeced60513252288ab
BLAKE2b-256 81005ddfde8b3f98bf09ee3c73a3627c91c0093b544f6b189a575243575277cc

See more details on using hashes here.

File details

Details for the file pwdc-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pwdc-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 294452578f1834fd566cf3b8aad431a9b4be6fba571a4ae4ad8b036e744697dc
MD5 5dd90cc8f57c702db75492dcdff1db2f
BLAKE2b-256 601581ee9cd3a6f5ff44cd60fba64184aec31064858beaf5992b8e99f619e6de

See more details on using hashes here.

Supported by

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