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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos
Commits
aff31d0e
Commit
aff31d0e
authored
Mar 13, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly launches accords platform
parent
fcb8c6f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
slapos/recipe/occi/__init__.py
slapos/recipe/occi/__init__.py
+8
-3
slapos/recipe/occi/accords.py
slapos/recipe/occi/accords.py
+18
-6
stack/occi/instance-occi.cfg
stack/occi/instance-occi.cfg
+1
-1
No files found.
slapos/recipe/occi/__init__.py
View file @
aff31d0e
...
...
@@ -30,7 +30,7 @@ from subprocess import Popen
import
sys
class
Recipe
(
GenericSlapRecipe
):
def
install
(
self
):
def
_
install
(
self
):
path_list
=
[]
poc_location
=
self
.
buildout
[
'pocdirectory'
][
'poc'
]
...
...
@@ -73,8 +73,13 @@ class Recipe(GenericSlapRecipe):
poc_location
=
poc_location
,
manifest_name
=
self
.
options
[
'manifest-name'
],
# XXX this is workaround
accords_lib_directory
=
self
.
options
[
'accords_lib_directory'
])
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
,)
wrapper_location
=
self
.
createPythonScript
(
self
.
options
[
'accords-wrapper'
],
'%s.accords.runAccords'
%
__name__
,
wrapper_config_dict
)
...
...
slapos/recipe/occi/accords.py
View file @
aff31d0e
...
...
@@ -29,15 +29,22 @@
from
slapos
import
slap
import
signal
from
subprocess
import
Popen
import
sys
import
time
def
runAccords
(
a
rgs
):
def
runAccords
(
a
ccords_conf
):
"""Launch ACCORDS, parse manifest, broker manifest, send connection
informations to SlapOS Master. Destroy instance and stops ACCORDS at
SIGTERM."""
computer_id
,
computer_partition_id
,
server_url
,
software_release_url
,
\
key_file
,
cert_file
,
\
accords_lib_directory
,
poc_location
,
manifest_name
=
args
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'
]
poc_location
=
accords_conf
[
'poc_location'
]
manifest_name
=
accords_conf
[
'manifest_name'
]
environment
=
dict
(
LD_LIBRARY_PATH
=
accords_lib_directory
,
...
...
@@ -49,26 +56,31 @@ def runAccords(args):
cwd
=
poc_location
,
env
=
environment
).
communicate
()
Popen
([
'./co-stop'
],
cwd
=
poc_location
,
env
=
environment
).
communicate
()
sys
.
exit
(
0
)
signal
.
signal
(
signal
.
SIGTERM
,
sigtermHandler
)
# Launch ACCORDS, parse & broke manifest to deploy instance
Popen
([
'./co-start'
],
cwd
=
poc_location
,
env
=
environment
).
communicate
()
print
'Parsing manifest...'
Popen
([
'./co-parser'
,
manifest_name
],
cwd
=
poc_location
,
env
=
environment
).
communicate
()
print
'Brokering manifest...'
Popen
([
'./co-broker'
,
manifest_name
],
cwd
=
poc_location
,
env
=
environment
).
communicate
()
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
()
computer_partition
.
setConnectionDict
(
connection_dict
)
# Go to sleep, wait kill
while
(
True
):
time
.
sleep
(
60
)
\ No newline at end of file
time
.
sleep
(
60
)
stack/occi/instance-occi.cfg
View file @
aff31d0e
...
...
@@ -28,7 +28,7 @@ listen-ip = $${slap-network-information:local-ipv4}
accords-configuration-file = $${pocdirectory:poc}/accords.ini
manifest-source = ${occi-manifest:target}
manifest-destination = $${pocdirectory:poc}/manifest.xml
manifest-name =
$${pocdirectory:poc}/
manifest
manifest-name = manifest
accords-wrapper = $${basedirectory:services}/accords
# Workaround
accords_lib_directory : ${accords:location}/lib
...
...
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