Commit a7324fe5 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'nexedi/master' into zope4py3

parents dd37f39e df6b58d2
Pipeline #34143 failed with stage
in 0 seconds
......@@ -23,6 +23,10 @@ patches =
https://github.com/coreutils/coreutils/commit/c4c5ed8f4e9cd55a12966d4f520e3a13101637d9.patch#b6810d7559ffbc5e24636a860f02e836
patch-options = -p1
# disable year 2038 problem ONLY for 32 bit architectures
[coreutils:bits32]
configure-options += --disable-year2038
[coreutils-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
......
......@@ -15,11 +15,11 @@
[instance-jupyter-notebook]
filename = instance.cfg.in
md5sum = 9f412363ce2c2ac99e3328f7d87d456d
md5sum = fd7ed44da8d8723983b8666df2971a36
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
md5sum = 720e90a829c63371696bc3009917a743
md5sum = 9d579353b579b6e488ae6330c7f4ad68
[jupyter-set-password]
filename = jupyter_set_password.cgi.jinja
......
......@@ -43,9 +43,9 @@ recipe = plone.recipe.command
command =
if [ ! -e ${instance-parameter:key_file} ]
then
{{ openssl_output }} req -x509 -nodes -days 3650 \
{{ openssl_output }} req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${instance-parameter:host}" \
-newkey rsa:1024 -keyout ${instance-parameter:key_file} \
-newkey rsa -keyout ${instance-parameter:key_file} \
-out ${instance-parameter:cert_file}
fi
update-command = ${:command}
......
......@@ -6,6 +6,7 @@ import ConfigParser
import random
from notebook.auth import passwd
import os
import ssl
def random_password(length = 10):
result = ""
......@@ -33,6 +34,9 @@ if not parser.has_option("jupyter_notebook", "password") or \
parser.set("jupyter_notebook", "password", random_password())
c.NotebookApp.password = passwd(parser.get("jupyter_notebook", "password"))
c.NotebookApp.ssl_options = {
'ssl_version': ssl.PROTOCOL_TLSv1_2,
}
with open(knowledge_0, 'w') as file:
parser.write(file)
......@@ -13,8 +13,8 @@ parts =
[libxml2]
recipe = slapos.recipe.cmmi
shared = true
url = https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz
md5sum = b2e7332289f5784087448a0717f45ac3
url = https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.7.tar.xz
md5sum = e22f0dfcbd3e37b8fb09dcd1b3e5e9ce
configure-options =
--disable-static
--without-python
......
......@@ -15,12 +15,6 @@ parts =
[gcc]
min_version = 7.1
[c-astral-xml-definition]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/c-astral-c-library.git
revision = v2.1
git-executable = ${git:location}/bin/git
[mavsdk-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/mavlink/MAVSDK.git
......@@ -53,7 +47,6 @@ cmake = ${cmake:location}/bin/cmake
depends = ${mavsdk-pythonpath:recipe}
pre-configure =
${git:location}/bin/git submodule update --init --recursive
sed -i 's#message_definitions/v1.0#${c-astral-xml-definition:location}#' ${mavsdk-source:location}/third_party/mavlink/CMakeLists.txt
configure-command =
${:cmake}
configure-options =
......@@ -72,12 +65,3 @@ make-binary =
environment = mavsdk-env
CMAKE_CFLAGS=-I${tinyxml2:location}/include
[c-astral-wrapper]
recipe = slapos.recipe.cmmi
configure-command = true
url = https://lab.nexedi.com/nexedi/c-astral-wrapper/-/archive/v2.0/c-astral-wrapper-v2.0.tar.gz
md5sum = ee2d05d225a57d17318282ff595fd498
environment =
CPLUS_INCLUDE_PATH=${qjs-wrapper-source:location}/include:${mavsdk:location}/include:${mavsdk:location}/include/mavsdk
LDFLAGS=-L${mavsdk:location}/lib -Wl,-rpath=${mavsdk:location}/lib
......@@ -60,23 +60,23 @@ md5sum = dd94cab4541b57b88cf3dab32d6336e3
[python3.8]
<= python3-common
version = 3.8
package_version = 3.8.18
md5sum = 5ea6267ea00513fc31d3746feb35842d
package_version = 3.8.19
md5sum = 2532d25930266546822c144b99652254
[python3.9]
<= python3-common
version = 3.9
package_version = 3.9.18
md5sum = 765576c3af57deb046819ecd57804bbb
package_version = 3.9.19
md5sum = 87d0f8281237b972ff8b23e0e2c8d325
[python3.10]
<= python3-common
version = 3.10
package_version = 3.10.13
md5sum = 8847dc6458d1431d0ae0f55942deeb89
package_version = 3.10.14
md5sum = 05148354ce821ba7369e5b7958435400
[python3.11]
<= python3-common
version = 3.11
package_version = 3.11.8
md5sum = b353b8433e560e1af2b130f56dfbd973
package_version = 3.11.9
md5sum = 22ea467e7d915477152e99d5da856ddc
[buildout]
extends =
../git/buildout.cfg
../mavsdk/buildout.cfg
../open62541/buildout.cfg
../quickjs/buildout.cfg
......@@ -10,13 +9,14 @@ parts = qjs-wrapper
[qjs-wrapper-source]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/qjs-wrapper.git
revision = v2.0
revision = v2.1
git-executable = ${git:location}/bin/git
[qjs-wrapper]
recipe = slapos.recipe.cmmi
configure-command = true
path = ${qjs-wrapper-source:location}
autopilot-wrapper =
environment =
C_INCLUDE_PATH=include:${open62541:location}/include:${open62541:location}/deps:${open62541:location}/src/pubsub:${quickjs:location}/include
LDFLAGS=-L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -L${c-astral-wrapper:location}/lib -Wl,-rpath=${c-astral-wrapper:location}/lib
LDFLAGS=-L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -L${:autopilot-wrapper}/lib -Wl,-rpath=${:autopilot-wrapper}/lib
......@@ -12,3 +12,7 @@ md5sum = a2d8042658cfd8ea939e6d911eaf4152
environment =
FORCE_UNSAFE_CONFIGURE=1
PATH=${xz-utils:location}/bin:%(PATH)s
# disable year 2038 problem ONLY for 32 bit architectures
[tar:bits32]
configure-options += --disable-year2038
......@@ -46,7 +46,7 @@ class CertificateAuthority:
try:
# no CA, let us create new one
popenCommunicate([self.openssl_binary, 'req', '-utf8', '-nodes',
'-config', self.openssl_configuration, '-new', '-x509',
'-config', self.openssl_configuration, '-new', '-sha256', '-x509',
'-extensions', 'v3_ca', '-keyout', self.key, '-out',
self.certificate, '-days', '10950'],
'Certificate Authority %s\n' % uuid.uuid1())
......@@ -75,7 +75,7 @@ class CertificateAuthority:
csr = certificate + '.csr'
try:
popenCommunicate([self.openssl_binary, 'req', '-config',
self.openssl_configuration, '-nodes', '-new', '-keyout',
self.openssl_configuration, '-nodes', '-new', '-sha256', '-keyout',
key, '-out', csr, '-days', '3650'],
common_name + '\n')
try:
......
......@@ -78,7 +78,7 @@ class Recipe(GenericBaseRecipe):
'%s' % key_file, self.options['key-size']]
#'-config', openssl_configuration
cert_command = [self.options['openssl-bin'], 'req', '-nodes', '-new',
cert_command = [self.options['openssl-bin'], 'req', '-nodes', '-new', '-sha256',
'-x509', '-batch', '-key', '%s' % key_file, '-set_serial',
'%s' % serial, '-days', '3650', '-out', '%s' % cert_file]
......
......@@ -19,7 +19,7 @@ md5sum = ed2bd38b78f2a66f474205249f6e6f2c
[template-instance-beremiz]
filename = instance-beremiz.cfg.jinja2.in
md5sum = bca63fc8943e7c5fa7dd43841e49bf95
md5sum = 29c65611d51975e5bb2a1e2002a0a6c8
[template-instance-beremiz-test]
filename = instance-beremiz-test.cfg.jinja2.in
......
......@@ -25,7 +25,7 @@ fluxbox = ${buildout:directory}/.fluxbox
[gen-certificate]
recipe = plone.recipe.command
command = "{{ openssl_bin }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key-file}" -out "${:cert-file}"
command = "{{ openssl_bin }}" req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "${:key-file}" -out "${:cert-file}"
stop-on-error = true
cert-file = ${directory:ssl}/beremiz.crt
key-file = ${directory:ssl}/beremiz.key
......
......@@ -18,11 +18,7 @@ md5sum = d1e4d7306c39f2ebc64d0407860d4301
[template-cloudooo-instance]
filename = instance-cloudooo.cfg.in
md5sum = 839b3952c045fca7c8363ad8d10885e9
[template-cloudooo-cfg]
filename = cloudooo.cfg.in
md5sum = e55a5dd239a8a107cbdadb0e4c086d07
md5sum = 786e277fa173948b986ff8dc55e0c07f
[template-haproxy-cfg]
filename = haproxy.cfg.in
......
......@@ -116,7 +116,7 @@ crl = ${directory:apache-conf}/crl.pem
[apache-ssl]
recipe = plone.recipe.command
command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
key = ${apache-conf-ssl:key}
cert = ${apache-conf-ssl:cert}
......
......@@ -15,4 +15,4 @@
[instance.cfg.in]
filename = instance.cfg.in
md5sum = f7a283e3288d3a9ddfd5de7e9b309273
md5sum = 1e9012cb8476e00497b3fe9881158440
......@@ -115,6 +115,7 @@ command =
-newkey rsa \
-batch \
-new \
-sha256 \
-nodes \
-keyout /dev/null \
-config '${dufs-certificate-csr-config:output}' \
......
......@@ -18,4 +18,4 @@ md5sum = 06b0acece285ecbc0e746fa267a374b6
[template-default]
filename = instance-default.cfg.jinja.in
md5sum = 164c4610ab20a081b3db26f23566bb7c
md5sum = bf95d5f4ac107ad27a0c980633ad20be
......@@ -118,9 +118,9 @@ recipe = plone.recipe.command
command =
if [ ! -e $${:cert-file} ]
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
${openssl-output:openssl} req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${:common-name}" \
-newkey rsa:2048 -keyout $${:cert-file} \
-newkey rsa -keyout $${:cert-file} \
-out $${:cert-file}
fi
update-command = $${:command}
......
......@@ -19,4 +19,4 @@ md5sum = 1747b8cda8d815055453420de4ed677f
[template-default]
filename = instance-default.cfg.in
md5sum = fa9bd07d6a5fcf55e9548f63a943f022
md5sum = 452599c3067904a9decb8c5dba55eb46
......@@ -58,7 +58,7 @@ recordings = $${:srv}/recordings
recipe = plone.recipe.command
cert-file = $${directory:data}/cert.pem
key-file = $${directory:data}/key.pem
command = ${openssl:location}/bin/openssl req -newkey rsa:2048 -batch -new -x509 -days 3650 -nodes -keyout "$${:key-file}" -out "$${:cert-file}"
command = ${openssl:location}/bin/openssl req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "$${:key-file}" -out "$${:cert-file}"
update-command =
stop-on-error = true
......
......@@ -54,7 +54,7 @@ md5sum = 58e3d5bbda32583d00cd8f44ec0525b0
[instance-gitlab.cfg.in]
_update_hash_filename_ = instance-gitlab.cfg.in
md5sum = 9303fa3912e6eaea04add760b55521f3
md5sum = b913c4a1f199a87ad71da6d102adffa4
[instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in
......
......@@ -766,7 +766,7 @@ key_file = ${nginx-ssl-dir:ssl}/gitlab_backend.key
command =
test -e ${:key_file} || \
{{ openssl_bin }} req -newkey rsa -batch -new -x509 -days 3650 -nodes \
{{ openssl_bin }} req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes \
-keyout ${:key_file} -out ${:cert_file}
update-command = ${:command}
......
......@@ -15,7 +15,7 @@
[instance-profile]
filename = instance.cfg.in
md5sum = b0bd4494451460b9cd2df7d333e5a157
md5sum = 84e2a0b82590d0d6ccf154c9f11b3a27
[influxdb-config-file]
filename = influxdb-config-file.cfg.in
......
......@@ -60,9 +60,9 @@ recipe = plone.recipe.command
command =
if [ ! -e ${:key-file} ]
then
{{ openssl_bin }} req -x509 -nodes -days 3650 \
{{ openssl_bin }} req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${:common-name}" \
-newkey rsa:1024 -keyout ${:key-file} \
-newkey rsa -keyout ${:key-file} \
-out ${:cert-file}
fi
update-command = ${:command}
......
......@@ -4,7 +4,7 @@ md5sum = c6cdcee1e16dd4bd3bc462d286dcb999
[instance-headless-chromium]
_update_hash_filename_ = instance-headless-chromium.cfg.in
md5sum = 8a7e024569d92b0992f40ddac232cff5
md5sum = b9af9d5ff5dbf131c143e9e4b2e74f6f
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
......
......@@ -114,7 +114,7 @@ command =
then
openssl req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${:common-name}" \
-newkey rsa:1024 -keyout ${:key-file} \
-newkey rsa -keyout ${:key-file} \
-out ${:cert-file}
openssl x509 -addtrust serverAuth \
-in ${:cert-file} \
......
......@@ -15,7 +15,7 @@
[template-cfg]
filename = instance.cfg.in
md5sum = edddaa4f6145f3eab4463063dacacfaa
md5sum = 6799fbb8d8e485725a046ba6361d20fa
[template_nginx_conf]
_update_hash_filename_ = templates/nginx_conf.in
......
......@@ -174,9 +174,9 @@ recipe = plone.recipe.command
command =
if [ ! -e ${:key-file} ]
then
{{ parameter_list['openssl_location'] }}/bin/openssl req -x509 -nodes -days 3650 \
{{ parameter_list['openssl_location'] }}/bin/openssl req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${hugo:ip}" \
-newkey rsa:1024 -keyout ${:key-file} \
-newkey rsa -keyout ${:key-file} \
-out ${:cert-file}
fi
update-command = ${:command}
......
......@@ -10,13 +10,17 @@
## Parameters ##
* autopilotType: Select which autopilot wrapper should be used
* autopilotIp: IPv4 address to identify the autopilot from the companion board
* droneGuidList: List of computer id on which flight script must be deployed
* droneNetIf: Drone network interface used for multicast traffic
* isASimulation: Must be set to 'true' to automatically take off during simulation
* debug: Must be set to 'true' to send drone logs through OPC-UA
* multicastIp: IPv6 of the multicast group of the swarm
* netIf: Network interface used for multicast traffic
* flightScript: URL of user's script to execute to fly drone swarm
* loopPeriod: Minimal period (in milliseconds) between 2 executions of the flight script loop
* subscriberGuidList: List of computer id on which a GUI must be deployed
* subscriberNetIf: Subscriber network interface used for multicast traffic
## How it works ##
......@@ -46,6 +50,7 @@ For each drone is displayed:
* the yaw angle in degrees
* the speed (ground speed for multicopters, airspeed for fixed wings) in meters per second
* the climb rate in meters per second
* the timestamp of the position in format hh:mm:ss
### Buttons
......
......@@ -14,32 +14,36 @@
# not need these here).
[index-html]
_update_hash_filename_ = web-gui/index.html.jinja2
md5sum = 1eedc017ecc9d1a6761dc2fff3bbab9b
md5sum = 1644d25ea48e35f4b50fbc31e899a74a
[instance-peer-base]
filename = instance-peer-base.cfg.in
md5sum = 01425a1c77e79788e1948398b9136724
[instance-profile]
filename = instance.cfg.in
md5sum = 80dae3e883663311d9814def78ee875a
md5sum = 4733c63573e6812c124b356dc146ffcc
[instance-default]
filename = instance-default.cfg.jinja2
md5sum = 9db922cc0fcaa67006a2d6b9b95b95fe
[instance-root]
filename = instance-root.cfg.jinja2
md5sum = 316f77c655540226f22dc7a6322624f1
[instance-peer]
filename = instance-peer.cfg.jinja2.in
md5sum = d12fbb134c587173ddff46ff1bc6ffe7
[instance-subscriber]
filename = instance-subscriber.cfg.in
md5sum = 8559dc8c95e9232060be6db3e0af4379
[main]
_update_hash_filename_ = drone-scripts/main.js.jinja2
md5sum = 9a8ec8a2778f63789f39291795f47e98
md5sum = 60146505ec8ea50d881d033f63b6725c
[pubsub]
_update_hash_filename_ = drone-scripts/pubsub.js.jinja2
md5sum = 1555496ad591a31a845f33488d5c335d
md5sum = 34a02101a607e60f4e422375beaf7fc2
[script-js]
_update_hash_filename_ = web-gui/script.js.jinja2
md5sum = e28492276416c2d84e770217ae97a88f
md5sum = efd986b3685e50f73c17c9352804bae0
[worker]
_update_hash_filename_ = drone-scripts/worker.js.jinja2
md5sum = 48540afedd5437129196d84832d2ed40
md5sum = 5fc7f9738d8230aeea9a9d25ea30f3f0
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
{% if isADrone -%}
/*global arm, console, close, dup2, exit, open, scriptArgs, setTimeout, start,
stop, stopPubsub, takeOffAndWait, Worker, SIGINT, SIGTERM*/
{% else -%}
/*global console, close, dup2, exit, open, scriptArgs, setTimeout, stopPubsub,
Worker, SIGINT, SIGTERM*/
{% endif -%}
import {
{% if isADrone -%}
arm,
start,
stop,
{% endif -%}
stopPubsub,
{% if isADrone -%}
takeOffAndWait
} from {{ json_module.dumps(qjs_wrapper) }};
{% endif -%}
} from "{{ qjs_wrapper }}";
import {
Worker,
SIGINT,
SIGTERM,
dup2,
setTimeout,
......@@ -17,30 +27,37 @@ import {
} from "os";
import { err, exit, open, out } from "std";
(function (arm, console, dup2, err, exit, open, out, scriptArgs,
setTimeout, start, stop, stopPubsub, takeOffAndWait, Worker,
SIGTERM) {
{% if isADrone -%}
(function (arm, console, dup2, err, exit, open, out, scriptArgs, setTimeout,
start, stop, stopPubsub, takeOffAndWait, Worker, SIGINT, SIGTERM) {
{% else -%}
(function (console, dup2, err, exit, open, out, scriptArgs, setTimeout,
stopPubsub, Worker, SIGINT, SIGTERM) {
{% endif -%}
"use strict";
var CONF_PATH = {{ json_module.dumps(configuration) }},
var CONF_PATH = "{{ configuration }}",
conf_file = open(CONF_PATH, "r"),
configuration = JSON.parse(conf_file.readAsString()),
AUTOPILOT_CONNECTION_TIMEOUT = 5,
MAVSDK_LOG_FILE_PATH =
"{{ log_dir }}/mavsdk_" + new Date().toISOString() + ".log",
LOG_FILE =
open("{{ log_dir }}/quickjs_" + new Date().toISOString() + ".log", "w"),
QUICKJS_LOG_FILE_PATH =
"{{ log_dir }}/quickjs_" + new Date().toISOString() + ".log",
QUICKJS_LOG_FILE =
open(QUICKJS_LOG_FILE_PATH, "w"),
pubsubWorker,
worker,
user_script = scriptArgs[1],
FPS = 50, // Minimum sampling interval for open62541 monitored items
LOOP_EXECUTION_PERIOD = configuration.loopPeriod,
previous_timestamp,
can_update = false;
conf_file.close();
// redirect stdout and stderr
dup2(LOG_FILE.fileno(), out.fileno());
dup2(LOG_FILE.fileno(), err.fileno());
dup2(QUICKJS_LOG_FILE.fileno(), out.fileno());
dup2(QUICKJS_LOG_FILE.fileno(), err.fileno());
// Use a Worker to ensure the user script
// does not block the main script
......@@ -50,13 +67,13 @@ import { err, exit, open, out } from "std";
// to prevent it to finish (and so, exit the quickjs process)
worker = new Worker("{{ worker_script }}");
function quit(is_a_drone, exit_code) {
function quit(exit_code) {
worker.onmessage = null;
stopPubsub();
if (is_a_drone) {
stop();
}
LOG_FILE.close();
{% if isADrone -%}
stop();
{% endif -%}
QUICKJS_LOG_FILE.close();
exit(exit_code);
}
......@@ -68,6 +85,7 @@ import { err, exit, open, out } from "std";
}
signal(SIGTERM, exitWorker.bind(null, 0));
signal(SIGINT, exitWorker.bind(null, 0));
function exitOnFail(ret, msg) {
if (ret) {
......@@ -76,6 +94,7 @@ import { err, exit, open, out } from "std";
}
}
{% if isADrone -%}
function connect() {
var address = configuration.autopilotIp + ":" + configuration.autopilotPort;
console.log("Will connect to", address);
......@@ -84,16 +103,17 @@ import { err, exit, open, out } from "std";
configuration.autopilotIp,
configuration.autopilotPort,
MAVSDK_LOG_FILE_PATH,
60
QUICKJS_LOG_FILE_PATH,
AUTOPILOT_CONNECTION_TIMEOUT,
configuration.debug
),
"Failed to connect to " + address
);
}
if (configuration.isADrone) {
console.log("Connecting to aupilot\n");
connect();
}
console.log("Connecting to aupilot\n");
connect();
{% endif -%}
pubsubWorker = new Worker("{{ pubsub_script }}");
pubsubWorker.onmessage = function (e) {
......@@ -104,15 +124,19 @@ import { err, exit, open, out } from "std";
worker.postMessage({type: "initPubsub"});
{% if isADrone -%}
function takeOff() {
exitOnFail(arm(), "Failed to arm");
takeOffAndWait();
}
{% endif -%}
function load() {
if (configuration.isADrone && configuration.isASimulation) {
{% if isADrone -%}
if (configuration.isASimulation) {
takeOff();
}
{% endif -%}
// First argument must provide the user script path
if (user_script === undefined) {
......@@ -130,23 +154,23 @@ import { err, exit, open, out } from "std";
var timestamp = Date.now(),
timeout;
if (can_update) {
if (FPS <= (timestamp - previous_timestamp)) {
if (LOOP_EXECUTION_PERIOD <= (timestamp - previous_timestamp)) {
// Expected timeout between every update
can_update = false;
worker.postMessage({
type: "update",
timestamp: timestamp
});
// Try to stick to the expected FPS
timeout = FPS - (timestamp - previous_timestamp - FPS);
// Try to stick to the expected LOOP_EXECUTION_PERIOD
timeout = LOOP_EXECUTION_PERIOD - (timestamp - previous_timestamp - LOOP_EXECUTION_PERIOD);
previous_timestamp = timestamp;
} else {
timeout = FPS - (timestamp - previous_timestamp);
timeout = LOOP_EXECUTION_PERIOD - (timestamp - previous_timestamp);
}
} else {
// If timeout occurs, but update is not yet finished
// wait a bit
timeout = FPS / 4;
timeout = LOOP_EXECUTION_PERIOD / 4;
}
// Ensure loop is not done with timeout < 1ms
setTimeout(loop, Math.max(1, timeout));
......@@ -158,12 +182,12 @@ import { err, exit, open, out } from "std";
pubsubWorker.postMessage({
action: "run",
id: configuration.id,
interval: FPS,
interval: LOOP_EXECUTION_PERIOD,
publish: configuration.isADrone
});
load();
} else if (type === 'loaded') {
previous_timestamp = -FPS;
previous_timestamp = -LOOP_EXECUTION_PERIOD;
can_update = true;
// Start the update loop
loop();
......@@ -173,11 +197,16 @@ import { err, exit, open, out } from "std";
can_update = true;
} else if (type === 'exited') {
worker.onmessage = null;
quit(configuration.isADrone, e.data.exit);
quit(e.data.exit);
} else {
console.log('Unsupported message type', type);
exitWorker(1);
}
};
{% if isADrone -%}
}(arm, console, dup2, err, exit, open, out, scriptArgs, setTimeout, start, stop,
stopPubsub, takeOffAndWait, Worker, SIGTERM));
stopPubsub, takeOffAndWait, Worker, SIGINT, SIGTERM));
{% else -%}
}(console, dup2, err, exit, open, out, scriptArgs, setTimeout, stopPubsub,
Worker, SIGINT, SIGTERM));
{% endif -%}
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global console, open, runPubsub, Worker*/
import {runPubsub} from {{ json_module.dumps(qjs_wrapper) }};
import {runPubsub} from "{{ qjs_wrapper }}";
import {Worker} from "os";
import {open} from "std";
(function (console, open, runPubsub, Worker) {
"use strict";
var CONF_PATH = {{ json_module.dumps(configuration) }},
var CONF_PATH = "{{ configuration }}",
PORT = "4840",
parent = Worker.parent,
conf_file = open(CONF_PATH, "r"),
......
......@@ -5,6 +5,7 @@
updateLogAndProjection, Drone, Worker*/
import {
Drone,
{% if isADrone -%}
triggerParachute,
getAirspeed,
getAltitude,
......@@ -13,14 +14,19 @@ import {
gpsIsOk,
getPosition,
getYaw,
{% endif -%}
initPubsub,
{% if isADrone -%}
isLanding,
loiter,
setAirSpeed,
{% endif -%}
setMessage,
{% if isADrone -%}
setTargetCoordinates,
updateLogAndProjection
} from {{ json_module.dumps(qjs_wrapper) }};
{% endif -%}
} from "{{ qjs_wrapper }}";
import {
SIGTERM,
WNOHANG,
......@@ -34,15 +40,21 @@ import {
} from "os";
import { evalScript, fdopen, loadFile, open } from "std";
{% if isADrone -%}
(function (Drone, SIGTERM, WNOHANG, Worker, close, console, evalScript, exec,
fdopen, getAltitude, getInitialAltitude, gpsIsOk, getPosition,
getYaw, initPubsub, kill, isLanding, loadFile, loiter, open, pipe,
setAirSpeed, setMessage, setReadHandler, setTargetCoordinates,
getYaw, initPubsub, isLanding, kill, loadFile, loiter, open,
pipe, setAirSpeed, setMessage, setReadHandler, setTargetCoordinates,
triggerParachute, updateLogAndProjection, waitpid) {
{% else -%}
(function (Drone, SIGTERM, WNOHANG, Worker, close, console, evalScript, exec,
fdopen, initPubsub, kill, loadFile, open, pipe, setMessage,
setReadHandler, waitpid) {
{% endif -%}
// Every script is evaluated per drone
"use strict";
var CONF_PATH = {{ json_module.dumps(configuration) }},
var CONF_PATH = "{{ configuration }}",
conf_file = open(CONF_PATH, "r"),
configuration = JSON.parse(conf_file.readAsString()),
clientId,
......@@ -57,9 +69,12 @@ import { evalScript, fdopen, loadFile, open } from "std";
peer_dict = {},
user_me = {
//required to fly
{% if isADrone -%}
triggerParachute: triggerParachute,
{% endif -%}
exit: exitWorker,
getDroneDict: function () { return drone_dict; },
{% if isADrone -%}
getAltitudeAbs: getAltitude,
getCurrentPosition: getPosition,
getInitialAltitude: getInitialAltitude,
......@@ -67,9 +82,14 @@ import { evalScript, fdopen, loadFile, open } from "std";
getYaw: getYaw,
getSpeed: getAirspeed,
getClimbRate: getClimbRate,
{% endif -%}
id: configuration.id,
{% if isADrone -%}
isLanding: isLanding,
loiter: loiter,
setAirSpeed: setAirSpeed,
setTargetCoordinates: setTargetCoordinates,
{% endif -%}
sendMsg: function (msg, id) {
if (id === undefined) { id = -1; }
setMessage(JSON.stringify({
......@@ -77,9 +97,7 @@ import { evalScript, fdopen, loadFile, open } from "std";
timestamp: Date.now(),
dest_id: id
}));
},
setAirSpeed: setAirSpeed,
setTargetCoordinates: setTargetCoordinates
}
};
conf_file.close();
......@@ -139,7 +157,7 @@ import { evalScript, fdopen, loadFile, open } from "std";
], {
block: false,
usePath: false,
file: {{ json_module.dumps(gwsocket_bin) }},
file: "{{ gwsocket_bin }}",
stdin: gwsocket_w_pipe[0],
stdout: gwsocket_r_pipe[1]
});
......@@ -149,9 +167,6 @@ import { evalScript, fdopen, loadFile, open } from "std";
handleWebSocketMessage = function () {
var message = readMessage(gwsocket_r_pipe_fd).data;
if (message.includes(configuration.websocketIp)) {
return;
}
onMessage(message);
};
user_me.writeWebsocketMessage = function (message) {
......@@ -200,16 +215,16 @@ import { evalScript, fdopen, loadFile, open } from "std";
}
function handleMainMessage(evt) {
var type = evt.data.type, message, peer_id;
var type = evt.data.type, message, peer_id, log;
switch (type) {
case "initPubsub":
initPubsub(configuration.numberOfDrone, configuration.numberOfSubscriber);
for (peer_id = 0; peer_id < configuration.numberOfDrone + configuration.numberOfSubscriber; peer_id++) {
initPubsub(configuration.numberOfDrones, configuration.numberOfSubscribers);
for (peer_id = 0; peer_id < configuration.numberOfDrones + configuration.numberOfSubscribers; peer_id++) {
peer_dict[peer_id] = new Drone(peer_id);
peer_dict[peer_id].init(peer_id);
if (peer_id < configuration.numberOfDrone) {
if (peer_id < configuration.numberOfDrones) {
drone_dict[peer_id] = peer_dict[peer_id];
}
}
......@@ -234,13 +249,16 @@ import { evalScript, fdopen, loadFile, open } from "std";
}
}
});
// Call the drone onStart function
// Call the drone onUpdate function
if (user_me.hasOwnProperty("onUpdate")) {
user_me.onUpdate(evt.data.timestamp);
}
if (evt.data.timestamp - last_log_timestamp >= 1000) {
{% if isADrone -%}
updateLogAndProjection();
{% endif -%}
last_log_timestamp = evt.data.timestamp;
}
......@@ -266,8 +284,14 @@ import { evalScript, fdopen, loadFile, open } from "std";
exitWorker(1);
}
};
{% if isADrone -%}
}(Drone, SIGTERM, WNOHANG, Worker, close, console, evalScript, exec,
fdopen, getAltitude, getInitialAltitude, gpsIsOk, getPosition, getYaw,
initPubsub, isLanding, kill, loadFile, loiter, open, pipe, setAirSpeed,
setMessage, setReadHandler, setTargetCoordinates, triggerParachute,
updateLogAndProjection, waitpid));
{% else -%}
}(Drone, SIGTERM, WNOHANG, Worker, close, console, evalScript, exec,
fdopen, initPubsub, kill, loadFile, open, pipe, setMessage, setReadHandler,
waitpid));
{% endif -%}
......@@ -4,6 +4,16 @@
"description": "Parameters to instantiate JS drone",
"additionalProperties": false,
"properties": {
"autopilotType": {
"title": "Type of the drone's autopilot",
"description": "Model of the autopilot used in the drones.",
"type": "string",
"default": "c-astral",
"enum": [
"c-astral",
"sqdr"
]
},
"autopilotIp": {
"title": "IP address of the drone's autopilot",
"description": "IP used to create a connection with the autopilot.",
......@@ -22,35 +32,53 @@
"type": "array",
"default": []
},
"droneNetIf": {
"title": "Drones Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
},
"isASimulation": {
"title": "Set the flight as a simulation",
"description": "The option used to determine if the flight is real or if it is a simulation. This affects the context of the flight (e.g. if the take off is manual or automatic).",
"type": "boolean",
"default": false
},
"debug": {
"title": "Set debug mode",
"description": "When debug mode is enabled, drone are publishing the script logs through OPC-UA.",
"type": "boolean",
"default": false
},
"multicastIpv6": {
"title": "IP of the multicast group",
"description": "IP address used to communicate with the other drones.",
"type": "string",
"default": "ff15::1111"
},
"netIf": {
"title": "Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
},
"flightScript": {
"title": "Script's URL of the flight",
"description": "URL of the script which will be executed for the flight. This URL must be publicly accesible so that the drone can fetch the script.",
"type": "string",
"default": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/default.js"
},
"loopPeriod": {
"title": "Loop execution period",
"description": "Minimal period between 2 executions of flight script loop",
"type": "integer",
"default": 200
},
"subscriberGuidList": {
"title": "List of subscribers computer ID",
"description": "List of computer ID of swarms subscribers",
"description": "List of computer ID of swarms subscribers (entities able to listen/send OPC-UA messages from/to the swarm)",
"type": "array",
"default": []
},
"subscriberNetIf": {
"title": "Subscribers Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
}
}
}
......@@ -3,6 +3,18 @@ parts =
qjs-launcher
publish-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap_connection:computer_id}
partition = $${slap_connection:partition_id}
url = $${slap_connection:server_url}
key = $${slap_connection:key_file}
cert = $${slap_connection:cert_file}
[directory]
recipe = slapos.cookbook:mkdirectory
......@@ -16,15 +28,26 @@ log = $${:var}/log
public = $${:srv}/public
service = $${:etc}/service
[peer-configuration]
recipe = slapos.recipe.template:jinja2
output = $${directory:etc}/configuration.json
extensions = jinja2.ext.do
extra-context =
context =
import json_module json
key parameter_dict slap-configuration:configuration
$${:extra-context}
inline =
{{ json_module.dumps(parameter_dict) }}
[js-dynamic-template]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_}.js
extra-context =
context =
import json_module json
raw gwsocket_bin ${gwsocket:location}/bin/gwsocket
key configuration peer-configuration:output
key isADrone slap-configuration:configuration.isADrone
raw qjs_wrapper ${qjs-wrapper:location}/lib/libqjswrapper.so
raw configuration {{ configuration }}
$${:extra-context}
[main]
......@@ -42,10 +65,13 @@ template = ${pubsub:target}
[worker]
<= js-dynamic-template
template = ${worker:target}
gwsocket_bin =
extra-context =
key gwsocket_bin :gwsocket_bin
[user]
recipe = slapos.recipe.build:download
url = {{ parameter_dict['flightScript'] }}
url = $${slap-configuration:configuration.flightScript}
destination = $${directory:etc}/user.js
offline = false
......@@ -54,41 +80,6 @@ recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:service}/qjs-launcher
command-line = ${quickjs:location}/bin/qjs $${main:rendered} $${user:target}
[script-js]
recipe = slapos.recipe.template:jinja2
template = ${script-js:target}
rendered = $${directory:public}/script.js
websocket-url = [{{ ipv6 }}]:{{ websocket_port }}
context =
raw websocket_url $${:websocket-url}
[index-html]
recipe = slapos.recipe.template:jinja2
template = ${index-html:target}
rendered = $${directory:public}/index.html
context =
raw nb_drones {{ parameter_dict['numberOfDrone'] }}
[httpd-port]
recipe = slapos.cookbook:free_port
minimum = 8080
maximum = 8090
ip = {{ ipv6 }}
[httpd]
recipe = slapos.cookbook:simplehttpserver
host = {{ ipv6 }}
port = $${httpd-port:port}
base-path = $${directory:public}
wrapper = $${directory:service}/http-server
log-file = $${directory:log}/httpd.log
use-hash-url = false
depends = $${index-html:rendered}
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
instance-path = $${directory:home}
{% if not parameter_dict['isADrone'] -%}
httpd-url = [$${httpd:host}]:$${httpd:port}
websocket-url = ws://$${script-js:websocket-url}
{% endif -%}
{
"$schema": "http://json-schema.org/draft-06/schema",
"type": "object",
"description": "Parameters to instantiate JS drone",
"additionalProperties": false,
"properties": {
"autopilotIp": {
"title": "IP address of the drone's autopilot",
"description": "IP used to create a connection with the autopilot.",
"type": "string"
},
"autopilotPort": {
"title": "Port of the drone's autopilot",
"description": "Port on which autopilot service is running.",
"type": "integer"
},
"numberOfDrone": {
"title": "Number of drone",
"description": "Number of drone in the swarm",
"type": "integer"
},
"numberOfSubscriber": {
"title": "Number of subscriber",
"description": "Number of subscriber of the swarm",
"type": "integer"
},
"id": {
"title": "drone ID",
"description": "Drone unique identifier",
"type": "integer"
},
"isADrone": {
"title": "Set the requested instance as a drone",
"description": "The option used to determine if the instance is a drone. This affects the context of the user script (e.g. if it should be linked to an autopilot or publish its GPS coordinates)",
"type": "boolean"
},
"isASimulation": {
"title": "Set the flight as a simulation",
"description": "The option used to determine if the flight is real or if it is a simulation. This affects the context of the flight (e.g. if the take off is manual or automatic).",
"type": "boolean"
},
"multicastIp": {
"title": "IP of the multicast group",
"description": "IP address used to communicate with the other drones.",
"type": "string"
},
"netIf": {
"title": "Network interface",
"description": "Interface used for multicast traffic.",
"type": "string"
},
"flightScript": {
"title": "Script's URL of the flight",
"description": "URL of the script which will be executed for the flight. This URL must be publicly accesible so that all drones can fetch the script.",
"type": "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by drone instantiation",
"additionalProperties": false,
"properties": {
"instance-path": {
"description": "Path of the directory where the quickjs binary and the flight scripts are located",
"type": "string"
}
},
"type": "object"
}
......@@ -10,28 +10,36 @@
[{{ request_peer_section_title }}]
<= slap-connection
recipe = slapos.cookbook:request.serialised
name = Peer{{ id }}
software-url = ${:software-release-url}
software-type = peer
{% if id < len(parameter_dict['droneGuidList']) -%}
{% set sr_name = parameter_dict['autopilotType'] -%}
name = Drone{{ id }}_{{ guid }}
{% else -%}
{% set sr_name = 'subscriber' -%}
name = Subscriber{{ len(parameter_dict['droneGuidList']) - id }}_{{ guid }}
{% endif -%}
software-url = {{ '/'.join(software_url.split('/')[:-1]) + '/software-%s.cfg' % sr_name }}
return = instance-path
sla-computer_guid = {{ guid }}
config-autopilotIp = {{ parameter_dict['autopilotIp'] }}
config-autopilotPort = {{ dumps(parameter_dict['autopilotPort']) }}
config-numberOfDrone = {{ dumps(len(parameter_dict['droneGuidList'])) }}
config-numberOfSubscriber = {{ dumps(len(parameter_dict['subscriberGuidList'])) }}
config-numberOfDrones = {{ dumps(len(parameter_dict['droneGuidList'])) }}
config-numberOfSubscribers = {{ dumps(len(parameter_dict['subscriberGuidList'])) }}
config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }}
config-debug = {{ dumps(parameter_dict['debug']) }}
config-loopPeriod = {{ dumps(parameter_dict['loopPeriod']) }}
{% if id < len(parameter_dict['droneGuidList']) -%}
{% do drone_id_list.append(id) %}
config-isADrone = {{ dumps(True) }}
config-flightScript = {{ parameter_dict['flightScript'] }}
config-netIf = {{ parameter_dict['droneNetIf'] }}
{% else -%}
{% do subscriber_id_list.append(id) %}
config-isADrone = {{ dumps(False) }}
config-flightScript = https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/subscribe.js
config-netIf = {{ parameter_dict['subscriberNetIf'] }}
{% endif -%}
config-multicastIp = {{ parameter_dict['multicastIp'] }}
config-netIf = {{ parameter_dict['netIf'] }}
{% endfor %}
[publish-connection-information]
......
[buildout]
extends =
${instance-peer-base:output}
[worker]
gwsocket_bin = ${gwsocket:location}/bin/gwsocket
[gwsocket-port]
recipe = slapos.cookbook:free_port
minimum = 6789
maximum = 6799
ip = $${slap-configuration:ipv6-random}
[peer-configuration]
extra-context =
key websocket_ip gwsocket-port:ip
key websocket_port gwsocket-port:port
inline =
{% do parameter_dict.__setitem__('websocketIp', websocket_ip) -%}
{% do parameter_dict.__setitem__('websocketPort', websocket_port) -%}
{{ json_module.dumps(parameter_dict) }}
[script-js]
recipe = slapos.recipe.template:jinja2
template = ${script-js:target}
rendered = $${directory:public}/script.js
websocket-url = [$${gwsocket-port:ip}]:$${gwsocket-port:port}
context =
key debug slap-configuration:configuration.debug
key websocket_url :websocket-url
[index-html]
recipe = slapos.recipe.template:jinja2
template = ${index-html:target}
rendered = $${directory:public}/index.html
context =
key debug slap-configuration:configuration.debug
key nb_drones slap-configuration:configuration.numberOfDrones
[httpd-port]
recipe = slapos.cookbook:free_port
minimum = 8080
maximum = 8090
ip = $${slap-configuration:ipv6-random}
[httpd]
recipe = slapos.cookbook:simplehttpserver
host = $${slap-configuration:ipv6-random}
port = $${httpd-port:port}
base-path = $${directory:public}
wrapper = $${directory:service}/http-server
log-file = $${directory:log}/httpd.log
use-hash-url = false
depends = $${index-html:rendered}
[publish-connection-information]
httpd-url = [$${httpd:host}]:$${httpd:port}
websocket-url = ws://$${script-js:websocket-url}
......@@ -8,9 +8,8 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = instance-default:output
peer = instance-peer:output
RootSoftwareInstance = $${:default}
default = instance-root:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
......@@ -19,61 +18,29 @@ partition = $${slap_connection:partition_id}
url = $${slap_connection:server_url}
key = $${slap_connection:key_file}
cert = $${slap_connection:cert_file}
software = $${slap-connection:software-release-url}
[dynamic-template-base]
[instance-root]
recipe = slapos.recipe.template:jinja2
url = ${instance-root:target}
output = $${buildout:directory}/$${:_buildout_section_name_}.cfg
extra-context =
extensions = jinja2.ext.do
context =
jsonkey default_parameter_dict :default-parameters
key parameter_dict slap-configuration:configuration
$${:extra-context}
key software_url slap-configuration:software
default-parameters =
{
"autopilotType": "c-astral",
"autopilotIp": "192.168.27.1",
"autopilotPort": 7909,
"debug": false,
"droneGuidList": [],
"droneNetIf": "eth0",
"flightScript": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/default.js",
"isASimulation": false,
"loopPeriod": 200,
"multicastIp": "ff15::1111",
"netIf": "eth0",
"droneGuidList": [],
"subscriberGuidList":[]
"subscriberGuidList":[],
"subscriberNetIf": "eth0"
}
[instance-default]
<= dynamic-template-base
url = ${instance-default:target}
extensions = jinja2.ext.do
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
etc = $${:home}/etc
[gwsocket-port]
recipe = slapos.cookbook:free_port
minimum = 6789
maximum = 6799
ip = $${slap-configuration:ipv6-random}
[peer-configuration]
recipe = slapos.recipe.template:jinja2
output = $${directory:etc}/configuration.json
extensions = jinja2.ext.do
context =
import json_module json
key websocket_ip gwsocket-port:ip
key websocket_port gwsocket-port:port
key parameter_dict slap-configuration:configuration
inline =
{% do parameter_dict.__setitem__('websocketIp', websocket_ip) -%}
{% do parameter_dict.__setitem__('websocketPort', websocket_port) -%}
{{ json_module.dumps(parameter_dict) }}
[instance-peer]
<= dynamic-template-base
url = ${instance-peer:output}
extra-context =
key configuration peer-configuration:output
key ipv6 slap-configuration:ipv6-random
key websocket_port gwsocket-port:port
[buildout]
extends =
../../component/mavsdk/buildout.cfg
software-peer-base.cfg
[c-astral-xml-definition]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/c-astral-c-library.git
revision = v2.1
git-executable = ${git:location}/bin/git
[mavsdk]
pre-configure +=
sed -i 's#message_definitions/v1.0#${c-astral-xml-definition:location}#' ${mavsdk-source:location}/third_party/mavlink/CMakeLists.txt
[c-astral-wrapper]
recipe = slapos.recipe.cmmi
configure-command = true
url = https://lab.nexedi.com/nexedi/c-astral-wrapper/-/archive/v2.1/c-astral-wrapper-v2.1.tar.gz
md5sum = cca66724e1b7a61c1b9559fde95c420b
environment =
CPLUS_INCLUDE_PATH=${qjs-wrapper-source:location}/include:${mavsdk:location}/include:${mavsdk:location}/include/mavsdk
LDFLAGS=-L${mavsdk:location}/lib -Wl,-rpath=${mavsdk:location}/lib
[qjs-wrapper]
autopilot-wrapper = ${c-astral-wrapper:location}
make-options = WITH_AUTOPILOT=y
......@@ -3,43 +3,25 @@ extends =
buildout.hash.cfg
../../stack/slapos.cfg
../../component/qjs-wrapper/buildout.cfg
../../component/gwsocket/buildout.cfg
parts =
instance-profile
instance-peer-base
slapos-cookbook
[instance-default]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[template-base]
[instance-peer-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
[instance-peer]
<= template-base
output = ${buildout:directory}/${:_buildout_section_name_}
[instance-profile]
<= template-base
output = ${buildout:directory}/template.cfg
[download]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
[index-html]
<= download
[main]
<= download
[pubsub]
<= download
[script-js]
<= download
[worker]
<= download
[buildout]
extends =
buildout.hash.cfg
../../stack/slapos.cfg
parts =
instance-profile
slapos-cookbook
[instance-root]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[instance-profile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
{
"name": "JS Drone",
"description": "JS Drone",
"name": "JS Drone Root",
"description": "Root instance requesting drones and subscribers",
"serialisation": "json-in-xml",
"software-type": {
"default": {
......@@ -10,14 +10,6 @@
"request": "instance-input-schema.json",
"response": "instance-output-schema.json",
"index": 0
},
"drone": {
"title": "Peer",
"software-type": "peer",
"description": "Peer Instance",
"request": "instance-peer-input-schema.json",
"response": "instance-peer-output-schema.json",
"index": 1
}
}
}
[buildout]
extends =
software.cfg
software-peer-base.cfg
[sqdr-source]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/slaposdrone/squadrone.git
revision = v2.0
revision = v2.1
git-executable = ${git:location}/bin/git
[sqdr-wrapper]
......@@ -17,6 +17,5 @@ environment =
LDFLAGS=-L${sqdr-source:location}/lib -Wl,-rpath=${sqdr-source:location}/lib
[qjs-wrapper]
environment =
C_INCLUDE_PATH=include:${open62541:location}/include:${open62541:location}/deps:${open62541:location}/src/pubsub:${quickjs:location}/include
LDFLAGS=-L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -L${sqdr-wrapper:location}/lib -Wl,-rpath=${sqdr-wrapper:location}/lib
autopilot-wrapper = ${sqdr-wrapper:location}
make-options = WITH_AUTOPILOT=y
[buildout]
extends =
../../component/gwsocket/buildout.cfg
software-peer-base.cfg
parts +=
instance-subscriber
[instance-subscriber]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
[instance-peer-base]
output = ${buildout:directory}/template-base.cfg
[index-html]
<= download
[script-js]
<= download
......@@ -31,9 +31,11 @@ import os
import socket
import struct
import time
import websocket
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from contextlib import closing
from websocket import create_connection
from slapos.testing.testcase import installSoftwareUrlList, makeModuleSetUpAndTestCaseClass
'''
0. positionArray
......@@ -46,11 +48,13 @@ from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
1.2 air speed
1.3 climb rate
2. message
3. log
'''
MONITORED_ITEM_NB = 3
MONITORED_ITEM_NB = 4
OPC_UA_PORT = 4840
OPC_UA_NET_IF = 'lo'
MCAST_GRP = 'ff15::1111'
LOOP_PERIOD = 200
# OPC UA Pub/Sub related constants
VERSION = 1
......@@ -107,10 +111,27 @@ SPEED_ARRAY_VALUES = (-72.419998, 15.93, -0.015)
STRING_TYPE = 12
MESSAGE_CONTENT = b'{\\"next_checkpoint\\":1}'
TEST_MESSAGE = b'{"content":"' + MESSAGE_CONTENT + b'","dest_id":-1}'
LOG = b''
root_software_release_url = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software-root.cfg'))
subscriber_software_release_url = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software-subscriber.cfg'))
c_astral_software_release_url = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software-c-astral.cfg'))
_, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(root_software_release_url))
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
def setUpModule():
installSoftwareUrlList(
SlapOSInstanceTestCase,
[root_software_release_url, subscriber_software_release_url,
c_astral_software_release_url],
debug=bool(int(os.environ.get('SLAPOS_TEST_DEBUG', 0))),
)
class SubscriberTestCase(SlapOSInstanceTestCase):
......@@ -119,8 +140,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
return {
'_': json.dumps({
'droneGuidList': [cls.slap._computer_id],
'netIf': OPC_UA_NET_IF,
'subscriberGuidList': [cls.slap._computer_id],
'subscriberNetIf': OPC_UA_NET_IF
})
}
......@@ -201,6 +222,12 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
ua_array += struct.pack(struct_type, value)
return ua_array
def ua_string_encode(self, string):
ua_string = struct.pack('B', STRING_TYPE)
ua_string += struct.pack('I', len(string))
ua_string += string
return ua_string
def ua_dataSetMessage_encode(self):
data_set_message = self.ua_dataSetMessageHeader_encode()
data_set_message += struct.pack('H', MONITORED_ITEM_NB)
......@@ -214,9 +241,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
'f',
SPEED_ARRAY_VALUES,
)
data_set_message += struct.pack('B', STRING_TYPE)
data_set_message += struct.pack('I', len(TEST_MESSAGE))
data_set_message += TEST_MESSAGE
data_set_message += self.ua_string_encode(TEST_MESSAGE)
data_set_message += self.ua_string_encode(LOG)
return data_set_message
def send_ua_networkMessage(self):
......@@ -238,7 +264,6 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
for expected_process_name in expected_process_name_list:
self.assertIn(expected_process_name, process_names)
def test_requested_instances(self):
connection_parameter_dict = json.loads(
self.computer_partition.getConnectionParameterDict()['_'])
......@@ -251,10 +276,12 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
{
'autopilotIp': '192.168.27.1',
'autopilotPort': 7909,
'numberOfDrone': 1,
'numberOfSubscriber': 1,
'numberOfDrones': 1,
'numberOfSubscribers': 1,
'id': 1,
'debug': False,
'isASimulation': False,
'loopPeriod': LOOP_PERIOD,
'isADrone': False,
'flightScript': 'https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/subscribe.js',
'netIf': OPC_UA_NET_IF,
......@@ -277,32 +304,32 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
self.assertIn(expected_string, f.readlines())
def test_pubsub_subscription(self):
ws = websocket.WebSocket()
ws.connect(self.websocket_server_address, timeout=5)
# Check if first message is 'Unknown instruction IP' where IP is client IPv6 address
self.assertIn(
b'Unknown instruction %s' % ws.sock.getsockname()[0].encode(),
ws.recv_frame().data
)
self.assertEqual(
ws.recv_frame().data,
b''.join((
b'{"drone_dict":{"0":{"latitude":',
b'"%.6f","longitude":"%.6f","altitude":"%.2f",' % (0, 0, 0),
b'"yaw":"%.2f","speed":"%.2f","climbRate":"%.2f",' % (0, 0, 0),
b'"timestamp":%d}}}' % 0,
))
)
self.send_ua_networkMessage()
time.sleep(0.1)
self.assertEqual(ws.recv_frame().data, MESSAGE_CONTENT.replace(b'\\', b''))
self.assertEqual(
ws.recv_frame().data,
b''.join((
b'{"drone_dict":{"0":{"latitude":',
b'"%.6f","longitude":"%.6f","altitude":"%.2f",' % POSITION_ARRAY_OUTPUT_VALUES[:-1],
b'"yaw":"%.2f","speed":"%.2f","climbRate":"%.2f",' % SPEED_ARRAY_VALUES,
b'"timestamp":%d}}}' % POSITION_ARRAY_INPUT_VALUES[-1],
))
)
ws.close()
with closing(create_connection(self.websocket_server_address, timeout=5)) as conn:
# Check if first message is 'Unknown instruction IP' where IP is client IPv6 address
self.assertIn(
b'Unknown instruction %s' % conn.sock.getsockname()[0].encode(),
conn.recv_frame().data,
)
self.assertEqual(
conn.recv_frame().data,
b''.join((
b'{"drone_dict":{"0":{"latitude":',
b'"%.6f","longitude":"%.6f","altitude":"%.2f",' % (0, 0, 0),
b'"yaw":"%.2f","speed":"%.2f","climbRate":"%.2f",' % (0, 0, 0),
b'"timestamp":%d,' % 0,
b'"log":""}}}',
)),
)
self.send_ua_networkMessage()
time.sleep(0.1)
self.assertEqual(conn.recv_frame().data, MESSAGE_CONTENT.replace(b'\\', b''))
self.assertEqual(
conn.recv_frame().data,
b''.join((
b'{"drone_dict":{"0":{"latitude":',
b'"%.6f","longitude":"%.6f","altitude":"%.2f",' % POSITION_ARRAY_OUTPUT_VALUES[:-1],
b'"yaw":"%.2f","speed":"%.2f","climbRate":"%.2f",' % SPEED_ARRAY_VALUES,
b'"timestamp":%d,' % POSITION_ARRAY_INPUT_VALUES[-1],
b'"log":""}}}',
)),
)
......@@ -9,7 +9,8 @@
<style>
button {
padding: 0.5%;
margin: 2vh;
padding: 2vh;
font-size: 24px;
cursor: pointer;
border: none;
......@@ -20,38 +21,64 @@
box-shadow: 0 2px #666;
transform: translateY(4px);
}
div > * {margin: 1%}
label {margin: 2%}
table {width: 30%}
label {margin: auto 2%}
table {
min-width: 1028px;
height: max-content;
}
textarea {
resize: none;
}
th, td{
padding: 1%;
text-align: center;
vertical-align: middle;
white-space: nowrap;
}
.blue-text {color: blue}
.connected {color: green}
.container {
display: flex;
align-items: center;
justify-content: center;
}
.cyan-text {color: cyan}
.disconnected {color: red}
.gray-button {background-color: lightgray}
.gray-button:hover {background-color: gray}
.green-text {color: green}
.green-button {background-color: #4caf50}
.green-button:hover {background-color: #3e8e41}
.magenta-text {color: magenta}
.red-button {background-color: red}
.red-button {background-color: #e42828}
.red-button:hover {background-color: #e42828}
.red-text {color: red}
.white-text {color: white}
.yellow-text {color: yellow}
#drones-status {height: 50vh}
</style>
</head>
<body>
<header class="container">
<div class="container">
<label for="web-socket-status">web socket status:</label>
<output class="disconnected" id="web-socket-status">Disconnected</output>
</header>
</div>
{% if debug -%}
<div class="container">
<table>
{% for i in range(int(nb_drones)) -%}
<tr>
<th>Drone {{ i }} logs</th>
<td><textarea id="log_{{ i }}" rows="4" cols="100" readonly></textarea><td>
</tr>
{% endfor %}
</table>
</div>
{% endif -%}
<div class="container" id="drones-status">
<table>
<tr>
<th></th>
......@@ -101,6 +128,12 @@
<td id="climb_rate_{{ i }}"></td>
{% endfor %}
</tr>
<tr>
<th>Timestamp (hh:mm:ss)</th>
{% for i in range(int(nb_drones)) -%}
<td id="timestamp_{{ i }}"></td>
{% endfor %}
</tr>
</table>
</div>
......
......@@ -12,17 +12,23 @@
FLIGHT_STATUS_BASE_ID = "flight_state_",
GREEN_BTN_CLASS_NAME = "green-button",
LATITUDE_BASE_ID = "latitude_",
LOG_BASE_ID = "log_",
LONGITUDE_BASE_ID = "longitude_",
QUIT_BTN_ID = "quit-btn",
RED_BTN_CLASS_NAME = "red-button",
SWITCH_BTN_ID = "switch-btn",
TIMESTAMP_BASE_ID = "timestamp_",
WEB_SOCKET_STATUS_OUTPUT_ID = "web-socket-status",
YAW_BASE_ID = "yaw_",
socket;
function updateConnexionClass(element, status) {
element.classList.remove(status ? DISCONNECTED_CLASS_NAME : CONNECTED_CLASS_NAME);
element.classList.add(status ? CONNECTED_CLASS_NAME : DISCONNECTED_CLASS_NAME);
element.classList.remove(
status ? DISCONNECTED_CLASS_NAME : CONNECTED_CLASS_NAME
);
element.classList.add(
status ? CONNECTED_CLASS_NAME : DISCONNECTED_CLASS_NAME
);
}
function setWebSocketStatus(connected, status) {
......@@ -49,28 +55,44 @@
socket = new WebSocket('ws://{{ websocket_url }}');
socket.onopen = function(event) {
socket.onopen = function (event) {
setWebSocketStatus(true, "Connected");
};
socket.onmessage = function(event) {
var message = JSON.parse(event.data),
flight_state_cell;
if (message.hasOwnProperty("drone_dict")) {
Object.entries(message["drone_dict"]).forEach(function ([id, drone]) {
document.getElementById(LATITUDE_BASE_ID + id).innerHTML = drone["latitude"];
document.getElementById(LONGITUDE_BASE_ID + id).innerHTML = drone["longitude"];
document.getElementById(ALTITUDE_BASE_ID + id).innerHTML = drone["altitude"];
document.getElementById(YAW_BASE_ID + id).innerHTML = drone["yaw"];
document.getElementById(SPEED_BASE_ID + id).innerHTML = drone["speed"];
document.getElementById(CLIMB_RATE_BASE_ID + id).innerHTML = drone["climbRate"];
});
} else if (message.hasOwnProperty("state") && message.hasOwnProperty("id")) {
flight_state_cell = document.getElementById(FLIGHT_STATUS_BASE_ID + message['id']);
flight_state_cell.innerHTML = message['state'];
updateConnexionClass(flight_state_cell, message['inAir']);
} else {
console.info(message);
socket.onmessage = function (event) {
var color_array,
date,
flight_state_cell,
i,
message,
new_div,
new_span,
text_array;
try {
message = JSON.parse(event.data);
if (message.hasOwnProperty("drone_dict")) {
Object.entries(message.drone_dict).forEach(function ([id, drone]) {
document.getElementById(LATITUDE_BASE_ID + id).innerHTML = drone["latitude"];
document.getElementById(LONGITUDE_BASE_ID + id).innerHTML = drone["longitude"];
document.getElementById(ALTITUDE_BASE_ID + id).innerHTML = drone["altitude"];
document.getElementById(YAW_BASE_ID + id).innerHTML = drone["yaw"];
document.getElementById(SPEED_BASE_ID + id).innerHTML = drone["speed"];
document.getElementById(CLIMB_RATE_BASE_ID + id).innerHTML = drone["climbRate"];
document.getElementById(TIMESTAMP_BASE_ID + id).innerHTML = new Date(drone["timestamp"]).toLocaleTimeString('fr-FR');
{% if debug -%}
document.getElementById(LOG_BASE_ID + id).value += drone["log"];
{% endif -%}
});
} else if (message.hasOwnProperty("state") && message.hasOwnProperty("id")) {
flight_state_cell = document.getElementById(FLIGHT_STATUS_BASE_ID + message['id']);
flight_state_cell.innerHTML = message['state'];
updateConnexionClass(flight_state_cell, message['inAir']);
} else {
console.info(message);
}
} catch (error) {
console.error(error, event.data);
}
};
......
......@@ -19,7 +19,7 @@ md5sum = 7333d1dfd4e8e4c375f7f1748292f554
[template-jscrawler]
filename = instance-jscrawler.cfg.jinja2.in
md5sum = 2ba9d6a30b420c9bf67d4a135b48212b
md5sum = 2d8da11d54464422110f92dc62c55c78
[template-jscrawler-builder]
filename = template-jscrawler.builder.sh.in
......
......@@ -19,7 +19,7 @@ tmp = ${:srv}/tmp
#################################
[gen-certificate]
recipe = plone.recipe.command
command = "{{ parameter_dict['openssl'] }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:ssl_key}" -out "${:ssl_crt}"
command = "{{ parameter_dict['openssl'] }}" req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "${:ssl_key}" -out "${:ssl_crt}"
stop-on-error = true
ssl_crt = ${directory:ssl}/httpd.crt
ssl_key = ${directory:ssl}/httpd.key
......
......@@ -19,7 +19,7 @@ md5sum = 5f39952f94095b1f12f41db76867e71e
[instance-jupyter]
filename = instance-jupyter.cfg.in
md5sum = 1ac942c544d2a2aa3d1e16a61a1f8bc8
md5sum = f9a0e5a134456d74ca8b4d87862f903d
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
......
......@@ -61,9 +61,9 @@ recipe = plone.recipe.command
command =
if [ ! -e ${instance-parameter:key_file} ]
then
{{ openssl_output }} req -x509 -nodes -days 3650 \
{{ openssl_output }} req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${instance-parameter:host}" \
-newkey rsa:1024 -keyout ${instance-parameter:key_file} \
-newkey rsa -keyout ${instance-parameter:key_file} \
-out ${instance-parameter:cert_file}
fi
update-command = ${:command}
......
......@@ -79,7 +79,7 @@ md5sum = a97ba5a5afcfd6f6bb9f4e77f37555dd
[template-httpd]
filename = instance-kvm-http.cfg.in
md5sum = 438192aab9f11e40dc521b46a4854dcf
md5sum = 12779e690aa8341da660d833e102e552
[image-download-controller]
filename = template/image-download-controller.py.in
......
......@@ -57,7 +57,7 @@ mode = 700
[httpd-ssl]
recipe = plone.recipe.command
command = "{{ openssl_executable_location }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
command = "{{ openssl_executable_location }}" req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
key = ${directory:ssl}/key
cert = ${directory:ssl}/cert
update-command =
......
[instance-profile]
filename = instance.cfg.in
md5sum = f753802ad631a57c559d868e525cf81b
md5sum = 798485b3dd08749ff8ec92d65c6a180f
......@@ -78,7 +78,7 @@ recipe = plone.recipe.command
command =
if [ ! -e $${:cert-file} ]
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
${openssl-output:openssl} req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${:common-name}" \
-newkey rsa -keyout $${:cert-file} \
-out $${:cert-file}
......
[template]
filename = instance.cfg.in
md5sum = 6482b6aea742357350f0d7e350f9baa6
md5sum = 52e599b14817e28e7ee48706360ad3cc
[template-nginx-configuration]
filename = template-nginx.cfg.in
......
......@@ -60,9 +60,9 @@ recipe = plone.recipe.command
command =
if [ ! -e $${:key-file} ]
then
${openssl:location}/bin/openssl req -x509 -nodes -days 3650 \
${openssl:location}/bin/openssl req -x509 -nodes -sha256 -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${nginx-configuration:ip}" \
-newkey rsa:1024 -keyout $${:key-file} \
-newkey rsa -keyout $${:key-file} \
-out $${:cert-file}
fi
update-command = $${:command}
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Cell. Common properties",
"type": "object",
"required": [
"cell_type",
"rf_mode",
......@@ -12,24 +10,22 @@
"bandwidth",
"ru"
],
"properties": {
"cell_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"cell_kind": {
"type": "string",
"const": "enb",
"template": "enb",
"options": { "hidden": true }
"const": "enb"
},
"rf_mode": {
"title": "RF mode",
"description": "Mode for TX/RX radio multiplexing: Frequency- or Time- Domain Division",
"type": "string",
"enum": ["fdd", "tdd"],
"enum": [
"fdd",
"tdd"
],
"propertyOrder": 101
},
"pci": {
......@@ -62,7 +58,6 @@
"propertyOrder": 9999
}
},
"$defs": {
"ru-of-cell": {
"title": "Radio Unit",
......@@ -71,12 +66,14 @@
"title": "Shared Radio Unit",
"description": "Use radio unit defined in separate shared instance",
"type": "object",
"required": ["ru_type", "ru_ref"],
"required": [
"ru_type",
"ru_ref"
],
"properties": {
"ru_type": {
"const": "ru_ref",
"template": "ru_ref",
"options": { "hidden": true }
"type": "string",
"const": "ru_ref"
},
"ru_ref": {
"title": "RU Reference",
......@@ -89,12 +86,14 @@
"title": "Shared Radio Unit of a Cell",
"description": "Use the same radio unit as referenced cell instance does",
"type": "object",
"required": ["ru_type", "ruincell_ref"],
"required": [
"ru_type",
"ruincell_ref"
],
"properties": {
"ru_type": {
"const": "ruincell_ref",
"template": "ruincell_ref",
"options": { "hidden": true }
"type": "string",
"const": "ruincell_ref"
},
"ruincell_ref": {
"title": "Cell Reference",
......@@ -103,7 +102,15 @@
}
}
},
{ "$ref": "../ru/input-schema.json" }
{
"$ref": "../ru/sdr/input-schema.json"
},
{
"$ref": "../ru/lopcomm/input-schema.json"
},
{
"$ref": "../ru/sunwave/input-schema.json"
}
]
}
}
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "LTE Cell",
"type": "object",
"required": [
"cell_type",
"rf_mode",
......@@ -11,19 +9,15 @@
"cell_id",
"bandwidth",
"ru",
"dl_earfcn",
"tac"
],
"properties": {
"$ref": "../../cell/common.json#/properties",
"cell_type": {
"$ref": "#/properties/cell_type",
"const": "lte",
"template": "lte"
"const": "lte"
},
"tdd_ul_dl_config": {
"title": "TDD Configuration",
"type": "string",
......@@ -38,7 +32,6 @@
}
}
},
"bandwidth": {
"$ref": "#/properties/bandwidth",
"enum": [
......@@ -50,7 +43,6 @@
20
]
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink E-UTRA Absolute Radio Frequency Channel Number of the cell",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NR Cell",
"type": "object",
"required": [
"cell_type",
"rf_mode",
......@@ -11,19 +9,15 @@
"cell_id",
"bandwidth",
"ru",
"dl_nr_arfcn",
"nr_band"
],
"properties": {
"$ref": "../../cell/common.json#/properties",
"cell_type": {
"$ref": "#/properties/cell_type",
"const": "nr",
"template": "nr"
"const": "nr"
},
"tdd_ul_dl_config": {
"title": "TDD Configuration",
"type": "string",
......@@ -39,11 +33,9 @@
}
}
},
"bandwidth": {
"$ref": "#/properties/bandwidth"
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
"description": "Downlink NR Absolute Radio Frequency Channel Number of the cell",
......@@ -76,7 +68,6 @@
"default": 1
}
},
"$defs": {
"tac": {
"title": "Tracking Area Code",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Type of the shared instance attached to eNB/gNB",
"type": "object",
"oneOf": [
{
"$ref": "ru/input-schema.json"
},
{
"$ref": "cell/input-schema.json"
},
{
"$ref": "peer/input-schema.json"
},
{
"$ref": "peer/cell/input-schema.json"
}
]
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Values returned by instantiation of a shared instance attached to eNB/gNB",
"type": "object",
"oneOf": [
{
"$ref": "ru/schema.json"
},
{
"$ref": "cell/schema.json"
},
{
"$ref": "peer/schema.json"
},
{
"$ref": "peer/cell/schema.json"
}
]
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Configuration of a shared instance attached to UEsim",
"type": "object",
"oneOf": [
{
"$ref": "ru/input-schema.json"
},
{
"$ref": "ue/input-schema.json"
},
{
"$ref": "ue/cell/input-schema.json"
}
]
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Values returned by instantiation of a shared instance attached to UEsim",
"type": "object",
"oneOf": [
{
"$ref": "ru/schema.json"
},
{
"$ref": "ue/schema.json"
},
{
"$ref": "ue/cell/schema.json"
}
]
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer Cell. Common properties",
"type": "object",
"required": [
......@@ -9,17 +8,13 @@
"pci",
"tac"
],
"properties": {
"cell_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"cell_kind": {
"type": "string",
"const": "enb_peer",
"template": "enb_peer",
"options": { "hidden": true }
"const": "enb_peer"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "LTE Peer Cell",
"type": "object",
"required": [
"cell_type",
"cell_kind",
"pci",
"tac",
"e_cell_id",
"dl_earfcn"
],
"properties": {
"cell_type": {
"$ref": "../../../peer/cell/common.json#/properties/cell_type",
"const": "lte",
"template": "lte"
"const": "lte"
},
"e_cell_id": {
"title": "E-UTRAN Cell ID",
"description": "28 bit E-UTRAN cell identity. Concatenation of enb_id and cell_id of the neighbour cell.",
"type": "string"
},
"dl_earfcn": { "$ref": "../../../cell/lte/input-schema.json#/properties/dl_earfcn" },
"pci": { "$ref": "../../../cell/lte/input-schema.json#/properties/pci" },
"tac": { "$ref": "../../../cell/lte/input-schema.json#/properties/tac" }
"dl_earfcn": {
"$ref": "../../../cell/lte/input-schema.json#/properties/dl_earfcn"
},
"pci": {
"$ref": "../../../cell/lte/input-schema.json#/properties/pci"
},
"tac": {
"$ref": "../../../cell/lte/input-schema.json#/properties/tac"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NR Peer Cell",
"type": "object",
"required": [
"cell_type",
"cell_kind",
"pci",
"tac",
"nr_cell_id",
"gnb_id_bits",
"dl_nr_arfcn",
"nr_band"
],
"properties": {
"cell_type": {
"$ref": "../../../peer/cell/common.json#/properties/cell_type",
"const": "nr",
"template": "nr"
"const": "nr"
},
"nr_cell_id": {
"title": "NR Cell ID",
"description": "Concatenation of gnb_id and cell_id of the neighbour cell",
......@@ -33,11 +27,23 @@
"description": "Number of bits for the gNodeB global identifier. (range 22 to 32)",
"type": "integer"
},
"dl_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/dl_nr_arfcn" },
"nr_band": { "$ref": "../../../cell/nr/input-schema.json#/properties/nr_band" },
"ssb_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/ssb_nr_arfcn" },
"ul_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/ul_nr_arfcn" },
"pci": { "$ref": "../../../cell/nr/input-schema.json#/properties/pci" },
"tac": { "$ref": "../../../cell/nr/input-schema.json#/$defs/tac" }
"dl_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/dl_nr_arfcn"
},
"nr_band": {
"$ref": "../../../cell/nr/input-schema.json#/properties/nr_band"
},
"ssb_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/ssb_nr_arfcn"
},
"ul_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/ul_nr_arfcn"
},
"pci": {
"$ref": "../../../cell/nr/input-schema.json#/properties/pci"
},
"tac": {
"$ref": "../../../cell/nr/input-schema.json#/$defs/tac"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer. Common properties",
"type": "object",
"required": [
"peer_type"
],
"properties": {
"peer_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer eNB",
"type": "object",
"required": [
"peer_type",
"x2_addr"
],
"properties": {
"peer_type": {
"$ref": "../../peer/common.json#/properties/peer_type",
"const": "lte",
"template": "lte"
"const": "lte"
},
"x2_addr": {
"title": "X2 Address",
"description": "X2 Address of the neighbour node (eNB Address)",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Peer gNB",
"type": "object",
"required": [
"peer_type",
"xn_addr"
],
"properties": {
"peer_type": {
"$ref": "../../peer/common.json#/properties/peer_type",
"const": "nr",
"template": "nr"
"const": "nr"
},
"xn_addr": {
"title": "XN Address",
"description": "XN Address of the neighbour node (gNB Address)",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Radio Unit. Common properties",
"type": "object",
"required": [
"ru_type",
"ru_link_type",
......@@ -12,56 +10,48 @@
"tx_gain",
"rx_gain"
],
"properties": {
"ru_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"ru_link_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"n_antenna_dl": {
"title": "Number of DL antennas",
"type": "integer"
},
"n_antenna_ul": {
"title": "Number of UL antennas",
"type": "integer"
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number"
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number"
},
"txrx_active": {
"title": "Activate Tx/Rx",
"description": "Activate or inactivate Tx transmission and Rx reception. When inactive RU does no radio.",
"type": "string",
"enum": ["ACTIVE", "INACTIVE"],
"enum": [
"ACTIVE",
"INACTIVE"
],
"default": "INACTIVE"
},
"cpri_link": {
"title": "CPRI link settings",
"options": {
"dependencies": {
"ru_link_type": "cpri"
}
},
"type": "object",
"required": [
"sdr_dev",
......@@ -80,13 +70,23 @@
"mapping": {
"title": "Mapping method of AxCs on the CPRI",
"type": "string",
"enum": ["standard", "hw", "spread", "bf1"]
"enum": [
"standard",
"hw",
"spread",
"bf1"
]
},
"mult": {
"title": "CPRI line bit rate multipler",
"description": "Select the CPRI line bit rate in terms of multiple of option 1 (614.4 Mbps). E.g set 4 for option 3, 8 for option 5 and 16 for option 7",
"type": "integer",
"enum": [4, 5, 8, 16],
"enum": [
4,
5,
8,
16
],
"default": 16
},
"rx_delay": {
......@@ -109,18 +109,15 @@
}
}
},
"mac_addr": {
"title": "RU MAC address",
"description": "RU MAC address used for NETCONF",
"type": "string",
"options": {
"dependencies": {
"ru_link_type": "cpri"
}
}
}
}
}
......@@ -38,5 +38,5 @@ destination = ${buildout:directory}/ncclient_common.py
[ru_lopcomm_firmware-dl]
recipe = slapos.recipe.build:download
url = https://lab.nexedi.com/nexedi/ors-utils/raw/master/lopcomm-firmware/${:filename}
filename = PR.PRM61C70V1005.004.tar.gz
md5sum = f16413604a8c7631fc6e3782fa9a2695
filename = PR.PRM61C70V1005.005.tar.gz
md5sum = 62281d0be42feac94e843e1850ba6e09
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Lopcomm ORAN",
"type": "object",
"required": [
"ru_type",
"ru_link_type",
......@@ -11,25 +9,19 @@
"n_antenna_ul",
"tx_gain",
"rx_gain",
"cpri_link",
"mac_addr"
],
"properties": {
"$ref": "../../ru/common.json#/properties",
"ru_type": {
"$ref": "#/properties/ru_type",
"const": "lopcomm",
"template": "lopcomm"
"const": "lopcomm"
},
"ru_link_type": {
"$ref": "#/properties/ru_link_type",
"const": "cpri",
"template": "cpri"
"const": "cpri"
},
"n_antenna_dl": {
"$ref": "#/properties/n_antenna_dl",
"default": 2
......@@ -44,9 +36,10 @@
"$ref": "#/properties/cpri_link/properties",
"mapping": {
"$ref": "#/properties/cpri_link/properties/mapping",
"const": "hw",
"enum": ["hw"],
"options": { "hidden": true }
"const": "hw",
"enum": [
"hw"
]
},
"rx_delay": {
"$ref": "#/properties/cpri_link/properties/rx_delay",
......@@ -62,7 +55,6 @@
}
}
},
"reset_schedule": {
"title": "Cron schedule for RRH reset",
"description": "Refer https://crontab.guru/ to make a reset schedule for RRH, for example, '0 1 * * *' means the RRH will reset every day at 1 am",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "SDR transiever",
"description": "Radio Unit constituted of several SDR boards",
"type": "object",
"required": [
"ru_type",
"ru_link_type",
......@@ -12,24 +10,18 @@
"n_antenna_ul",
"tx_gain",
"rx_gain",
"sdr_dev_list"
],
"properties": {
"$ref": "../../ru/common.json#/properties",
"ru_type": {
"$ref": "#/properties/ru_type",
"const": "sdr",
"template": "sdr"
"const": "sdr"
},
"ru_link_type": {
"$ref": "#/properties/ru_link_type",
"const": "sdr",
"template": "sdr"
"const": "sdr"
},
"sdr_dev_list": {
"title": "SDR boards",
"description": "Which SDR boards to use as combined RF port",
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sunwave M2RU",
"type": "object",
"required": [
"ru_type",
"ru_link_type",
......@@ -11,25 +9,19 @@
"n_antenna_ul",
"tx_gain",
"rx_gain",
"cpri_link",
"mac_addr"
],
"properties": {
"$ref": "../../ru/common.json#/properties",
"ru_type": {
"$ref": "#/properties/ru_type",
"const": "sunwave",
"template": "sunwave"
"const": "sunwave"
},
"ru_link_type": {
"$ref": "#/properties/ru_link_type",
"const": "cpri",
"template": "cpri"
"const": "cpri"
},
"n_antenna_dl": {
"$ref": "#/properties/n_antenna_dl",
"default": 2
......@@ -44,9 +36,10 @@
"$ref": "#/properties/cpri_link/properties",
"mapping": {
"$ref": "#/properties/cpri_link/properties/mapping",
"const": "bf1",
"enum": ["bf1"],
"options": { "hidden": true }
"const": "bf1",
"enum": [
"bf1"
]
},
"rx_delay": {
"$ref": "#/properties/cpri_link/properties/rx_delay",
......
......@@ -11,49 +11,22 @@
"response": "instance-enb-schema.json",
"index": 1
},
"ru": {
"title": "→ eNB/gNB | Radio Unit",
"description": "Configuration of Radio Unit attached to eNB/gNB",
"enb/*": {
"title": "→ eNB/gNB | Radio Unit / Cell / Peer / Peer Cell",
"description": "Configuration of a shared instance attached to eNB/gNB",
"software-type": "enb",
"shared": true,
"request": "ru/input-schema.json",
"response": "ru/schema.json",
"request": "instance-enb-item-input-schema.json",
"response": "instance-enb-item-schema.json",
"index": 2
},
"cell": {
"title": "→ eNB/gNB | Cell",
"description": "Configuration of Cell served by eNB/gNB",
"software-type": "enb",
"shared": true,
"request": "cell/input-schema.json",
"response": "cell/schema.json",
"index": 3
},
"peer": {
"title": "→ eNB/gNB | Peer",
"description": "Handover information about nearby eNB/gNB",
"software-type": "enb",
"shared": true,
"request": "peer/input-schema.json",
"response": "peer/schema.json",
"index": 4
},
"peer/cell": {
"title": "→ eNB/gNB | Peer Cell",
"description": "Handover information about Peer Cell served by nearby eNB/gNB",
"software-type": "enb",
"shared": true,
"request": "peer/cell/input-schema.json",
"response": "peer/cell/schema.json",
"index": 5
},
"core-network": {
"title": "Core Network",
"software-type": "core-network",
"description": "Core Network Configuration",
"request": "instance-core-network-input-schema.json",
"response": "instance-core-network-schema.json",
"index": 6
"index": 3
},
"core-network-slave": {
"title": "→ Core Network | Sim Card",
......@@ -62,7 +35,7 @@
"request": "sim/input-schema.json",
"response": "sim/schema.json",
"shared": true,
"index": 7
"index": 4
},
"ue": {
"title": "UEsim",
......@@ -70,34 +43,16 @@
"software-type": "ue",
"request": "instance-ue-input-schema.json",
"response": "instance-ue-schema.json",
"index": 8
},
"ue/ru": {
"title": "→ UEsim | Radio Unit",
"description": "Configuration of Radio Unit attached to UEsim",
"software-type": "ue",
"shared": true,
"request": "ru/input-schema.json",
"response": "ru/schema.json",
"index": 9
},
"ue/ue": {
"title": "→ UEsim | UE",
"description": "Configuration of UE simulated by UEsim",
"software-type": "ue",
"shared": true,
"request": "ue/input-schema.json",
"response": "ue/schema.json",
"index": 10
"index": 5
},
"ue/cell": {
"title": "→ UEsim | UE Cell",
"description": "Information about Cell to which UEsim attaches",
"ue/*": {
"title": "→ UEsim | Radio Unit / UE / UE Cell",
"description": "Configuration of a shared instance attached to UEsim",
"software-type": "ue",
"shared": true,
"request": "ue/cell/input-schema.json",
"response": "ue/cell/schema.json",
"index": 11
"request": "instance-ue-item-input-schema.json",
"response": "instance-ue-item-schema.json",
"index": 6
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "UE Cell. Common properties",
"type": "object",
"required": [
"cell_type",
"cell_kind",
"rf_mode",
"ru"
],
"properties": {
"cell_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"cell_kind": {
"type": "string",
"const": "ue",
"template": "ue",
"options": { "hidden": true }
"const": "ue"
},
"rf_mode": {
"$ref": "../../cell/common.json#/properties/rf_mode"
},
"rf_mode": { "$ref": "../../cell/common.json#/properties/rf_mode" },
"ru": { "$ref": "../../cell/common.json#/$defs/ru-of-cell" }
"ru": {
"$ref": "../../cell/common.json#/$defs/ru-of-cell"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "LTE Cell",
"type": "object",
"required": [
"cell_type",
"cell_kind",
"rf_mode",
"ru",
"dl_earfcn",
"bandwidth"
],
"properties": {
"cell_type": {
"$ref": "../../../ue/cell/common.json#/properties/cell_type",
"const": "lte",
"template": "lte"
"const": "lte"
},
"cell_kind": { "$ref": "../../../ue/cell/common.json#/properties/cell_kind" },
"rf_mode": { "$ref": "../../../ue/cell/common.json#/properties/rf_mode" },
"ru": { "$ref": "../../../ue/cell/common.json#/properties/ru",
"propertyOrder": 9999"
"cell_kind": {
"$ref": "../../../ue/cell/common.json#/properties/cell_kind"
},
"rf_mode": {
"$ref": "../../../ue/cell/common.json#/properties/rf_mode"
},
"ru": {
"$ref": "../../../ue/cell/common.json#/properties/ru",
"propertyOrder": 9999
},
"dl_earfcn": {
"$ref": "../../../cell/lte/input-schema.json#/properties/dl_earfcn"
},
"ul_earfcn": {
"$ref": "../../../cell/lte/input-schema.json#/properties/ul_earfcn"
},
"dl_earfcn": { "$ref": "../../../cell/lte/input-schema.json#/properties/dl_earfcn" },
"ul_earfcn": { "$ref": "../../../cell/lte/input-schema.json#/properties/ul_earfcn" },
"bandwidth": {
"$ref": "../../../cell/common.json#/properties/bandwidth",
"enum": [
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NR Cell",
"type": "object",
"required": [
"cell_type",
"cell_kind",
"rf_mode",
"ru",
"dl_nr_arfcn",
"bandwidth",
"nr_band"
],
"properties": {
"cell_type": {
"$ref": "../../../ue/cell/common.json#/properties/cell_type",
"const": "nr",
"template": "nr"
},
"cell_kind": { "$ref": "../../../ue/cell/common.json#/properties/cell_kind" },
"rf_mode": { "$ref": "../../../ue/cell/common.json#/properties/rf_mode" },
"ru": { "$ref": "../../../ue/cell/common.json#/properties/ru",
"propertyOrder": 9999"
},
"dl_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/dl_nr_arfcn" },
"bandwidth": { "$ref": "../../../cell/common.json#/properties/bandwidth" },
"nr_band": { "$ref": "../../../cell/nr/input-schema.json#/properties/nr_band" },
"ul_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/ul_nr_arfcn" },
"ssb_nr_arfcn": { "$ref": "../../../cell/nr/input-schema.json#/properties/ssb_nr_arfcn" }
"const": "nr"
},
"cell_kind": {
"$ref": "../../../ue/cell/common.json#/properties/cell_kind"
},
"rf_mode": {
"$ref": "../../../ue/cell/common.json#/properties/rf_mode"
},
"ru": {
"$ref": "../../../ue/cell/common.json#/properties/ru",
"propertyOrder": 9999
},
"dl_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/dl_nr_arfcn"
},
"bandwidth": {
"$ref": "../../../cell/common.json#/properties/bandwidth"
},
"nr_band": {
"$ref": "../../../cell/nr/input-schema.json#/properties/nr_band"
},
"ul_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/ul_nr_arfcn"
},
"ssb_nr_arfcn": {
"$ref": "../../../cell/nr/input-schema.json#/properties/ssb_nr_arfcn"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "UE. Common properties",
"type": "object",
"required": [
"ue_type",
"rue_addr"
],
"properties": {
"$ref": "../sim/input-schema.json#/properties",
"ue_type": {
"type": "string",
"options": { "hidden": true }
"type": "string"
},
"rue_addr": {
"title": "[Required] Remote UE address",
"description": "[Required] Address of remote UE server. Default port is 2152.",
"type": "string",
"default": ""
},
"imsi": {
"$ref": "../sim/input-schema.json#/properties/imsi",
"default": "001010123456789"
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "LTE UE",
"type": "object",
"properties": {
"$ref": "../../ue/common.json#/properties",
"ue_type": {
"$ref": "#/properties/ue_type",
"const": "lte",
"template": "lte"
"const": "lte"
}
}
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NR UE",
"type": "object",
"properties": {
"$ref": "../../ue/common.json#/properties",
"ue_type": {
"$ref": "#/properties/ue_type",
"const": "nr",
"template": "nr"
"const": "nr"
}
}
}
[instance-profile]
filename = instance.cfg.in
md5sum = cf6c11bc335c75139695008128f1565a
md5sum = 9ca5ddf6bed34861a17e3352dacc4813
......@@ -55,3 +55,5 @@ service = ${:etc}/service
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url-ipv6 = opc.tcp://[${instance-parameter:ipv6-random}]:${instance-parameter:configuration.opc_ua_port}
username = ${instance-parameter:configuration.username}
password = ${instance-parameter:configuration.password}
......@@ -17,15 +17,6 @@ extends =
# we want this SR to use a fixed gcc (so that we have the same gcc as open62541 component)
max_version = 0
# disable warning for time_t type structure after 2038
# https://www.gnu.org/software/gnulib/manual/html_node/Avoiding-the-year-2038-problem.html
[coreutils]
configure-options =
--disable-libcap
--without-selinux
--prefix=@@LOCATION@@
--disable-year2038
# we need open62541's sources even after compiling and linking in [open62541]
# section. Reasons is that coupler's C application depends on it.
[open62541-source]
......
......@@ -22,15 +22,15 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-frontend]
filename = instance-frontend.cfg.in
md5sum = bb8129cdd89632c3c3ce86556496cb0f
md5sum = b3c5694042035f13832479dca3481597
[profile-master]
filename = instance-master.cfg.in
md5sum = 3006197ddce87bd92866b76b5ce8ce08
md5sum = 934b7f5e8d470e18bc980942bf467ada
[profile-slave-list]
filename = instance-slave-list.cfg.in
md5sum = b75e42233c1b7bdd5f21971ed8907efc
md5sum = 96bd66e98c7b4492ab4aba46e0e14e13
[profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in
......@@ -102,7 +102,7 @@ md5sum = e82ccdb0b26552a1c88ff523d8fae24a
[profile-kedifa]
filename = instance-kedifa.cfg.in
md5sum = 669da915003122e48646dc75fec239a5
md5sum = 107dc147d94d02d2084b97b8ec591831
[template-frontend-haproxy-rsyslogd-conf]
_update_hash_filename_ = templates/frontend-haproxy-rsyslogd.conf.in
......
......@@ -209,7 +209,7 @@ command =
rm -f ${:certificate}
/bin/bash -c ' \
{{ software_parameter_dict['openssl'] }} req \
-new -newkey rsa:2048 -sha256 \
-new -newkey rsa -sha256 \
-nodes -x509 -days 36500 \
-keyout ${:certificate} \
-subj "/CN=Self Signed IP Access" \
......@@ -233,7 +233,7 @@ command =
rm -f ${:certificate}
/bin/bash -c ' \
{{ software_parameter_dict['openssl'] }} req \
-new -newkey rsa:2048 -sha256 \
-new -newkey rsa -sha256 \
-nodes -x509 -days 36500 \
-keyout ${:certificate} \
-subj "/CN=Fallback certificate/OU={{ instance_parameter_dict['configuration.frontend-name'] }}" \
......@@ -282,7 +282,7 @@ command =
{% if slapparameter_dict['kedifa-caucase-url'] %}
if [ ! -f ${:template-csr} ] && [ ! -f ${:key} ] ; then
{{ software_parameter_dict['openssl'] }} req -new -sha256 \
-newkey rsa:2048 -nodes -keyout ${:key} \
-newkey rsa -nodes -keyout ${:key} \
-subj "/O=${:organization}/OU=${:organizational_unit}" \
-out ${:template-csr}
fi
......@@ -335,7 +335,7 @@ command =
{% if slapparameter_dict['backend-client-caucase-url'] %}
if [ ! -f ${:template-csr} ] && [ ! -f ${:key} ] ; then
{{ software_parameter_dict['openssl'] }} req -new -sha256 \
-newkey rsa:2048 -nodes -keyout ${:key} \
-newkey rsa -nodes -keyout ${:key} \
-subj "/O=${:organization}/OU=${:organizational_unit}" \
-out ${:template-csr}
fi
......
......@@ -89,7 +89,7 @@ organizational_unit = Kedifa Partition
command =
if [ ! -f ${:template-csr} ] && [ ! -f ${:key} ] ; then
/bin/bash -c '{{ software_parameter_dict['openssl'] }} req -new -sha256 \
-newkey rsa:2048 -nodes -keyout ${:key} \
-newkey rsa -nodes -keyout ${:key} \
-subj "/O=${:organization}/OU=${:organizational_unit}" \
-reqexts SAN \
-config <(cat {{ software_parameter_dict['openssl_cnf'] }} \
......@@ -135,7 +135,7 @@ stop-on-error = True
update-command = ${:command}
command =
if ! [ -f ${:key} ] && ! [ -f ${:certificate} ] ; then
{{ software_parameter_dict['openssl'] }} req -new -newkey rsa:2048 -sha256 -subj \
{{ software_parameter_dict['openssl'] }} req -new -newkey rsa -sha256 -subj \
"/O=${kedifa-csr:organization}/OU=${kedifa-csr:organizational_unit}/CN={{ instance_parameter_dict['ipv6-random'] }}" \
-days 5 -nodes -x509 -keyout ${:key} -out ${:certificate}
fi
......
......@@ -631,7 +631,7 @@ organizational_unit = Automatic Internal Kedifa Caucase CSR
command =
if [ ! -f ${:csr} ] && [ ! -f ${:key} ] ; then
{{ software_parameter_dict['openssl'] }} req -new -sha256 \
-newkey rsa:2048 -nodes -keyout ${:key} \
-newkey rsa -nodes -keyout ${:key} \
-subj "/O=${:organization}/OU=${:organizational_unit}" \
-out ${:csr}
fi
......@@ -752,7 +752,7 @@ organizational_unit = Automatic Sign Backend Client Caucase CSR
command =
if [ ! -f ${:csr} ] && [ ! -f ${:key} ] ; then
{{ software_parameter_dict['openssl'] }} req -new -sha256 \
-newkey rsa:2048 -nodes -keyout ${:key} \
-newkey rsa -nodes -keyout ${:key} \
-subj "/O=${:organization}/OU=${:organizational_unit}" \
-out ${:csr}
fi
......@@ -927,7 +927,7 @@ update-command = ${:command}
command =
[ -f ${:certificate} ] && {{ software_parameter_dict['findutils'] }}/bin/find ${:certificate} -type f -mtime +3 -delete
if ! [ -f ${:certificate} ] ; then
openssl req -new -newkey rsa:2048 -sha256 -subj \
openssl req -new -newkey rsa -sha256 -subj \
"/CN=${master-introspection-server-configuration:ip}" \
-days 5 -nodes -x509 -keyout ${:certificate} -out ${:certificate}
fi
......
......@@ -611,7 +611,7 @@ stop-on-error = True
update-command = ${:command}
command =
if ! [ -f ${:key} ] && ! [ -f ${:certificate} ] ; then
openssl req -new -newkey rsa:2048 -sha256 -subj \
openssl req -new -newkey rsa -sha256 -subj \
"/O={{ expose_csr_organization }}/OU={{ expose_csr_organizational_unit }}/CN=${slap-configuration:ipv6-random}" \
-days 5 -nodes -x509 -keyout ${:key} -out ${:certificate}
fi
......
......@@ -15,4 +15,4 @@
[instance.cfg.in]
filename = instance.cfg.in
md5sum = b5c479ebb4cf2fd2f63623af88b95078
md5sum = 1d9513c44185ad47bd3bb50f748c372a
......@@ -111,9 +111,10 @@ recipe = plone.recipe.command
command =
if [ ! -f '${:csr}' ] ; then
{{ openssl_bin }} req \
-newkey rsa:2048 \
-newkey rsa \
-batch \
-new \
-sha256 \
-nodes \
-keyout /dev/null \
-config '${rest-server-certificate-csr-config:output}' \
......
......@@ -19,4 +19,4 @@ md5sum = 10e19df182c692b71ea552da183a0bcf
[template-selenium]
filename = instance-selenium.cfg.in
md5sum = 7239845e758b2d10299699e061b0fc75
\ No newline at end of file
md5sum = 9bef75759623a660cfaf4b6f5a48a923
\ No newline at end of file
......@@ -137,7 +137,7 @@ command =
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${:common-name}" \
-newkey rsa:2048 -keyout $${:cert-file} \
-newkey rsa -keyout $${:cert-file} \
-out $${:cert-file}
fi
update-command = $${:command}
......
......@@ -18,7 +18,7 @@ md5sum = 38eab3283d175230231c998fa4a3416e
[template-balancer]
filename = instance-balancer.cfg.in
md5sum = 88e15a803df4aa35285e59ae9186438a
md5sum = 8af2ed33ef2a57cf5c5df4dd5d834d69
[template-apache-backend-conf]
filename = apache-backend.conf.in
......
......@@ -148,7 +148,7 @@ cert = ${apache-ssl-cert:output}
{{ simplefile('apache-ssl-cert', '${apache-conf-ssl:cert}', ssl_parameter_dict['cert']) }}
{% else %}
recipe = plone.recipe.command
command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -new -sha256 -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
key = ${apache-conf-ssl:key}
cert = ${apache-conf-ssl:cert}
{%- endif %}
......
......@@ -446,7 +446,7 @@ class TestDeploymentScriptInstantiation(ERP5InstanceTestCase):
cert = os.path.join(self.ca_path, 'certs', 'test.crt')
common_name = 'TEST-SSL-AUTH'
popenCommunicate([
'openssl', 'req', '-utf8', '-nodes', '-config', openssl_config, '-new',
'openssl', 'req', '-utf8', '-nodes', '-config', openssl_config, '-new', '-sha256',
'-keyout', key, '-out', csr, '-days', '3650'], f'{common_name}\n'.encode(),
stdin=subprocess.PIPE)
popenCommunicate([
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment