-
Notifications
You must be signed in to change notification settings - Fork 262
Better channel restoration for local dev with content proxying #5046
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
Better channel restoration for local dev with content proxying #5046
Conversation
8de0abb to
586f089
Compare
f7d9fe4 to
16638f6
Compare
| ) | ||
| parser.add_argument( | ||
| "--source-url", | ||
| default="http://localhost:8080", |
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.
port 8080 here is the nginx port?
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.
Yes it is. The default functionality before my changes had this command attempt to load from the local instance, so I kept that, but having this be the nginx route means that the logic for fetching the channel's SQLite database can be the same as non-local (production)
| action="store_true", | ||
| default=False, | ||
| help="Whether to download content files", | ||
| ) |
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.
We surely needed this. Thanks for adding it ❤️
|
TODO changes:
|
| function _on_interrupt() { $(DOCKER_COMPOSE) stop studio-nginx; }; \ | ||
| trap _on_interrupt SIGINT SIGTERM SIGKILL ERR; \ | ||
| $(DOCKER_COMPOSE) up -d studio-nginx; \ | ||
| $(MAKE) -j 2 devrun-django devrun-webpack |
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.
Maybe add an echo here to tell the actual URL to access on, to make sure people ignore the logging from the django runserver?
|
superseded by #5611 |
Summary
restore_channelmanagement command to be more robust and useful for restoring channels for local development:package.jsontoMakefilemakeand to handle always runningnginxin front of the devserverReferences
Needs for building on search recommendations
Reviewer guidance
python contentcuration/manage.py restore_channel --editor a@a.com --source-url https://studio.learningequality.org --public --publish --token <your_studio_token> <channel_id>(the following is a small channel: d0ef6f71e4fe4e54bb87d7dab5eeaae2)make devrun-servicesthenmake devrun-serverNotes
I simply deleted the existing tests for the channel restoration. Since it's a development only command, the tests usefulness are questionable, but I'm willing to add tests later if it's desired.