-
Notifications
You must be signed in to change notification settings - Fork 1
Admin Guide
Clone the git repository and execute ./install.sh
. The installer will take care of
- installing the required dependencies
- distributing the default configuration
- distributing the engine libraries and executables
By default, files are installed by symlinking from the github repository directory to the installation directories. You can use ./install.sh copy
to issue a file copy instead.
Write permissions are required on the following directories
-
/opt
# installation -
/var/log/
# logs -
/etc
# configuration -
/usr/local/bin
# server executable
The following ruby gems are required. They will be installed automatically by ./install.sh
.
- sinatra
- logger
- json-schema
- opennebula
For ecrypting the connection between the Device Client and the Engine Endpoint you can deploy the engine infrastructure in a private network and expose services to the internet using a web server. This guide assumes you have a root SSH connection to the vpn-router-lb
machine.
Public Internet
|
|
+----------+----------+
| <Public IPv4> |
| <Public IPv6> |
| vpn-router-lb |
| 10.10.10.1 |
+----------+----------+
|
|
| 10.10.10.0/24
+-----------------+-----------------+
| | |
+--------v-------+ +-------v-------+ +-------v-------+
| opennebula- | | scheduler | | provisioning |
| frontend | | | | engine |
| 10.10.10.2 | | 10.10.10.3 | | 10.10.10.4 |
+----------------+ +----------------+ +--------------+
Install nginx-proxy-manager with the following configuration.
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '127.0.0.1:81:81'
- '443:443'
- '1337:1337'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
The connect to the UI, first redirect the management port through SSH to your user machine localhost. Is a good idea to avoid exposing management publicly.
ssh -L8081:localhost:81 root@<your_public_ip>
then access http://localhost:8081/
Add a Proxy Host entry with your SSL certificate
Add a redirection to the Provision Engine machine
You should now be able see the Provision Engine endpoint exposed on your domain.
You can customize the engine server at /etc/provision-engine/engine.conf
Execute provision-engine start
and provision-engine stop
to start the engine stop it respectively.
~ provision-engine-server start
provision-engine-server started
~ provision-engine-server stop
provision-engine-server stopped
The log files for the different engine components can be found at /var/log/provision-engine/
.
# Log debug level
# 3 = ERROR, 2 = WARNING, 1 = INFO, 0 = DEBUG
#
# System
# - file: log to log file
# - syslog: log to syslog
:log:
:level: 1
:system: 'file'
Engine specific logs are written to the file engine.log
. These contain information related to the API Calls. You can inspect return codes, execution steps, requests and response bodies in there.
Logfile created on 2023-09-06 10:51:55 -0600 by logger.rb/v1.5.3
I, [2023-09-06 10:51:55 #41286] INFO -- : Initializing Provision Engine component: engine
I, [2023-09-06 10:51:55 #41286] INFO -- : Using oned at http://3.72.81.234:2633/RPC2
I, [2023-09-06 10:51:55 #41286] INFO -- : Using oneflow at http://3.72.81.234:2474
I, [2023-09-06 10:52:01 #41286] INFO -- : Received request to Create a Serverless Runtime
I, [2023-09-06 10:52:04 #41286] INFO -- : Response HTTP Return Code: 201
D, [2023-09-06 10:52:04 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "PENDING",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:04 #41286] INFO -- : Serverless Runtime created
I, [2023-09-06 10:52:04 #41286] INFO -- : Received request to Retrieve a Serverless Runtime information
I, [2023-09-06 10:52:07 #41286] INFO -- : Response HTTP Return Code: 200
D, [2023-09-06 10:52:07 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "PENDING",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:07 #41286] INFO -- : Serverless Runtime
I, [2023-09-06 10:52:07 #41286] INFO -- : Received request to Retrieve a Serverless Runtime information
I, [2023-09-06 10:52:09 #41286] INFO -- : Response HTTP Return Code: 200
D, [2023-09-06 10:52:09 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "PENDING",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:09 #41286] INFO -- : Serverless Runtime
I, [2023-09-06 10:52:09 #41286] INFO -- : Received request to Retrieve a Serverless Runtime information
I, [2023-09-06 10:52:12 #41286] INFO -- : Response HTTP Return Code: 200
D, [2023-09-06 10:52:12 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "PENDING",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:12 #41286] INFO -- : Serverless Runtime
I, [2023-09-06 10:52:12 #41286] INFO -- : Received request to Retrieve a Serverless Runtime information
I, [2023-09-06 10:52:15 #41286] INFO -- : Response HTTP Return Code: 200
D, [2023-09-06 10:52:15 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "PENDING",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:15 #41286] INFO -- : Serverless Runtime
I, [2023-09-06 10:52:15 #41286] INFO -- : Received request to Retrieve a Serverless Runtime information
I, [2023-09-06 10:52:18 #41286] INFO -- : Response HTTP Return Code: 200
D, [2023-09-06 10:52:18 #41286] DEBUG -- : Response Body: {
"DOCUMENT": {
"ID": "3",
"UID": "0",
"GID": "0",
"UNAME": "oneadmin",
"GNAME": "oneadmin",
"NAME": "nature_9a81dd36-4995-49b4-ada0-6605ec4267c7",
"TYPE": "1337",
"PERMISSIONS": {
"OWNER_U": "1",
"OWNER_M": "1",
"OWNER_A": "0",
"GROUP_U": "0",
"GROUP_M": "0",
"GROUP_A": "0",
"OTHER_U": "0",
"OTHER_M": "0",
"OTHER_A": "0"
},
"TEMPLATE": {
"BODY": {
"FAAS": {
"FLAVOUR": "nature",
"ENDPOINT": "http://3.72.81.234:2474",
"VM_ID": "0",
"STATE": "ACTIVE",
"CPU": "1",
"MEMORY": "128",
"DISK_SIZE": "256"
},
"SCHEDULING": {
},
"DEVICE_INFO": {
},
"SERVICE_ID": "2",
"registration_time": 1694019124
}
}
}
}
I, [2023-09-06 10:52:18 #41286] INFO -- : Serverless Runtime
I, [2023-09-06 10:52:18 #41286] INFO -- : Received request to Update a Serverless Runtime
E, [2023-09-06 10:52:18 #41286] ERROR -- : Serverless Runtime update not implemented
I, [2023-09-06 10:52:18 #41286] INFO -- : Received request to Delete a Serverless Runtime
I, [2023-09-06 10:52:22 #41286] INFO -- : Response HTTP Return Code: 204
D, [2023-09-06 10:52:22 #41286] DEBUG -- : Response Body:
I, [2023-09-06 10:52:22 #41286] INFO -- : Serverless Runtime deleted
This log rotates every time a provision engine is started.
Each time a call is issued, the engine uses a component called the CloudClient which takes care of interacting with OpenNebula. These interactions are logged to CloudClient.log
# Logfile created on 2023-08-28 18:31:50 -0600 by logger.rb/v1.5.3
I, [2023-08-28 18:31:50 #2724] INFO -- : Initializing Provision Engine component: CloudClient
I, [2023-08-28 18:31:50 #2724] INFO -- : Creating oneflow Service for Serverless Runtime
D, [2023-08-28 18:31:50 #2724] DEBUG -- : Instantiating service_template 0 with options {"name"=>"nature5c2e4955-3a33-4772-a46a-bf28761a2619"}
I, [2023-08-28 18:31:50 #2724] INFO -- : Serverless Runtime Service created
D, [2023-08-28 18:31:51 #2724] DEBUG -- : {"DOCUMENT"=>{"ID"=>"77", "UID"=>"0", "GID"=>"0", "UNAME"=>"oneadmin", "GNAME"=>"oneadmin", "NAME"=>"nature5c2e4955-3a33-4772-a46a-bf28761a2619", "TYPE"=>"100", "PERMISSIONS"=>{"OWNER_U"=>"1", "OWNER_M"=>"1", "OWNER_A"=>"0", "GROUP_U"=>"0", "GROUP_M"=>"0", "GROUP_A"=>"0", "OTHER_U"=>"0", "OTHER_M"=>"0", "OTHER_A"=>"0"}, "TEMPLATE"=>{"BODY"=>{"name"=>"nature5c2e4955-3a33-4772-a46a-bf28761a2619", "deployment"=>"straight", "description"=>"", "roles"=>[{"name"=>"FaaS", "cardinality"=>1, "vm_template"=>0, "elasticity_policies"=>[], "scheduled_policies"=>[], "vm_template_contents"=>"", "state"=>1, "cooldown"=>300, "nodes"=>[{"deploy_id"=>114, "vm_info"=>{"VM"=>{"ID"=>"114", "UID"=>"0", "GID"=>"0", "UNAME"=>"oneadmin", "GNAME"=>"oneadmin", "NAME"=>"FaaS_0_(service_77)"}}}], "on_hold"=>false, "last_vmname"=>1}], "ready_status_gate"=>false, "automatic_deletion"=>false, "registration_time"=>1692200149, "state"=>1, "start_time"=>1693269110, "log"=>[{"timestamp"=>1693269110, "severity"=>"I", "message"=>"New state: DEPLOYING_NETS"}, {"timestamp"=>1693269110, "severity"=>"I", "message"=>"New state: DEPLOYING"}]}}}}
I, [2023-08-28 18:31:51 #2724] INFO -- : Allocating Serverless Runtime Document
D, [2023-08-28 18:31:51 #2724] DEBUG -- : {"FAAS"=>{"FLAVOUR"=>"nature", "ENDPOINT"=>"http://localhost:1339", "VM_ID"=>"114", "STATE"=>"PENDING", "CPU"=>"1", "MEMORY"=>"128", "DISK_SIZE"=>"256"}, "SCHEDULING"=>{}, "DEVICE_INFO"=>{}, "SERVICE_ID"=>"77"}
I, [2023-08-28 18:31:52 #2724] INFO -- : Created Serverless Runtime Document
This log rotates every time an engine call is issued.
The REST API is built with sinatra. You can find the sinatra stdout and stderr output at api.log
. These are mostly required to look for possible server exceptions or crashes. Unlike the previous logs this one doesn't rotate. Every time the engine is started it will overwrite the previous file.
- Stop the provision engine
provision-engine server stop
- Update local git repository
- Check out
share/etc/engine.conf
in the git repository for possible new configuration parameters - Start provision engine
provision-engine server start
- Check the logs at
/var/log/provision-engine/engine.log
and/var/log/provision-engine/api.log
to make sure there are no errors after the update
Execute ./install.sh clean
. It will only remove the engine libraries. Gem dependencies and configuration will remain installed. Alternatively issue ./install.sh clean purge
to remove everything. The gems will be removed unless they are required by other gems already installed in the system.