-
Notifications
You must be signed in to change notification settings - Fork 0
Ensure that egg-info folder is created when edx-platform is mounted #152
Comments
I am working on this now. I'll make PRs for both Options A and B so we can compare them side-by-side. |
@regisb , I've created a draft PRs for two different possible solutions to this issue:
Take a look and let me know what you think. I like Option A, because it means users don't need to re-run With either option, the end goal from #146 is to collapse the "setting up a development environment" instructions into one line, either: |
I understand the appeal of adding an entrypoint, but I would lean toward option B. Not so long ago, the openedx image that ships with Tutor did have an entrypoint. It was removed in this commit: overhangio/tutor@d5a790d There are a few annoying issues with entrypoints, though none of them is major:
I understand that the entrypoint you are proposing is fairly simple, and thus some of these items do not apply here. Still, I would prefer if we managed to avoid adding that entrypoint back in. |
Those are all good points. Point 3 isn't an immediate issue here since it's sufficient for Let me mull over this a bit more, but I think I'm on board with option B. |
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
Before this commit, setting up an edx-platform development environment took multiple steps: tutor dev launch tutor dev run --mount=/path/to/edx-platform lms bash >> pip install -e . >> npm clean-install >> openedx-assets build --env=dev This commit moves the steps under ``run`` into an init task, which is automatically run by ``launch``. Thus, setup is now one command: tutor dev launch --mount=edx-platform These extra init steps are only applicable when bind-mounting edx-platform (because bind-mounting the repository overrides some important artifacts that exist on the image, which must be re-generated). Thus, the new init tasks exists early if it detects that it is *not* operating on a bind-mounted repository. Finally, we try to simplify the Open edX development docs so that it is clearer how bind-mounting fits into the development process. These bind-mounts: * ../build/openedx/themes:/openedx/themes * ../build/openedx/requirements:/openedx/requirements existed in the dev lms and cms containers, but they did not exist in the lms-job and cms-job containers. This means that themes and requirements that were *built into the image* would exist in the job containers, but live updates to the themes and requirements would not apply. To resolve this, we set ``volumes:`` on the lms-job and cms-job services so that they match the volumes for the normal lms and cms services. Part of: openedx-unsupported/wg-developer-experience#146 Closes: openedx-unsupported/wg-developer-experience#152 This works around (but does not close) these related issues: * openedx-unsupported/wg-developer-experience#150 * https://github.com/openedx/wg-developer-experience/issues/151
I stuck with option B (from the comment above), and then went further and used the same init task for node_modules and for static assets: overhangio/tutor#813 |
Background
This is a sub-task of #146.
What do we need to ensure? That the ./Open_edX.egg-info/ is generated in edx-platform and is up-to-date with any changes that have been made to ./setup.py. Essentially, in pseudocode, we want this:
(For the sake of brevity, we're just going to call this theoretical script
ensure-setup
in the Tasks below.)If edx-platform is not mounted, then
ensure-setup
is not necessary, because Open_edX.egg-info is already build and up-to-date in the openedx Docker image.However, if edx-platform is mounted by a user, then Open_edX.egg-info is likely to be missing or outdated. If this happens, the user will face opaque errors about missing apps, stemming from the Django App Plugin or XBlock frameworks, both of which rely on a proper egg-info existing.
Tasks
Choose one of the following approaches:
A. Entrypoint script:
set-up-and-run
). It should first do theensure-setup
thing. Then, it should run the arguments passed to it as a shell command.set-up-and-run ./manage.py lms runserver ...
would create the egg-info if necessary, and then pass control to./manage.py ...
.['set-up-and-run']
.pip install ....
from the mounted edx-platform setup steps.B. Init task:
ensure-setup
in the LMS container as part of thedo init
job.launch
(ordo init
) should be called when first mounting an edx-platform, but removepip install ....
from the mounted edx-platform setup steps.C. Job + documentation: Write
ensure-setup
into a do-job, namededx-platform-setup
. Then, in Tutor's Open edX dev setup docs, replace the stuff aboutpip install ...
with:tutor dev do --mount=edx-platform edx-platform-setup
D. Documentation alone: In Tutor's Open edX dev setup docs, replace the stuff about
pip install ...
with a simpler:tutor dev run lms --mount=edx-platform pip install -e .
Notes
do edx-platform-setup
for any reason, then I think Option C becomes superior.The text was updated successfully, but these errors were encountered: