Skeleton of basic occi recipe/stack

parent 4e272509
...@@ -26,24 +26,41 @@ ...@@ -26,24 +26,41 @@
############################################################################## ##############################################################################
import os import os
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
form subprocess import Popen
class Recipe(GenericBaseRecipe): class Recipe(GenericBaseRecipe):
def install(self): def install(self):
ip = self.options['ip']
occi_server_port = int(self.options['server-port'])
occi_server_listen_port = int(self.options['server-listen-port'])
path_list = [] path_list = []
poc_location = self.buildout['pocdirectory']['poc']
config = dict( # Generate os-config.xml
occi_server_binary=self.options['occi-server-binary'], os_config_parameters = dict(
occi_server_ip=ip, userid=self.options['userid'],
occi_server_log=self.options['occi-server-log'], userid=self.options['userid'],
occi_server_port=occi_server_port, password=self.options['password'],
occi_server_listen_port=occi_server_listen_port, domain=self.options['domain'],
) )
os_config_file = self.createFile(self.options['os-config'],
self.substituteTemplate(self.getTemplateFilename('os-config.xml.in'),
os_config_parameters))
path_list.append(os_config_file)
# Initiate configuration
Popen('./accords-config',
cwd=poc_location
).communicate()
# Generate manifest
manifest_origin_location = self.options['manifest']
manifest_location = self.options['manifest-destination']
self.createFile(manifest_origin_location, manifest_location)
path_list.append(manifest_location)
# Generate wrapper
# XXX create wrapper
path_list.append(self.createExecutable(self.options['server-wrapper'], path_list.append(self.createExecutable(self.options['server-wrapper'],
self.substituteTemplate(self.getTemplateFilename('occi_server.in'), self.substituteTemplate(self.getTemplateFilename('accords.in'),
config))) config)))
return path_list return path_list
<os_configs>
<os_config
id="e1f892e3-0001-4326-8866-9354b95d3b17"
name="%(userid)s"
user="%(userid)s"
password="%(password)s"
namespace="%(domain)s"
description="ACCORDS rocks"
agent=’OpenStackClient/1.0a.0.01’
host=’http://94.143.114.137:5000/v2.0/’
version="v1.1"
authenticate=""
base=""
tls="0"
current="0" />
</os_configs>
\ No newline at end of file
...@@ -8,10 +8,12 @@ parts = ...@@ -8,10 +8,12 @@ parts =
accords accords
eggs eggs
occi-xwiki-manifest occi-xwiki-manifest
occi-xwiki-os-config
[occi-xwiki-manifest] [occi-manifest]
# Manifest for xwiki
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/xwiki.manifest.cfg.in url = ${:_profile_base_location_}/xwiki.manifest.xml
#md5sum = 3e1ea477d48080e9bdb98579f7f28be6 #md5sum = 3e1ea477d48080e9bdb98579f7f28be6
filename = xwiki.manifest.cfg filename = xwiki.manifest.xml
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
<?xml version="1.0" encoding="UTF8"?>
<manifest name="pocxwiki" xmlns="http://www.compatibleone.fr/schemes/cords.xsd">
<description>This manifest describes the CompatibleOne XWIKI Proof of Concept, comprising
two appliance nodes, a web application server front end connected to a backe end sql database engine and whilst allowing public access to service instances of the manifest restricts administration access to the list of persons described in the account section.</description>
<node name="Sqldatabase">
<infrastructure name="database">
<compute name="FastDualCore" cores="2" speed="3GHz" architecture="x686" memory="8GB"/>
<storage name="LargeDisk" size="1TB" type="SATA"/>
<network name="EtherNet" vlan="true" label="database"/>
</infrastructure>
<image name="MySQL">
<system name="debian squeeze"/>
<package name="MySql"/>
<package name="XwikiData"/>
<package name="XwikiDataPatch"/>
</image>
</node>
<node name="Xwiki">
<infrastructure name="LAMPServer">
<compute name="FastQuadCore" cores="4" speed="3GHz" architecture="x686" memory="32GB"/>
<storage name="MediumDisk" size="160GB" type="SATA"/>
<network name="EtherNet" vlan="true" label="database"/>
</infrastructure>
<image name="Xwiki">
<system name="debian squeeze"/>
<package name="Apache"/>
<package name="Php" version="5"/>
<package name="TomCat"/>
<package name="XwikiApplication"/>
<package name="XwikiCodePatch"/>
</image>
</node>
<configuration>
<action type="cordscript" expression="Xwiki.configure(Sqldatabase.hostname);"/>
</configuration>
<security name="public" level="public"/>
<account name="poc1">
<user name="fabio"/>
<user name="Jamie"/>
<user name="stephane"/>
<user name="brian"/>
<user name="jean"/>
</account>
</manifest>
\ No newline at end of file
[buildout] [buildout]
parts = parts =
url copy-scripts
occi occi
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
[url] #[url]
recipe = slapos.cookbook:publishurl #recipe = slapos.cookbook:publishurl
url = mysqls://$${mariadb:user}:$${mariadb:password}@[$${stunnel:remote-address}]:$${stunnel:remote-port}/$${mariadb:database} #url =
[occi] [occi]
recipe = slapos.cookbook:occi recipe = slapos.cookbook:occi
# Options # Options
ip = $${slap-network-information:local-ipv4} userid = $${slap-parameter:userid}
password = $${slap-parameter:password}
domain = $${slap-parameter:domain}
os-config = $${pocdirectory:poc}/os-config.xml
# Paths # Paths
manifest = ${occi-manifest:location}/${occi-manifest:filename}
manifest-destination = ${pocdirectory:poc}/manifest.xml
# Binary information # Binary information
parser = ${accords:location}/bin/bc-parser accords = ${accords:location}/bin/parser
broker = ${accords:location}/bin/bc-broker parser = ${accords:location}/bin/parser
broker = ${accords:location}/bin/broker
[rootdirectory] [rootdirectory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -36,3 +42,42 @@ log = $${rootdirectory:var}/log/ ...@@ -36,3 +42,42 @@ log = $${rootdirectory:var}/log/
services = $${rootdirectory:etc}/run/ services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/ run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/ backup = $${rootdirectory:srv}/backup/
[pocdirectory]
recipe = slapos.cookbook:mkdirectory
poc = $${rootdirectory:poc}/poc
rest = $${rootdirectory:poc}/poc/rest
service = $${rootdirectory:poc}/poc/service
security = $${rootdirectory:poc}/poc/security
[copy-scripts]
recipe = slapos.cookbook:symbolic.link
target-directory = $${pocdirectory:poc}
file-list =
${accord-source:location}/scripts/accords
${accord-source:location}/scripts/accords-config
${accord-source:location}/scripts/co-broker
${accord-source:location}/scripts/co-command
${accord-source:location}/scripts/co-parser
${accord-source:location}/scripts/cords_user.xml
${accord-source:location}/scripts/co-resolver
${accord-source:location}/scripts/co-start
${accord-source:location}/scripts/co-status
${accord-source:location}/scripts/co-stop
${accord-source:location}/scripts/run-azprocci
${accord-source:location}/scripts/run-broker
${accord-source:location}/scripts/run-coees
${accord-source:location}/scripts/run-coes
${accord-source:location}/scripts/run-coips
${accord-source:location}/scripts/run-comons
${accord-source:location}/scripts/run-conets
${accord-source:location}/scripts/run-coobas
${accord-source:location}/scripts/run-cosacs
${accord-source:location}/scripts/run-coss
${accord-source:location}/scripts/run-ezvm
${accord-source:location}/scripts/run-fileserver
${accord-source:location}/scripts/run-onprocci
${accord-source:location}/scripts/run-osprocci
${accord-source:location}/scripts/run-parser
${accord-source:location}/scripts/run-procci
${accord-source:location}/scripts/run-publisher
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