This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Move node_modules outside of edx-platform in Tutor's openedx image #150
Comments
kdmccormick
moved this from 📋 Refined
to 🛠️ In Progress
in Developer Experience Working Group
Jan 5, 2023
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Jan 10, 2023
Background: NPM packages were installed into the openedx image at /openedx/edx-platform/node_modules. So, when one mounted their own copy of edx-platform, the built-in node_modules folder was overriden. This forced edx-platform developers to re-run ``npm install``, which is redundant, slow, resource-intensive, and added complexity to the first-time developer setup process. If one forgot to run ``npm install``, their LMS/CMS frontend would be broken. And, when edx-platform's NPM requirements were updated, developers would not receive these updates from the openedx image; they would need to think to re-run ``npm install`` themselves. The solution: Move /openedx/edx-platform/node_modules to /openedx/node_modules. Note that this new location is outside of the edx-platform repository. So, when a developer mounts their own copy of edx-platform, the image's node_modules will remain intact. Closes openedx-unsupported/wg-developer-experience#150
kdmccormick
moved this from 🛠️ In Progress
to 👀 In Review
in Developer Experience Working Group
Jan 10, 2023
kdmccormick
moved this from 👀 In Review
to ⚠️ Blocked
in Developer Experience Working Group
Jan 11, 2023
kdmccormick
moved this from ⚠️ Blocked
to 🛠️ In Progress
in Developer Experience Working Group
Jan 17, 2023
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Jan 18, 2023
Background: NPM packages were installed into the openedx image at /openedx/edx-platform/node_modules. So, when one mounted their own copy of edx-platform, the built-in node_modules folder was overriden. This forced edx-platform developers to re-run ``npm install``, which is redundant, slow, resource-intensive, and added complexity to the first-time developer setup process. If one forgot to run ``npm install``, their LMS/CMS frontend would be broken. And, when edx-platform's NPM requirements were updated, developers would not receive these updates from the openedx image; they would need to think to re-run ``npm install`` themselves. The solution: Move /openedx/edx-platform/node_modules to /openedx/node_modules. Note that this new location is outside of the edx-platform repository. So, when a developer mounts their own copy of edx-platform, the image's node_modules will remain intact. Closes openedx-unsupported/wg-developer-experience#150
This was referenced Jan 18, 2023
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Jan 20, 2023
Background: NPM packages were installed into the openedx image at /openedx/edx-platform/node_modules. So, when one mounted their own copy of edx-platform, the built-in node_modules folder was overriden. This forced edx-platform developers to re-run ``npm install``, which is redundant, slow, resource-intensive, and added complexity to the first-time developer setup process. If one forgot to run ``npm install``, their LMS/CMS frontend would be broken. And, when edx-platform's NPM requirements were updated, developers would not receive these updates from the openedx image; they would need to think to re-run ``npm install`` themselves. The solution: Move /openedx/edx-platform/node_modules to /openedx/node_modules. Note that this new location is outside of the edx-platform repository. So, when a developer mounts their own copy of edx-platform, the image's node_modules will remain intact. Closes openedx-unsupported/wg-developer-experience#150
Blocked by openedx/edx-platform#31798 |
kdmccormick
moved this from 🛠️ In Progress
to ⚠️ Blocked
in Developer Experience Working Group
Feb 24, 2023
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 13, 2023
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
kdmccormick
added a commit
to kdmccormick/tutor
that referenced
this issue
Mar 14, 2023
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
regisb
pushed a commit
to overhangio/tutor
that referenced
this issue
Mar 15, 2023
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
github-project-automation
bot
moved this from Blocked
to Closed
in Developer Experience Working Group
Aug 18, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Background
This is a sub-task of #146
The problem: NPM packages are installed into the openedx image at /openedx/edx-platform/node_modules. So, when you mount your own edx-platform, you override that node_modules folder. Now, you must re-install node_modules yourself (
tutor dev run --mount=edx-platform lms npm install
), which takes a long time and is completely redundant with the node_modules that you had to download when you downloaded the openedx image. If you forget to do this, then your edx-platform frontend will be broken.The solution: Move node_modules somewhere else in the openedx image, such as /openedx/node_modules.
Tasks
npm install
from within /openedx, causing the packages to be installed at /openedx/node_modules.npm clean-install
step from Tutor's dev env setup instructions.Notes
NPM checks first for node_modules in the current working directory, then checks the parent directory, then the grandparent directory, and so on. This is why we are able to locate NPM packages at /openedx/node_modules without totally breaking edx-platform. node_modules that exist in a mounted edx-platform
The text was updated successfully, but these errors were encountered: