<commit_before>## Ochonetes

### Overview

This project is a small development PaaS leveraging [**Ochopod**](https://github.com/autodesk-cloud/ochopod)
and overlaying it on top of [**Kubernetes**](https://github.com/GoogleCloudPlatform/kubernetes).

It provides a self-contained web-shell ([**JQuery**](https://jquery.com/) rocks !) hosting our little toolkit that will
allow you to create, query and manage your ochopod containers. It also lets you CURL your commands directly which is
a great way to build your CI/CD pipeline !

Please note we **only support bindings to run over AWS** at this point.

### Getting started

#### Step 1 : install K8S on AWS

You know how to do it. Just peruse their [**AWS guide**](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/aws.md)
that will get you setup in minutes.

Note what the master IP is and what your credentials. These can be found locally, for instance:

```
$ cat ~/.kube/kubernetes/kubernetes_auth
```

#### Step 2 : deploy our proxy

We use a simple proxy mechanism to interact with our containers. Edit the provided ```ocho-proxy.yml``` and specify
the master IP and user credentials. Then create the pod:

```
$ kubernetes/cluster/kubectl.sh create -f ocho-proxy.yml
```

The _create_ will return immediately. Wait a bit until the pod is up and note the public IP it is running from. You
can check the state of your pods at any time by doing:

```
$ kubernetes/cluster/kubectl.sh get pods
```

Look for _ocho-proxy_ and note its internal EC2 IP address (usually something like ```ip-172-20-0-11.ec2.internal```).
Go in your AWS EC2 console and find out what minion matches it. What you want of course it the minion public IP (e.g
the one you can reach from your workstation).

This IP (or the corresponding hostname, whatever you prefer) will be the only thing you need to access from now on.
You can easily firewall it depending on your needs. Simply use your browser and look the proxy node IP up on port 9000.
You should see our little web-shell (notice the elegant ascii art).

### The CLI

You are now all setup and can remotely issue commands to the proxy. Are you afraid of using CURL or feel lazy ? No
problemo, use our little self-contained CLI ! You just need to have [**Python 2.7+**](https://www.python.org/)
installed locally:

```
$ chmod +x cli.py
$ ./cli.py <PROXY IP>
welcome to the ocho CLI ! (CTRL-C to exit)
>
```

You can set the $OCHOPOD_PROXY environment variable to avoid passing the proxy IP on the command line. Any command
typed in that interactive session will be relayed to your proxy ! If you prefer to CURL directory you can do so as
well.

The proxy supports a whole set of tools doing various things. Just type ```help``` in the CLI to get a list of what is
there. Each tool also has supports a ```---help``` switch that will print out all the details you need to know.

### Deploying your first containers

Go ahead and use the CLI to deploy a 3 node [**Zookeeper**](https://zookeeper.apache.org/) ensemble ! Look at the
little ```zookeeper.yml```. This is the container definition you are going to send to the proxy for deployment.
The proxy will then setup the corresponding k8s infrastructure (replication controller & pods) for you and ochopod will
automatically cluster those pods into a functional cross-configured ensemble. If you are a nerd please have a look at
```images/zookeeper``` to see what is hiding in our image.

Let us get going with the CLI:<commit_msg>improved README<commit_after>## Ochonetes

### Overview

This project is a small development PaaS leveraging [**Ochopod**](https://github.com/autodesk-cloud/ochopod)
and overlaying it on top of [**Kubernetes**](https://github.com/GoogleCloudPlatform/kubernetes).

It provides a self-contained web-shell ([**JQuery**](https://jquery.com/) rocks !) hosting our little toolkit that will
allow you to create, query and manage your ochopod containers. It also lets you CURL your commands directly which is
a great way to build your CI/CD pipeline !

Please note we **only support bindings to run over AWS** at this point.

### Getting started

#### Step 1 : install K8S on AWS

You know how to do it. Just peruse their [**AWS guide**](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/aws.md)
that will get you setup in minutes.

Note what the master IP is and what your credentials. These can be found locally, for instance:

```
$ cat ~/.kube/kubernetes/kubernetes_auth
```

#### Step 2 : deploy our proxy

We use a simple proxy mechanism to interact with our containers. Edit the provided ```ocho-proxy.yml``` and specify
the master IP and user credentials. Then create the pod:

```
$ kubernetes/cluster/kubectl.sh create -f ocho-proxy.yml
```

The _create_ will return immediately. Wait a bit until the pod is up and note the public IP it is running from. You
can check the state of your pods at any time by doing:

```
$ kubernetes/cluster/kubectl.sh get pods
```

Look for _ocho-proxy_ and note its internal EC2 IP address (usually something like ```ip-172-20-0-11.ec2.internal```).
Go in your AWS EC2 console and find out what minion matches it. What you want of course it the minion public IP (e.g
the one you can reach from your workstation).

This IP (or the corresponding hostname, whatever you prefer) will be the only thing you need to access from now on.
You can easily firewall it depending on your needs. Simply use your browser and look the proxy node IP up on port 9000.
You should see our little web-shell (notice the elegant ascii art).

### The CLI

You are now all setup and can remotely issue commands to the proxy. Are you afraid of using CURL or feel lazy ? No
problemo, use our little self-contained CLI ! You just need to have [**Python 2.7+**](https://www.python.org/)
installed locally:

```
$ chmod +x cli.py
$ ./cli.py <PROXY IP>
welcome to the ocho CLI ! (CTRL-C to exit)
>
```

You can set the $OCHOPOD_PROXY environment variable to avoid passing the proxy IP on the command line. Any command
typed in that interactive session will be relayed to your proxy ! If you prefer to CURL directory you can do so as
well.

The proxy supports a whole set of tools doing various things. Just type ```help``` in the CLI to get a list of what is
there. Each tool also has supports a ```---help``` switch that will print out all the details you need to know. As
an example:

```
$ ./cli.py
welcome to the ocho CLI ! (CTRL-C to exit)
> help
available commands -> deploy, grep, info, kill, log, ls, off, on

> grep --help
usage: ocho grep [-h] [-d] [clusters [clusters ...]]

Displays high-level information for the specified cluster(s).

positional arguments:
  clusters     1+ clusters (can be a glob pattern, e.g foo*)

optional arguments:
  -h, --help   show this help message and exit
  -d, --debug  debug mode
```

### Deploying your first containers

Go ahead and use the CLI to deploy a 3 node [**Zookeeper**](https://zookeeper.apache.org/) ensemble ! Look at the
little ```zookeeper.yml```. This is the container definition you are going to send to the proxy for deployment.
The proxy will then setup the corresponding k8s infrastructure (replication controller & pods) for you and ochopod will
automatically cluster those pods into a functional cross-configured ensemble. If you are a nerd please have a look at
```images/zookeeper``` to see what is hiding in our image.

Let us get going with the CLI:
{'fraction_non_alphanumeric': 0.08673537679025566, 'fraction_numerical': 0.006023290054878865, 'mean_word_length': 4.069199457259159, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2689213', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2063, 'n_words': 1109}