-
Notifications
You must be signed in to change notification settings - Fork 420
invert dependencies so that backends now depend on frontends (plus some cleanup) #783
invert dependencies so that backends now depend on frontends (plus some cleanup) #783
Conversation
bacd16c
to
e7404a8
Compare
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.
Notes/questions for reviewers + some typos I will fix.
@@ -45,22 +45,22 @@ services: | |||
registrar-worker: | |||
volumes: | |||
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar/registrar | |||
gradebook: | |||
frontend-app-gradebook: |
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.
These changes will require a simple Devstack restart (make dev.down
, make dev.up...
). I will note this in my email.
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.
After this PR merges, if a dev has the pre-changes devstack started, then pulls the latest devstack changes, then runs make dev.down
, will all containers be properly stopped?
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.
Good point; they will not be stopped until Docker itself or the OS is restarted.
I will include running make dev.down
before git-pulling in the email I send out.
volumes: | ||
- ${DEVSTACK_WORKSPACE}/frontend-app-gradebook:/edx/app/gradebook:cached | ||
- gradebook_node_modules:/edx/app/gradebook/node_modules | ||
- gradebook_tox:/edx/app/gradebook/.tox |
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.
Frontends don't use tox; the gradebook_tox
line must have been copypasta. Removing.
@@ -59,11 +59,11 @@ volumes: | |||
external: true | |||
registrar-sync: | |||
external: true | |||
gradebook-sync: |
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, several frontends are missing from this file. I'm not going tackle that in this PR. I also doubt that anyone uses the Docker Sync stuff.
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.
Update: sync and NFS are slated for removal soon, so this is even further moot.
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.
This change makes sense to me - just had a question or two.
@@ -45,22 +45,22 @@ services: | |||
registrar-worker: | |||
volumes: | |||
- ${DEVSTACK_WORKSPACE}/registrar:/edx/app/registrar/registrar | |||
gradebook: | |||
frontend-app-gradebook: |
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.
After this PR merges, if a dev has the pre-changes devstack started, then pulls the latest devstack changes, then runs make dev.down
, will all containers be properly stopped?
298cf9f
to
962f6ce
Compare
86779ca
to
d7bbc3b
Compare
d7bbc3b
to
ca727ba
Compare
b49d337
to
aa03e4f
Compare
aa03e4f
to
c4de2c6
Compare
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.
This is an approval in spirit more than in detail, as I'm hardly a docker expert.
1. <service>-restart doesn't work for every backend; <service>-restart-devserver is more reliable. 2. <service>-restart-devserver doesn't work on frontends; recommend attach and Ctrl+C instead.
All micro-frontends in Devstack follow the frontend-app-* naming convention except course-authoring, gradebook, and program-console. This was presumably done to reduce typing, but adds confusion via its inconsistency. Furthermore, the upcoming change (in which backend services will depend on MFEs) will make it so these frontend names will be referenced much less often in the typical dev workflow. For example, `make dev.up.lms` will be sufficient to start Gradebook, so typing `make dev.up.frontend-app-gradebook` soon won't be necessary. This is a breaking interface change in that it renames the commands needed to start/stop/manage these frontends; however, the change is not expected to be breaking in any other way.
Diffing / spotting issues in repetative config can be difficult. Alphabetization makes it easier.
It was once separated out because the idea of DEFAULT_SERVICES and a generalized `dev.up.*` command hadn't been developed, so everything in docker-compose.yml was always started. This is no longer the case (the Registrar extra service exists in docker-compose.yml yet isn't started by default). So, the separation of docker-compose-xqueue.yml is just confusing. Furthermore, by pulling xqueue and xqueue_consumer into docker-compose.yml, we can properly define mysql57 as its dependency.
lms now depends on frontend-app-learning; previously, the converse was true. Running `make dev.up.lms` will start the frontend-app-learning container. This change has been made for all Devstack frontends/backends. This is breaking in that `make dev.up.frontend-app-*` is no longer the best way to start a frontend from a clean state, since it will not start related backend service(s). Instead, the backend service should be started, which will cause all related frontend apps to be started as dependencies. See included ADR (#4) for more context. Also includes some doc updates related to this change. TNL-8407
Allows installation of local versions of NPM packages via module.config.js, allowing frontend devs to test out frontend library changes within devstack. The mounts follow nearly the same pattern that micro-services do, which allows devs to develop local versions of Python packages alongside devstack micro-services. See included ADR #5 for details and rationale. TNL-8407
cf4be4e
to
37a834e
Compare
Partially reverting this in #815 |
Description
The intent of this PR is to resolve an immediate developer experience issue: since the Learning MFE is now enabled by default, the command
make dev.up.lms
on its own is no longer sufficient to run the default Open edX courseware experience.We hope that the fix for this issue will help us resolve a deeper, upcoming developer experience issue: soon 1, several micro-frontends will need to be started alongside backend services in order to provide a working Open edX experience out-of-the-box.
Changes are best reviewed by-commit.
make dev.up.<backend-service>
automatically starts all required frontends service.I will communicate all interface changes via email and Slack.
Supporting information
TNL-8407
Further details are in the included ADRs (0004 and 0005).
Related PR to update frontend-build docs: openedx/frontend-build#193
Testing instructions
Suggested smoke test for service dependencies:
make dev.up.lms
brings up at least LMS, frontend-app-gradebook and frontend-app-learning. Ensure that those services are usable.make dev.attach.frontend-app-gradebook
attaches to the Gradebook MFE container.make dev.up.xqueue
brings up XQueue and MySQL 5.7.make dev.down
brings down all services.Suggested smoke test for local package mounting:
make lms-up
.src/
directory within your devstack workspace.npm install && npm build
in that repo.module.config.js
into frontend-app-learning.module.config.js
, set@edx/brand
to the directory../src/brand-edx.org
. Comment out all other local modules.make frontend-app-learning-shell
) and runnpm install
. Exit shell.Footnotes
When? Not sure; it's up to individual squads that own MFEs.
We do know that Engage squad has work in-flight to make the Course Home features run in the Learning MFE by default.(update: they just did!) Also, several MFEs run as the default in Lilac, so it would make sense if those were made to run in Devstack by default as well. ↩