...
 
Commits (3)
......@@ -8,6 +8,7 @@ cert_file = /etc/opt/slapos/ssl/computer.crt
certificate_repository_path = /etc/opt/slapos/ssl/partition_pki
software_root = /opt/slapgrid
instance_root = /srv/slapgrid
shared_software_root = /opt/slapgrid/shared
[slapformat]
# Replace by your network interface providing IPv6 if you don't use re6st
......
......@@ -248,7 +248,7 @@ class Computer(object):
ipv6_interface=None, software_user='slapsoft',
tap_gateway_interface=None,
instance_root=None, software_root=None, instance_storage_home=None,
partition_list=None, config=None):
shared_software_root=None, partition_list=None, config=None):
"""
Attributes:
reference: str, the reference of the computer.
......@@ -270,6 +270,7 @@ class Computer(object):
"Computer's instance_root and software_root must not be empty!"
self.software_root = software_root
self.instance_root = instance_root
self.shared_software_root = shared_software_root
self.instance_storage_home = instance_storage_home
# The following properties are updated on update() method
......@@ -540,7 +541,12 @@ class Computer(object):
network_interface_name = self.interface.name
self._addUniqueLocalAddressIpv6(network_interface_name)
for path in self.instance_root, self.software_root:
path_list = [self.instance_root, self.software_root]
if self.shared_software_root is not None:
path_list.extend(self.shared_software_root.split(","))
for path in path_list:
if not os.path.exists(path):
os.makedirs(path, 0o755)
else:
......
......@@ -109,7 +109,8 @@ class Software(object):
download_binary_dir_url=None, upload_binary_dir_url=None,
download_from_binary_cache_url_blacklist=None,
upload_to_binary_cache_url_blacklist=None,
software_min_free_space=None):
software_min_free_space=None,
shared_software_root=None):
"""Initialisation of class parameters
"""
......@@ -124,6 +125,7 @@ class Software(object):
self.software_url_hash = md5digest(self.url)
self.software_path = os.path.join(self.software_root,
self.software_url_hash)
self.shared_software_root = shared_software_root
self.buildout = buildout
self.logger = logger
self.signature_private_key_file = signature_private_key_file
......@@ -259,6 +261,10 @@ class Software(object):
additional_parameters = list(self._additional_buildout_parameters(extends_cache))
additional_parameters.extend(['-c', buildout_cfg])
if self.shared_software_root:
additional_parameters.append('buildout:shared-software-root=%s' %
self.shared_software_root)
utils.bootstrapBuildout(path=self.software_path,
buildout=self.buildout,
logger=self.logger,
......
......@@ -556,7 +556,8 @@ stderr_logfile_backups=1
shadir_ca_file=self.shadir_ca_file,
shadir_cert_file=self.shadir_cert_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_software_root=self.config.get('shared_software_root'),)
# call manager for every software release
for manager in self._manager_list:
......