-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add static init for instances of Partition and Authentication #766
Open
aneojgurhem
wants to merge
9
commits into
main
Choose a base branch
from
jg/staticinit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aneojgurhem
force-pushed
the
jg/staticinit
branch
4 times, most recently
from
October 8, 2024 20:04
247eac9
to
8cdc6f1
Compare
ngruelaneo
reviewed
Oct 9, 2024
aneojgurhem
force-pushed
the
jg/staticinit
branch
from
October 11, 2024 12:05
63dc3d6
to
ba0f910
Compare
dbrasseur-aneo
previously approved these changes
Oct 11, 2024
lemaitre-aneo
previously approved these changes
Oct 18, 2024
lemaitre-aneo
previously approved these changes
Oct 18, 2024
aneojgurhem
force-pushed
the
jg/staticinit
branch
from
December 19, 2024 22:38
8b83d78
to
14bc401
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Description
An
InitServices
options class was introduced to initialize services. It contains two classes :Authentication
andPartitionning
to configure authentications and Partitions respectively. Authentication has several list of strings as fields:UserCertificates
,Roles
andUsers
. Those fields are JSON strings that are deserialized into corresponding objects that will be inserted into the database. Partitions works the same with thePartitionning
class with the fieldPartitions
.These options can be configured as environment variables. Lists should be converted into an environment variable per element with its index as shown below.
See the classes
Partition
,User
,Role
andCertificate
for the field that should be given has JSON strings.Testing
Unit tests were added to validate the behavior of the implementation. ArmoniK.Core infrastructure was also updated to support a deployment with and without initialization activated in the compute plane and control plane. It can be toggled during deployment with the
just
optioncinit
.Impact
Additional Information
Infrastructure will need to be modified to use the new way to initialize database. However, current (2.20 as of today) infrastructure should still be compatible with this development.
Integer are used as Id for Roles, Users and Certificates. When we will try to create new instances and insert them into the database through new APIs, we have two ways to generate the Id:
In both cases, if the item can not be inserted into the database due to Id already existing, Id will have to be re-generated until we can insert the item successfully.
Checklist