diff --git a/changelog.d/20230627_162842_regis.md b/changelog.d/20230627_162842_regis.md new file mode 100644 index 00000000..8aa98c51 --- /dev/null +++ b/changelog.d/20230627_162842_regis.md @@ -0,0 +1 @@ +- [Improvement] Don't override `imagePullPolicy` in Kubernetes. This was only necessary in older releases. (by @regisb) diff --git a/changelog.d/20230802_121750_regis_single_dev_container.md b/changelog.d/20230802_121750_regis_single_dev_container.md new file mode 100644 index 00000000..82ba56e3 --- /dev/null +++ b/changelog.d/20230802_121750_regis_single_dev_container.md @@ -0,0 +1 @@ +- [Improvement] Fix very high CPU and memory usage in development. We resolve this issue by running just a single container for all MFES, just like in production. To al;low developers to test their changes in Tutor, we run `npm run start` only for those MFEs that have a manual bind-mount that was created with `tutor mounts add .../frontend-app-mymfe`. (by @regisb) diff --git a/changelog.d/20230802_123027_regis_fix_dev_profile_link.md b/changelog.d/20230802_123027_regis_fix_dev_profile_link.md new file mode 100644 index 00000000..7e3279b2 --- /dev/null +++ b/changelog.d/20230802_123027_regis_fix_dev_profile_link.md @@ -0,0 +1 @@ +- [Bugfix] In development, fix link to profile in header. (by @regisb) diff --git a/tutormfe/patches/caddyfile b/tutormfe/patches/caddyfile index edab1016..55dec86f 100644 --- a/tutormfe/patches/caddyfile +++ b/tutormfe/patches/caddyfile @@ -3,10 +3,5 @@ request_body { max_size 2MB } - reverse_proxy /api/mfe_config/v1* lms:8000 { - # We need to specify the host header, otherwise it will be rejected with 400 - # from the lms. - header_up Host {{ LMS_HOST }} - } import proxy "mfe:8002" } diff --git a/tutormfe/patches/k8s-deployments b/tutormfe/patches/k8s-deployments index fe889ead..ba34efd4 100644 --- a/tutormfe/patches/k8s-deployments +++ b/tutormfe/patches/k8s-deployments @@ -17,7 +17,6 @@ spec: containers: - name: mfe image: {{ MFE_DOCKER_IMAGE }} - imagePullPolicy: Always ports: - containerPort: 8002 volumeMounts: diff --git a/tutormfe/patches/local-docker-compose-dev-services b/tutormfe/patches/local-docker-compose-dev-services index 293f9365..39319c1a 100644 --- a/tutormfe/patches/local-docker-compose-dev-services +++ b/tutormfe/patches/local-docker-compose-dev-services @@ -1,6 +1,15 @@ -# MFE apps -{% for app_name, app in iter_mfes() %} -{{ app_name }}: +mfe: + ports: + {%- for app_name, app in iter_mfes() %} + {%- if not iter_mounts(MOUNTS, app_name)|list %} + - {{ app["port"] }}:8002 # {{ app_name }} + {%- endif %} + {%- endfor %} + +{%- for app_name, app in iter_mfes() %} +{%- set mounts = iter_mounts(MOUNTS, app_name)|list %} +{%- if mounts %} +{{ app_name }}: # Work on this MFE for development image: "{{ DOCKER_REGISTRY }}overhangio/openedx-{{ app_name }}-dev:{{ MFE_VERSION }}" ports: - "{{ app["port"] }}:{{ app["port"] }}" @@ -8,10 +17,11 @@ tty: true volumes: - ../plugins/mfe/apps/mfe/webpack.dev-tutor.config.js:/openedx/app/webpack.dev-tutor.config.js:ro - {%- for mount in iter_mounts(MOUNTS, app_name) %} + {%- for mount in mounts %} - {{ mount }} {%- endfor %} restart: unless-stopped depends_on: - lms -{% endfor %} +{%- endif %} +{%- endfor %} diff --git a/tutormfe/patches/local-docker-compose-prod-services b/tutormfe/patches/local-docker-compose-services similarity index 100% rename from tutormfe/patches/local-docker-compose-prod-services rename to tutormfe/patches/local-docker-compose-services diff --git a/tutormfe/patches/openedx-lms-development-settings b/tutormfe/patches/openedx-lms-development-settings index aad502e5..2ea4871c 100644 --- a/tutormfe/patches/openedx-lms-development-settings +++ b/tutormfe/patches/openedx-lms-development-settings @@ -44,8 +44,8 @@ MFE_CONFIG["LEARNING_BASE_URL"] = "http://{{ MFE_HOST }}:{{ app["port"] }}" {% elif app_name == "ora-grading" %} ORA_GRADING_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ app["port"] }}/ora-grading" {% elif app_name == "profile" %} -PROFILE_MICROFRONTEND_URL = "{% if ENABLE_HTTPS %}https://{% else %}http://{% endif %}{{ MFE_HOST }}:{{ app["port"] }}/profile/u/" -MFE_CONFIG["ACCOUNT_PROFILE_URL"] = "http://{{ MFE_HOST }}:{{ app["port"] }}" +PROFILE_MICROFRONTEND_URL = "http:/{{ MFE_HOST }}:{{ app["port"] }}/profile/u/" +MFE_CONFIG["ACCOUNT_PROFILE_URL"] = "http://{{ MFE_HOST }}:{{ app["port"] }}/profile" {% elif app_name == "communications" %} COMMUNICATIONS_MICROFRONTEND_URL = "http://{{ MFE_HOST }}:{{ app["port"] }}/communications" MFE_CONFIG["SCHEDULE_EMAIL_SECTION"] = True diff --git a/tutormfe/templates/mfe/apps/mfe/Caddyfile b/tutormfe/templates/mfe/apps/mfe/Caddyfile index 78e42df3..ec6a9b44 100644 --- a/tutormfe/templates/mfe/apps/mfe/Caddyfile +++ b/tutormfe/templates/mfe/apps/mfe/Caddyfile @@ -12,6 +12,12 @@ } } + reverse_proxy /api/mfe_config/v1* lms:8000 { + # We need to specify the host header, otherwise it will be rejected with 400 + # from the lms. + header_up Host {{ LMS_HOST }} + } + {% for app_name, app in iter_mfes() %} @mfe_{{ app_name }} { path /{{ app_name }} /{{ app_name }}/*