Skip to content

Commit

Permalink
readd documentation folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ufasoli committed Jul 21, 2020
1 parent 5a04ea7 commit 9549b0e
Show file tree
Hide file tree
Showing 35 changed files with 965 additions and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ func initClient() (*client.Client, context.Context) {
}

func printBanner() {
//content, _ := ioutil.ReadFile("init_banner.txt")
//fmt.Print(string(content))


f, err := pkger.Open("/assets/init_banner.txt")
if err != nil {
Expand Down
31 changes: 31 additions & 0 deletions documentation/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# `platys` - What's new?

## What's new in 2.2.0

Platys 2.2.0 contains the following new functionalities and enhancements:

### New Functionality

* first version of a `clean` command

### Enhancements

* `--structure` flag moved from `gen` to `init` command

## What's new in 2.1.0

Platys 2.1.0 contains the following new functionalities and enhancements:

### New Functionality

* supports CentOS 7

## What's new in 2.0.0

Platys 2.0.0 contains the following new functionalities and enhancements:

### New Functionality

* supports windows


15 changes: 15 additions & 0 deletions documentation/command-line-ref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `platys` command-line reference

The following pages describe the usage information for the `platys` subcommands.

You can also see this information by running `platys [SUBCOMMAND] --help` from the command line.

* [platys](overview-platys-command.md)
* [init](platys-init-command.md)
* [gen](platys-gen-command.md)
* [clean](platys-clean-command.md)
* [list_services](platys-list_services-command.md)

## Where to go next

* [Available Platform Stacks](../platform-stacks)
18 changes: 18 additions & 0 deletions documentation/creating-and-maintaining-platform-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Creating and Maintaining a Platform Stack

A Platform Stack has to be provided as a docker image. It contains the generator template, the config file as well as the static artefacts necessary for running the docker-compose.yml generated by the stack.

A generator is based on the [Docker Compose Templer](https://github.com/Aisbergg/python-docker-compose-templer) project, a small utility that adds more dynamism to Docker Compose files by utilizing the Jinja2 template engine. We added some wrapper logic around it to make it easier to use.

The implementation of a generator supporting a platform version and platform type is contained in a docker image itself, which is completly independent of the MDP tool itself. Currently there is only one pla

## How to build
The service generator is available as a docker image from where it can be run.

It can be found on [Docker Hub](https://hub.docker.com/repository/docker/trivadis/modern-data-platform-stack-generator) under `trivadis/modern-data-platform-stack-generator`.

If you want to build the docker image locally, perform (this is not necessary if you follow the installation instructions below).

```
docker build -t trivadis/platys-modern-data-platform:1.3.0 .
```
143 changes: 143 additions & 0 deletions documentation/environment/Lightsail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Provision on AWS Lightsail

Navigate to the [AWS Console](http://console.aws.amazon.com) and login with your user. Click on the [Lightsail service](https://lightsail.aws.amazon.com/ls/webapp/home/instances).

![Alt Image Text](./images/lightsail-homepage.png "Lightsail Homepage")

## Provision instance

Click **Create instance** to navigate to the **Create an instance** dialog.

![Alt Image Text](./images/lightsail-create-instance-1.png "Lightsail Homepage")

Optionally change the **Instance Location** to a AWS region of your liking.
Keep **Linux/Unix** for the **Select a platform** and click on **OS Only** and select **Ubuntu 18.04 LTS** for the **Select a blueprint**.

![Alt Image Text](./images/lightsail-create-instance-2.png "Lightsail Homepage")

Scroll down to **Launch script** and add the following script

```
# Install Docker and Docker Compose
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge"
apt-get install -y docker-ce
sudo usermod -a -G docker ubuntu
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# Install ctop
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.2/ctop-0.7.2-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
# Install wget
apt-get install -y wget
# Install kafkacat
apt-get install -y kafkacat
# needed for elasticsearch
sudo sysctl -w vm.max_map_count=262144
# Prepare Environment Variables
export PUBLIC_IP=$(curl ipinfo.io/ip)
export DOCKER_HOST_IP=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
export COMPOSE_HTTP_TIMEOUT=300
cd /home/ubuntu
git clone https://github.com/TrivadisBDS/modern-data-analytics-stack.git
cd modern-data-analytics-stack/full-stack/docker
# Startup Environment
docker-compose up
```

into the **Launch Script** edit field

![Alt Image Text](./images/lightsail-create-instance-3.png "Lightsail Homepage")

Click on **Change SSH key pair** and leave the **Default** selected and then click on **Download** and save the file to a convenient location on your machine. Under **Choose your instance plan** click on the arrow on the right and select the **16 GB** instance.

Under **Identify your instance** enter **Ubuntu-Analytics-Platform** into the edit field.

![Alt Image Text](./images/lightsail-create-instance-4.png "Lightsail Homepage")

Click on **Create Instance** to start provisioning the instance.

The new instance will show up in the Instances list on the Lightsail homepage.

![Alt Image Text](./images/lightsail-image-started.png "Lightsail Homepage")

Click on the instance to navigate to the image details page. On the right you can find the Public IP address **18.196.124.212** of the newly created instance.

![Alt Image Text](./images/lightsail-image-details.png "Lightsail Homepage")

Next we have to configure the Firewall to allow traffic into the Lightsail instance.

Click on the **Networking** tab/link to navigate to the network settings and under **Firewall** click on **+ Add another**.
We allow TCP traffic on ports 28000 - 28200 by selecting **Custom**, entering **28000 - 28200** into the **Port range** field and then click **Save**.

![Alt Image Text](./images/lightsail-image-networking-add-firewall-rule.png "Lightsail Homepage")

Now let's see how the provisioning of the lightsail instance is doing.
Navigate to the **Connect** tab and click **Connect using SSH** to open the console and enter the following command to watch the log file of the init script.

```
tail -f /var/log/cloud-init-output.log --lines 1000
```

The initialisation is finished when you see the `Creating xxxxx .... done` lines after all the docker images have been downloaded, which takes a couple of minutes.

![Alt Image Text](./images/lightsail-create-instance-log-file.png "Lightsail Homepage")

Optionally you can also SSH into the Lightsail instance using the **SSH key pair** you have downloaded above. For that open a terminal window (on Mac / Linux) or Putty (on Windows) and connect as ubuntu to the Public IP address of the instance.

```
ssh -i LightsailDefaultKey-eu-central-1.pem ubuntu@18.196.124.212
```

Your instance is now ready to use. Complete the post installation steps documented the [here](README.md).

## Stop an Instance

To stop the instance, navigate to the instance overview and click on the drop-down menu and select **Stop**.

![Alt Image Text](./images/lightsail-stop-instance.png "Lightsail Homepage")

Click on **Stop** to confirm stopping the instance.

![Alt Image Text](./images/lightsail-stop-instance-confirm.png "Lightsail Homepage")

A stopped instance will still incur charges, you have to delete the instance completely to stop charges.

## Delete an Instance

t.b.d.

## Create a snapshot of an Instance

When an instance is stopped, you can create a snapshot, which you can keep, even if later drop the instance to reduce costs.

![Alt Image Text](./images/lightsail-image-create-snapshot.png "Lightsail Homepage")

You can always recreate an instance based on a snapshot.

# De-provision the environment

To stop the environment, execute the following command:

```
docker-compose stop
```

after that it can be re-started using `docker-compose start`.

To stop and remove all running container, execute the following command:

```
docker-compose down
```

72 changes: 72 additions & 0 deletions documentation/environment/LocalDocker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Provision on Local Docker Environment

Make sure that you have Docker and Docker Compose running on your local environment. To run docker on windows you need to have Windows 10.

* Mac: <https://docs.docker.com/docker-for-mac/>
* Windows 10: <https://docs.docker.com/docker-for-windows/install/>

## Prepare Environment

In the Virtual Machine, start a terminal window and execute the following commands.

First let's add the environment variables. Make sure to adapt the network interface (**ens33** according to your environment. You can retrieve the interface name by using **ipconfig** on windows or **ifconfig* on Mac/Linux.

```
# Set environment variables to match the IP address of the local machine
export PUBLIC_IP=10.1.215.134
export DOCKER_HOST_IP=10.1.215.134
```

Now for Elasticsearch to run properly, we have to increase the `vm.max_map_count` parameter like shown below.

```
# needed for elasticsearch
sudo sysctl -w vm.max_map_count=262144
```

Now let's checkout the NoSQL Workshop project from GitHub:

Navigate to your local folder, where you want to keep the workshop and execute the `git clone` command

```
# Get the project
git clone https://github.com/TrivadisBDS/modern-data-analytics-stack.git
cd modern-data-analytics-stack/base-stack/docker
```

## Start Environment

And finally let's start the environment:

```
# Make sure that the environment is not running
docker-compose down
# Startup Environment
docker-compose up -d
```

The environment should start immediately, as all the necessary images should already be available in the local docker image registry.

The output should be similar to the one below.

![Alt Image Text](./images/start-env-docker.png "StartDocker")

Your instance is now ready to use. Complete the post installation steps documented the [here](README.md).

## Stop environment

To stop the environment, execute the following command:

```
docker-compose stop
```

after that it can be re-started using `docker-compose start`.

To stop and remove all running container, execute the following command:

```
docker-compose down
```

71 changes: 71 additions & 0 deletions documentation/environment/LocalVirtualMachine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Provision on Local Virtual Machine Environment

Open and start the virtual machine either by using **VMWare Workstation** on Windows or **VMWare Fusion** on Mac or **Virtual Box**.

Currently the VM is configured to use 14 GB of Memory. If you have less than 16 GB in total available on your system, make sure to reduce it before starting the virtual machine.

## Prepare Environment

In the Virtual Machine, start a terminal window and execute the following commands.

First let's add the environment variables. Make sure to adapt the network interface (**ens33** according to your environment. You can retrieve the interface name by using **ipconfig** on windows or **ifconfig* on Mac/Linux.

```
# Prepare Environment Variables
export PUBLIC_IP=$(curl ipinfo.io/ip)
export DOCKER_HOST_IP=$(ip addr show ens33 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
```

Now for Elasticsearch to run properly, we have to increase the `vm.max_map_count` parameter like shown below.

```
# needed for elasticsearch
sudo sysctl -w vm.max_map_count=262144
```

Now let's checkout the NoSQL Workshop project from GitHub:

```
# Get the project
cd /home/bigdata
git clone https://github.com/TrivadisBDS/modern-data-analytics-stack.git
cd modern-data-analytics-stack/base-stack/docker
```

## Start Environment

And finally let's start the environment:

```
# Make sure that the environment is not running
docker-compose down
# Startup Environment
docker-compose up -d
```

The environment should start immediately, as all the necessary images should already be available in the local docker image registry.

The output should be similar to the one below.

![Alt Image Text](./images/start-env-docker.png "StartDocker")

Your instance is now ready to use. Complete the post installation steps documented the [here](README.md).

## Stop environment

To stop the environment, execute the following command:

```
docker-compose stop
```

after that it can be re-started using `docker-compose start`.

To stop and remove all running container, execute the following command:

```
docker-compose down
```


Loading

0 comments on commit 9549b0e

Please sign in to comment.