Project

Profile

Help

Issue #3879

Issue #3981: Switch Pulp3 settings to Dynaconf

Cannot opt out of settings defaults due to merging of settings

Added by ehelms@redhat.com over 1 year ago. Updated 8 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

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


Checklist

Associated revisions

Revision e1fcdda1 View on GitHub
Added by Bruno Rocha about 1 year ago

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

Revision e1fcdda1 View on GitHub
Added by Bruno Rocha about 1 year ago

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

History

#1 Updated by bmbouter over 1 year ago

  • 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.

#2 Updated by bmbouter over 1 year ago

  • Description updated (diff)

#3 Updated by ehelms@redhat.com over 1 year ago

Updated description reads good for talking the merge. The issues around console logging by default will be raised by me to the list.

#4 Updated by bmbouter over 1 year ago

I propose this be added to the sprint.

#5 Updated by daviddavis over 1 year ago

+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.

#6 Updated by daviddavis over 1 year ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes

#7 Updated by CodeHeeler over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 40

#8 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 40 to Sprint 41

#9 Updated by vdusek over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to vdusek

#10 Updated by vdusek over 1 year ago

  • Status changed from ASSIGNED to NEW

#11 Updated by vdusek over 1 year ago

  • Assignee deleted (vdusek)

#12 Updated by jortel@redhat.com over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com

#13 Updated by jortel@redhat.com over 1 year ago

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.

#14 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 41 to Sprint 42

#15 Updated by bmbouter over 1 year ago

  • Parent task set to #3981

#16 Updated by jortel@redhat.com about 1 year ago

  • Status changed from ASSIGNED to NEW
  • Assignee deleted (jortel@redhat.com)

#17 Updated by rchan about 1 year ago

  • Sprint changed from Sprint 42 to Sprint 43

#18 Updated by bmbouter about 1 year ago

  • Sprint deleted (Sprint 43)

This will be resolved by the epic 3981.

#19 Updated by dkliban@redhat.com about 1 year ago

  • Status changed from NEW to POST
  • Assignee set to dkliban@redhat.com

#21 Updated by Anonymous about 1 year ago

  • Status changed from POST to MODIFIED

#22 Updated by daviddavis 8 months ago

  • Sprint/Milestone set to 3.0

#23 Updated by bmbouter 8 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF