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 almost 2 years ago. Updated 7 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
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 almost 2 years 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 almost 2 years 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 almost 2 years 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 almost 2 years ago

  • Description updated (diff)

#3 Updated by ehelms@redhat.com almost 2 years 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 almost 2 years ago

I propose this be added to the sprint.

#5 Updated by daviddavis almost 2 years 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 almost 2 years ago

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

#7 Updated by CodeHeeler almost 2 years ago

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

#8 Updated by rchan almost 2 years ago

  • Sprint changed from Sprint 40 to Sprint 41

#9 Updated by vdusek almost 2 years ago

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

#10 Updated by vdusek almost 2 years ago

  • Status changed from ASSIGNED to NEW

#11 Updated by vdusek almost 2 years ago

  • Assignee deleted (vdusek)

#12 Updated by jortel@redhat.com almost 2 years ago

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

#13 Updated by jortel@redhat.com almost 2 years 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 almost 2 years ago

  • Sprint changed from Sprint 41 to Sprint 42

#15 Updated by bmbouter almost 2 years ago

  • Parent task set to #3981

#16 Updated by jortel@redhat.com almost 2 years ago

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

#17 Updated by rchan almost 2 years ago

  • Sprint changed from Sprint 42 to Sprint 43

#18 Updated by bmbouter almost 2 years ago

  • Sprint deleted (Sprint 43)

This will be resolved by the epic 3981.

#19 Updated by dkliban@redhat.com almost 2 years ago

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

#21 Updated by Anonymous almost 2 years ago

  • Status changed from POST to MODIFIED

#22 Updated by daviddavis about 1 year ago

  • Sprint/Milestone set to 3.0.0

#23 Updated by bmbouter about 1 year ago

  • Tags deleted (Pulp 3)

#24 Updated by bmbouter 7 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF