Skip to content

Commit

Permalink
feat: use entrypoint to automatically pip-install mounted edx-platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Jan 11, 2023
1 parent b903c69 commit c30b728
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
13 changes: 13 additions & 0 deletions changelog.d/20230111_135800_kdmc_egg_info_entrypoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
Create a changelog entry for every new user-facing change. Please respect the following instructions:
- Indicate breaking changes by prepending an explosion 💥 character.
- Prefix your changes with either [Bugfix], [Improvement], [Feature], [Security], [Deprecation].
- You may optionally append "(by @<author>)" at the end of the line, where "<author>" is either one (just one)
of your GitHub username, real name or affiliated organization. These affiliations will be displayed in
the release notes for every release.
-->

<!-- - 💥[Feature] Foobarize the blorginator. This breaks plugins by renaming the `FOO_DO` filter to `BAR_DO`. (by @regisb) -->
<!-- - [Improvement] This is a non-breaking change. Life is good. (by @billgates) -->

- [Improvement] It is no longer necessary to pip-install any requirements after bind-mounting a local copy of edx-platform.
3 changes: 0 additions & 3 deletions docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ Then, you should run the following commands::
# Run bash in the lms container
tutor dev run --mount=/path/to/edx-platform lms bash

# Compile local python requirements
pip install --requirement requirements/edx/development.txt

# Install nodejs packages in node_modules/
npm clean-install

Expand Down
1 change: 1 addition & 0 deletions tutor/templates/build/openedx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ ENV DJANGO_SETTINGS_MODULE lms.envs.tutor.production
{{ patch("openedx-dockerfile") }}

EXPOSE 8000
ENTRYPOINT ["set-up-and-run"]

###### Intermediate image with dev/test dependencies
FROM production as development
Expand Down
13 changes: 13 additions & 0 deletions tutor/templates/build/openedx/bin/set-up-and-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# If the the entry points info file (within the *egg-info directory)
# doesn't exist or is out-of-date with respect to setup.py,
# then we need to (re-)generate the egg-info by pip-installing this directory.
# Otherwise, XBlocks and Django App Plugins will not be registered.
ENTRY_POINTS_INFO=Open_edX.egg-info/entry_points.txt
if [ ! -f "$ENTRY_POINTS_INFO" ] || [ "$ENTRY_POINTS_INFO" -ot setup.py ]; then
pip install -e .
fi

# Run all arguments as a command.
"$@" || true

0 comments on commit c30b728

Please sign in to comment.