Skip to content

Quick start

If you want to try Onteon, go to download page.

Start

To start your docker compose, simply go to directory with docker-compose.yml file and execute docker-compose up.

$ ls
docker-compose.yml # terminal should print this file
$ docker-compose up

It will start the Onteon environment

Docker compose environment

Docker compose is used for demonstration purposes only. Onteon does not require Docker.

Onteon and Docker

onteoncli is a docker container with pre-installed OnteonCLI and demo applications. It does not start automatically. You can run it by executing docker-compose run --rm onteoncli. You can read more about it in the next step.

onteoncc-master_1 is a docker container with Onteon Control Center that manages Onteon Node Managers.

onteon-node-manager-1_1 and onteon-node-manager-1_2 are a docker containers that contains Onteon Node Managers. Onteon Node Manager is responsible for running applications.

OnteonCLI

o start docker container with onteoncli, execute docker-compose run --rm onteoncli.

$ docker-compose run --rm onteoncli
Creating docker-compose-without-sonario_onteoncli_run ... done
root@78e8cc9193d7:/opt/onteon#

After this, you should see bash with preinstalled OnteonCLI and Onteon demo applications.

root@dbe41221577f:/home/root/onteon# onteoncli
OnteonCLI (R)
root@dbe41221577f:/home/root/onteon# ls
applications  distributions
root@dbe41221577f:/home/root/onteon#

Login

You need to login to Onteon Cluster before running any commands. You can do this by executing onteoncli login --cluster-url <cluster-url>.

OnteonCLI login

As you can see, Onteon Control Center can be accessed on address http://onteoncc-master:8050. So your command should look like this: onteoncli login --cluster-url http://onteoncc-master:8050.

root@dbe41221577f:/opt/onteon# onteoncli login --cluster-url http://onteoncc-master:8050
Your code: 18FC-uCiI
Trying to open URL ('http://localhost:8050/onteon-auth-access/oauth_20/device?code=18FC-uCiI') in browser...
Cannot run default browser. Please visit this URL and continue authorization: http://localhost:8050/onteon-auth-access/oauth_20/device?code=18FC-uCiI

After executing the command, copy link printed in the console, and go to your browser. Then open link in your browser:

OnteonCLI confirm login

and confirm the code.

OnteonCLI confirmed login

Now you are logged in.

root@dbe41221577f:/opt/onteon# onteoncli login --cluster-url http://onteoncc-master:8050
Your code: 18FC-uCiI
Trying to open URL ('http://localhost:8050/onteon-auth-access/oauth_20/device?code=18FC-uCiI') in browser...
Cannot run default browser. Please visit this URL and continue authorization: http://localhost:8050/onteon-auth-access/oauth_20/device?code=18FC-uCiI
loggedIn: true

Environment

Nodes

Onteon and Docker

As you can see, there are two nodes connected to Onteon Control Center. Nodes automatically connect to Onteon Control Center after the start.

Execute onteoncli node list to see your nodes.

root@dbe41221577f:/opt/onteon# onteoncli node list
id                       createdAt                updatedAt                ipAddress  nodeApiPort zoneId status
1c02fcff5fc0eba2cd76159e 2021-10-21T12:55:29.705Z 2021-10-21T12:55:50.657Z 172.27.0.4 8030        null   available
a667a077dd8dd7d580ff563b 2021-10-21T12:55:29.705Z 2021-10-21T12:55:50.845Z 172.27.0.5 8030        null   available

If you want to know more about nodes:

  • Read node documentation
  • Read node commands list
  • Execute onteoncli node --help

Load balancers

Execute onteoncli application-instance list to see list of application instances.

