profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/overhangio/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

overhangio/tutor 562

The docker-based Open edX distribution designed for peace of mind

overhangio/indigo 35

An elegant, customizable theme for Open edX

overhangio/openedx-scorm-xblock 23

SCORM XBlock for Open edX

overhangio/tutor-figures 10

Figures plugin for Tutor, for analytics and reporting

overhangio/tutor-discovery 9

Course Discovery plugin for Tutor

overhangio/tutor-ecommerce 9

Ecommerce plugin for Tutor

overhangio/cookiecutter-tutor-plugin 6

Cookiecutter for tutor plugins

overhangio/tutor-minio 6

MinIO plugin for Tutor

overhangio/openedx-e2e 5

End-to-end testing for any live-running Open edX platform [BETA]

overhangio/tutor-xqueue 5

Xqueue plugin for Tutor

push eventoverhangio/tutor

Régis Behmo

commit sha 134319c429f392f060b02fa355f0ddd029ef84bf

feat: get rid of the nginx container and services Nginx and Caddy performed duplicate tasks. It was decided to get rid of the nginx container, for simplification. This is a breaking change for plugin developers. Also, applications that collect nginx logs will have to be modified. See: - Corresponding TEP: https://discuss.overhang.io/t/tep-get-rid-of-the-nginx-container/2024 - the prior discussion: https://discuss.overhang.io/t/why-caddy-nginx/1952

view details

push time in 9 hours

PR closed overhangio/tutor

fix: LANGUAGE_COOKIE_NAME is not set by default

Regression caused by https://github.com/edx/edx-platform/pull/28796

Details:

response.delete_cookie(
    settings.LANGUAGE_COOKIE_NAME,
    domain=settings.SHARED_COOKIE_DOMAIN
)
caused an Exception due to absence of LANGUAGE_COOKIE_NAME settings variable

> production.py

LANGUAGE_COOKIE_NAME = ENV_TOKENS.get('LANGUAGE_COOKIE', None) or ENV_TOKENS.get('LANGUAGE_COOKIE_NAME')

Exception:

2021-10-07 20:26:57,299 INFO 8 [audit] [user 3] [ip 172.19.0.1] models.py:2723 - Login success - user.id: 3
2021-10-07 20:26:57,318 INFO 8 [openedx_events.tooling] [user 3] [ip 172.19.0.1] tooling.py:160 - Responses of the Open edX Event <org.openedx.learning.auth.session.login.completed.v1>:
[]
2021-10-07 20:26:57,429 ERROR 8 [root] [user 3] [ip 172.19.0.1] signals.py:22 - Uncaught exception from None
Traceback (most recent call last):
  File "/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/openedx/venv/lib/python3.8/site-packages/django/utils/deprecation.py", line 96, in __call__
    response = self.process_response(request, response)
  File "./openedx/core/djangoapps/lang_pref/middleware.py", line 93, in process_response
    response.delete_cookie(
  File "/openedx/venv/lib/python3.8/site-packages/django/http/response.py", line 216, in delete_cookie
    secure = key.startswith(('__Secure-', '__Host-'))
AttributeError: 'NoneType' object has no attribute 'startswith'
+3 -0

5 comments

3 changed files

cmltaWt0

pr closed time in 11 hours

pull request commentoverhangio/tutor

fix: LANGUAGE_COOKIE_NAME is not set by default

Actually I'm closing this PR as not needed anymore.

cmltaWt0

comment created time in 11 hours

pull request commentoverhangio/tutor

fix: LANGUAGE_COOKIE_NAME is not set by default

Adding upstream PR https://github.com/edx/edx-platform/pull/29096

Have to keep in mind that maple quick fix should be reverted after upstream PR is merged due to losing the ability to use $LMS_CFG as a point to override the LANGUAGE_COOKIE_NAME for different envs easily and dynamically.

cmltaWt0

comment created time in 11 hours

pull request commentoverhangio/tutor

fix: require at least 4 GB RAM on macOS for local commands

Thanks for the feedback -- I've updated the code based on your comments & also amended the troubleshooting doc.

Do you have any preferences as to when it should log warnings instead of silently ignoring errors regarding the docker config file? I made it log warnings for all cases except OSError, loosely following your example, but TBH I don't have any strong opinions on this myself.

Also, do you want the commits squashed (with the commit messages sensibly merged into a single one)?

ppar

comment created time in 21 hours

Pull request review commentoverhangio/tutor

fix: require at least 4 GB RAM on macOS for local commands

 def check_output(*command: str) -> bytes:         raise exceptions.TutorError(             "Command failed: {}".format(" ".join(command))         ) from e+++def check_macos_memory() -> None:+    """+    Try to assert that the RAM allocated to the Docker VM on macOS is at least 4 GB.+    """+    if sys.platform != "darwin":+        return++    try:+        settings_path = (+            "{}/Library/Group Containers/group.com.docker/settings.json".format(+                os.path.expanduser("~")+            )+        )+        with open(settings_path) as fp:+            data = json.load(fp)+    except Exception as e:+        # Ignore any IO and JSON parse errors+        return++    if "memoryMiB" not in data or not isinstance(data["memoryMiB"], int):+        # Ignore absent / erratic values (Docker creates the file with the default setting of 2048 explicitly+        # written in, so we shouldn't need to assume a default value here).+        return

Done

ppar

comment created time in a day

PullRequestReviewEvent

PR opened overhangio/tutor-mfe

refactor: change base image

Some MFE require dependencies that are not available in the alpine image, this PR changes the base image to a Debian/Ubuntu image.

Forum thread.

+4 -10

0 comment

1 changed file

pr created time in 2 days

PullRequestReviewEvent

Pull request review commentoverhangio/tutor

feat: get rid of the nginx container and services

-{{ LMS_HOST }}{% if not ENABLE_HTTPS %}:80{% endif %} {-    reverse_proxy nginx:80 {+# Global configuration+{+    {{ patch("caddyfile-global")|indent(4) }}+}++# proxy directive snippet (with logging) to be used as follows:+#+#     import proxy "containername:port"+(proxy) {+    log {+        output stdout+        format filter {+            wrap json+            fields {+                common_log delete+                request>headers delete+                resp_headers delete+                tls delete+            }+        }+    }++    reverse_proxy {args.0} {         header_up X-Forwarded-Port {{ 443 if ENABLE_HTTPS else 80 }}     } }-{{ PREVIEW_LMS_HOST }}{% if not ENABLE_HTTPS %}:80{% endif %} {-    reverse_proxy nginx:80++{% if ENABLE_HTTPS and RUN_WEB_PROXY %}+{% set port = "" %}+{# listening to https is disabled and we must only listen to http #}+{% else %}+{% set port = ":80" %}+{% endif %}++{{ LMS_HOST }}{{ port }}, {{ PREVIEW_LMS_HOST }}{{ port }} {

Let me know what you think of this new proposed solution @iamCristYe.

regisb

comment created time in 2 days

push eventoverhangio/tutor

Régis Behmo

commit sha 59308799280b282931f2c1fff7353f66a9e6f03a

feat: get rid of the nginx container and services Nginx and Caddy performed duplicate tasks. It was decided to get rid of the nginx container, for simplification. This is a breaking change for plugin developers. Also, applications that collect nginx logs will have to be modified. See: - Corresponding TEP: https://discuss.overhang.io/t/tep-get-rid-of-the-nginx-container/2024 - the prior discussion: https://discuss.overhang.io/t/why-caddy-nginx/1952

view details

push time in 2 days

Pull request review commentoverhangio/tutor

feat: get rid of the nginx container and services

 version: "3.7" services:-  {% if RUN_CADDY %}-  # Web proxy for SSL termination+  # Web proxy for load balancing and SSL termination   caddy:     image: {{ DOCKER_IMAGE_CADDY }}     restart: unless-stopped     ports:-      - "80:80"-      {% if ENABLE_HTTPS %}- "443:443"{% endif %}+      - "{{ CADDY_HTTP_PORT }}:80"+      {% if ENABLE_HTTPS and ENABLE_LOAD_BALANCER %}- "{{ CADDY_HTTP_PORT }}:443"{% endif %}     volumes:       - ../apps/caddy/Caddyfile:/etc/caddy/Caddyfile:ro-      {% if ENABLE_HTTPS %}- ../../data/caddy:/data{% endif %}-  {% endif %}--  # Web server-  nginx:-    image: {{ DOCKER_IMAGE_NGINX }}-    restart: unless-stopped-    {% if not RUN_CADDY %}-    ports:-      - "{{ NGINX_HTTP_PORT }}:80"-    {% endif %}-    {% if RUN_CADDY and not ENABLE_HTTPS %}+      {% if ENABLE_HTTPS and ENABLE_LOAD_BALANCER %}- ../../data/caddy:/data{% endif %}+    {% if not ENABLE_HTTPS %}

sorry I didn't see endif. I thought this if doesn't have any content.

regisb

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentoverhangio/tutor

feat: get rid of the nginx container and services

 version: "3.7" services:-  {% if RUN_CADDY %}-  # Web proxy for SSL termination+  # Web proxy for load balancing and SSL termination   caddy:     image: {{ DOCKER_IMAGE_CADDY }}     restart: unless-stopped     ports:-      - "80:80"-      {% if ENABLE_HTTPS %}- "443:443"{% endif %}+      - "{{ CADDY_HTTP_PORT }}:80"+      {% if ENABLE_HTTPS and ENABLE_LOAD_BALANCER %}- "{{ CADDY_HTTP_PORT }}:443"{% endif %}     volumes:       - ../apps/caddy/Caddyfile:/etc/caddy/Caddyfile:ro-      {% if ENABLE_HTTPS %}- ../../data/caddy:/data{% endif %}-  {% endif %}--  # Web server-  nginx:-    image: {{ DOCKER_IMAGE_NGINX }}-    restart: unless-stopped-    {% if not RUN_CADDY %}-    ports:-      - "{{ NGINX_HTTP_PORT }}:80"-    {% endif %}-    {% if RUN_CADDY and not ENABLE_HTTPS %}+      {% if ENABLE_HTTPS and ENABLE_LOAD_BALANCER %}- ../../data/caddy:/data{% endif %}+    {% if not ENABLE_HTTPS %}

I doubt if we're talking about the same line. I'm taking about this one: https://github.com/overhangio/tutor/blob/b39fd4eedc473b27b464c70df6045c0db60810b3/tutor/templates/local/docker-compose.prod.yml#L13

regisb

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentoverhangio/tutor

feat: get rid of the nginx container and services

 Vendor services Caddy ***** -- ``RUN_CADDY`` (default: ``true``)+- ``CADDY_HTTP_PORT`` (default: ``80``)+- ``CADDY_HTTPS_PORT`` (default: ``443``)+- ``ENABLE_LOAD_BALANCER`` (default: ``true``)

like ENABLE_PROXY?

regisb

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentoverhangio/tutor

feat: get rid of the nginx container and services

 Vendor services Caddy ***** -- ``RUN_CADDY`` (default: ``true``)+- ``CADDY_HTTP_PORT`` (default: ``80``)+- ``CADDY_HTTPS_PORT`` (default: ``443``)+- ``ENABLE_LOAD_BALANCER`` (default: ``true``)

That's a concise one. But using RUN feels like it's a service that would create a docker container, should we user ENABLE instead?

regisb

comment created time in 2 days

issue commentoverhangio/tutor

Support for ARM64

docker pull --platform linux/amd64 mysql:5.7.35

does work on both macOS and linux, but then when I go back to running tutor quickstart, it will just complain again about there being no linux/arm64/v8 image.

mariadb is a fork of mysql so it should be compatible right? Maybe it's worth trying that out in the future?

throwaway-a

comment created time in 2 days

issue commentoverhangio/tutor

Support for ARM64

This issue seems to match the problem reported elsewhere: https://github.com/docker-library/mysql/issues/778 Let's try to narrow it down. Does any one of those commands succeed?

docker pull mysql:5.7.35
docker pull --platform linux/amd64 mysql:5.7.35

What I do not understand is why other images do not cause the same issue.

throwaway-a

comment created time in 3 days

issue commentoverhangio/tutor

Support for ARM64

It appears to fail on "tutor images pull mysql" (though I'll need the full list of images to check in order to see what others might fail)

throwaway-a

comment created time in 3 days

issue commentoverhangio/tutor

Support for ARM64

Hi @throwaway-a! It's not clear to me which image is causing the "pull" command to fail. Can you please try to run:

tutor images pull openedx
tutor images pull mysql
...

until you find a culprit?

throwaway-a

comment created time in 3 days

Pull request review commentoverhangio/tutor

fix: require at least 4 GB RAM on macOS for local commands

 def docker_compose(root: str, config: Config, *command: str) -> int: @click.pass_obj def local(context: Context) -> None:     context.docker_compose_func = docker_compose+    utils.check_macos_memory()

Could you move this check to the local quickstart command? (and amend the changelog) I believe it should be enough to perform this check only when tutor local quickstart is run.

ppar

comment created time in 3 days

Pull request review commentoverhangio/tutor

fix: require at least 4 GB RAM on macOS for local commands

 def check_output(*command: str) -> bytes:         raise exceptions.TutorError(             "Command failed: {}".format(" ".join(command))         ) from e+++def check_macos_memory() -> None:+    """+    Try to assert that the RAM allocated to the Docker VM on macOS is at least 4 GB.+    """+    if sys.platform != "darwin":+        return++    try:+        settings_path = (+            "{}/Library/Group Containers/group.com.docker/settings.json".format(+                os.path.expanduser("~")+            )+        )+        with open(settings_path) as fp:+            data = json.load(fp)+    except Exception as e:+        # Ignore any IO and JSON parse errors+        return++    if "memoryMiB" not in data or not isinstance(data["memoryMiB"], int):+        # Ignore absent / erratic values (Docker creates the file with the default setting of 2048 explicitly+        # written in, so we shouldn't need to assume a default value here).+        return

Can you rewrite the above piece of code such that we are being more explicit about the type of errors that we are catching:

try:
    ...
    data  = ...
    memory = int(data["memoryMiB"])
except FileReadingError: # or whatever the exception is named
    return
except JsonLoadingError: # or whatever the exception is named
    # do some logging
except TypeError:
    # do some logging
except KeyError:
    return
if memory < 4096:
    ...
ppar

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentoverhangio/tutor-mfe

Change base image

For some reason I can't re-open this PR. The "Reopen and comment" button is greyed out. I believe it is because you force-pushed your branch. Feel free to open a different PR.

BbrSofiane

comment created time in 3 days

pull request commentoverhangio/tutor

feat: run all services as unprivileged containers

My concern with the chmod approach for permissions management just for the case that a developer wants to access a directory from the host while it is simultaneously bound as a container volume. If both the host and guest users are i.e. UID 1000, this isn’t a problem. But if not, attempting to work with the mounted files from the host machine likely won’t work, since the file permissions will have been changed by the new service, and the host user may no longer have access.

The point of this PR is precisely to make sure that the user ID in the openedx-dev container matches the one on the host. So we shouldn't have a problem here.

ACLs let us keep the existing file permissions on such a mounted directory (so that the host user never loses access), while separately granting “extended” permissions which allow the guest user to also have the correct permissions. This way, even if the host and guest UIDs don’t match, both will still have the correct permissions.

I played around with setfacl, which I didn't know about before. Actually, I had no idea that there was such a thing as Access Control Lists on UNIX. I must say that it looks very promising. I am only concerned by the support of ACLs across operating systems. At this point, I think I need to make further investigations.

regisb

comment created time in 3 days

pull request commentoverhangio/tutor-forum

Tutor-forum plugin

At this point I should check whether the plugin works. The changes I requested are very minor. Feel free to wait until I have verified that it works.

ghassanmas

comment created time in 3 days