# Overview

### Introduction

Aurras is a middleware that acts as an event processor and a low code workflow orchestration platform. Aurras is being pitched as a next-generation system for enabling decentralized push notifications. This middleware solution listens to events from blockchain applications and propagates them to a registered pool of MQTT brokers. The broader architecture consists of a parachain from which the middleware listens for the events.

### Architecture

![High-level Architecture](https://4070323283-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQaoEO8OnHgYeSq8re-%2F-MSiDmmuaBqujshq6sFL%2F-MSiIVjWMEbxsZUWklL1%2FAurras%20Architecture.png?alt=media\&token=72c0142e-c67f-44f6-9e21-2b065c467c67)

### Components

* [Core](/components/event-manager)
* [Event Feed](/components/event-feed)
* Workflow Composer
* Web API Gateway and Backend Service


# Core

[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

### Introduction

Aurras is a middleware that acts as an event processor and a low code workflow orchestration platform. Aurras is being pitched as a next-generation system for enabling decentralized push notification. This middleware solution listens to events from blockchain applications and propagates them to a registered pool of MQTT brokers. The broader architecture consists of parachain from which the middleware listens for the events.

The Event Manager as a core component of the aurras system is composed of multiple actions including using a database to store trigger URLs and their respective auth, and Kafka provider, consumer, and producer. Once the event manager receives an event from the event feed, this data is produced to a topic. The feed action in the manager lets the user hook into the system. That is, once an event is indexed to a particular topic, it can invoke a particular action. While creating the workflow, users can choose the event trigger as feed and provide necessary parameters from which chain it should be listening to.

### Prerequisites

1. [Openwhisk](/dependencies/openwhisk)
2. [Openwhisk CLI](https://github.com/apache/openwhisk-cli)

### Components

#### Actions

* Event Register
* Event Receiver
* Event Processor
* Event Producer
* Kafka Provider
* Balance Filter
* Balance Notification Register
* Push Notification

### Installation

Assuming basic dependency such as [git](https://git-scm.com/) and [yarn](https://yarnpkg.com/) already installed.

1. Clone the repository

```
git clone https://github.com/HugoByte/aurras.git
```

&#x20; 2\. Navigate to the cloned directory

```
cd aurras
```

&#x20; 3\. Generate server token from [https://console.firebase.google.com/project/\[project-name\]/settings/cloudmessaging](https://console.firebase.google.com/project/%5Bproject-name%5D/settings/cloudmessaging) and add as env FIREBASE\_API\_KEY

&#x20; 4\. Deploy the actions using the deploy script. The script supports optional parameters which can be found [here](/components/event-manager/configuration).

```
./deploy.sh
```

### Usage

Generate Event Registration ID

```
./register_event_source.sh --name "Node Template Balance"
```

### Testing

Run Unit test suites

To test push-notification action it is required to have a push notification token generated from the client and Firebase API Key in TEST\_DEVICE\_TOKEN and FIREBASE\_API\_KEY environment variable respectively

```
cargo test --all-features
```

### License

Licensed under [Apache-2.0](https://github.com/HugoByte/aurras-documentation/tree/f07f6727f0cb01cccf04f15ec446e2d310ca1cb9/components/event-feed/substrate-event-feed/LICENSE/README.md)


# Configuration

Configuration values below are passed as parameters to the script.

### Openwhisk API Host

Openwhisk API Endpoint to where the actions to be deployed

| Parameter          | Default Value             |
| ------------------ | ------------------------- |
| --openwhiskApiHost | `https://localhost:31001` |

#### usage

```
./deploy.sh --openwhiskApiHost https://localhost:31001
```

###

### Openwhisk API Key

Openwhisk authentication key.

| Parameter         | Default Value                                                                                         |
| ----------------- | ----------------------------------------------------------------------------------------------------- |
| --openwhiskApiKey | 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP |

#### usage

```
./deploy.sh --openwhiskApiKey 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
```

###

### Openwhisk Namespace

Organization space where the actions to be deployed

| Parameter            | Default Value |
| -------------------- | ------------- |
| --openwhiskNamespace | guest         |

#### usage

```
./deploy.sh --openwhiskNamespace guest
```


# Event Feed

This is the source of events for the aurras system. Events come from numerous sources.

* Blockchain
  * [Substrate based chain](/components/event-feed/event-feed-substrate) (Polkadot, Kusama)
* IoT Devices


# Event Feed - Substrate

[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

### Introduction

Aurras is a middleware that acts as an event processor and a low code workflow orchestration platform. Aurras is being pitched as a next-generation system for enabling decentralized push notification. This middleware solution listens to events from blockchain applications and propagates them to a registered pool of MQTT brokers. The broader architecture consists of parachain from which the middleware listens for the events.

This Event Feed package facilitates to source events from substrate-based chains. The events will be posted to the OpenWhisk system. [polkadot-js/api](https://github.com/polkadot-js/api) is used under the hood to establish the connection to blockchain nodes and receive events.

### Prerequisites

1. [Substrate Based Chain](https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/)
2. [Aurras Core](/components/event-manager)

### Installation

Assuming basic dependency such as [git](https://git-scm.com/) and [yarn](https://yarnpkg.com/) already installed.

1. Clone the repository

```
git clone https://github.com/HugoByte/aurras-event-feed-substrate-js.git
```

&#x20; 2\. Navigate to the cloned directory

```
cd aurras-event-feed-substrate-js
```

&#x20; 3\. Install dependencies

```
yarn install
```

### Configuration

Configurations are passed through environment variables which can be found [here](/components/event-feed/event-feed-substrate/configuration).

For local development and testing create a **.env** file with respective configurations in the project root folder.

```
CHAIN_NAME=Node Template
CHAIN_ENDPOINT=ws://localhost:9944
LOGGERS=console,info;file,error,/logs/event-feed.log
EXCLUDES=system
TYPES_FILE=/configs/types.json
KAFKA_BROKERS=localhost:9092
TOPICS=balances=c76b7a5d-d18a-43e6-a28f-db6bb7520986
OPENWHISK_API_KEY=23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
OPENWHISK_API_HOST=https://localhost:31001
OPENWHISK_NAMESPACE=guest
EVENT_RECEIVER=event-receiver
EVENT_PROCESSOR=substrate-event-processor
```

### Usage

Start the feed in development mode.

```
yarn serve
```

### Testing

Run Unit test suites

```
yarn test
```

### Deployment

Deployment is done through either docker-compose or Kubernetes which can be found [here](/components/event-feed/event-feed-substrate/deployment).

### License

Licensed under [Apache-2.0](https://github.com/HugoByte/aurras-documentation/tree/f07f6727f0cb01cccf04f15ec446e2d310ca1cb9/components/event-feed/substrate-event-feed/LICENSE/README.md)


# Configuration

Configuration values below are passed through environment variables.

#### CHAIN\_NAME \[Mandatory]

An alphanumeric string to identify the chain.

| Environment Variable | Sample Values              |
| -------------------- | -------------------------- |
| CHAIN\_NAME          | `CHAIN_NAME=Node Template` |

#### CHAIN\_ENDPOINT \[Mandatory]

The Endpoint of the chain node to which the event feed should connect to. Protocols Supported: ws (WebSocket) and wss (WebSocket Secure)

| Environment Variable | Sample Values                                                                                                     |
| -------------------- | ----------------------------------------------------------------------------------------------------------------- |
| CHAIN\_ENDPOINT      | <p><code>CHAIN\_ENDPOINT=ws\://localhost:9944</code></p><p><code>CHAIN\_ENDPOINT=wss\://localhost:9944</code></p> |

#### LOGGERS \[Mandatory]

The configuration pertains to the loggers enabled for the event feed. This configuration is extensible to add multiple logging such as logging to a file, logging to console, logging to monitoring system based on different levels of logging. Winston is used under the hood.&#x20;

Loggers Available:

* console&#x20;
* file

Logger Levels:

* info
* warning
* error
* debug

Format:\
LOGGERS=type,level\[,param]

Multiple loggers can be provided separated by ";"

| Environment Variable | Sample Values                                          |
| -------------------- | ------------------------------------------------------ |
| LOGGERS              | `LOGGERS=console,info;file,error,/logs/event-feed.log` |

#### EXCLUDES \[Optional]

Sections or Methods of a specific section can be excluded provided through this configuration.

* A Section can be excluded as whole
* Specific methods of the section can be excluded

Format: EXCLUDES="section\[=methods]"

Multiple sections to be provided separated by ";"

Multiple methods to be separated by ","

| Environment Variable | Sample Values                         |
| -------------------- | ------------------------------------- |
| EXCLUDES             | `EXCLUDES="system;balance=transfer;"` |

#### TYPES\_FILE \[Optional]

Location to custom types for the chain.

| Environment Variable | Sample Values                  |
| -------------------- | ------------------------------ |
| TYPES\_FILE          | `TYPES_FILE="/opt/types.json"` |

#### KAFKA\_BROKERS \[Mandatory]

List of Kafka brokers where the event should be posted. separated by ";"

| Environment Variable | Sample Values                                 |
| -------------------- | --------------------------------------------- |
| KAFKA\_BROKERS       | `KAFKA_BROKERS=localhost:9091;localhost:9092` |

#### **TOPICS** \[Mandatory]

{% hint style="info" %}
Topics are generated using [register\_event\_source.sh](/components/event-manager#usage)&#x20;
{% endhint %}

Topic to which events from certain sections to be posted ";"

Multiple sections with topic can be provided separated by ";"

| Environment Variable | Sample Values                                          |
| -------------------- | ------------------------------------------------------ |
| TOPICS               | `TOPICS=balances=c76b7a5d-d18a-43e6-a28f-db6bb7520986` |

#### OPENWHISK\_API\_KEY \[Mandatory]

Openwhisk authentication key.

| Environment Variable | Sample Values                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| OPENWHISK\_API\_KEY  | `OPENWHISK_API_KEY=23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP` |

#### OPENWHISK\_API\_HOST \[Mandatory]

Openwhisk API Endpoint

| Environment Variable | Sample Values                                |
| -------------------- | -------------------------------------------- |
| OPENWHISK\_API\_HOST | `OPENWHISK_API_HOST=https://localhost:31001` |

#### OPENWHISK\_NAMESPACE \[Mandatory]

Organization space where the actions, rules, and triggers related to aurras resides.

| Environment Variable | Sample Values               |
| -------------------- | --------------------------- |
| OPENWHISK\_NAMESPACE | `OPENWHISK_NAMESPACE=guest` |

​‌

**EVENT\_RECEIVER \[Mandatory]**

Trigger Endpoint where the event should be posted

| Environment Variable | Sample Values                   |
| -------------------- | ------------------------------- |
| EVENT\_RECEIVER      | `EVENT_RECEIVER=event-receiver` |

**EVENT\_PROCESSOR \[Mandatory]**

Action which is responsible for parsing the events to generic specification.

| Environment Variable | Sample Values                               |
| -------------------- | ------------------------------------------- |
| EVENT\_PROCESSOR     | `EVENT_PROCESSOR=substrate-event-processor` |

**HEALTH\_API\_PORT \[Optional]**&#x200C;

Configuration for Health API port primarily used for Kubernetes readiness and liveness probe. Default port is 80.

| Environment Variable | Sample Values          |
| -------------------- | ---------------------- |
| HEALTH\_API\_PORT    | `HEALTH_API_PORT=8080` |


# Deployment

* [Docker Compose](/components/event-feed/event-feed-substrate/deployment/docker-compose)
* [Kubernetes](/components/event-feed/event-feed-substrate/deployment/kubernetes)


# Docker Compose

### Prerequisites

1. [Docker](/dependencies/docker)
2. [Docker Compose](/dependencies/docker-compose)
3. [Openwhisk](/dependencies/openwhisk) ([docker-compose](/dependencies/openwhisk/deployment/setup-docker-compose))
4. [Aurras Core](/components/event-manager#installation)

### Deployment Guide

1. Clone [aurras-deployment-docker-compose](https://github.com/HugoByte/aurras-deployment-docker-compose)

```
git clone https://github.com/HugoByte/aurras-deployment-docker-compose
```

&#x20;   2\. Navigate to aurras-event-feed-substrate setup directory

```
cd aurras-deployment-docker-compose/aurras-event-feed-substrate
```

&#x20;  3\. Make [configuration](/components/event-feed/event-feed-substrate/configuration) changes if need to local.env

&#x20;  4\. Generate the Event ID using [`register_event_source.sh`](/components/event-manager#usage)&#x20;

&#x20;  5\. Update the TOPICS env configuration with the generated Event ID

&#x20;  6\. Add custom type if any for the chain to `config/types.json`

&#x20;  7\. Run docker-compose command to start the service

```
docker-compose --project-name aurras up -d
```


# Kubernetes

### Prerequisites

* [Kubernetes](/dependencies/kubernetes)
* [Helm](/dependencies/helm)
* [Openwhisk](/dependencies/openwhisk) ([Kubernetes](/dependencies/openwhisk/deployment/setup-kubernetes))

### Deployment Guide

1. Clone [aurras-deployment-kubernetes](https://github.com/HugoByte/aurras-deployment-kubernetes) with submodules

```
git clone https://github.com/HugoByte/aurras-deployment-kubernetes --recurse-submodules
```

&#x20;  2\. Navigate to aurras-event-feed-substrate setup directory

```
cd aurras-deployment-kubernetes/aurras-event-feed-substrate
```

&#x20;  3\. Get InternalIP of the cluster

```
kubectl describe nodes | grep InternalIP
```

&#x20;  4\. Creating mycluster.yaml with environment variables provided below with host of the **CHAIN\_ENDPOINT** and **OPENWHISK\_API\_HOST** as InternalIP of the nodes&#x20;

{% hint style="info" %}
Assuming the IP returned from the above step 3 as "192.168.65.3"
{% endhint %}

```
env:
  - CHAIN_NAME: Node Template
  - CHAIN_ENDPOINT: ws://192.168.65.3:9944
  - LOGGERS: console,info;file,error,/logs/event-feed.log
  - EXCLUDES: system
  - TYPES_FILE: /configs/types.json #name of the types file should be types.json
  - KAFKA_BROKERS: 192.168.65.3:9092
  - OPENWHISK_API_KEY: 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
  - OPENWHISK_API_HOST: https://192.168.65.3:31001
  - OPENWHISK_NAMESPACE: guest
  - EVENT_RECEIVER: event-receiver
  - TOPICS=balances=<Generated>
  - EVENT_PROCESSOR=substrate-event-processor
```

5\. Add custom type if any for the chain to `helm/config/types.json`

6\. Deploy Openwhisk using helm

```
helm install aurras-event-feed-substrate ./helm -n aurras -f mycluster.yaml
```

&#x20; 7\. Get the summary of installation using

```
helm status aurras-event-feed-substrate -n aurras
```


# Docker

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that the machine might have that could differ from the machine used for writing and testing the code.

### Environments

* [Windows](/dependencies/docker/environments/windows)
* [macOS](/dependencies/docker/environments/macos)
* [Ubuntu](/dependencies/docker/environments/docker-ubuntu)


# Environments

* [Windows](/dependencies/docker/environments/windows)
* [macOS](/dependencies/docker/environments/macos)
* [Ubuntu](/dependencies/docker/environments/docker-ubuntu)


# Windows

### Prerequisites

1. Install Windows Subsystem for Linux with WSL 2 Enabled.

### Installation Guide

1. Navigate to <https://hub.docker.com/editions/community/docker-ce-desktop-windows/>
2. Click Get Docker Button and download docker for desktop
3. When prompted, ensure the Enable Hyper-V Windows Features option is selected on the Configuration page.
4. Follow the usual installation instructions to install Docker Desktop.
5. If your admin account is different from your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to  Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.
6. Start Docker Desktop from the Windows Start menu.
7. From the Docker menu, select Settings > General.
8. Enable Use WSL 2 Based Engine Option.
9. Go to Settings > Resources > WSL Integration and Select from your installed WSL 2 distributions
10. Click Apply & Restart
11. To confirm that Docker has been installed, open a Ubuntu Terminal and check the docker version using

```
docker --version
```

Reference:&#x20;

* <https://docs.microsoft.com/en-us/windows/wsl/install-win10>
* <https://docs.docker.com/docker-for-windows/install/>


# macOS

### Installation Guide

1. Navigate to <https://hub.docker.com/editions/community/docker-ce-desktop-mac/>
2. Click Get Docker Button and download .dmg for mac
3. Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder.
4. Double-click Docker.app in the Applications folder to start Docker.
5. Once the Docker menu  (![whale menu](https://docs.docker.com/docker-for-mac/images/whale-x.png)) appears in the top status bar open a Terminal and check the docker version using

```
docker --version
```

Reference

1. <https://docs.docker.com/docker-for-mac/install/>


# Ubuntu

### Installation Guide

1. Update the apt package index and install packages to allow apt to use a repository over HTTPS

```
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
```

2\. Add Docker’s official GPG key:

```
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```

3\. Verify that the key has the fingerprint`9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88`, by searching for the last 8 characters of the fingerprint.

```
sudo apt-key fingerprint 0EBFCD88
```

> pub     rsa4096 2017-02-22 \[SCEA]\
> &#x20;           9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88\
> uid                         \[ unknown] Docker Release (CE deb) <docker@docker.com>\
> sub       rsa4096 2017-02-22 \[S]

4\. Set up the docker repository

```
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
```

5\. Update the apt package index, and install the latest version of Docker Engine and containerd

```
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```

6\. Create the docker group.

```
sudo groupadd docker
```

7\. Add user to the docker group.

```
sudo usermod -aG docker $USER
```

8\. Log out and log back in so that your group membership is re-evaluated.

9\. To confirm that Docker has been installed, check the docker version using

```
docker --version
```

Reference:&#x20;

1. <https://docs.docker.com/engine/install/ubuntu/>


# Docker Compose

Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.

### Prerequisites

1. [Docker](/dependencies/docker)

### Environment

* [Windows](/dependencies/docker-compose/environments/windows)
* [macOS](/dependencies/docker-compose/environments/macos)
* [Ubuntu](/dependencies/docker-compose/environments/ubuntu)


# Environments

* [Windows](/dependencies/docker-compose/environments/windows)
* [macOS](/dependencies/docker-compose/environments/macos)
* [Ubuntu](/dependencies/docker-compose/environments/ubuntu)


# Windows

{% hint style="info" %}
Docker with WSL 2 enabled comes with pre-installed docker-compose. If docker-compose --version gives version 1.2X and above, you may skip this setup.
{% endhint %}

### Installation Guide

1. Open Ubuntu Terminal.
2. Download a stable release of Docker Compose

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

&#x20;   3\.  Create a symbolic link to /usr/bin

```
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```

&#x20;   4\. Apply executable permissions to the binary

```
sudo chmod +x /usr/local/bin/docker-compose
```

&#x20;   5\. To confirm that Docker Compose has been installed, check the docker compose version using

```
docker-compose --version
```

Reference: <https://docs.docker.com/compose/install/>


# macOS

{% hint style="info" %}
Docker Desktop for macOS comes with pre-installed docker-compose. If docker-compose --version gives version 1.2X and above, you may skip this setup.
{% endhint %}

### Installation Guide

1. Open Terminal.
2. Download a stable release of Docker Compose

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

&#x20;   3\.  Create a symbolic link to /usr/bin

```
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```

&#x20;   4\. Apply executable permissions to the binary

```
sudo chmod +x /usr/local/bin/docker-compose
```

&#x20;   5\. To confirm that Docker Compose has been installed, check the docker compose version using

```
docker-compose --version
```

Reference: <https://docs.docker.com/compose/install/>


# Ubuntu

### Installation Guide

1. Open Terminal.
2. Download a stable release of Docker Compose

```
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

&#x20;   3\.  Create a symbolic link to /usr/bin

```
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
```

&#x20;   4\. Apply executable permissions to the binary

```
sudo chmod +x /usr/local/bin/docker-compose
```

&#x20;   5\. To confirm that Docker Compose has been installed, check the docker compose version using

```
docker-compose --version
```

Reference: <https://docs.docker.com/compose/install/>


# Kubernetes

Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. You do not need to have detailed knowledge of either Kubernetes or Helm to use this project, but you may find it useful to review their basic documentation to become familiar with their key concepts and terminology.

Kubernetes can be set up using multiple approaches.

### Simple Docker-based options

{% hint style="info" %}
Consider using this only for development and testing
{% endhint %}

#### Prerequisites

1. [Docker](/dependencies/docker)

#### Environment

* [Windows](/dependencies/kubernetes/environments/windows)
* [macOS](/dependencies/kubernetes/environments/macos)
* [Ubuntu](/dependencies/kubernetes/environments/kubernetes-ubuntu)

### Kubernetes cluster from a cloud provider

This will be an ideal, easier and a managed solution to deploy aurras to production.

#### Common Cloud Providers

* [IBM Cloud Private (ICP)](https://www.ibm.com/support/knowledgecenter/en/SSBS6K_3.1.1/getting_started/introduction.html)
* [IBM Kubernetes Service (IKS)](https://docs.aurras.hugobyte.com/dependencies/www.ibm.com/kubernetes/service)
* [Google Kubernetes Engine (GKE)](https://cloud.google.com/containers/gke)
* [Amazon Elastic Kubernetes Service (EKS)](https://aws.amazon.com/eks/)

### Self Build Kubernetes Cluster

Building your own cluster setup requires advanced technical and networking skills, and a good understanding of Kubernetes. This solution is recommended only for advanced users.


# Environments

* [Windows](/dependencies/kubernetes/environments/windows)
* [macOS](/dependencies/kubernetes/environments/macos)
* [Ubuntu](/dependencies/kubernetes/environments/kubernetes-ubuntu)


# Windows

### Setup Guide

1. Open Docker settings from the dashboard
2. Select the Kubernetes tab
3. Select Enable Kubernetes
4. Click Apply & Restart to save the settings


# macOS

### Setup Guide

1. &#x20;Choose the Docker menu ![whale menu](https://docs.docker.com/docker-for-mac/images/whale-x.png) > **Preferences** from the menu bar
2. Select the Kubernetes tab
3. Select Enable Kubernetes
4. Click Apply & Restart to save the settings


# Ubuntu

### Setup Guide

1. Download the latest stable release of kind (**kind-linux-amd64**) from <https://github.com/kubernetes-sigs/kind/releases>
2. Create a kind-cluster.yaml to configure your cluster with below configuration

```
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  extraPortMappings:
    - hostPort: 31001
      containerPort: 31001
- role: worker
```

&#x20;   3\. Create the cluster using

```
kind create cluster --config kind-cluster.yaml
```

&#x20;   4\. Confirm if the clusters have been created using

```
kind get clusters
```


# Helm

Helm is a package manager for Kubernetes that simplifies the management of Kubernetes applications. You do not need to have detailed knowledge of either Kubernetes or Helm to use this project, but you may find it useful to review their basic documentation to become familiar with their key concepts and terminology.

### Setup Guide

1. Open terminal (Ubuntu terminal if windows)
2. Get Helm executable via official install script

```
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
```

&#x20;  3\. To confirm that Helm has been installed, check the helm version using

```
helm version
```


# Openwhisk

Apache OpenWhisk is an open-source, distributed Serverless platform that executes functions (fx) in response to events at any scale. OpenWhisk manages the infrastructure, servers, and scaling using Docker containers so you can focus on building amazing and efficient applications.

## Deployment

Openwhisk can be deployed in multiple ways. For production, it is recommended to use Kubernetes

* [Docker Compose](/dependencies/openwhisk/deployment/setup-docker-compose)
* [Kubernetes](/dependencies/openwhisk/deployment/setup-kubernetes)


# Deployment

* [Docker Compose](/dependencies/openwhisk/deployment/setup-docker-compose)
* [Kubernetes](/dependencies/openwhisk/deployment/setup-kubernetes)


# Docker Compose

OpenWhisk docker-compose deployment is used for local development and testing and should not be used for production.

### Prerequisites

1. [Docker](/dependencies/docker)
2. [Docker Compose](/dependencies/docker-compose)

### Deployment Guide

1. Clone [aurras-deployment-docker-compose](https://github.com/HugoByte/aurras-deployment-docker-compose)

```
git clone https://github.com/HugoByte/aurras-deployment-docker-compose
```

&#x20;   2\. Navigate to openwhisk setup directory

```
cd aurras-deployment-docker-compose/openwhisk
```

&#x20;  3\. Run docker-compose command to start the services

```
docker-compose --project-name openwhisk up -d
```


# Kubernetes

Only OpenWhisk Kubernetes deployment should be used for production deployment

{% hint style="warning" %}
For production deployment generate a new user and namespace with **wskadmin\_openwhisk-wskadmin** container cli ([reference](https://github.com/apache/openwhisk/tree/master/tools/admin)) and override default provided system and guest auth
{% endhint %}

### Prerequisites

* [Kubernetes](/dependencies/kubernetes)
* [Helm](/dependencies/helm)

### Environment

* [Windows](/dependencies/openwhisk/deployment/setup-kubernetes/environment/windows)
* [macOS](/dependencies/openwhisk/deployment/setup-kubernetes/environment/macos)
* [Ubuntu](/dependencies/openwhisk/deployment/setup-kubernetes/environment/ubuntu)
* [IBM Cloud Private (ICP)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-ibm-private.md#configuring-openwhisk)
* [IBM Kubernetes Service (IKS)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-ibm-public.md#configuring-openwhisk)
* [Google Kubernetes Engine (GKE)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-google.md#configuring-openwhisk)
* [Amazon Elastic Kubernetes Service (EKS)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-aws.md#configuring-openwhisk)


# Environment

* [Windows](/dependencies/openwhisk/deployment/setup-kubernetes/environment/windows)
* [macOS](/dependencies/openwhisk/deployment/setup-kubernetes/environment/macos)
* [Ubuntu](/dependencies/openwhisk/deployment/setup-kubernetes/environment/ubuntu)
* [IBM Cloud Private (ICP)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-ibm-private.md#configuring-openwhisk)
* [IBM Kubernetes Service (IKS)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-ibm-public.md#configuring-openwhisk)
* [Google Kubernetes Engine (GKE)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-google.md#configuring-openwhisk)
* [Amazon Elastic Kubernetes Service (EKS)](https://github.com/apache/openwhisk-deploy-kube/blob/master/docs/k8s-aws.md#configuring-openwhisk)


# Windows

### Deployment Guide

1. Clone [aurras-deployment-kubernetes](https://github.com/HugoByte/aurras-deployment-kubernetes) with submodules

```
git clone https://github.com/HugoByte/aurras-deployment-kubernetes --recurse-submodules
```

&#x20;  2\. Navigate to openwhisk setup directory

```
cd aurras-deployment-kubernetes/openwhisk
```

&#x20;  3\. Get InternalIP of the cluster

```
kubectl describe nodes | grep InternalIP
```

&#x20;  4\. Creating mycluster.yaml with **apiHostName** as InternalIP of the nodes&#x20;

{% hint style="info" %}
Assuming the IP returned from the above step 3 as "192.168.65.3"
{% endhint %}

```
whisk:
  ingress:
    type: NodePort
    apiHostName: 192.168.65.3
    apiHostPort: 31001

nginx:
  httpsNodePort: 31001
```

&#x20;  5\. Create a namespace

```
kubectl create namespace aurras
```

&#x20;  6\. Indicate the Kubernetes worker nodes that should be used to execute user containers by OpenWhisk's invokers

```
kubectl label nodes --all openwhisk-role=invoker
```

&#x20; 7\. Deploy Openwhisk using helm

```
helm install openwhisk ./helm/openwhisk -n aurras -f mycluster.yaml
```

&#x20; 8\. Get the summary of installation using

```
helm status openwhisk -n aurras
```


# macOS

### Deployment Guide

1. Clone [aurras-deployment-kubernetes](https://github.com/HugoByte/aurras-deployment-kubernetes) with submodules

```
git clone https://github.com/HugoByte/aurras-deployment-kubernetes --recurse-submodules
```

&#x20;  2\. Navigate to openwhisk setup directory

```
cd aurras-deployment-kubernetes/openwhisk
```

&#x20;  3\. Get InternalIP of the cluster

```
kubectl describe nodes | grep InternalIP
```

&#x20;  4\. Creating mycluster.yaml with **apiHostName** as InternalIP of the nodes&#x20;

{% hint style="info" %}
Assuming the IP returned from the above step 3 as "192.168.65.3"
{% endhint %}

```
whisk:
  ingress:
    type: NodePort
    apiHostName: 192.168.65.3
    apiHostPort: 31001

nginx:
  httpsNodePort: 31001
```

&#x20;  5\. Create a namespace

```
kubectl create namespace aurras
```

&#x20;  6\. Indicate the Kubernetes worker nodes that should be used to execute user containers by OpenWhisk's invokers

```
kubectl label nodes --all openwhisk-role=invoker
```

&#x20; 7\. Deploy Openwhisk using helm

```
helm install openwhisk ./helm/openwhisk -n aurras -f mycluster.yaml
```

&#x20; 8\. Get the summary of installation using

```
helm status openwhisk -n aurras
```


# Ubuntu

### Deployment Guide

1. Clone [aurras-deployment-kubernetes](https://github.com/HugoByte/aurras-deployment-kubernetes) with submodules

```
git clone https://github.com/HugoByte/aurras-deployment-kubernetes --recurse-submodules
```

&#x20;  2\. Navigate to openwhisk setup directory

```
cd aurras-deployment-kubernetes/openwhisk
```

&#x20;  3\. Label the two worker nodes so that one is reserved for the invoker and the other will be used to run the rest of the OpenWhisk system.

```
kubectl label node kind-worker openwhisk-role=core
kubectl label node kind-worker2 openwhisk-role=invoker
```

&#x20;  4\. Get InternalIP of the cluster

```
kubectl describe node kind-worker | grep InternalIP: | awk '{print $2}'
```

&#x20;  5\. Creating mycluster.yaml with **apiHostName** as InternalIP of the nodes&#x20;

{% hint style="info" %}
Assuming the IP returned from the above step 4 as "192.168.65.3"
{% endhint %}

```
whisk:
  ingress:
    type: NodePort
    apiHostName: 192.168.65.3
    apiHostPort: 31001

nginx:
  httpsNodePort: 31001
```

&#x20;  6\. Create a namespace

```
kubectl create namespace aurras
```

&#x20;   7\. Deploy Openwhisk using helm

```
helm install openwhisk ./helm/openwhisk -n aurras -f mycluster.yaml
```

&#x20; 8\. Get the summary of installation using

```
helm status openwhisk -n aurras
```


