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.
You Need to have an instance of [Play-With-Docker](https://github.com/franela/play-with-docker) without the Capcha test.
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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pwdc-0.0.3.tar.gz
.
File metadata
- Download URL: pwdc-0.0.3.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3463ea01496272bb255afd5f99e879333001a3da838dca29426d73c59144da9e |
|
MD5 | 08ef4b884bb95e717ef8d8d5f2a15e71 |
|
BLAKE2b-256 | d64edc7adfba788dabb7eb844ed49945a71a494f1fedf341b21b47f84595c756 |
File details
Details for the file pwdc-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pwdc-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e625678fe7b322faddba05b8d71f189c687a1013632d2a533cf3931915db981d |
|
MD5 | a04cf03805566bd5eb62e8038e5d065b |
|
BLAKE2b-256 | 093d5073683343b3cedceb2b22ed6afac7bb10cb645b15def4420bd2ef76fd5a |