Project

Profile

Help

Issue #3879

closed

Issue #3981: Switch Pulp3 settings to Dynaconf

Cannot opt out of settings defaults due to merging of settings

Added by ehelms@redhat.com almost 6 years ago. Updated over 4 years 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:
Quarter:

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

Actions #1

Updated by bmbouter almost 6 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.

Actions #2

Updated by bmbouter almost 6 years ago

  • Description updated (diff)
Actions #3

Updated by ehelms@redhat.com almost 6 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.

Actions #4

Updated by bmbouter almost 6 years ago

I propose this be added to the sprint.

Actions #5

Updated by daviddavis almost 6 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.

Actions #6

Updated by daviddavis almost 6 years ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes
Actions #7

Updated by CodeHeeler over 5 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 40
Actions #8

Updated by rchan over 5 years ago

  • Sprint changed from Sprint 40 to Sprint 41
Actions #9

Updated by vdusek over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to vdusek
Actions #10

Updated by vdusek over 5 years ago

  • Status changed from ASSIGNED to NEW
Actions #11

Updated by vdusek over 5 years ago

  • Assignee deleted (vdusek)
Actions #12

Updated by jortel@redhat.com over 5 years ago

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

Updated by jortel@redhat.com over 5 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.

Actions #14

Updated by rchan over 5 years ago

  • Sprint changed from Sprint 41 to Sprint 42
Actions #15

Updated by bmbouter over 5 years ago

  • Parent issue set to #3981
Actions #16

Updated by jortel@redhat.com over 5 years ago

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

Updated by rchan over 5 years ago

  • Sprint changed from Sprint 42 to Sprint 43
Actions #18

Updated by bmbouter over 5 years ago

  • Sprint deleted (Sprint 43)

This will be resolved by the epic 3981.

Actions #19

Updated by dkliban@redhat.com over 5 years ago

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

Added by Bruno Rocha over 5 years ago

Revision e1fcdda1 | View on GitHub

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

Added by Bruno Rocha over 5 years ago

Revision e1fcdda1 | View on GitHub

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

Actions #21

Updated by Anonymous over 5 years ago

  • Status changed from POST to MODIFIED
Actions #22

Updated by daviddavis about 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #23

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #24

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF