Remote debugging of openlibrary site in docker#2097
Merged
mekarpeles merged 1 commit intointernetarchive:masterfrom May 23, 2019
Merged
Remote debugging of openlibrary site in docker#2097mekarpeles merged 1 commit intointernetarchive:masterfrom
mekarpeles merged 1 commit intointernetarchive:masterfrom
Conversation
|
Before merging/closing this, can we find a home in the wiki or in a repo md file to document this feature? |
Collaborator
Author
|
Added a page here/to the sidebar: https://github.com/internetarchive/openlibrary/wiki/Debugger |
This file contains hidden or 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
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.
Description
Feature. Allow for remote debugging the local site. Closes #2076 . Logging in doesn't seem to work with only 1 gunicorn worker (for some reason), so the flow is a bit awks, but I think still useful.
In action (sorry mouse is invisible):

Not crazy over the magic
/attach_debuggerendpoint; ideally I'd like to show a "Dev Tools" button visible on the homepage toolbar if the site is running locally, but not sure how to access configs from the template (if anyone has info on that). I think still this is worth merging as is, BUT WANT SOMEONE TO TRY IT BEFORE IT GETS MERGED. @hornc @mekarpeles One of you would be great candidates :)Technical
This requires VS Code + its Python extension. To use:
docker-compose up -das usual and login as admin. Thendocker-compose down.docker/ol-docker-start.shto sayworkers 1instead of4docker-compose up -d.vscode/launch.json:a. if using a docker machine (or docker toolbox), update
host(rundocker-machine ip)b. on Windows, I had to change
localRootto bec:/Users/MyUser/openlibrary/; if you get "file not found" errors, you might have to do the same.