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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos
Commits
c1794c82
Commit
c1794c82
authored
Dec 06, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accords: move component to unstable, remove recipe
parent
3a4e5da9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
276 deletions
+0
-276
component/unstable/accords/buildout.cfg
component/unstable/accords/buildout.cfg
+0
-0
setup.py
setup.py
+0
-1
slapos/recipe/accords/__init__.py
slapos/recipe/accords/__init__.py
+0
-105
slapos/recipe/accords/accords.py
slapos/recipe/accords/accords.py
+0
-92
slapos/recipe/accords/template/accords.ini.in
slapos/recipe/accords/template/accords.ini.in
+0
-35
slapos/recipe/accords/template/coips.xml.in
slapos/recipe/accords/template/coips.xml.in
+0
-15
slapos/recipe/accords/template/os_config.xml.in
slapos/recipe/accords/template/os_config.xml.in
+0
-17
slapos/recipe/accords/template/testos.in
slapos/recipe/accords/template/testos.in
+0
-11
No files found.
component/accords/buildout.cfg
→
component/
unstable/
accords/buildout.cfg
View file @
c1794c82
File moved
setup.py
View file @
c1794c82
...
...
@@ -77,7 +77,6 @@ setup(name=name,
entry_points
=
{
'zc.buildout'
:
[
'addresiliency = slapos.recipe.addresiliency:Recipe'
,
'accords = slapos.recipe.accords:Recipe'
,
'apacheperl = slapos.recipe.apacheperl:Recipe'
,
'apachephp = slapos.recipe.apachephp:Recipe'
,
'apachephpconfigure = slapos.recipe.apachephpconfigure:Recipe'
,
...
...
slapos/recipe/accords/__init__.py
deleted
100644 → 0
View file @
3a4e5da9
##############################################################################
#
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
shutil
from
slapos.recipe.librecipe
import
GenericSlapRecipe
import
shutil
import
subprocess
import
sys
class
Recipe
(
GenericSlapRecipe
):
def
_install
(
self
):
path_list
=
[]
accords_location
=
self
.
buildout
[
'accordsdirectory'
][
'accords'
]
parameter_dict
=
dict
(
userid
=
self
.
options
[
'userid'
],
tenantname
=
self
.
options
[
'tenantname'
],
password
=
self
.
options
[
'password'
],
domain
=
self
.
options
[
'domain'
],
openstack_url
=
self
.
options
[
'openstack_url'
],
python_location
=
sys
.
executable
,
accords_location
=
accords_location
,
manifest_name
=
self
.
options
[
'manifest-name'
],
# XXX this is workaround
accords_lib_directory
=
self
.
options
[
'accords_lib_directory'
],
computer_id
=
self
.
computer_id
,
computer_partition_id
=
self
.
computer_partition_id
,
server_url
=
self
.
server_url
,
software_release_url
=
self
.
software_release_url
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
,
path
=
'%s:%s'
%
(
self
.
options
[
'accords_bin_directory'
],
os
.
environ
.
get
(
'PATH'
,
''
)),
)
# Generate os-config.xml
os_config_file
=
self
.
createFile
(
self
.
options
[
'os-config'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'os_config.xml.in'
),
parameter_dict
))
path_list
.
append
(
os_config_file
)
# Put modified accords configuration file
accords_configuration_parameter_dict
=
dict
(
listen_ip
=
self
.
options
[
'listen-ip'
]
)
accords_configuration_file_location
=
self
.
createFile
(
self
.
options
[
'accords-configuration-file'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'accords.ini.in'
),
accords_configuration_parameter_dict
))
path_list
.
append
(
accords_configuration_file_location
)
# XXX is it dangerous?
security_path
=
os
.
path
.
join
(
accords_location
,
'security'
)
if
os
.
path
.
exists
(
security_path
):
shutil
.
rmtree
(
security_path
)
# Initiate configuration
subprocess
.
check_call
(
'./accords-config'
,
cwd
=
accords_location
)
# Generate manifest
manifest_origin_location
=
self
.
options
[
'manifest-source'
]
manifest_location
=
self
.
options
[
'manifest-destination'
]
shutil
.
copy
(
manifest_origin_location
,
manifest_location
)
path_list
.
append
(
manifest_location
)
# Generate wrapper
wrapper_location
=
self
.
createPythonScript
(
self
.
options
[
'accords-wrapper'
],
__name__
+
'.accords.runAccords'
,
(
parameter_dict
,))
path_list
.
append
(
wrapper_location
)
# Generate helper for debug
self
.
createExecutable
(
self
.
options
[
'testos-wrapper'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'testos.in'
),
parameter_dict
)
)
return
path_list
slapos/recipe/accords/accords.py
deleted
100644 → 0
View file @
3a4e5da9
#!%(python_location)s
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
from
slapos
import
slap
import
signal
import
subprocess
from
subprocess
import
Popen
import
sys
import
time
def
runAccords
(
accords_conf
):
"""Launch ACCORDS, parse manifest, broker manifest, send connection
informations to SlapOS Master. Destroy instance and stops ACCORDS at
SIGTERM."""
computer_id
=
accords_conf
[
'computer_id'
]
computer_partition_id
=
accords_conf
[
'computer_partition_id'
]
server_url
=
accords_conf
[
'server_url'
]
software_release_url
=
accords_conf
[
'software_release_url'
]
key_file
=
accords_conf
[
'key_file'
]
cert_file
=
accords_conf
[
'cert_file'
]
accords_lib_directory
=
accords_conf
[
'accords_lib_directory'
]
accords_location
=
accords_conf
[
'accords_location'
]
manifest_name
=
accords_conf
[
'manifest_name'
]
environment
=
dict
(
LD_LIBRARY_PATH
=
accords_lib_directory
,
PATH
=
accords_conf
[
'path'
],
HOME
=
accords_location
,
)
# Set handler to stop ACCORDS when end of world comes
# XXX use subprocess.check_call and add exception handlers
def
sigtermHandler
(
signum
,
frame
):
Popen
([
'./co-command'
,
'stop'
,
'/service/*'
],
cwd
=
accords_location
,
env
=
environment
).
communicate
()
Popen
([
'./co-stop'
],
cwd
=
accords_location
,
env
=
environment
).
communicate
()
sys
.
exit
(
0
)
signal
.
signal
(
signal
.
SIGTERM
,
sigtermHandler
)
# Launch ACCORDS, parse & broke manifest to deploy instance
print
'Starting ACCORDS and friends...'
subprocess
.
check_call
([
'./co-start'
],
cwd
=
accords_location
,
env
=
environment
)
print
'Parsing manifest...'
subprocess
.
check_call
([
'./co-parser'
,
manifest_name
],
cwd
=
accords_location
,
env
=
environment
)
print
'Brokering manifest...'
subprocess
.
check_call
([
'./co-broker'
,
manifest_name
],
cwd
=
accords_location
,
env
=
environment
)
print
'Done.'
# Parse answer
# XXX
connection_dict
=
dict
(
connection
=
'hardcoded'
)
# Send information about published service to SlapOS Master
slap_connection
=
slap
.
slap
()
slap_connection
.
initializeConnection
(
server_url
,
key_file
,
cert_file
)
computer_partition
=
slap_connection
.
registerComputerPartition
(
computer_id
,
computer_partition_id
)
computer_partition
.
setConnectionDict
(
connection_dict
)
# Go to sleep, wait kill
while
(
True
):
time
.
sleep
(
60
)
slapos/recipe/accords/template/accords.ini.in
deleted
100644 → 0
View file @
3a4e5da9
# REST host (default: 127.0.0.1)
resthost=%(listen_ip)s
# REST port (default: 8086)
#restport=8086
# Target (default: ./accords.xml)
#target=accords.xml
# Acitvate TLS (default: 0)
#tls=0
# Activate monitoring (default: 1)
#monitor=1
# Trace (default: 1)
#trace=1
# Threads (default:1)
#threads=1
# Be verbose (default: 1)
#verbose=0
# Debug (default: 1)
#debug=1
# Domain (default: occi)
#domain=occi
# Operator (default: accords)
#operator=accords
# Password (default: co-system)
#password=co-system
slapos/recipe/accords/template/coips.xml.in
deleted
100644 → 0
View file @
3a4e5da9
<?xml version="1.0" encoding="UTF8"?>
<manifest
name=
"coips:model"
xmlns=
"http://www.compatibleone.fr/schemes/cords.xsd"
>
<description>
Infrastructure profile used by production tool
</description>
<node
name=
"coips:model"
>
<infrastructure
name=
"coips:model"
>
<compute
name=
"coips:model"
cores=
"1"
speed=
"1GHz"
architecture=
"x686"
memory=
"1GB"
/>
<storage
name=
"coips:model"
size=
"10GB"
type=
"SATA"
/>
<network
name=
"coips:model"
vlan=
"true"
label=
"database"
/>
</infrastructure>
</node>
</manifest>
\ No newline at end of file
slapos/recipe/accords/template/os_config.xml.in
deleted
100644 → 0
View file @
3a4e5da9
<os_configs>
<os_config
id="e1f892e3-slap-slap-slap-9354b95d3b17"
name="slaposrecipe"
description="Configuration of Account used by slapos recipe"
user="%(userid)s"
password="%(password)s"
authenticate=""
agent="CompatibleOne/OpenStackClient/1.0a.0.01"
host="%(openstack_url)s"
version="v1.1"
namespace="%(domain)s"
base=""
tls="0"
current="0"
/>
</os_configs>
slapos/recipe/accords/template/testos.in
deleted
100644 → 0
View file @
3a4e5da9
#!/bin/sh
export
PATH
=
%
(
path
)
s
export
ENO_HOST
=
%
(
openstack_url
)
s
export
ENO_USER
=
%
(
userid
)
s
export
ENO_PASS
=
%
(
password
)
s
export
ENO_VERSION
=
v1.1
export
ENO_TENANT
=
%
(
tenantname
)
s
testos
--host
$ENO_HOST
--password
$ENO_PASS
--user
$ENO_USER
--version
$ENO_VERSION
--tenant
$ENO_TENANT
$1
$2
$3
$4
$5
$6
$7
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