devstack icon indicating copy to clipboard operation
devstack copied to clipboard

feat: adds scripts to start/stop all enterprise services

Open chavesj opened this issue 3 years ago • 2 comments

Description

  • Adds bash scripts to start/stop the following enterprise services (and their dependencies):
    • LMS (edx-enterprise)
    • ecommerce
    • enterprise-catalog
    • license-manager
  • Also starts/stops the enterprise learner portal and admin portal MFEs
    • npm start & used to start each MFE as a background job
    • Logs for above command are still output to the terminal, it'd be nice for them not to be
  • Script requires the DEVSTACK_WORKSPACE environment variable to be defined

Note: This script doesn't start any of the enterprise frontend applications - would we like it to?

Testing instructions

  • Stop all docker containers running on your machine
  • Run the new script (enterprise/up.sh) and observe all enterprise backend services being started

chavesj avatar Feb 25 '21 14:02 chavesj

Note: This script doesn't start any of the enterprise frontend applications - would we like it to?

@chavesj We might need to backlog a ticket to enable the frontend apps as they are not currently dockerized, so require a longstanding webpack-dev-server process to run in a terminal. If we dockerized the MFEs and/or the dev server process isn't actually an issue), then yes including them in this script would be fantastic :)

adamstankiewicz avatar Feb 26 '21 00:02 adamstankiewicz

Note: This script doesn't start any of the enterprise frontend applications - would we like it to?

@chavesj We might need to backlog a ticket to enable the frontend apps as they are not currently dockerized, so require a longstanding webpack-dev-server process to run in a terminal. If we dockerized the MFEs and/or the dev server process isn't actually an issue), then yes including them in this script would be fantastic :)

While dockerization is generally more convenient, it's not the only way to serve our MFEs without hijacking the shell job. If run as a background job (e.g. npm start &) we should be able to do so, but we won't have the idempotence that we'd get out of the box with Docker. However, this can still be solved from the shell by only running the background job if no running processes are listening on the port used by the given MFE.

e.g. lsof -i tcp:8734 | grep LISTEN | awk '{print $2}' will return the pid(s) for any process(es) listening on port 8734. This can be used in two ways - to determine when an MFE has already been started and to use in killing the MFE processes. Now I'm starting to see that a down.sh script should accompany up.sh 🙂

Dockerizing our MFEs still sounds like a good thing to backlog but the described approach should get us what we want for now.

chavesj avatar Mar 01 '21 15:03 chavesj