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

Inject initial data on startup of backend manage container when a specific env var is set. #1616

Closed
normanjaeckel opened this issue Feb 1, 2023 · 7 comments
Assignees
Milestone

Comments

@normanjaeckel
Copy link
Member

See OpenSlides/openslides-manage-service#212

It would be great if the backend can automaticly inject the default initial data during startup (if db is empty of course) if a specific env var is set. Proposal DEFAULT_INITIAL_DATA_ON_STARTUP which should trigger on values like "true" or "1" and not on values like "false" or "0".

@normanjaeckel normanjaeckel added this to the 4.1 milestone Feb 1, 2023
@jsangmeister
Copy link
Contributor

This is a feature which has existed for a long time in the datastore: https://github.com/OpenSlides/openslides-datastore-service/blob/main/docs/development.md#initial-data-creation and https://github.com/OpenSlides/openslides-datastore-service/blob/7a1a15159642c89a4124ce659224fe5b13fa2576/dc.dev.yml#L28 for an example. Feel free to utilize it in the manage service (it's only in the development.md file because we just needed it for the development until now).

@normanjaeckel
Copy link
Member Author

The feature request here is that not the manage service initialize the automaticle setup but instead the single manage backend container should do this. One community member is requesting a possibility to initialize everything on startup without any manual intervention. At the moment the manage service is just a GRPC server that waits on commands from outside. If it should do anything extra on startup it has to ensure that the manage service e. g. is already up. That's why we want to propose the solution I described above. Maybe let's discuss which is the best way here.

@jsangmeister
Copy link
Contributor

But that's exactly what the datastore is capable of: During generation of the yaml file, the manage service would set the variables for the datastore accordingly (see the documentation). Upon first startup, the data from the provided file is automatically loaded into the datastore, if no events are present yet. Upon future starts, it is skipped since other events are already present. Only thing one could argue is that we should let this run via the backend to ensure relation and data integrity, but since only experienced users will use that feature anyway (instances hosted by us will and do not), I think we could put that responsibility into the user's own hands.

@ostcar
Copy link
Member

ostcar commented Mar 14, 2023

@normanjaeckel ping. Is this still relevant? Maybe we need a draft for an concept? Could you write something?

@normanjaeckel
Copy link
Member Author

A community member (https://github.com/Floens) requested this feature. If the current way directly through the datastore is enough, it is ok for me. But I think this is more like a hidden feature.

@normanjaeckel normanjaeckel removed their assignment Mar 24, 2023
@jsangmeister
Copy link
Contributor

@normanjaeckel Yes, this is a "hidden feature" because you need deep knowledge of OS to know where to set the appropriate variables. What he wished for was a way to do that directly in the manage tool. Since you opened this issue, I assumed you were interested in adding such a feature to the manage service, which is why I pointed out the current way to do it. So now you have to either tell me why this way doesn't suffice and what you need, or we can close this because we either don't want to implement such a feature in the manage service or the current datastore way suffices.

@jsangmeister
Copy link
Contributor

closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants