-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improve setup docs and configs based on Jean's onboarding #687
Improve setup docs and configs based on Jean's onboarding #687
Conversation
@@ -49,7 +49,7 @@ redis_bind_address: "redis.service.driver.internal" | |||
redis_port: 6379 | |||
|
|||
## WEB SETTINGS | |||
js_html5mode: "true" | |||
js_html5mode: "false" |
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.
There was some discussion about this in the DRIVER Slack channel -- it seems like Tiago ran into a similar issue. I'm still not sure why it was a problem, but the app was failing to load with HTML5 enabled due to this issue: https://stackoverflow.com/questions/37034140/location-in-html5-mode-requires-a-base
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.
Yeah, good call; this has tripped up several people recently; I don't know why it broke in the first place but our standard practice has become setting it to false, so it should be that way here too.
@@ -56,7 +56,7 @@ <h2>Add New Geography</h2> | |||
</select> | |||
</div> | |||
</form> | |||
<div class="save-area"> | |||
<div class="save-area col-sm-12"> |
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.
Without assigned column widths, these buttons didn't appear for me in either Chrome or Firefox.
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.
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.
That's where they went! My screen must be too small to see them.
@@ -1,13 +1,33 @@ | |||
#Loading data for development | |||
# Loading data for development |
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.
I updated the data loading docs to provide a little more background on the requirements. Apologies for the ugly diff.
scripts/requirements.txt
Outdated
@@ -0,0 +1,3 @@ | |||
python-dateutil | |||
pytz | |||
requests |
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.
Ideally these dependencies should be pinned, but I think it would make sense to wait to see if we want to put more effort into containerizing the test data ETL before doing that. My Python environment is substantially different such that I'm not confident the versions of these packages that I installed will generalize to all machines.
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.
Hmm yeah, it might actually be best to hold off on this file altogether for the moment. If we add containerization it won't be necessary, and if this was what you needed to get things going for your own local machine, then it's likely to be incomplete because you probably had some stuff installed already. What might be good is to include these in the list of requirements you added to the README; then we can provide better context and explain that the listed requirements are not necessarily complete.
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.
I like that solution -- much more clearly communicates the level of confidence I have in the completeness of the dependencies.
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.
Thanks for putting this together! This is looking pretty good, but it should be targeted against develop
rather than master
; we only merge to master
when we're releasing a new version. I had a few other minor comments as well.
scripts/README.md
Outdated
## Script and schema dependencies | ||
|
||
Certain ETL scripts and schemas in this repo depend on specific data | ||
sources to run properly. Retrieve these dependencies from the fileshare and |
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.
Outside users won't have access to our fileshare, so I don't think we should include this in the setup instructions. What might be nice is to add some of the files below to a sample_data directory so that they're in the repo. However, the incident data is from the Philippines and I think we should get authorization before including it. Perhaps we could just include these for now:
black_spots.json
interventions_sample_pts.geojson
That will at least allow users to generate a schema with black spots and interventions, and then perhaps manually generate some data using the web UI.
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.
Sounds great! I'll create the sample_data
directory. I think the dependency table is still helpful if you have access to the fileshare, since it's the only documentation that exists for matching scripts and schemas to the example data that they rely on, but I agree that it's weird to have open docs that reference a private data directory. Is it OK to leave the table here, or would it be better to move it to a README in the fileshare folder?
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.
I think a README in the fileshare folder would be perfect, that's a great solution!
scripts/requirements.txt
Outdated
@@ -0,0 +1,3 @@ | |||
python-dateutil | |||
pytz | |||
requests |
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.
Hmm yeah, it might actually be best to hold off on this file altogether for the moment. If we add containerization it won't be necessary, and if this was what you needed to get things going for your own local machine, then it's likely to be incomplete because you probably had some stuff installed already. What might be good is to include these in the list of requirements you added to the README; then we can provide better context and explain that the listed requirements are not necessarily complete.
@@ -56,7 +56,7 @@ <h2>Add New Geography</h2> | |||
</select> | |||
</div> | |||
</form> | |||
<div class="save-area"> | |||
<div class="save-area col-sm-12"> |
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.
@@ -49,7 +49,7 @@ redis_bind_address: "redis.service.driver.internal" | |||
redis_port: 6379 | |||
|
|||
## WEB SETTINGS | |||
js_html5mode: "true" | |||
js_html5mode: "false" |
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.
Yeah, good call; this has tripped up several people recently; I don't know why it broke in the first place but our standard practice has become setting it to false, so it should be that way here too.
Overview
It took me two days to get DRIVER fully set up; most of that time was spent getting well enough acquainted with Vagrant/Ansible/VirtualBox/Docker/Angular so that I could debug routine errors in the toolchain, but some of it was genuine issues with the app setup that could be merged back in.
This PR attempts to pull out the useful changes I made during my onboarding and merge them back upstream.
Checklist
Notes
For posterity, here are a few problems I ran into that turned out to require environment changes (i.e. changes to my setup and not the app itself):
DRIVER
andashlar
repos lived outside of my encrypted drive in order to get the mount to work. The particular error I was getting was something along the lines ofmount.nfs Error: /path/to/shared/folder is not a file or a directory
.app
andcelery
VMs failed a few times due to routine config problems (e.g. I had a port collision on 5432 that I had to resolve by settingDRIVER_DATABASE_PORT_5432=5433
). I wasn't aware thatvagrant up
andvagrant reload
don't automatically rerun provisioning tasks; I spent a while trying to figure out why the loopback interface was denying my requests before I realized that large chunks of the app were missing because they still needed to be provisioned after I fixed the config errors. The solution to this is to runvagrant reload --provision
or do as the docs say and manually retryvagrant provision <VM>
when you're debugging provisioning problems.Testing Instructions
Most of these changes are tiny, so I don't think they need real testing. If you want to verify my work, you could:
scripts/requirements.txt
file, and the updated docs inscripts/README.md