Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos
Commits
d79bc190
Commit
d79bc190
authored
Jul 10, 2024
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/wendelin-telecom: Add software release
parent
06154499
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
294 additions
and
0 deletions
+294
-0
software/wendelin-telecom/buildout.hash.cfg
software/wendelin-telecom/buildout.hash.cfg
+7
-0
software/wendelin-telecom/instance-shared-input-schema.json
software/wendelin-telecom/instance-shared-input-schema.json
+26
-0
software/wendelin-telecom/instance-shared-output-schema.json
software/wendelin-telecom/instance-shared-output-schema.json
+19
-0
software/wendelin-telecom/instance-wendelin-telecom-input-schema.json
...delin-telecom/instance-wendelin-telecom-input-schema.json
+10
-0
software/wendelin-telecom/instance-wendelin-telecom-output-schema.json
...elin-telecom/instance-wendelin-telecom-output-schema.json
+11
-0
software/wendelin-telecom/instance-wendelin-telecom.cfg.in
software/wendelin-telecom/instance-wendelin-telecom.cfg.in
+107
-0
software/wendelin-telecom/instance.cfg.in
software/wendelin-telecom/instance.cfg.in
+24
-0
software/wendelin-telecom/software.cfg
software/wendelin-telecom/software.cfg
+67
-0
software/wendelin-telecom/software.cfg.json
software/wendelin-telecom/software.cfg.json
+23
-0
No files found.
software/wendelin-telecom/buildout.hash.cfg
0 → 100644
View file @
d79bc190
[template-extend]
filename = instance.cfg.in
md5sum = 79e4a9d4c632eaf0472929464a12e768
[template-wendelin-telecom]
filename = instance-wendelin-telecom.cfg.in
md5sum = eb17784ee1a9d1f5bf8f5741cd733446
software/wendelin-telecom/instance-shared-input-schema.json
0 → 100644
View file @
d79bc190
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"type"
:
"object"
,
"properties"
:
{
"project-title"
:
{
"description"
:
"Title of the ORS client project to register"
,
"title"
:
"Client Project Title"
,
"type"
:
"string"
},
"client-username"
:
{
"description"
:
"Username for the client project's user account"
,
"title"
:
"Client Project Account Username"
,
"type"
:
"string"
},
"ors-tag"
:
{
"description"
:
"Fluentbit tag of the ORS to register to the client project"
,
"title"
:
"ORS Tag"
,
"type"
:
"string"
},
"ors-title"
:
{
"description"
:
"Title of the ORS to register to the client project"
,
"title"
:
"ORS Title"
,
"type"
:
"string"
}
}
}
software/wendelin-telecom/instance-shared-output-schema.json
0 → 100644
View file @
d79bc190
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"description"
:
"Values returned by Wendelin Telecom"
,
"type"
:
"object"
,
"properties"
:
{
"ors-wendelin-homepage"
:
{
"description"
:
"URL to the homepage of the Wendelin Telecom platform"
,
"type"
:
"string"
},
"username"
:
{
"description"
:
"Username for the project's user account"
,
"type"
:
"string"
},
"init-password"
:
{
"description"
:
"Initial password for the project's user account"
,
"type"
:
"string"
}
}
}
software/wendelin-telecom/instance-wendelin-telecom-input-schema.json
0 → 100644
View file @
d79bc190
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"type"
:
"object"
,
"properties"
:
{
"client-frontend-url"
:
{
"description"
:
"Base URL of the Wendelin Telecom frontend instance intended for use by the clients."
,
"type"
:
"string"
}
}
}
software/wendelin-telecom/instance-wendelin-telecom-output-schema.json
0 → 100644
View file @
d79bc190
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"description"
:
"Values returned by Wendelin Telecom"
,
"type"
:
"object"
,
"properties"
:
{
"slave-amount"
:
{
"description"
:
"Amount of slaves attached to this instance"
,
"type"
:
"number"
}
}
}
software/wendelin-telecom/instance-wendelin-telecom.cfg.in
0 → 100644
View file @
d79bc190
[buildout]
extends =
{{ instance_erp5 }}
parts +=
ors-client-project-register
[directory]
ors-client-project-register = ${:etc}/ors-client-project-register
[ors-client-project-register]
recipe = slapos.recipe.build
slave-instance-list = {{ dumps(slave_instance_list) }}
ors-client-project-register-path = ${directory:ors-client-project-register}
backend-url = ${publish:family-default-v6}
client-frontend-url = {{ slapparameter_dict.get('client-frontend-url', '')}}
inituser-login = ${publish:inituser-login}
inituser-password = ${publish-early:inituser-password}
update =
import json
import logging
import os
import requests
import slapos
log = logging.getLogger('SLAPOS-WENDELIN-TELECOM')
logging.basicConfig(level=logging.INFO)
slap = slapos.slap.slap()
slap_connection = self.buildout['slap-connection']
self.computer_id = slap_connection['computer-id']
self.computer_partition_id = slap_connection['partition-id']
self.server_url = slap_connection['server-url']
self.software_release_url = slap_connection['software-release-url']
self.key_file = slap_connection.get('key-file')
self.cert_file = slap_connection.get('cert-file')
self.slave_instance_list = list(options['slave-instance-list'])
# Redeploy instance to update published information
slap.initializeConnection(self.server_url, self.key_file, self.cert_file)
computer_partition = slap.registerComputerPartition(self.computer_id, self.computer_partition_id)
ors_client_project_register_path = options['ors-client-project-register-path']
wendelin_telecom_backend_url = options['backend-url']
wendelin_telecom_client_frontend_url = options['client-frontend-url']
inituser_login = options['inituser-login']
inituser_password = options['inituser-password']
for slave in self.slave_instance_list:
slave_reference = slave['slave_reference']
try:
project_title = slave['project-title']
project_reference = project_title.replace(" ", "_").lower()
client_username = slave['client-username']
ors_tag = slave['ors-tag']
ors_title = slave['ors-title']
except KeyError as e:
log.fatal("%s: Parameter %s not found, skipping registration" % (slave_reference, e))
continue
register_file = os.path.join(ors_client_project_register_path, '%s.json' % slave_reference)
connection_dict = {}
if not os.path.exists(register_file):
with open(register_file, 'w') as file:
json.dump(connection_dict, file)
else:
with open(register_file, 'r') as file:
connection_dict = json.load(file)
request_url = "%s/erp5/Base_registerOrsClientProject?project_reference=%s&project_title=%s&client_username=%s&ors_tag=%s&ors_title=%s" \
% (wendelin_telecom_backend_url, project_reference, project_title, client_username, ors_tag, ors_title)
response = requests.get(request_url, verify=False, auth=(inituser_login, inituser_password))
response = response.json()
error_msg_key = "error_msg"
if error_msg_key in response:
error_msg = response[error_msg_key]
log.info(error_msg)
else:
if "username" in response and "init_password" in response:
connection_dict = {
"username": response['username'],
"init-password": response['init_password']
}
with open(register_file, 'w') as file:
json.dump(connection_dict, file)
log.info("ORS client project successfully registered: %s" % slave_reference)
else:
log.fatal("Error while fetching client user account credentials")
continue
no_client_frontend_url_msg = "Wendelin Telecom website has not been configured."
connection_dict['wendelin-telecom-homepage'] = wendelin_telecom_client_frontend_url or no_client_frontend_url_msg
try:
log.info("Update parameters for client project %s" % slave_reference)
computer_partition.setConnectionDict(connection_dict, slave_reference)
except Exception:
log.fatal("Error while sending slave %s information: %s",
slave_reference, traceback.format_exc())
[publish]
slave-amount = {{ len(slave_instance_list) }}
software/wendelin-telecom/instance.cfg.in
0 → 100644
View file @
d79bc190
[buildout]
extends =
{{ template_base }}
[jinja2-template-extend]
recipe = slapos.recipe.template:jinja2
output = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
extra-context =
context =
key slapparameter_dict slap-configuration:configuration
${:extra-context}
[dynamic-template-wendelin-telecom]
<= jinja2-template-extend
url = {{ template_wendelin_telecom }}
filename = instance-wendelin-telecom.cfg
extensions = jinja2.ext.do
extra-context =
import json_module json
key slave_instance_list slap-configuration:slave-instance-list
key instance_erp5 dynamic-template-erp5:output
[switch-softwaretype]
default = dynamic-template-wendelin-telecom:output
software/wendelin-telecom/software.cfg
0 → 100644
View file @
d79bc190
[buildout]
extends =
buildout.hash.cfg
../../software/wendelin/software.cfg
parts +=
wendelin-telecom
template-extend
[eggs]
eggs +=
websocket-client
${xlte:egg}
extra-paths +=
${wendelin-telecom:location}
[xlte-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/kirr/xlte.git
branch = py2
git-executable = ${git:location}/bin/git
revision = 58df27260dfd7c23ebd86505be4e5a5c44e12871
[xlte]
recipe = zc.recipe.egg:develop
setup = ${xlte-repository:location}
egg = xlte
depends =
${numpy:egg}
${pygolang:egg}
websocket-client
[wendelin-telecom]
<= erp5
repository = https://lab.nexedi.com/paul.graydon/wendelin-telecom.git
branch = master
revision = 71d02c8d6cce7e9970b1371d149622f201440fda
[local-bt5-repository]
list += ${wendelin-telecom:location}/bt5
[erp5_repository_list]
repository_id_list += wendelin-telecom
[template]
output = ${buildout:directory}/template-base.cfg
[template-extend]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
key template_base template:output
key template_wendelin_telecom template-wendelin-telecom:target
[download-base-extend]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[template-wendelin-telecom]
<= download-base-extend
[versions]
websocket-client = 0.59.0
backports.ssl-match-hostname = 3.7.0.1
software/wendelin-telecom/software.cfg.json
0 → 100644
View file @
d79bc190
{
"name"
:
"Wendelin Telecom"
,
"description"
:
"Master instance of Wendelin Telecom"
,
"serialisation"
:
"xml"
,
"software-type"
:
{
"default"
:
{
"title"
:
"Default"
,
"description"
:
"Wendelin Telecom"
,
"request"
:
"instance-wendelin-telecom-input-schema.json"
,
"response"
:
"instance-wendelin-telecom-output-schema.json"
,
"index"
:
0
},
"default-slave"
:
{
"title"
:
"Default (Shared)"
,
"description"
:
"ORS Client Project Registration"
,
"software-type"
:
"default"
,
"request"
:
"instance-shared-input-schema.json"
,
"response"
:
"instance-shared-output-schema.json"
,
"shared"
:
true
,
"index"
:
1
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment