-
Notifications
You must be signed in to change notification settings - Fork 25
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
#1340: added docker support for spinning up the dev environment #1364
#1340: added docker support for spinning up the dev environment #1364
Conversation
@athersharif I think instead of modifying all the evolutions files to add I've only just started testing, but I figured I'd bring this up sooner rather than later :) |
@misaugstad the reason why I had to add |
Yep, that's why I suggest creating a schema from a version of the database where the evolutions haven't been applied to it. The alternative would be to use the schema you have, but include the entries in the |
@misaugstad ah, right. totally get what you're saying. how do you feel about the schema handling everything besides the data, and the evolutions handling the data part? because tbh, adding inserts into the schema kinda makes it not the schema anymore 🤣 there's also the issue of adding the fields in the evolutions but they get added as part of the schema anyway (and maybe, by definition of a schema, should). I hacked around it by removing those fields in the evolutions (don't really like what I did there) before the add statements are executed. proposition to move all the |
This should also be solved by creating the schema from a database before the evolutions were applied (the schema would not include those columns).
I don't think that we should be modifying the evolutions files. The purpose of them is to make changes to a live production database, and they are not meant to ever be modified. Like if we modified these evolutions files and pushed to a live database, it would apply the downs for all the evolutions (which would delete a bunch of tables that had data in them) then would reapply the modified evolutions. I am not 100% rigid on leaving the evolution files alone, but I think we should do as much as we can to avoid touching them. Even if it involves bending the definition of a "schema" 😉 |
hmm, that clarifies things a bit. in that case, yeah we should probably generate the schema-only dump from the prod database, and let evolutions do the rest. we'd just need to move the thoughts on the other bits? |
I still think we should keep the inserts in the "schema" (maybe we just shouldn't call it a "schema" 😉 )
What are the other bits? 😅 |
@athersharif from the console output it looks like you are using |
@misaugstad yup, got it. by other bits, i meant were you able to run the server, etc. etc. don't wanna push new code when you're in the process of reviewing it. 🤣 yup, using |
Oh I see! Yes I just now finished the first compilation, and it runs! With the change you made plus using
Oh interesting, when are those commands run right now? I didn't realize those were ever being run in the background. The reason I say to use sbt over activator is that activator was EOL'd in 2017 😅 and sbt is the direct replacement. |
cool, i'll make the changes to the schema and the evolutions as per your suggestions, and add the sudo-for-linux instruction in the readme. haha, wow just saw here. i'll switch to |
Amazing, thank you! Now let's say I exit after running |
my understanding of the codebase so far is this: if you make changes to the assets (js, css, etc.), |
Yep this is one of the main things we will be doing while doing dev. So this part needs to be tested and added to README. I didn't follow that exact process, but I am rerunning |
yikes, yeah definitely don't want that. you got it, will push new commits shortly. |
I just have to step in here to say that this discussion makes me incredibly happy 😃. Go team!!!
…Sent from my iPhone
On Dec 19, 2018, at 4:00 PM, Ather Sharif ***@***.***> wrote:
yikes, yeah definitely don't want that. you got it, will push new commits shortly.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Still testing, but some stuff I've noticed:
|
@misaugstad good catch on a bit confused here. if i understand you correctly, is this what you're looking for:
did i miss anything above? |
Yes to first point, no to 2nd and 3rd point.
If you include the entries in the |
wouldn't that be an issue for all the |
additionally, here are some findings:
now a dumb question - if the goal here is to avoid running the evolutions completely (as you said they'll never be run, with this change), why do they exist? |
How so if the evolutions are never run?
Including
Okay what you want to do is run the develop branch with whatever database you want to create the schema from. This will cause the recently added evolutions to run, which will add that table. Then you can create the schema.
I'm not sure why that matters. You just need to make inserts for the records that were already in the database you create the schema from.
They are a bit of a legacy thing. They were added whenever we wanted to make changes to the code that involved changing the database structure. The idea is that the evolutions were already run, and you only run an evolution when you add a new evolution file. |
that's basically the answer to all my questions :). pushed the new commits to address the comments. |
Started fresh and on the It did eventually continue, but it hung there for like 10 minutes I think. And idk if it ended up continuing because I refreshed the page or something. That's as far as I was able to get tonight (haven't been able to test restoring a database dump, etc). Will get to that tomorrow. |
@athersharif there still seem to be some issues with the
It seems like you didn't do this exactly, because I am at least finding a bunch of tables in the schema that shouldn't be there. For example, the |
@misaugstad you're right. so bizarre that those stayed even though i ran the evolutions and then exported the schema. fixed them in 72aff2c. |
The schema looks good now! My last concern is the potential conflict in the |
7385526
to
c34abb2
Compare
@misaugstad you're right. for some reasons, the schema was reflecting the changes from master. updated that in the last commit. (also, rebased on the develop branch so this pr is up to date with the develop branch). @aileenzeng pushed the changes as we discussed today. |
@athersharif just tested the setup and everything seemed to work great! Changes to the back-end or front-end were auto-updated. Stopping @aileenzeng could you test it one more time to make sure all those things you mentioned above have been fixed for you? |
I've been doing my intro task using the Docker set-up, and Mikey asked me to comment that keeping Docker running on my computer drains my battery really quickly (to the point where I'm losing like 10% in 2 minutes). |
Just to finish with some relevant things @olgatron9000 told me: this incentivizes her to stop Docker, and restart it when she is working again. Starting it up then takes 5-10 minutes that first time. |
@olgatron9000 have you tried |
It works for me! I think the only comment that I had is that it took me a while to load the webpage after modifying a |
And how long do these things generally take to execute?
…Sent from my iPhone
On Feb 13, 2019, at 9:59 PM, Aileen Zeng ***@***.***> wrote:
It works for me! I think the only comment that I had is that it took me a while to load the webpage after modifying a .js file (grunt took a while to run, and it also took over 1 min. to load the webpage after grunt finished).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Generally it takes less than 15 seconds (grunt + reloading the webpage) |
Ack. So that’s a pretty significant time penalty. I worry that this will make coding, testing, and iteration cycles longer and more frustrating as students make changes and then have to wait to even see a simple change in their code loaded into system.
Any ideas Ather?
…Sent from my iPhone
On Feb 13, 2019, at 10:19 PM, Aileen Zeng ***@***.***> wrote:
Generally it takes less than 15 seconds (grunt + reloading the webpage)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jonfroehlich how do you feel about merging the PR now and creating an issue for improving the update time for the dev environment? |
Let’s do it! Can you tag Ather on the new Issue to seek his input on speedup ideas?
…Sent from my iPhone
On Feb 15, 2019, at 10:30 AM, Mikey Saugstad ***@***.***> wrote:
@jonfroehlich how do you feel about merging the PR now and creating an issue for improving the update time for the dev environment?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
sorry, i am just getting caught up on this. had family visiting from back home. pretty positive this is a docker for mac issue. unfortunately, docker for mac is always behind the regular docker stuff and has some additional complications with respect to volumes and file systems that causes it to be slow and use a higher cpu consumption than normal. fortunately, there are workarounds for that. i'll push a new pr for the new issue created to address that. |
fixes #1340.
fixes #483
this PR adds docker support for spinning up the dev environment. few notes:
javax.media jai-core
library (solution suggested by @aileenzeng here: Can't build website service aileenzeng/sidewalk-docker#5).