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
Joanne Hugé
slapos
Commits
7a2f0ca1
Commit
7a2f0ca1
authored
May 26, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slaprunner instantiation recipe.
parent
d53bca5e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
169 additions
and
0 deletions
+169
-0
slapos/slapos.recipe.slaprunner/CHANGES.txt
slapos/slapos.recipe.slaprunner/CHANGES.txt
+9
-0
slapos/slapos.recipe.slaprunner/MANIFEST.in
slapos/slapos.recipe.slaprunner/MANIFEST.in
+2
-0
slapos/slapos.recipe.slaprunner/README.txt
slapos/slapos.recipe.slaprunner/README.txt
+1
-0
slapos/slapos.recipe.slaprunner/setup.py
slapos/slapos.recipe.slaprunner/setup.py
+33
-0
slapos/slapos.recipe.slaprunner/src/slapos/__init__.py
slapos/slapos.recipe.slaprunner/src/slapos/__init__.py
+6
-0
slapos/slapos.recipe.slaprunner/src/slapos/recipe/__init__.py
...os/slapos.recipe.slaprunner/src/slapos/recipe/__init__.py
+6
-0
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/__init__.py
...ecipe.slaprunner/src/slapos/recipe/slaprunner/__init__.py
+81
-0
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/execute.py
...recipe.slaprunner/src/slapos/recipe/slaprunner/execute.py
+6
-0
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/template/slapos.cfg.in
...unner/src/slapos/recipe/slaprunner/template/slapos.cfg.in
+25
-0
No files found.
slapos/slapos.recipe.slaprunner/CHANGES.txt
0 → 100644
View file @
7a2f0ca1
Changelog
=========
1.2 (unreleased)
----------------
1.1 (2011-04-22)
----------------
slapos/slapos.recipe.slaprunner/MANIFEST.in
0 → 100644
View file @
7a2f0ca1
include CHANGES.txt
recursive-include src/slapos/recipe/slaprunner/ *.in
slapos/slapos.recipe.slaprunner/README.txt
0 → 100644
View file @
7a2f0ca1
slapos/slapos.recipe.slaprunner/setup.py
0 → 100644
View file @
7a2f0ca1
from
setuptools
import
setup
,
find_packages
name
=
"slapos.recipe.slaprunner"
version
=
'1.2-dev'
def
read
(
name
):
return
open
(
name
).
read
()
long_description
=
(
read
(
'README.txt'
)
+
'
\
n
'
+
read
(
'CHANGES.txt'
))
setup
(
name
=
name
,
version
=
version
,
description
=
"ZC Buildout recipe for OSOE SlapOS training"
,
long_description
=
long_description
,
license
=
"GPLv3"
,
keywords
=
"buildout slapos recipe runner"
,
classifiers
=
[
"Framework :: Buildout :: Recipe"
,
"Programming Language :: Python"
,
],
packages
=
find_packages
(
'src'
),
package_dir
=
{
''
:
'src'
},
include_package_data
=
True
,
install_requires
=
[
'setuptools'
,
# for namespacing
'slapos.lib.recipe'
,
# uses internally
'zc.recipe.egg'
,
'zc.buildout'
,
# it is recipe
],
namespace_packages
=
[
'slapos'
,
'slapos.recipe'
],
entry_points
=
{
'zc.buildout'
:
[
'default = %s:Recipe'
%
name
]},
)
slapos/slapos.recipe.slaprunner/src/slapos/__init__.py
0 → 100644
View file @
7a2f0ca1
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
slapos/slapos.recipe.slaprunner/src/slapos/recipe/__init__.py
0 → 100644
View file @
7a2f0ca1
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/__init__.py
0 → 100644
View file @
7a2f0ca1
##############################################################################
#
# 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.
#
##############################################################################
from
slapos.lib.recipe.BaseSlapRecipe
import
BaseSlapRecipe
import
os
import
pkg_resources
import
sys
import
zc.buildout
import
zc.recipe.egg
class
Recipe
(
BaseSlapRecipe
):
def
__init__
(
self
,
buildout
,
name
,
options
):
BaseSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
options
[
'eggs'
]
=
'slapos.recipe.slaprunner'
self
.
egg
=
zc
.
recipe
.
egg
.
Scripts
(
buildout
,
name
,
options
)
def
_install
(
self
):
self
.
path_list
=
[]
self
.
requirements
,
self
.
ws
=
self
.
egg
.
working_set
()
ipv4
=
self
.
getLocalIPv4Address
()
ipv6
=
self
.
getGlobalIPv6Address
()
proxy_port
=
'50000'
runner_port
=
'50000'
workdir
=
self
.
createDataDirectory
(
'runner'
)
software_root
=
os
.
path
.
join
(
workdir
,
'software'
)
instance_root
=
os
.
path
.
join
(
workdir
,
'instance'
)
configuration
=
dict
(
software_root
=
software_root
,
instance_root
=
instance_root
,
master_url
=
'http://%s:%s/'
%
(
ipv4
,
proxy_port
),
computer_id
=
'slaprunner'
,
partition_amount
=
2
,
slapgrid_sr
=
self
.
options
[
'slapgrid_sr'
],
slapgrid_cp
=
self
.
options
[
'slapgrid_cp'
],
slapproxy
=
self
.
options
[
'slapproxy'
],
supervisor
=
self
.
options
[
'supervisor'
],
supervisord_config
=
os
.
path
.
join
(
instance_root
,
'etc'
,
'supervisord.conf'
),
runner_workdir
=
workdir
,
runner_host
=
ipv6
,
runner_port
=
runner_port
,
ipv4_address
=
ipv4
,
ipv6_address
=
ipv6
,
proxy_host
=
ipv4
,
proxy_port
=
proxy_port
,
proxy_database
=
os
.
path
.
join
(
workdir
,
'proxy.db'
)
)
config_file
=
self
.
createConfigurationFile
(
'slapos.cfg'
,
self
.
substituteTemplate
(
pkg_resources
.
resource_filename
(
__name__
,
'template/slapos.cfg.in'
),
configuration
))
self
.
path_list
.
append
(
config_file
)
self
.
path_list
.
extend
(
zc
.
buildout
.
easy_install
.
scripts
([(
'slaprunner'
,
'slapos.recipe.slaprunner.execute'
,
'execute'
)],
self
.
ws
,
sys
.
executable
,
self
.
wrapper_directory
,
arguments
=
[
self
.
options
[
'slaprunner'
].
strip
(),
config_file
]))
self
.
setConnectionDict
(
dict
(
url
=
'http://[%s]:%s'
%
(
ipv6
,
runner_port
)))
return
self
.
path_list
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/execute.py
0 → 100644
View file @
7a2f0ca1
import
os
def
execute
(
args
):
"""Portable execution with process replacement"""
os
.
execv
(
args
[
0
],
args
)
slapos/slapos.recipe.slaprunner/src/slapos/recipe/slaprunner/template/slapos.cfg.in
0 → 100644
View file @
7a2f0ca1
[slapos]
software_root = %(software_root)s
instance_root = %(instance_root)s
master_url = %(master_url)s
computer_id = %(computer_id)s
[slapformat]
partition_amount = %(partition_amount)s
[slaprunner]
slapgrid_sr = %(slapgrid_sr)s
slapgrid_cp = %(slapgrid_cp)s
slapproxy = %(slapproxy)s
supervisor = %(supervisor)s
supervisord_config = %(supervisord_config)s
runner_workdir = %(runner_workdir)s
runner_host = %(runner_host)s
runner_port = %(runner_port)s
ipv4_address = %(ipv4_address)s
ipv6_address = %(ipv6_address)s
[slapproxy]
host = %(proxy_host)s
port = %(proxy_port)s
database_uri = %(proxy_database)s
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