Skip to main content

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.

Installation

The easiest way is to install from Pypi library:

$ pip install pwdc

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

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).

Metadata

Release files for pwdc 0.0.3

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

Source distribution (sdist)

Source distribution for pwdc 0.0.3
File Size Uploaded
pwdc-0.0.3.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pwdc 0.0.3
File Interpreter ABI Platform
pwdc-0.0.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 22.8 kB

Release files / pwdc-0.0.3.tar.gz

Download URL pwdc-0.0.3.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3463ea01496272bb255afd5f99e879333001a3da838dca29426d73c59144da9e
BLAKE2b-256 checksum
How to use checksums
d64edc7adfba788dabb7eb844ed49945a71a494f1fedf341b21b47f84595c756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pwdc-0.0.3-py2.py3-none-any.whl

Download URL pwdc-0.0.3-py2.py3-none-any.whl
Size 14.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e625678fe7b322faddba05b8d71f189c687a1013632d2a533cf3931915db981d
BLAKE2b-256 checksum
How to use checksums
093d5073683343b3cedceb2b22ed6afac7bb10cb645b15def4420bd2ef76fd5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

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