Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
dbab6068
Commit
dbab6068
authored
Sep 21, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid: new shared_part_list config file option
parent
1b68f7d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
slapos.cfg.example
slapos.cfg.example
+6
-0
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+11
-4
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+5
-1
No files found.
slapos.cfg.example
View file @
dbab6068
...
@@ -8,6 +8,12 @@ cert_file = /etc/opt/slapos/ssl/computer.crt
...
@@ -8,6 +8,12 @@ cert_file = /etc/opt/slapos/ssl/computer.crt
certificate_repository_path = /etc/opt/slapos/ssl/partition_pki
certificate_repository_path = /etc/opt/slapos/ssl/partition_pki
software_root = /opt/slapgrid
software_root = /opt/slapgrid
instance_root = /srv/slapgrid
instance_root = /srv/slapgrid
# A list of directories containing shared parts for slapos.recipe.cmmi.
# Only the last one is used to install new parts, other ones can have
# already installed parts.
shared_part_list =
/opt/slapgrid/read_only_shared
/opt/slapgrid/shared
[slapformat]
[slapformat]
# Replace by your network interface providing IPv6 if you don't use re6st
# Replace by your network interface providing IPv6 if you don't use re6st
...
...
slapos/grid/SlapObject.py
View file @
dbab6068
...
@@ -39,6 +39,7 @@ import tarfile
...
@@ -39,6 +39,7 @@ import tarfile
import
tempfile
import
tempfile
import
time
import
time
from
six.moves
import
xmlrpc_client
as
xmlrpclib
,
range
from
six.moves
import
xmlrpc_client
as
xmlrpclib
,
range
from
six.moves.configparser
import
ConfigParser
from
supervisor
import
xmlrpc
from
supervisor
import
xmlrpc
...
@@ -112,7 +113,8 @@ class Software(object):
...
@@ -112,7 +113,8 @@ class Software(object):
download_from_binary_cache_url_blacklist
=
None
,
download_from_binary_cache_url_blacklist
=
None
,
upload_to_binary_cache_url_blacklist
=
None
,
upload_to_binary_cache_url_blacklist
=
None
,
software_min_free_space
=
None
,
software_min_free_space
=
None
,
buildout_debug
=
False
,):
buildout_debug
=
False
,
shared_part_list
=
None
):
"""Initialisation of class parameters
"""Initialisation of class parameters
"""
"""
...
@@ -127,6 +129,7 @@ class Software(object):
...
@@ -127,6 +129,7 @@ class Software(object):
self
.
software_url_hash
=
md5digest
(
self
.
url
)
self
.
software_url_hash
=
md5digest
(
self
.
url
)
self
.
software_path
=
os
.
path
.
join
(
self
.
software_root
,
self
.
software_path
=
os
.
path
.
join
(
self
.
software_root
,
self
.
software_url_hash
)
self
.
software_url_hash
)
self
.
shared_part_list
=
shared_part_list
self
.
buildout
=
buildout
self
.
buildout
=
buildout
self
.
buildout_debug
=
buildout_debug
self
.
buildout_debug
=
buildout_debug
self
.
logger
=
logger
self
.
logger
=
logger
...
@@ -260,7 +263,7 @@ class Software(object):
...
@@ -260,7 +263,7 @@ class Software(object):
try
:
try
:
buildout_cfg
=
os
.
path
.
join
(
self
.
software_path
,
'buildout.cfg'
)
buildout_cfg
=
os
.
path
.
join
(
self
.
software_path
,
'buildout.cfg'
)
if
not
os
.
path
.
exists
(
buildout_cfg
):
if
not
os
.
path
.
exists
(
buildout_cfg
):
self
.
_create_buildout_profile
(
buildout_cfg
,
self
.
url
)
self
.
_create_buildout_profile
(
buildout_cfg
,
self
.
url
,
self
.
shared_part_list
)
additional_parameters
=
list
(
self
.
_additional_buildout_parameters
(
extends_cache
))
additional_parameters
=
list
(
self
.
_additional_buildout_parameters
(
extends_cache
))
additional_parameters
.
extend
([
'-c'
,
buildout_cfg
])
additional_parameters
.
extend
([
'-c'
,
buildout_cfg
])
...
@@ -292,9 +295,13 @@ class Software(object):
...
@@ -292,9 +295,13 @@ class Software(object):
if
f
is
not
None
:
if
f
is
not
None
:
f
.
close
()
f
.
close
()
def
_create_buildout_profile
(
self
,
buildout_cfg
,
url
):
def
_create_buildout_profile
(
self
,
buildout_cfg
,
url
,
shared_part_list
):
parser
=
ConfigParser
()
parser
.
add_section
(
'buildout'
)
parser
.
set
(
'buildout'
,
'extends'
,
url
)
parser
.
set
(
'buildout'
,
'shared-parts'
,
shared_part_list
)
with
open
(
buildout_cfg
,
'w'
)
as
fout
:
with
open
(
buildout_cfg
,
'w'
)
as
fout
:
fout
.
write
(
'[buildout]
\
n
extends = '
+
url
+
'
\
n
'
)
parser
.
write
(
fout
)
self
.
_set_ownership
(
buildout_cfg
)
self
.
_set_ownership
(
buildout_cfg
)
def
uploadSoftwareRelease
(
self
,
tarpath
):
def
uploadSoftwareRelease
(
self
,
tarpath
):
...
...
slapos/grid/slapgrid.py
View file @
dbab6068
...
@@ -241,6 +241,7 @@ def create_slapgrid_object(options, logger):
...
@@ -241,6 +241,7 @@ def create_slapgrid_object(options, logger):
return
Slapgrid
(
software_root
=
op
[
'software_root'
],
return
Slapgrid
(
software_root
=
op
[
'software_root'
],
instance_root
=
op
[
'instance_root'
],
instance_root
=
op
[
'instance_root'
],
shared_part_list
=
op
.
get
(
'shared_part_list'
,
''
),
master_url
=
op
[
'master_url'
],
master_url
=
op
[
'master_url'
],
computer_id
=
op
[
'computer_id'
],
computer_id
=
op
[
'computer_id'
],
buildout
=
op
.
get
(
'buildout'
),
buildout
=
op
.
get
(
'buildout'
),
...
@@ -340,6 +341,7 @@ class Slapgrid(object):
...
@@ -340,6 +341,7 @@ class Slapgrid(object):
firewall_conf
=
{},
firewall_conf
=
{},
config
=
None
,
config
=
None
,
buildout_debug
=
False
,
buildout_debug
=
False
,
shared_part_list
=
None
):
):
"""Makes easy initialisation of class parameters"""
"""Makes easy initialisation of class parameters"""
# Parses arguments
# Parses arguments
...
@@ -405,6 +407,7 @@ class Slapgrid(object):
...
@@ -405,6 +407,7 @@ class Slapgrid(object):
self
.
firewall_conf
=
firewall_conf
self
.
firewall_conf
=
firewall_conf
self
.
config
=
config
self
.
config
=
config
self
.
_manager_list
=
slapmanager
.
from_config
(
config
)
self
.
_manager_list
=
slapmanager
.
from_config
(
config
)
self
.
shared_part_list
=
shared_part_list
or
''
def
_getWatchdogLine
(
self
):
def
_getWatchdogLine
(
self
):
invocation_list
=
[
WATCHDOG_PATH
]
invocation_list
=
[
WATCHDOG_PATH
]
...
@@ -562,7 +565,8 @@ stderr_logfile_backups=1
...
@@ -562,7 +565,8 @@ stderr_logfile_backups=1
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_ca_file
=
self
.
shadir_ca_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_cert_file
=
self
.
shadir_cert_file
,
shadir_key_file
=
self
.
shadir_key_file
,
shadir_key_file
=
self
.
shadir_key_file
,
software_min_free_space
=
self
.
software_min_free_space
)
software_min_free_space
=
self
.
software_min_free_space
,
shared_part_list
=
self
.
shared_part_list
)
# call manager for every software release
# call manager for every software release
for
manager
in
self
.
_manager_list
:
for
manager
in
self
.
_manager_list
:
...
...
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