root@dbe41221577f:/opt/onteon# onteoncli application-instance list
id                       createdAt                applicationName applicationVersion applicationId nodeId                   status
7d7dae6f66ab28d95bbf79b3 2021-10-21T12:55:27.255Z nginx-edge      1.0.0              null          1c02fcff5fc0eba2cd76159e running
f7ecaf61c66e83c83f40c738 2021-10-21T12:55:27.132Z nginx-edge      1.0.0              null          a667a077dd8dd7d580ff563b running
3b74c7a53dd36b3a0b68e8a7 2021-10-21T12:55:26.131Z nginx-inner     1.0.0              null          1c02fcff5fc0eba2cd76159e running
6ba03d26d534d6092354dec2 2021-10-21T12:55:26.004Z nginx-inner     1.0.0              null          a667a077dd8dd7d580ff563b running

As you can see, there are 4 running application instances, 2 nginx-edges and 2 nginx-inners. One for each node. These are embedded applications. This is a special type of application, used for internal purposes..

Open your browser and go to http://localhost:8020/ to see the start page of Edge Load Balancer (nginx-edge).

Onteon Load Balancers

Nginx-edge application is an Edge Load Balancer. It is responsible for getting traffic from outside the cluster. By default, it works on port 8020. Here you can access it on ports 8020 and 8021 ( depends on docker port forwarding).

Nginx-inner application is an Inner Load Balancer. It is responsible for getting traffic from inside the cluster. It should not be accessible from outside. By default, it works on port 8021.

You can decide on which Load Balancers your application should be accessible. You can read more about it here.

If you want to access application instance on one of these load balancers, you can use these urls:

  • /_by_name/<application-name>/
  • /_by_name_and_version/<application-name>/<application-version>/

If you have many application versions running, /_by_name/<application-name>/ will choose random application instance.

This example is configured only to support /_by_name/<application-name>/ accessing.

Application

In this section, you will upload and start demo application.

Upload

Let's upload the Demo Cookbook application. You can find it here: applications/onteon-demo-app-cookbook-native-1.2.1.tar.gz. It is a native application, so it will be started as simple process. You can upload it to Onteon Control Center by executing onteoncli application-registry upload applications/onteon-demo-app-cookbook-native-1.2.1.tar.gz .

Upload

root@dbe41221577f:/opt/onteon# onteoncli application-registry upload applications/onteon-demo-app-cookbook-native-1.2.1.tar.gz
Starting upload session...
Sending part no 0...
Sending part no 1...
Sending part no 2...
Sending part no 3...
Sending part no 4...
Sending part no 5...
Sending part no 6...
Sending part no 7...
Sending part no 8...
Finishing upload session...
uploaded: true

After the upload of application, you can see new application by executing onteoncli application list.

root@dbe41221577f:/opt/onteon# onteoncli application list
id                       createdAt                updatedAt                name                            version type     processType
617163bc3e1a0a5d1060e30a 2021-10-21T12:57:32.334Z 2021-10-21T12:57:32.334Z onteon-demo-app-cookbook-native 1.2.1   standard native

Start manually

If your application is uploaded, you can create and start application instance. For now, you can try to do it manually, but most of the time you will probably use distributions, which creates, starts and removes applications automatically.

First you need to get id of application that you want to start, and id of target node that will get the new application instance.

root@dbe41221577f:/opt/onteon# onteoncli application list
id                       createdAt                updatedAt                name                            version type     processType
617163bc3e1a0a5d1060e30a 2021-10-21T12:57:32.334Z 2021-10-21T12:57:32.334Z onteon-demo-app-cookbook-native 1.2.1   standard native

root@dbe41221577f:/opt/onteon# onteoncli node list
id                       createdAt                updatedAt                ipAddress  nodeApiPort zoneId status
1c02fcff5fc0eba2cd76159e 2021-10-21T12:55:29.705Z 2021-10-21T12:58:20.535Z 172.27.0.4 8030        null   available
a667a077dd8dd7d580ff563b 2021-10-21T12:55:29.705Z 2021-10-21T12:58:20.575Z 172.27.0.5 8030        null

For now, it does not matter which node you will choose.

Then you need to create application instance. You can do this by executing onteoncli application-instance create <applicationId> <nodeId>.

root@dbe41221577f:/opt/onteon# onteoncli application-instance create 617163bc3e1a0a5d1060e30a 1c02fcff5fc0eba2cd76159e
id:                 967cb25a3f8505a8d0160b34
createdAt:          2021-10-21T12:58:59.478Z
applicationName:    onteon-demo-app-cookbook-native
applicationVersion: 1.2.1
applicationId:      617163bc3e1a0a5d1060e30a
nodeId:             1c02fcff5fc0eba2cd76159e
status:             created

Application instance

After executing this command, Onteon Control Center will send application files to specified node (only if node does not contain given application files). After this, node will create new application instance. You can check if new application instance was created by executing onteoncli application-instance list.

root@dbe41221577f:/opt/onteon# onteoncli application-instance list
id                       createdAt                applicationName                 applicationVersion applicationId            nodeId                   status
967cb25a3f8505a8d0160b34 2021-10-21T12:58:59.478Z onteon-demo-app-cookbook-native 1.2.1              617163bc3e1a0a5d1060e30a 1c02fcff5fc0eba2cd76159e created
7d7dae6f66ab28d95bbf79b3 2021-10-21T12:55:27.255Z nginx-edge                      1.0.0              null                     1c02fcff5fc0eba2cd76159e running
f7ecaf61c66e83c83f40c738 2021-10-21T12:55:27.132Z nginx-edge                      1.0.0              null                     a667a077dd8dd7d580ff563b running
3b74c7a53dd36b3a0b68e8a7 2021-10-21T12:55:26.131Z nginx-inner                     1.0.0              null                     1c02fcff5fc0eba2cd76159e running
6ba03d26d534d6092354dec2 2021-10-21T12:55:26.004Z nginx-inner                     1.0.0              null                     a667a077dd8dd7d580ff563b running

As you can see application instance was created. Now you need to start it by executing onteoncli application-instance start <application-instance-id>.

root@dbe41221577f:/opt/onteon# onteoncli application-instance start 967cb25a3f8505a8d0160b34
start instance described by input:{instanceName=onteon-demo-app-cookbook-native-1.2.1-7a1e1975121c8c7-1c02fcff5fc0eba2cd76159e-1_2021_10_21_12_58_59-1c02fcff5fc0eba2cd76159e, appName=onteon-demo-app-cookbook-native-1.2.1-7a1e1975121c8c7-1c02fcff5fc0eba2cd76159e}

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.3)

Spring Boot properly started
process:onteon-demo-app-cookbook-native-1.0.0-7a1e1975121c8c7-1c02fcff5fc0eba2cd76159e-1_2021_10_21_12_58_59-1c02fcff5fc0eba2cd76159e with pid:'829 was correctly started
resultType: SUCCESS
message:    Command executed successfully.

root@dbe41221577f:/opt/onteon# onteoncli application-instance list
id                       createdAt                applicationName                 applicationVersion applicationId            nodeId                   status
967cb25a3f8505a8d0160b34 2021-10-21T12:58:59.478Z onteon-demo-app-cookbook-native 1.2.1              617163bc3e1a0a5d1060e30a 1c02fcff5fc0eba2cd76159e running
7d7dae6f66ab28d95bbf79b3 2021-10-21T12:55:27.255Z nginx-edge                      1.0.0              null                     1c02fcff5fc0eba2cd76159e running
f7ecaf61c66e83c83f40c738 2021-10-21T12:55:27.132Z nginx-edge                      1.0.0              null                     a667a077dd8dd7d580ff563b running
3b74c7a53dd36b3a0b68e8a7 2021-10-21T12:55:26.131Z nginx-inner                     1.0.0              null                     1c02fcff5fc0eba2cd76159e running
6ba03d26d534d6092354dec2 2021-10-21T12:55:26.004Z nginx-inner                     1.0.0              null                     a667a077dd8dd7d580ff563b running

If application has started, you can access it here: http://localhost:8020/_by_name/onteon-demo-app-cookbook-native/cookbook/.

Distributions

Distribution automatically manages application instances . You need to specify application that you want to distribute and number of instances. The Distribution will manage it automatically, and you can always change the number of instances. Additionally, you can specify the distribution's logic with the scripts.

Distributions

Upload docker application

First, lets upload the second application called Demo App Fridge.

root@dbe41221577f:/opt/onteon# onteoncli application-registry upload applications/onteon-demo-app-fridge-docker-1.1.1.tar.gz
Starting upload session...
Sending part no 0...
Finishing upload session...
uploaded: true

root@dbe41221577f:/opt/onteon# onteoncli application list
id                       createdAt                updatedAt                name                            version type     processType
617164ef3e1a0a5d1060e3e6 2021-10-21T13:02:39.369Z 2021-10-21T13:02:39.369Z onteon-demo-app-fridge-docker   1.1.1   standard docker
617163bc3e1a0a5d1060e30a 2021-10-21T12:57:32.334Z 2021-10-21T12:57:32.334Z onteon-demo-app-cookbook-native 1.2.1   standard native

Create distribution

You can create distribution in two ways:

  • by specifying all information in command line. Read more
  • by distribution file - covered in this tutorial

Let's create distribution file:

application: onteon-demo-app-fridge-docker:1.1.1   # 'name:version' of application. You can also use application id.
numberOfInstances: 2  # number of instances
type: total # total number of instances in cluster
scripts:
  checkIfNodeCanAcceptNewApplicationInstance: defaultAvailableNodeOnlyCINCANAIV1      # default distribution script
  selectNodeForNewApplicationInstance: defaultApplicationInstancesCountOnlySNFNAIV1   # default distribution script
  selectApplicationInstanceToRemove: defaultApplicationInstancesCountOnlySAITRV1      # default distribution script

You can execute command below, to create file:

cat <<EOT >> distribution.yml
application: onteon-demo-app-fridge-docker:1.1.1
numberOfInstances: 2
type: total
scripts:
  checkIfNodeCanAcceptNewApplicationInstance: defaultAvailableNodeOnlyCINCANAIV1
  selectNodeForNewApplicationInstance: defaultApplicationInstancesCountOnlySNFNAIV1
  selectApplicationInstanceToRemove: defaultApplicationInstancesCountOnlySAITRV1
EOT

Now you can create distribution by executing onteoncli distribution create-from-file distribution.yml, and then watch how distribution works with watch onteoncli application-instance list command.

root@dbe41221577f:/opt/onteon# onteoncli distribution create-from-file distribution.yml
id:                                                 617165253e1a0a5d1060e417
createdAT:                                          2021-10-21T13:03:33.952Z
updatedAt:                                          2021-10-21T13:03:33.952Z
applicationId:                                      617164ef3e1a0a5d1060e3e6
numberOfInstances:                                  2
type:                                               total
checkIfNodeCanAcceptNewApplicationInstanceScriptId: 6171632f3e1a0a5d1060e2a9
selectNodeForNewApplicationInstanceScriptId:        6171632f3e1a0a5d1060e2a5
selectApplicationInstanceToRemoveScriptId:          6171632f3e1a0a5d1060e2a7

root@dbe41221577f:/opt/onteon# onteoncli application-instance list
id                       createdAt                applicationName                 applicationVersion applicationId            nodeId                   status
30d64058829e7bc70c74a7c6 2021-10-21T13:04:07.867Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 a667a077dd8dd7d580ff563b running
a5608d9496d549b1e5476308 2021-10-21T13:03:43.649Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 a667a077dd8dd7d580ff563b running
967cb25a3f8505a8d0160b34 2021-10-21T12:58:59.478Z onteon-demo-app-cookbook-native 1.2.1              617163bc3e1a0a5d1060e30a 1c02fcff5fc0eba2cd76159e running
7d7dae6f66ab28d95bbf79b3 2021-10-21T12:55:27.255Z nginx-edge                      1.0.0              null                     1c02fcff5fc0eba2cd76159e running
f7ecaf61c66e83c83f40c738 2021-10-21T12:55:27.132Z nginx-edge                      1.0.0              null                     a667a077dd8dd7d580ff563b running
3b74c7a53dd36b3a0b68e8a7 2021-10-21T12:55:26.131Z nginx-inner                     1.0.0              null                     1c02fcff5fc0eba2cd76159e running
6ba03d26d534d6092354dec2 2021-10-21T12:55:26.004Z nginx-inner                     1.0.0              null                     a667a077dd8dd7d580ff563b running

