Minor Fixes
3 minor fixes discovered while debugging the python long running storlet. 1. Upon timeout middleware sends a cancel command that is processed by manager.py who kills the process. the os.kill call was missing the signal to send 2. The ansible script that is used to re-deploy the container locally once a container side code is updated had a typo 3. The storlet_timeout was written to the swift conf files instead of the gatewat conf file and so was effectively non configurable TrivialFix Change-Id: I36e0afb3e21ba2ca59add16fe86bfafcdad26a11
This commit is contained in:
parent
8d75f143d9
commit
a2d3034fb3
@ -278,10 +278,12 @@ that do not appear in the above configurable installation_vars.yml
|
||||
- "storlet_dependency". The name of the container where dependencies are uploaded to.
|
||||
- "storlet_log". Curently not in use. Placeholder for future log upload feature.
|
||||
- "storlet_images". The name of the container for uploading user tailored images.
|
||||
- "storlet_timeout". The time Swift gives the a storlet to start producung output.
|
||||
- "storlet_gateway_module". The class implementing the storlets plugin used. Currently, we have only one
|
||||
such plugin.
|
||||
- "storlet_execute_on_proxy_only". Controls whether storlets will run only on the proxy servers.
|
||||
|
||||
- The config parameters of the storlet gateway plugin
|
||||
|
||||
- "storlet_timeout". The time Swift gives the a storlet to start producung output.
|
||||
- "restart_linux_container_timeout": The number of times the middleware tries to spwans a Docker container
|
||||
before giving up.
|
||||
|
||||
|
@ -359,7 +359,6 @@ do the following:
|
||||
use = egg:storlets#storlet_handler
|
||||
storlet_container = storlet
|
||||
storlet_dependency = dependency
|
||||
storlet_timeout = 40
|
||||
storlet_gateway_module = docker
|
||||
storlet_gateway_conf = /etc/swift/storlet_docker_gateway.conf
|
||||
storlet_execute_on_proxy_only = false
|
||||
@ -384,7 +383,6 @@ otherwise the file is typically /etc/swift/object-server.conf
|
||||
use = egg:storlets#storlet_handler
|
||||
storlet_container = storlet
|
||||
storlet_dependency = dependency
|
||||
storlet_timeout = 40
|
||||
storlet_gateway_module = docker
|
||||
storlet_gateway_conf = /etc/swift/storlet_docker_gateway.conf
|
||||
storlet_execute_on_proxy_only = false
|
||||
@ -404,6 +402,7 @@ with the following content:
|
||||
script_dir = /home/docker_device/scripts
|
||||
storlets_dir = /home/docker_device/storlets/scopes
|
||||
pipes_dir = /home/docker_device/pipes/scopes
|
||||
storlet_timeout = 40
|
||||
docker_repo =
|
||||
restart_linux_container_timeout = 3
|
||||
|
||||
|
@ -287,7 +287,6 @@ use = egg:swift#xprofile
|
||||
# storlet_dependency = dependency
|
||||
# storlet_logcontainer = storletlog
|
||||
# storlet_execute_on_proxy_only = false
|
||||
# storlet_timeout = 40
|
||||
# storlet_gateway_module = swift.common.middleware.storlet_common.StorletStubGateway
|
||||
# storlet_gateway_conf = /etc/swift/storlet_stub_gateway.conf
|
||||
# execution_server = object
|
||||
|
@ -631,7 +631,6 @@ use = egg:swift#xprofile
|
||||
# storlet_dependency = dependency
|
||||
# storlet_logcontainer = storletlog
|
||||
# storlet_execute_on_proxy_only = false
|
||||
# storlet_timeout = 40
|
||||
# storlet_gateway_module = docker
|
||||
# storlet_gateway_conf = /etc/swift/storlet_stub_gateway.conf
|
||||
# execution_server = proxy
|
||||
|
@ -146,8 +146,6 @@ def patch_swift_config_file(conf, conf_file, service):
|
||||
conf.get('common-confs', 'storlet_container'))
|
||||
f.write('storlet_dependency = %s\n' %
|
||||
conf.get('common-confs', 'storlet_dependency'))
|
||||
f.write('storlet_timeout = %s\n' %
|
||||
conf.get('common-confs', 'storlet_timeout'))
|
||||
f.write('storlet_gateway_module = %s\n' %
|
||||
conf.get('common-confs', 'storlet_gateway_module'))
|
||||
f.write('storlet_gateway_conf = %s\n' %
|
||||
|
@ -8,3 +8,4 @@ storlets_dir = {{ docker_device }}/storlets/scopes
|
||||
pipes_dir = {{ docker_device }}/pipes/scopes
|
||||
docker_repo = ""
|
||||
restart_linux_container_timeout = {{ restart_linux_container_timeout }}
|
||||
storlet_timeout = {{ storlet_timeout }}
|
||||
|
@ -11,7 +11,6 @@ storlet_middleware = {{ storlet_middleware }}
|
||||
storlet_container = {{ storlet_container }}
|
||||
storlet_dependency = {{ storlet_dependency }}
|
||||
#storlet_log = {{ storlet_log }}
|
||||
storlet_timeout = {{ storlet_timeout }}
|
||||
storlet_gateway_module = {{ storlet_gateway_module }}
|
||||
storlet_gateway_conf = {{ storlet_gateway_conf_file }}
|
||||
storlet_proxy_execution = {{ storlet_execute_on_proxy_only }}
|
||||
|
@ -19,6 +19,7 @@ import os
|
||||
import pwd
|
||||
import sys
|
||||
import uuid
|
||||
import signal
|
||||
from storlets.sbus import SBus
|
||||
from storlets.sbus.command import SBUS_CMD_PREFIX
|
||||
from storlets.agent.daemon.files import StorletInputFile, \
|
||||
@ -259,7 +260,7 @@ class Daemon(object):
|
||||
outfile.write('False: BAD')
|
||||
else:
|
||||
try:
|
||||
os.kill(pid)
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
self._remove_pid(pid)
|
||||
outfile.write('True: OK')
|
||||
except OSError:
|
||||
|
Loading…
Reference in New Issue
Block a user