"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "storlets/gateway/gateways/docker/runtime.py" between
storlets-6.0.0.tar.gz and storlets-7.0.0.tar.gz

About: OpenStack Swift Storlets extend Swift with the capability to run computation near the data in a secure and isolated manner.
The "Wallaby" series (latest release).

runtime.py  (storlets-6.0.0):runtime.py  (storlets-7.0.0)
skipping to change at line 230 skipping to change at line 230
self.storlet_daemon_thread_pool_size = \ self.storlet_daemon_thread_pool_size = \
int(conf.get('storlet_daemon_thread_pool_size', 5)) int(conf.get('storlet_daemon_thread_pool_size', 5))
self.storlet_daemon_debug_level = \ self.storlet_daemon_debug_level = \
conf.get('storlet_daemon_debug_level', 'DEBUG') conf.get('storlet_daemon_debug_level', 'DEBUG')
# TODO(change logger's route if possible) # TODO(change logger's route if possible)
self.logger = logger self.logger = logger
self.default_docker_image_name = \ self.default_docker_image_name = \
conf.get('default_docker_image_name', conf.get('default_docker_image_name',
'ubuntu_18.04_jre11_storlets') 'ubuntu_20.04_jre11_storlets')
def ping(self): def ping(self):
""" """
Ping to daemon factory process inside container Ping to daemon factory process inside container
:returns: 1 when the daemon factory is responsive :returns: 1 when the daemon factory is responsive
0 when the daemon factory is not responsive 0 when the daemon factory is not responsive
-1 when it fails to send command to the process -1 when it fails to send command to the process
""" """
pipe_path = self.paths.host_factory_pipe pipe_path = self.paths.host_factory_pipe
skipping to change at line 427 skipping to change at line 427
for dep in dependencies] for dep in dependencies]
return class_path + ':' + ':'.join(dep_path_list) return class_path + ':' + ':'.join(dep_path_list)
def activate_storlet_daemon(self, sreq, cache_updated=True): def activate_storlet_daemon(self, sreq, cache_updated=True):
storlet_daemon_status = \ storlet_daemon_status = \
self.get_storlet_daemon_status(sreq.storlet_main) self.get_storlet_daemon_status(sreq.storlet_main)
if (storlet_daemon_status == -1): if (storlet_daemon_status == -1):
# We failed to send a command to the factory. # We failed to send a command to the factory.
# Best we can do is execute the container. # Best we can do is execute the container.
self.logger.debug('Failed to check Storlet daemon status, ' self.logger.debug('Failed to check the storlet daemon status. '
'restart Docker container') 'Restart Docker container')
self.restart() self.restart()
storlet_daemon_status = 0 storlet_daemon_status = 0
if (cache_updated is True and storlet_daemon_status == 1): if (cache_updated is True and storlet_daemon_status == 1):
# The cache was updated while the daemon is running we need to # The cache was updated while the daemon is running we need to
# stop it. # stop it.
self.logger.debug('The cache was updated, and the storlet daemon ' self.logger.debug('The cache was updated, and the storlet daemon '
'is running. Stopping daemon') 'is running. Stopping daemon')
res = self.stop_storlet_daemon(sreq.storlet_main) res = self.stop_storlet_daemon(sreq.storlet_main)
if res != 1: if res != 1:
self.logger.warning('Failed to stop the storlet daemon. '
'Restart Docker container')
self.restart() self.restart()
else: else:
self.logger.debug('Deamon stopped') self.logger.debug('Deamon stopped')
storlet_daemon_status = 0 storlet_daemon_status = 0
if (storlet_daemon_status == 0): if (storlet_daemon_status == 0):
self.logger.debug('Going to start storlet daemon!') self.logger.debug('Going to start the storlet daemon!')
# TODO(takashi): This is not needed for python application # TODO(takashi): This is not needed for python application
classpath = self._get_storlet_classpath( classpath = self._get_storlet_classpath(
sreq.storlet_main, sreq.storlet_id, sreq.dependencies) sreq.storlet_main, sreq.storlet_id, sreq.dependencies)
daemon_status = self.start_storlet_daemon( daemon_status = self.start_storlet_daemon(
classpath, sreq.storlet_main, sreq.storlet_language, classpath, sreq.storlet_main, sreq.storlet_language,
sreq.storlet_language_version) sreq.storlet_language_version)
if daemon_status != 1: if daemon_status != 1:
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)