If your application instances have status 'running', open http://localhost:8020/_by_name/onteon-demo-app-fridge-docker in your browser. You should not be able to access this application because it is configured to be unavailable in external load balancer. But you can see it is working. Go to http://localhost:8020/_by_name/onteon-demo-app-cookbook-native/cookbook/sign#in and login with user admin and password password. Then click 'My fridge' button in the top navigation bar. You should see list of items that was retrieved from fridge application via inner load balancer.

Modify distribution

Now you can try to change number of distribution instances.

Modify Distribution

First, get the id of distribution that you want to modify. Then execute onteoncli distribution set-number-of-instance <distribution-id> <new-number-of-instances>.

root@dbe41221577f:/opt/onteon# onteoncli distribution list 
id                       createdAt                updatedAt                applicationId            numberOfInstances
617165253e1a0a5d1060e417 2021-10-21T13:03:33.952Z 2021-10-21T13:03:33.952Z 617164ef3e1a0a5d1060e3e6 2

root@dbe41221577f:/opt/onteon# onteoncli distribution set-number-of-instances 617165253e1a0a5d1060e417 4
id:                                                 617165253e1a0a5d1060e417
createdAT:                                          2021-10-21T13:03:33.952Z
updatedAt:                                          2021-10-21T13:17:54.81Z
applicationId:                                      617164ef3e1a0a5d1060e3e6
numberOfInstances:                                  4
checkIfNodeCanAcceptNewApplicationInstanceScriptId: 6171632f3e1a0a5d1060e2a9
selectNodeForNewApplicationInstanceScriptId:        6171632f3e1a0a5d1060e2a5
selectApplicationInstanceToRemoveScriptId:          6171632f3e1a0a5d1060e2a7

root@dbe41221577f:/opt/onteon# onteoncli application-instance list
id                       createdAt                applicationName                 applicationVersion applicationId            nodeId                   status
213ea76b4c29a635b2ae1ce7 2021-10-21T13:18:10.082Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 a667a077dd8dd7d580ff563b running
204a618b5c742fa92fcb832c 2021-10-21T13:18:02.652Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 1c02fcff5fc0eba2cd76159e running
30d64058829e7bc70c74a7c6 2021-10-21T13:04:07.867Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 a667a077dd8dd7d580ff563b running
a5608d9496d549b1e5476308 2021-10-21T13:03:43.649Z onteon-demo-app-fridge-docker   1.1.1              617164ef3e1a0a5d1060e3e6 a667a077dd8dd7d580ff563b running
967cb25a3f8505a8d0160b34 2021-10-21T12:58:59.478Z onteon-demo-app-cookbook-native 1.2.1              617163bc3e1a0a5d1060e30a 1c02fcff5fc0eba2cd76159e running
7d7dae6f66ab28d95bbf79b3 2021-10-21T12:55:27.255Z nginx-edge                      1.0.0              null                     1c02fcff5fc0eba2cd76159e running
f7ecaf61c66e83c83f40c738 2021-10-21T12:55:27.132Z nginx-edge                      1.0.0              null                     a667a077dd8dd7d580ff563b running
3b74c7a53dd36b3a0b68e8a7 2021-10-21T12:55:26.131Z nginx-inner                     1.0.0              null                     1c02fcff5fc0eba2cd76159e running
6ba03d26d534d6092354dec2 2021-10-21T12:55:26.004Z nginx-inner                     1.0.0              null                     a667a077dd8dd7d580ff563b running

Stop

To stop your docker compose, simply go to directory with docker-compose.yml file and execute docker-compose down.

$ ls
docker-compose.yml
$ docker-compose down

It will stop the Onteon environment.