diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1e805fafc9..1ee5e063f0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -51,6 +51,8 @@ Changed * Update various internal dependencies to latest stable versions (greenlet, pymongo, pytz, stevedore, tooz). #4410 +* Improve ``st2.conf`` migration for the new services by using prod-friendly logging settings by default #4415 + Fixed ~~~~~ diff --git a/conf/st2.conf.sample b/conf/st2.conf.sample index 1cae55ad46..bc21be5182 100644 --- a/conf/st2.conf.sample +++ b/conf/st2.conf.sample @@ -19,7 +19,7 @@ virtualenv_binary = /usr/bin/virtualenv # Python 3 binary which will be used by Python actions for packs which use Python 3 virtual environment python3_binary = /usr/bin/python3 # location of the logging.conf file -logging = conf/logging.conf +logging = /etc/st2/logging.actionrunner.conf # True to store and stream action output (stdout and stderr) in real-time. stream_output = True # List of virtualenv options to be passsed to "virtualenv" command that creates pack virtualenv. @@ -31,7 +31,7 @@ python_binary = /usr/bin/python # List of origins allowed for api, auth and stream allow_origin = http://127.0.0.1:3000 # comma separated list allowed here. # location of the logging.conf file -logging = conf/logging.conf +logging = /etc/st2/logging.api.conf # Maximum limit (page size) argument which can be specified by the user in a query string. max_page_size = 100 # True to mask secrets in the API responses @@ -50,7 +50,7 @@ port = 9101 # Enable authentication middleware. enable = True # Path to the logging config. -logging = conf/logging.conf +logging = /etc/st2/logging.auth.conf # Base URL to the API endpoint excluding the version api_url = None # Service token ttl in seconds. @@ -138,7 +138,7 @@ port = 27017 [exporter] # location of the logging.exporter.conf file -logging = conf/logging.exporter.conf +logging = /etc/st2/logging.exporter.conf # Directory to dump data to. dump_dir = /opt/stackstorm/exports/ @@ -148,7 +148,7 @@ action_executions_ttl = None # Trigger instances older than this value (days) will be automatically deleted. trigger_instances_ttl = None # Location of the logging configuration file. -logging = conf/logging.garbagecollector.conf +logging = /etc/st2/logging.garbagecollector.conf # How long to wait / sleep (in seconds) between collection of different object types. sleep_delay = 2 # Set to True to perform garbage collection on Inquiries (based on the TTL value per Inquiry) @@ -226,7 +226,7 @@ retry_exp_max_msec = 300000 [notifier] # Location of the logging configuration file. -logging = conf/logging.notifier.conf +logging = /etc/st2/logging.notifier.conf [packs] # Enable/Disable support for pack common libs. Setting this config to ``True`` would allow you to place common library code for sensors and actions in lib/ folder in packs and use them in python sensors and actions. See https://docs.stackstorm.com/reference/sharing_code_sensors_actions.html for details. @@ -238,7 +238,7 @@ query_interval = 5 # Sleep delay in between queries when query queue is empty. empty_q_sleep_time = 1 # Location of the logging configuration file. -logging = conf/logging.resultstracker.conf +logging = /etc/st2/logging.resultstracker.conf # Sleep delay for query when there is no more worker in pool. no_workers_sleep_time = 1 # Number of threads to use to query external workflow systems. @@ -246,7 +246,7 @@ thread_pool_size = 10 [rulesengine] # Location of the logging configuration file. -logging = conf/logging.rulesengine.conf +logging = /etc/st2/logging.rulesengine.conf [scheduler] # The frequency for rescheduling action executions. @@ -268,7 +268,7 @@ partition_provider = {'name': 'default'} # Run in a single sensor mode where parent process exits when a sensor crashes / dies. This is useful in environments where partitioning, sensor process life cycle and failover is handled by a 3rd party service such as kubernetes. single_sensor_mode = False # location of the logging.conf file -logging = conf/logging.sensorcontainer.conf +logging = /etc/st2/logging.sensorcontainer.conf # name of the sensor node. sensor_node_name = sensornode1 @@ -292,7 +292,7 @@ heartbeat = 25 # StackStorm stream API server host host = 127.0.0.1 # location of the logging.conf file -logging = conf/logging.conf +logging = /etc/st2/logging.stream.conf # StackStorm API stream, server port port = 9102 @@ -330,7 +330,7 @@ enable = True # Timezone pertaining to the location where st2 is run. local_timezone = America/Los_Angeles # Location of the logging configuration file. -logging = conf/logging.timersengine.conf +logging = /etc/st2/logging.timersengine.conf [timersengine] # Specify to enable timer service. @@ -338,7 +338,7 @@ enable = True # Timezone pertaining to the location where st2 is run. local_timezone = America/Los_Angeles # Location of the logging configuration file. -logging = conf/logging.timersengine.conf +logging = /etc/st2/logging.timersengine.conf [webui] # Base https URL to access st2 Web UI. This is used to construct history URLs that are sent out when chatops is used to kick off executions. @@ -346,5 +346,5 @@ webui_base_url = https://localhost [workflow_engine] # Location of the logging configuration file. -logging = conf/logging.workflowengine.conf +logging = /etc/st2/logging.workflowengine.conf diff --git a/conf/st2.prod.conf b/conf/st2.prod.conf deleted file mode 100644 index 39d72a5f66..0000000000 --- a/conf/st2.prod.conf +++ /dev/null @@ -1,84 +0,0 @@ -# System-wide configuration - -[api] -# Host and port to bind the API server. -host = 127.0.0.1 -port = 9101 -logging = /etc/st2api/logging.conf -mask_secrets = True -# allow_origin is required for handling CORS in st2 web UI. -# allow_origin = http://myhost1.example.com:3000,http://myhost2.example.com:3000 - -[stream] -logging = /etc/st2stream/logging.conf - -[sensorcontainer] -logging = /etc/st2reactor/logging.sensorcontainer.conf - -[rulesengine] -logging = /etc/st2reactor/logging.rulesengine.conf - -[actionrunner] -logging = /etc/st2actions/logging.conf - -[auth] -host = 127.0.0.1 -port = 9100 -use_ssl = False -debug = False -enable = True -logging = /etc/st2auth/logging.conf - -mode = proxy - -# Note: Settings below are only used in "standalone" mode -backend = flat_file -backend_kwargs = - -# Base URL to the API endpoint excluding the version (e.g. http://myhost.net:9101/) -api_url = - -[garbagecollector] -logging = /etc/st2reactor/logging.garbagecollector.conf - -[system] -base_path = /opt/stackstorm - -[syslog] -host = 127.0.0.1 -port = 514 -facility = local7 -protocol = udp - -[webui] -# webui_base_url = https://mywebhost.domain - -[log] -excludes = requests,paramiko -redirect_stderr = False -mask_secrets = True - -[system_user] -user = stanley -ssh_key_file = /home/stanley/.ssh/stanley_rsa - -[messaging] -url = amqp://guest:guest@127.0.0.1:5672/ - -[ssh_runner] -remote_dir = /tmp - -[resultstracker] -logging = /etc/st2actions/logging.resultstracker.conf - -[notifier] -logging = /etc/st2actions/logging.notifier.conf - -[timersengine] -logging = /etc/st2timersengine/logging.st2timersengine.conf - -[workflow_engine] -logging = /etc/st2actions/logging.workflowengine.conf - -[scheduler] -logging = /etc/st2actions/logging.scheduler.conf diff --git a/st2actions/st2actions/notifier/config.py b/st2actions/st2actions/notifier/config.py index 7e107caf4e..7d727e9732 100644 --- a/st2actions/st2actions/notifier/config.py +++ b/st2actions/st2actions/notifier/config.py @@ -47,7 +47,7 @@ def _register_common_opts(): def _register_notifier_opts(): notifier_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.notifier.conf', + 'logging', default='/etc/st2/logging.notifier.conf', help='Location of the logging configuration file.') ] diff --git a/st2actions/st2actions/resultstracker/config.py b/st2actions/st2actions/resultstracker/config.py index 34ef04c04d..e2e74aa22d 100644 --- a/st2actions/st2actions/resultstracker/config.py +++ b/st2actions/st2actions/resultstracker/config.py @@ -47,7 +47,7 @@ def _register_common_opts(): def _register_results_tracker_opts(): resultstracker_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.resultstracker.conf', + 'logging', default='/etc/st2/logging.resultstracker.conf', help='Location of the logging configuration file.') ] diff --git a/st2actions/st2actions/scheduler/config.py b/st2actions/st2actions/scheduler/config.py index 628990861d..b6050fcfe7 100644 --- a/st2actions/st2actions/scheduler/config.py +++ b/st2actions/st2actions/scheduler/config.py @@ -42,7 +42,7 @@ def _register_service_opts(): scheduler_opts = [ cfg.StrOpt( 'logging', - default='conf/logging.scheduler.conf', + default='/etc/st2/logging.scheduler.conf', help='Location of the logging configuration file.' ) ] diff --git a/st2actions/st2actions/workflows/config.py b/st2actions/st2actions/workflows/config.py index 9497c1c401..ac659ef29c 100644 --- a/st2actions/st2actions/workflows/config.py +++ b/st2actions/st2actions/workflows/config.py @@ -42,7 +42,7 @@ def _register_service_opts(): wf_engine_opts = [ cfg.StrOpt( 'logging', - default='conf/logging.workflowengine.conf', + default='/etc/st2/logging.workflowengine.conf', help='Location of the logging configuration file.' ) ] diff --git a/st2api/st2api/config.py b/st2api/st2api/config.py index 2483990542..bfee0c04a5 100644 --- a/st2api/st2api/config.py +++ b/st2api/st2api/config.py @@ -72,7 +72,7 @@ def _register_app_opts(): logging_opts = [ cfg.BoolOpt('debug', default=False), cfg.StrOpt( - 'logging', default='conf/logging.conf', + 'logging', default='/etc/st2/logging.api.conf', help='location of the logging.conf file'), cfg.IntOpt( 'max_page_size', default=100, diff --git a/st2auth/st2auth/config.py b/st2auth/st2auth/config.py index 34daedbf7d..0f810a710f 100644 --- a/st2auth/st2auth/config.py +++ b/st2auth/st2auth/config.py @@ -63,7 +63,7 @@ def _register_app_opts(): 'key', default='/etc/apache2/ssl/mycert.key', help='Path to the SSL private key file. Only used when "use_ssl" is specified.'), cfg.StrOpt( - 'logging', default='conf/logging.conf', + 'logging', default='/etc/st2/logging.auth.conf', help='Path to the logging config.'), cfg.BoolOpt( 'debug', default=False, diff --git a/st2common/Makefile b/st2common/Makefile index ab54ade247..e72dd06993 100644 --- a/st2common/Makefile +++ b/st2common/Makefile @@ -1,48 +1,3 @@ -# <<<< TO DEPRICATE -SHELL := /bin/bash -RPM_ROOT=~/rpmbuild -RPM_SOURCES_DIR := $(RPM_ROOT)/SOURCES/ -RPM_SPECS_DIR := $(RPM_ROOT)/SPECS/ -VER=0.4.0 - -COMPONENTS := st2common - -.PHONY: rpm -rpm: - pushd ~ && rpmdev-setuptree && popd - mkdir -p st2 && cp -f ../conf/st2.prod.conf st2/st2.conf - mkdir -p logrotate.d && cp -f ../conf/logrotate.conf logrotate.d/st2.conf - mkdir -p rbac/roles && cp -f ../st2tests/st2tests/fixtures/rbac/roles/role_sample.yaml rbac/roles/sample.yaml - mkdir -p rbac/assignments && cp -f ../st2tests/st2tests/fixtures/rbac/assignments/user_sample.yaml rbac/assignments/sample.yaml - sed -i '/\[actionrunner\]/a python_binary = /usr/bin/python2.7' st2/st2.conf - tar --transform=s~^~$(COMPONENTS)-$(VER)/~ --exclude=correlation -czf $(RPM_SOURCES_DIR)/$(COMPONENTS).tar.gz bin st2 logrotate.d rbac $(COMPONENTS) ../contrib ../tools/ ../requirements.txt - cp packaging/rpm/$(COMPONENTS).spec $(RPM_SPECS_DIR)/ - cd $(RPM_SPECS_DIR) && rpmbuild --clean --rmsource -ba $(COMPONENTS).spec - -.PHONY: rhel-rpm -rhel-rpm: - pushd ~ && rpmdev-setuptree && popd - mkdir -p st2 && cp -f ../conf/st2.prod.conf st2/st2.conf - mkdir -p logrotate.d && cp -f ../conf/logrotate.conf logrotate.d/st2.conf - mkdir -p rbac/roles && cp -f ../st2tests/st2tests/fixtures/rbac/roles/role_sample.yaml rbac/roles/sample.yaml - mkdir -p rbac/assignments && cp -f ../st2tests/st2tests/fixtures/rbac/assignments/user_sample.yaml rbac/assignments/sample.yaml - sed -i '/\[actionrunner\]/a python_binary = /usr/bin/python2.7' st2/st2.conf - tar --transform=s~^~$(COMPONENTS)-$(VER)/~ --exclude=correlation -czf $(RPM_SOURCES_DIR)/$(COMPONENTS).tar.gz bin st2 logrotate.d rbac $(COMPONENTS) ../contrib ../tools/ ../requirements.txt - cp packaging/rpm/$(COMPONENTS)-rhel6.spec $(RPM_SPECS_DIR)/ - cd $(RPM_SPECS_DIR) && rpmbuild --clean --rmsource -ba $(COMPONENTS)-rhel6.spec - -.PHONY: deb -deb: - mkdir -p ~/debbuild - mkdir -p st2 && cp -f ../conf/st2.prod.conf st2/st2.conf - mkdir -p logrotate.d && cp -f ../conf/logrotate.conf logrotate.d/st2.conf - mkdir -p rbac/roles && cp -f ../st2tests/st2tests/fixtures/rbac/roles/role_sample.yaml rbac/roles/sample.yaml - mkdir -p rbac/assignments && cp -f ../st2tests/st2tests/fixtures/rbac/assignments/user_sample.yaml rbac/assignments/sample.yaml - tar --transform=s~^~$(COMPONENTS)-$(VER)/~ --exclude=correlation -czf ~/$(COMPONENTS).tar.gz bin st2 logrotate.d rbac $(COMPONENTS) ../contrib ../tools/ ../requirements.txt packaging/debian - pushd ~ && tar -xzf $(COMPONENTS).tar.gz && cd $(COMPONENTS)-$(VER) && cp -Rf packaging/debian ./ && dpkg-buildpackage -us -uc -b && popd - cp -f ~/$(COMPONENT)*.deb ~/debbuild/ -# >>>> - WHEELDIR ?= /tmp/wheelhouse ST2_COMPONENT := $(notdir $(CURDIR)) ST2PKG_RELEASE ?= 1 diff --git a/st2common/st2common/config.py b/st2common/st2common/config.py index fb5b96c11a..85a6be2c60 100644 --- a/st2common/st2common/config.py +++ b/st2common/st2common/config.py @@ -325,7 +325,7 @@ def register_opts(ignore_errors=False): action_runner_opts = [ # Common runner options cfg.StrOpt( - 'logging', default='conf/logging.conf', + 'logging', default='/etc/st2/logging.actionrunner.conf', help='location of the logging.conf file'), # Python runner options diff --git a/st2exporter/st2exporter/config.py b/st2exporter/st2exporter/config.py index a716df66f7..84a70debb6 100644 --- a/st2exporter/st2exporter/config.py +++ b/st2exporter/st2exporter/config.py @@ -59,7 +59,7 @@ def _register_app_opts(): logging_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.exporter.conf', + 'logging', default='/etc/st2/logging.exporter.conf', help='location of the logging.exporter.conf file') ] diff --git a/st2reactor/st2reactor/garbage_collector/config.py b/st2reactor/st2reactor/garbage_collector/config.py index 15de54bfa8..3aff4eec0f 100644 --- a/st2reactor/st2reactor/garbage_collector/config.py +++ b/st2reactor/st2reactor/garbage_collector/config.py @@ -49,7 +49,7 @@ def _register_common_opts(): def _register_garbage_collector_opts(): logging_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.garbagecollector.conf', + 'logging', default='/etc/st2/logging.garbagecollector.conf', help='Location of the logging configuration file.') ] diff --git a/st2reactor/st2reactor/rules/config.py b/st2reactor/st2reactor/rules/config.py index 767490540f..5750bbac07 100644 --- a/st2reactor/st2reactor/rules/config.py +++ b/st2reactor/st2reactor/rules/config.py @@ -47,7 +47,7 @@ def _register_common_opts(): def _register_rules_engine_opts(): logging_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.rulesengine.conf', + 'logging', default='/etc/st2/logging.rulesengine.conf', help='Location of the logging configuration file.') ] diff --git a/st2reactor/st2reactor/sensor/config.py b/st2reactor/st2reactor/sensor/config.py index 90d9d5e974..21adb29e2b 100644 --- a/st2reactor/st2reactor/sensor/config.py +++ b/st2reactor/st2reactor/sensor/config.py @@ -46,7 +46,7 @@ def _register_common_opts(ignore_errors=False): def _register_sensor_container_opts(ignore_errors=False): logging_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.sensorcontainer.conf', + 'logging', default='/etc/st2/logging.sensorcontainer.conf', help='location of the logging.conf file') ] diff --git a/st2reactor/st2reactor/timer/config.py b/st2reactor/st2reactor/timer/config.py index 619c0b0788..a4416ede97 100644 --- a/st2reactor/st2reactor/timer/config.py +++ b/st2reactor/st2reactor/timer/config.py @@ -47,7 +47,7 @@ def _register_timers_engine_opts(): # under ``timer`` section as well as ``timersengine``. logging_opts = [ cfg.StrOpt( - 'logging', default='conf/logging.timersengine.conf', + 'logging', default='/etc/st2/logging.timersengine.conf', help='Location of the logging configuration file.') ] diff --git a/st2stream/st2stream/config.py b/st2stream/st2stream/config.py index 3d48e9e846..99f6be9883 100644 --- a/st2stream/st2stream/config.py +++ b/st2stream/st2stream/config.py @@ -63,7 +63,7 @@ def _register_app_opts(): 'debug', default=False, help='Specify to enable debug mode.'), cfg.StrOpt( - 'logging', default='conf/logging.conf', + 'logging', default='/etc/st2/logging.stream.conf', help='location of the logging.conf file') ]