Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote templates to first-level objects #3267

Open
SchoolGuy opened this issue Oct 18, 2022 · 1 comment · May be fixed by #3295
Open

Promote templates to first-level objects #3267

SchoolGuy opened this issue Oct 18, 2022 · 1 comment · May be fixed by #3295
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SchoolGuy
Copy link
Member

SchoolGuy commented Oct 18, 2022

Is your feature request related to a problem?

Currently it is not possible to have an overview of templates that are used during Cobbler runtime. Promoting templates to first-level entities would enable better control over them during runtime.

Provide a detailed description of the proposed feature

During the discussion of #3259 it become evident that it is needed to cache templates during the runtime of Cobbler. Thus it is reasonable to promote templates to first-level objects, so all code is accessing templates equally.

The advantages are:

  • We inform Cobbler users what templates are detected.
  • We open ourselves up to caching templates
  • We have control over the flow of data
  • We enable new sources for storing the templates (like an external webserver)

Alternatives you've considered

Caching this on a "per-file" basis is of course possible but then the flow of data is not very transparent as multiple places introduce other methods of caching for the different modules of code. We want to reuse and control the flow of data. Thus a maybe quick thing to implement but not a proper thing to do. Caching is hard, let's make it not harder.

Additional information

This is not necessarily a performance improvement but it can't hurt to cache templates and promote them.

Going forward the goal for the PR is to do the following:

  • Reduce the amount of attributes present for no good reasons at the different item types - aka slim down item.py and introduce additional classes for those who need similar attributes.
  • Introduce computable properties that won't get saved on disk. Attributes like parents can be calculated during startup and don't need a setter anymore (thus saving time hopefully).
  • Use attribute UUIDs as primary keys in Cobbler to enable an easier rename operation. This must introduce a cache that enables an easy name based lookup as this is a frequent data-access-path.
  • Finally add the templates a first-level objects.
@SchoolGuy SchoolGuy added this to the v3.4.0 milestone Oct 18, 2022
@SchoolGuy SchoolGuy self-assigned this Oct 18, 2022
@SchoolGuy SchoolGuy added the enhancement New feature or request label Oct 18, 2022
@SchoolGuy
Copy link
Member Author

I have started to create a drawio diagram of the current state of the items so I can play drag & drop with the properties and create new classes as desired later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant