Skip to content

tutor status support from MFEs #1204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
e0d opened this issue Mar 4, 2025 · 5 comments · May be fixed by #1223
Open

tutor status support from MFEs #1204

e0d opened this issue Mar 4, 2025 · 5 comments · May be fixed by #1223
Assignees
Labels
good first issue Good issue to tacke for first-time contributors

Comments

@e0d
Copy link

e0d commented Mar 4, 2025

Is your feature request related to a problem? Please describe.

A useful approach for MFE development with Tutor is to

  1. Enable the MFE plugin
  2. Bind mount 1 or more MFEs
  3. Shut down specific MFEs, e.g. tutor dev stop learner-dashboard
  4. Use npm to start a dev server npm run dev

It would be useful for tutor status to provide some better visibility here.

Currently if you run

tutor dev status you get output like the following

tutor_main_dev-mfe-1             
docker.io/overhangio/openedx-mfe:19.0.0-main-indigo    "caddy run --config …"   
mfe             19 minutes ago   Up 19 minutes   
80/tcp, 443/tcp, 2019/tcp, 443/udp, 
0.0.0.0:1984->8002/tcp, 
0.0.0.0:1990->8002/tcp, 
0.0.0.0:1993->8002/tcp, 
0.0.0.0:1994->8002/tcp, 
0.0.0.0:1995->8002/tcp, 
0.0.0.0:1997->8002/tcp, 
0.0.0.0:1999->8002/tcp, 
0.0.0.0:2000->8002/tcp, 
0.0.0.0:2001->8002/tcp, 
0.0.0.0:2002->8002/tcp, 
[::]:1984->8002/tcp, 
[::]:1990->8002/tcp, 
[::]:1993->8002/tcp, 
[::]:1994->8002/tcp, 
[::]:1995->8002/tcp, 
[::]:1997->8002/tcp, 
[::]:1999->8002/tcp, 
[::]:2000->8002/tcp, 
[::]:2001->8002/tcp, 
[::]:2002->8002/tcp

While you can determine from that with inside knowledge that port 1996 isn't being proxied and thus the learner-dashboard isn't running, it would be nicer to get a status for MFEs that is similar to what you get for backend services.

@github-project-automation github-project-automation bot moved this to Pending Triage in Tutor project management Mar 4, 2025
@DawoudSheraz DawoudSheraz moved this from Pending Triage to Backlog in Tutor project management Mar 6, 2025
@DawoudSheraz DawoudSheraz added the good first issue Good issue to tacke for first-time contributors label Mar 11, 2025
@mlabeeb03 mlabeeb03 self-assigned this Apr 21, 2025
@mlabeeb03 mlabeeb03 moved this from Backlog to In Progress in Tutor project management Apr 21, 2025
@mlabeeb03
Copy link
Contributor

I think if I understand your problem correctly, you need some of way knowing the status of your MFE mounted containers that are not running. Right? You can run tutor dev dc ps --all to list exited containers in addition to the running containers. If that solves your problem we can add the --all flag argument to the tutor dev status command as well.

@e0d
Copy link
Author

e0d commented Apr 23, 2025

Making the behavior that I desire optional makes sense. Could you include a sample of the output you expect to produce? I find the output on first start after running tutor dev launch quite good:

    http://local.openedx.io:8000
    http://studio.local.openedx.io:8001
    http://meilisearch.local.openedx.io:7700
    http://credentials.local.openedx.io:8150
    http://discovery.local.openedx.io:8381
    http://apps.local.openedx.io:1999/authn
    http://apps.local.openedx.io:2001/authoring
    http://apps.local.openedx.io:1997/account
    http://apps.local.openedx.io:1984/communications
    http://apps.local.openedx.io:2002/discussions
    http://apps.local.openedx.io:1994/gradebook
    http://apps.local.openedx.io:1996/learner-dashboard
    http://apps.local.openedx.io:2000/learning
    http://apps.local.openedx.io:1993/ora-grading
    http://apps.local.openedx.io:1995/profile
    http://apps.local.openedx.io:1990/learner-record

You can clearly see the running MFEs.

@mlabeeb03
Copy link
Contributor

mlabeeb03 commented Apr 24, 2025

The output you get by using the --all flag would be:

{"Image":"overhangio/openedx-learning-dev:19.0.0", "Status": "Up 3 minutes", "Ports":"0.0.0.0:2000->2000/tcp", "Names":"tutor_dev-learning-1" }

Or if it is stopped:

{"Image":"overhangio/openedx-learning-dev:19.0.0", "Status": "Exited (1) 7 seconds ago", "Ports":"", "Names":"tutor_dev-learning-1" }

This is for mounted MFEs, there would be no difference for the ones that are part of the mfe plugin. I am not sure if you need more details for them too.

Regarding the output you shared for tutor dev launch that is the APP_PUBLIC_HOSTS filter. They are not necessarily running MFEs. But if that format suits you we can display running MFEs in that format.

@regisb
Copy link
Contributor

regisb commented Apr 24, 2025

@mlabeeb03 this is not the output that I'm seeing. Here's what I have, on a stopped platform:

$ tutor dev dc ps --all
docker compose -f /home/regis/.local/share/tutor-main/env/local/docker-compose.yml -f /home/regis/.local/share/tutor-main/env/dev/docker-compose.yml --project-name tutor_main_dev ps --all
NAME                           IMAGE                                                                     COMMAND                  SERVICE       CREATED       STATUS                    PORTS
tutor_main_dev-cms-1           openedx-dev:19.0.2-main                                                   "./manage.py cms run…"   cms           3 weeks ago   Exited (137) 6 days ago   
tutor_main_dev-lms-1           openedx-dev:19.0.2-main                                                   "./manage.py lms run…"   lms           3 weeks ago   Exited (137) 6 days ago   
tutor_main_dev-meilisearch-1   docker.io/getmeili/meilisearch:v1.8.4                                     "tini -- /bin/sh -c …"   meilisearch   3 weeks ago   Exited (143) 6 days ago   
tutor_main_dev-mfe-1           sha256:07fd2093d8946ff25189c29453d16f6228049ac172768fab83801d2eb19bb40b   "caddy run --config …"   mfe           6 days ago    Exited (137) 6 days ago   
tutor_main_dev-mongodb-1       docker.io/mongo:7.0.7                                                     "docker-entrypoint.s…"   mongodb       3 weeks ago   Exited (0) 6 days ago     
tutor_main_dev-mysql-1         docker.io/mysql:8.4.0                                                     "docker-entrypoint.s…"   mysql         3 weeks ago   Exited (0) 6 days ago     
tutor_main_dev-permissions-1   docker.io/overhangio/openedx-permissions:19.0.2-main                      "sh /usr/local/bin/s…"   permissions   3 weeks ago   Exited (0) 6 days ago     
tutor_main_dev-redis-1         docker.io/redis:7.2.4                                                     "docker-entrypoint.s…"   redis         3 weeks ago   Exited (0) 6 days ago     
tutor_main_dev-smtp-1          docker.io/devture/exim-relay:4.96-r1-0                                    "/sbin/tini -- exim …"   smtp          3 weeks ago   Exited (0) 6 days ago     
tutor_main_dev-watchthemes-1   openedx-dev:19.0.2-main                                                   "npm run watch-sass"     watchthemes   6 days ago    Exited (137) 6 days ago

But @e0d, it seems you instead be satisfied if you had instead a separate command that would print the list of available hosts, right? Something like:

$ tutor dev hosts
http://local.openedx.io:8000
http://studio.local.openedx.io:8001
http://meilisearch.local.openedx.io:7700
http://credentials.local.openedx.io:8150
http://discovery.local.openedx.io:8381
http://apps.local.openedx.io:1999/authn
http://apps.local.openedx.io:2001/authoring
http://apps.local.openedx.io:1997/account
http://apps.local.openedx.io:1984/communications
http://apps.local.openedx.io:2002/discussions
http://apps.local.openedx.io:1994/gradebook
http://apps.local.openedx.io:1996/learner-dashboard
http://apps.local.openedx.io:2000/learning
http://apps.local.openedx.io:1993/ora-grading
http://apps.local.openedx.io:1995/profile
http://apps.local.openedx.io:1990/learner-record

Note that this list does include hosts from stopped containers.

@e0d
Copy link
Author

e0d commented Apr 24, 2025

The list of hosts with their current status, think tutor plugins list, is really what I want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good issue to tacke for first-time contributors
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

4 participants