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

Adds ruxitagentproc.conf update mechanism for CSI driver #366

Merged
merged 15 commits into from
Nov 22, 2021

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Nov 17, 2021

The basic idea is that after the csi driver downloads a oneagent version(zip) then it updates the ruxitagentproc.conf file within it according to what the settings on the tenant are.

Details:
A new api was/will-be added on the tenant side to get the latest revision of the ruxitagentproc.conf file, this file is read on startup by the standalone agent to do its magic.
The csi driver uses this api to get the revision and store it in the tenants directory for use when a new agent version is downloaded. The csi driver also periodically checks for newer revisions, and if there is one then it updates the latest downloaded versions ruxitagentproc.conf file again.
To make multiple updates on a single version simple, during the initial update it makes a copy of the ruxitagentproc.conf next to it with the name _ruxitagentproc.conf, so it uses _ruxitagentproc.conf as the base for creating the latest ruxitagentproc.conf. This can be done because in case of a new revision we get all the information again and not the stuff that changed from the previous revision.

So the following is implemented:

  • dtclient is able to query the new endpoint for the latest ruxitagentproc.conf revision
  • Small helper library to do the merging of the revisions from the api's response and the actual ruxitagentproc.conf file.
  • provisioner updated accordingly (do the caching and creating the copy etc.)

TODO:
In the beginning I added a new (simple) database table to keep track which revision is cached for a given tenant, this is probably unnecessary so I will look into just removing it.

@0sewa0 0sewa0 marked this pull request as ready for review November 18, 2021 08:22
conf/update.go Outdated Show resolved Hide resolved
conf/update_test.go Outdated Show resolved Hide resolved
controllers/csi/provisioner/ruxit_conf.go Outdated Show resolved Hide resolved
controllers/csi/provisioner/ruxit_conf.go Outdated Show resolved Hide resolved
controllers/csi/provisioner/ruxit_conf.go Outdated Show resolved Hide resolved
controllers/csi/provisioner/ruxit_conf.go Outdated Show resolved Hide resolved
dtclient/ruxit_conf.go Outdated Show resolved Hide resolved
dtclient/ruxit_conf.go Outdated Show resolved Hide resolved
dtclient/ruxit_conf.go Outdated Show resolved Hide resolved
dtclient/ruxit_conf.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@baichinger baichinger left a comment

Choose a reason for hiding this comment

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

Please pay attention to consistent naming. Different terms are used throughout the code: Ruxit, RuxitConf, and RuxitProc. We agreed to call the API endpoint processmoduleconfig. Therefore it seems logical to use the same term for the variables here as well: ProcessModuleConfig

conf/update.go Outdated

// ConfMap is the representation of a config file with sections that are divided by headers (map[header] == section)
// each section consists of key value pairs.
type ConfMap map[string]map[string]string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like this is the process module configuration. Why not name it like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so I renamed stuff to ProcessModuleConfig, but left the ConfMap the same because I renamed the package to processmoduleconfig and naming it processmoduleconfig.ProcessModuleConfig feels very redundant :)

@0sewa0 0sewa0 merged commit 84d3aee into master Nov 22, 2021
@0sewa0 0sewa0 deleted the feature/ruxitagentproc.conf branch November 22, 2021 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants