Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement runtime configuration package with multi-org support#14470

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
dannykopping wants to merge19 commits intomainfromdk/runtime-configs

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedAug 28, 2024
edited by Emyrk
Loading

RFC.

What this does

Adds a newruntimeconfig package for managing all runtime related configuration. The goal of this package is to create a consistent method for CRUD on runtime configuration (as opposed to startup values).

The motivation and driver is mutli-org. Multi org settings must be configured at runtime. Instead of creating ad-hoc CRUD operations to a key/val store, this package creates a single code path for all settings.

Design

The design uses aManager singleton that producesResolvers to enable a cache layer in the future. A pure singleton cannot be used as theResolver requires adatabase.Store, which could be atx. So the user of the package must create theResolver on demand with their local instance of thedb.

Usage

The design is intentionally created so that we can deprecate startup values in favor of runtime in the future. TheDeploymentEntry type specifically uses startup values as a fallback.

This will allow us to move some startup values into runtime, which has been a sticky point for configuring aspects of coder for awhile now.

Future work

Caching layer ::#14586

A follow up to this PR will be a caching layer that uses pubsub to update it's cached values. Adding a cache layer will make all settings essentially free to read, allowing use in hot paths such ashttpmw (as we currently do for startup values).

RBAC layer ::coder/internal#154

When caching is implemented,dbauthz will not be called for cache hits. So this layer, or some layer above, needs to be RBAC aware.

Maybe in theinitialize? theNew? The field could know it's own RBAC properties??

Remove old runtime settings in favor of this

Pretty much all these sql queries:https://github.com/coder/coder/blob/e461d2773b5a2f1bd04ff899a922032b373e187f/coderd/database/queries/siteconfig.sql

Upside is we will remove a lot of database.Store queries (always nice to trim)

Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is the look aside cache just going to be a wrapper on the resolver?

I like the interface simplicity. The only thing that I don't 100% follow is the usage of reflect. It would be good to drop comments on why it is required.

@dannykoppingdannykoppingforce-pushed thedk/runtime-configs branch 3 times, most recently from3650ee6 to12e798fCompareSeptember 4, 2024 12:06
@dannykoppingdannykopping changed the titleWIP: runtime config implementationRuntime config implementation proposalSep 4, 2024
@EmyrkEmyrk changed the titleRuntime config implementation proposalfeat: runtime configuration package that support organization namespacesSep 6, 2024
@EmyrkEmyrk changed the titlefeat: runtime configuration package that support organization namespacesfeat: runtime configuration package with multi-org supportSep 6, 2024
@EmyrkEmyrk changed the titlefeat: runtime configuration package with multi-org supportfeat: implement runtime configuration package with multi-org supportSep 6, 2024
@EmyrkEmyrk marked this pull request as ready for reviewSeptember 6, 2024 14:19
@dannykopping
Copy link
ContributorAuthor

@Emyrk good to go 👍

dannykoppingand others added12 commitsSeptember 6, 2024 10:19
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Emyrkand others added6 commitsSeptember 6, 2024 10:19
* chore: refactor entry into deployment and runtimeRuntimeEntry has no startup value, and omits functions requiredto be serpent compatible.Co-authored-by: Danny Kopping <danny@coder.com>---------Co-authored-by: Danny Kopping <danny@coder.com>
@EmyrkEmyrk requested a review fromjohnstcnSeptember 9, 2024 14:35
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Approving to unblock.

@dannykopping
Copy link
ContributorAuthor

@github-actionsgithub-actionsbot deleted the dk/runtime-configs branchMarch 7, 2025 00:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@EmyrkEmyrkEmyrk left review comments

@johnstcnjohnstcnjohnstcn approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtis

Assignees

@dannykoppingdannykopping

Labels
staleThis issue is like stale bread.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@dannykopping@johnstcn@spikecurtis@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp