-
Notifications
You must be signed in to change notification settings - Fork 897
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
Remove seed on rails server start in development. #19535
Conversation
cc @h-kataria @himdel I'm not sure if anyone was depending on |
cc @himdel @skateman @h-kataria @martinpovolny I'd like your input here and make sure I'm not making too many assumptions, particularly since this might affect the flow of UI developers. In my mind this is the way it always should have been (I was actually surprised to find we did any seeding at all when calling |
@jrafanie i have always been running seeding manually either by running |
@jrafanie Marking as WIP cause I'm changing it as discussed above in #19535 (comment) , with tests. |
5d3bd76
to
fe2f02a
Compare
@jrafanie Updated. Thoughts? |
fe2f02a
to
c62c582
Compare
This makes sense to me. I mentioned in chat that I believe the original logic for automatically seeding primordial was added to rails server processes back when bundler might have been the only dependency management we had to do frequently. Back then, the UI workflow was update your code, bundle update, rake the database, and run rails server. Now that |
eeac334
to
97a7929
Compare
I'm good with this, but we might want to focus on the remaining 9 seconds 😆 |
@skateman I'll update the OP, but there's a few other reasons for this...
|
@skateman Want to talk routes with me? I can give you all the fun details |
Let's do that when I'm in Mahwah! |
@Fryguy I'm seeing one potentially big issue... If we only do primordial seed once on the appliance, those tokens are not really secure anymore, right? (Unless they are supposed to stay the same during the whole lifetime..) EDIT: not seeing any other issues 👍 |
@himdel do we care about that in development? |
Not really, but does this only affect development though? |
BTW we're also seeding region twice .. Zone.seed calls MiqRegion.seed |
This also means changing the |
There are a number of these interdependencies...definitely needs to be fixed / cleaned up. |
Yes this only affects development. In production, evmserverd is doing all of the seeding up front, and then we use forking, which bypasses Vmdb::Initializer.init |
97a7929
to
36ab6ec
Compare
In a production setting, evmserverd will be resposible for seeding the database. In a development setting, we should not be seeding when we start the UI. Developers should instead be encouraged to use bin/update or call db:seed directly when changes are made. Since most developers need to call bin/update before starting a rails server, in order to build the UI assets, this is part of the normal workflow. This change should eliminate about 1 second at rails server boot in development.
36ab6ec
to
56fab2e
Compare
Checked commit Fryguy@56fab2e with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/models/mixins/miq_web_server_worker_mixin.rb
|
Can we drop the |
Maybe but not in this PR 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll merge it tomorrow morning
In a production setting, evmserverd will be resposible for seeding the
database. In a development setting, we should not be seeding when we
start the UI. Developers should instead be encouraged to use bin/update
or call db:seed directly when changes are made. Since most developers
need to call bin/update before starting a rails server, in order to
build the UI assets, this is part of the normal workflow.
This change should eliminate about 1 second at rails server boot in
development.
Some more: