Issue #3879
closed
Issue #3981: Switch Pulp3 settings to Dynaconf
Cannot opt out of settings defaults due to merging of settings
Status:
CLOSED - CURRENTRELEASE
Description
Issue¶
The pointed issue is that if I want to configure pure console logging (for container environments) I cannot. The syslog handler gets configured and attempts to connect failing. If I try to set my logging configuration like the following, the syslog handler I explicitly try to exclude is added:
logging:
formatters:
simple:
format: "pulp: %(name)s:%(levelname)s: %(message)s"
handlers:
console:
class: logging.StreamHandler
formatter: simple
loggers:
'':
handlers: ["console"]
level: INFO
I have had to hack around this for now via -- https://github.com/ehelms/pulp/commit/8e82d27a6294c2db139ce2ffc41002cc70309777
How can I only use my settings and not "merge" with the defaults.
Solution¶
Update the behavior to be an 'overwrite' from the top level of each. The merge could would only replace user values for default values for the keys: DATABASES, logging, ..., PROFILING
https://github.com/pulp/pulp/blob/12919c2040b3de1a061e647f1f59e7494294d600/pulpcore/pulpcore/app/settings.py#L219-L240
- Subject changed from Can not configure pure console logging, settings merges unwanted content to Cannot opt out of settings defaults due to merging of settings
@ehelms, I agree this design is problematic in several ways. One is the inability to waive included defaults. Also the yaml format overlaid onto Python code here causes some issues as I remember. We should write out some ideas on this ticket I think.
Also I'm +1 to syslog being the default. Maybe at INFO level? How would you feel about highlighting this default change for pulp3 on pulp-dev? If not I'm happy to. Then this ticket can be for the overlay issue.
- Description updated (diff)
Updated description reads good for talking the merge. The issues around console logging by default will be raised by me to the list.
I propose this be added to the sprint.
+1 to adding this to the sprint. At the very least, I'll mark it as a sprint candidate so we consider it at the sprint planning next week.
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
- Triaged changed from No to Yes
- Sprint set to Sprint 40
- Sprint changed from Sprint 40 to Sprint 41
- Status changed from NEW to ASSIGNED
- Assignee set to vdusek
- Status changed from ASSIGNED to NEW
- Assignee deleted (
vdusek)
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Looks like only the console logging (change) has been resolved on @pulp-dev. I don't recall a discussion or consensus reached re: how the .yaml is applied to the settings.py. I'll start the discussion on @pulp-dev just to be sure.
- Sprint changed from Sprint 41 to Sprint 42
- Parent issue set to #3981
- Status changed from ASSIGNED to NEW
- Assignee deleted (
jortel@redhat.com)
- Sprint changed from Sprint 42 to Sprint 43
- Sprint deleted (
Sprint 43)
This will be resolved by the epic 3981.
- Status changed from NEW to POST
- Assignee set to dkliban@redhat.com
- Status changed from POST to MODIFIED
- Sprint/Milestone set to 3.0.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Problem: Pulp can't be configured using environment variables
Solution: use dynaconf to manage all of Pulp configuration settings
This patch also adds pulpcore.rqconfig module that is dynamically generated from the Django settings generated by dynaconf. The rq workers use this module for their configuration.
The default location of the config file is now at
/etc/pulp/settings.py
. Pulp can operate without by relying on environment variables.closes: #3981 https://pulp.plan.io/issues/3981
closes: #3879 https://pulp.plan.io/issues/3879
closes: #3980 https://pulp.plan.io/issues/3980
closes #3618 https://pulp.plan.io/issues/3618
closes: #3943 https://pulp.plan.io/issues/3943