From f5351bb66bcd790fedb108b8e72299059fdb0206 Mon Sep 17 00:00:00 2001 From: Gabor Boros Date: Sun, 17 Oct 2021 13:07:05 +0200 Subject: [PATCH 1/6] feat: make SINGLE_BEAT_IDENTIFIER configurable Other squashed commit messages: fix: celery 5.0+ does not support --app as a worker flag refactor: remove duplicated app declaration fix: --config flag is global since Celery 5.0+ fix: replace single-beat with an updated version fix: add missing comma fix: replace maxtasksperchild worker flag refactor: address PR review comments refactor: remove celery<5 adjustments fix: set single-beat autorestart Signed-off-by: Gabor Boros (cherry picked from commit d0550581cfd6309c61aaf751ea88a6f1c54c143c) Signed-off-by: Gabor Boros --- CHANGELOG.md | 48 +++++++++++++++++++ .../edx/app/ecomworker/ecomworker.sh.j2 | 2 +- .../conf.d.available/app-workers.conf.j2 | 14 +----- playbooks/roles/edxapp/defaults/main.yml | 6 ++- playbooks/roles/edxapp/tasks/deploy.yml | 3 +- .../edx/app/edxapp/beat_scheduler.sh.j2 | 6 +-- .../templates/edx/app/edxapp/worker.sh.j2 | 4 +- .../conf.d.available/workers.conf.j2 | 30 ++++++------ 8 files changed, 78 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd14ea6c492..c5ec7d83748 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,54 @@ Add any new changes to the top (right below this line). - Role: discovery - Replaced `ELASTICSEARCH_URL` with `ELASTICSEARCH_CLUSTER_URL` in `discovery_service_config_overrides`. + - 2021-11-30 + - Upgrade celery to 5.2.0 and adjust CLI call parameters too + - Bumped single-beat to use a more supported fork of the project + + - 2021-11-01 + - Docker: edxapp + - Removed unnecessary `CELERY_QUEUES` overrides for LMS and Studio. + Instead, just use the default value of `CELERY_QUEUES` as set in + edx-platform's settings files. + Functionally, this means that in addition to the existing queues + that LMS and Studio defined, there is now a "low priority" queue + for Studio, suitable for tasks like a CourseGraph dump. + + - 2021-10-20 + - Role neo4j + - Upgrade Neo4j from 3.2.2 to 3.5.28. + + - 2021-08-26 + - Role neo4j + - Bring Neo4j role closer in with what we really deploy: + - Change Neo4j version from 3.2.2 to 3.3.1. + - Expose Bolt on 0.0.0.0:7687 with optional encryption. + - Enable `dbms.allow_upgrade`, which is the new name of the `dbms.allow_format_migration` key. + - Remove http->https redirection logic when NGINX_ENABLE_SSL is false. + + - 2021-09-28 + - Role nginx + - Add `NGINX_ENABLE_IPV6` configuration variable to make nginx + services listen on the IPv6 wildcard address (in addition to + the IPv4 one, where services always listen). Defaults to true. + + - 2021-09-19 + - Remove configuration for edx-certificates, as that repo and service are no longer used. + + - 2021-07-29 + - Role edxapp + - Add `EDXAPP_ENABLE_MONGODB_INDEXES` configuration variable to optionally set up indexes on edxapp mongodb. + - Role forum + - Add `FORUM_ENABLE_MONGODB_INDEXES` configuration variable to optionally set up indexes on forum mongodb. + + - 2021-07-19 + - Role: edx_django_service + - Allows writing extra requirements to an 'extra.txt' requirements file in the service's requirements directory. + - Role: ecommerce + - Adds an optional flag to write the extra requirements to an 'extra.txt' file since many of the app's setup commands + use tox and that creates its own environments separate from the default ecommerce virtualenv environment where the + `ECOMMERCE_EXTRA_REQUIREMENTS` requirements are installed. + - 2021-06-17 - Role credentials - Installs extra python packages specified in `CREDENTIALS_EXTRA_REQUIREMENTS` (defaults to `[]`). diff --git a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 index d2c355d1c97..516e775452c 100644 --- a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 +++ b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 @@ -17,4 +17,4 @@ export NEW_RELIC_LICENSE_KEY='{{ NEWRELIC_LICENSE_KEY }}' source {{ ecommerce_worker_home }}/{{ ecommerce_worker_service_name }}_env # We exec so that celery is the child of supervisor and can be managed properly -exec {{ executable }} -A ecommerce_worker worker --app ecommerce_worker.celery_app:app --concurrency={{ ECOMMERCE_WORKER_CONCURRENCY }} --loglevel=info --hostname=ecomworker.%%h --queue=ecommerce.fulfillment,ecommerce.email_marketing +exec {{ executable }} --app ecommerce_worker.celery_app:app worker -A ecommerce_worker --concurrency={{ ECOMMERCE_WORKER_CONCURRENCY }} --loglevel=info --hostname=ecomworker.%%h --queue=ecommerce.fulfillment,ecommerce.email_marketing diff --git a/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 b/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 index 6ec910b4254..437c590ac62 100644 --- a/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 +++ b/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 @@ -10,14 +10,9 @@ directory={{ edx_django_service_code_dir }} stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log -command={{ edx_django_service_home }}/{{ edx_django_service_name }}-workers.sh worker -A {{ edx_django_service_name }} --app {{ edx_django_service_name }}.celery:app --loglevel=info --queue={{ w.queue }} --hostname={{ edx_django_service_name }}.{{ w.queue }}.%%h --concurrency=1 {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not edx_django_service_celery_heartbeat_enabled|bool else '' }} +command={{ edx_django_service_home }}/{{ edx_django_service_name }}-workers.sh --app {{ edx_django_service_name }}.celery:app worker -A {{ edx_django_service_name }} --loglevel=info --queue={{ w.queue }} --hostname={{ edx_django_service_name }}.{{ w.queue }}.%%h --concurrency=1 {{ '--max-tasks-per-child ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not edx_django_service_celery_heartbeat_enabled|bool else '' }} killasgroup=true stopwaitsecs={{ w.stopwaitsecs | default(edx_django_service_default_stopwaitsecs) }} -; Set autorestart to `true`. The default value for autorestart is `unexpected`, but celery < 4.x will exit -; with an exit code of zero for certain types of unrecoverable errors, so we must make sure that the workers -; are auto restarted even when exiting with code 0. -; The Celery bug was reported in https://github.com/celery/celery/issues/2024, and is fixed in Celery 4.0.0. -autorestart=true {% endfor %} {% endfor %} @@ -39,14 +34,9 @@ stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log {% set worker_app_name = 'course_discovery' %} {% endif %} -command={{ edx_django_service_home }}/{{ edx_django_service_name }}-workers.sh worker -A {{ edx_django_service_name }} --app {{ worker_app_name }}.celery:app --loglevel=info --queue={{ w.queue }} --hostname={{ edx_django_service_name }}.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not edx_django_service_celery_heartbeat_enabled|bool else '' }} +command={{ edx_django_service_home }}/{{ edx_django_service_name }}-workers.sh --app {{ worker_app_name }}.celery:app worker -A {{ edx_django_service_name }} --loglevel=info --queue={{ w.queue }} --hostname={{ edx_django_service_name }}.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--max-tasks-per-child ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not edx_django_service_celery_heartbeat_enabled|bool else '' }} killasgroup=true stopwaitsecs={{ w.stopwaitsecs | default(edx_django_service_default_stopwaitsecs) }} -; Set autorestart to `true`. The default value for autorestart is `unexpected`, but celery < 4.x will exit -; with an exit code of zero for certain types of unrecoverable errors, so we must make sure that the workers -; are auto restarted even when exiting with code 0. -; The Celery bug was reported in https://github.com/celery/celery/issues/2024, and is fixed in Celery 4.0.0. -autorestart=true {% endfor %} diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index 18883116082..8c92706b36b 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -178,7 +178,11 @@ EDXAPP_ENABLE_CELERY_BEAT: false EDXAPP_SINGLE_BEAT_LOCK_TIME: 60 # EDXAPP_SINGLE_BEAT_HEARTBEAT_INTERVAL must be smaller than EDXAPP_SINGLE_BEAT_LOCK_TIME / 2 EDXAPP_SINGLE_BEAT_HEARTBEAT_INTERVAL: 29 -EDXAPP_SINGLE_BEAT_VERSION: "0.4.2" +EDXAPP_SINGLE_BEAT_REPO: "https://github.com/akachanov/single-beat.git" +EDXAPP_SINGLE_BEAT_VERSION: "e500ac4b56756cdf96836666883af8060aaef455" +EDXAPP_SINGLE_BEAT_USER: "{{ EDXAPP_CELERY_USER }}" +EDXAPP_SINGLE_BEAT_PASSWORD: "{{ EDXAPP_CELERY_PASSWORD }}" +EDXAPP_SINGLE_BEAT_IDENTIFIER: "celerybeat" EDXAPP_BRANCH_IO_KEY: "" EDXAPP_AUTH_USE_OPENID_PROVIDER: true diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index f3ace3721fa..0f05bbc9bfe 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -367,8 +367,7 @@ - name: install single-beat to run only one celerybeat scheduler pip: - name: single-beat - version: "{{ EDXAPP_SINGLE_BEAT_VERSION|default(omit) }}" + name: "git+{{ EDXAPP_SINGLE_BEAT_REPO }}@{{ EDXAPP_SINGLE_BEAT_VERSION|default(master) }}#egg=single-beat" virtualenv: "{{ edxapp_venv_dir }}" state: present become_user: "{{ edxapp_user }}" diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/beat_scheduler.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/beat_scheduler.sh.j2 index acf54f89058..12068c05450 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/beat_scheduler.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/beat_scheduler.sh.j2 @@ -5,7 +5,7 @@ {% set edxapp_venv_bin = edxapp_venv_dir + "/bin" %} source {{ edxapp_app_dir }}/edxapp_env {% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/single-beat ' + edxapp_venv_bin + '/celery beat' %} +{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/single-beat ' + edxapp_venv_bin + '/celery' %} export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini" if command -v ec2metadata >/dev/null 2>&1; then @@ -14,9 +14,9 @@ if command -v ec2metadata >/dev/null 2>&1; then export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" fi {% else %} -{% set executable = edxapp_venv_bin + '/single-beat' + edxapp_venv_bin + '/celery beat' %} +{% set executable = edxapp_venv_bin + '/single-beat' + edxapp_venv_bin + '/celery' %} {% endif %} # We exec so that celery is the child of supervisor and can be managed properly -exec {{ executable }} $@ +exec {{ executable }} --config="${SERVICE_CONFIG}" beat $@ diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 index 75e3c116f98..ccd903b8b5b 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 @@ -5,7 +5,7 @@ {% set edxapp_venv_bin = edxapp_venv_dir + "/bin" %} source {{ edxapp_app_dir }}/edxapp_env {% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/celery worker' %} +{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/celery' %} export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini" if command -v ec2metadata >/dev/null 2>&1; then @@ -14,7 +14,7 @@ if command -v ec2metadata >/dev/null 2>&1; then export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" fi {% else %} -{% set executable = edxapp_venv_bin + '/celery worker' %} +{% set executable = edxapp_venv_bin + '/celery' %} {% endif %} # We exec so that celery is the child of supervisor and can be managed properly diff --git a/playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2 b/playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2 index 245eb933c42..3dd9641c9a7 100644 --- a/playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/supervisor/conf.d.available/workers.conf.j2 @@ -7,14 +7,9 @@ directory={{ edxapp_code_dir }} stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log -command={{ edxapp_app_dir }}/worker.sh --app={{ w.service_variant }}.celery:APP --loglevel=info --queues=edx.{{ w.service_variant }}.core.{{ w.queue }} --hostname=edx.{{ w.service_variant }}.core.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not EDXAPP_CELERY_HEARTBEAT_ENABLED|bool else '' }} {{ '-O ' + w.prefetch_optimization if w.prefetch_optimization is defined else '' }} +command={{ edxapp_app_dir }}/worker.sh --app={{ w.service_variant }}.celery:APP worker --loglevel=info --queues=edx.{{ w.service_variant }}.core.{{ w.queue }} --hostname=edx.{{ w.service_variant }}.core.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--max-tasks-per-child ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} {{ '--without-heartbeat' if not EDXAPP_CELERY_HEARTBEAT_ENABLED|bool else '' }} {{ '-O ' + w.prefetch_optimization if w.prefetch_optimization is defined else '' }} killasgroup=true stopwaitsecs={{ w.stopwaitsecs | default(EDXAPP_WORKER_DEFAULT_STOPWAITSECS) }} -; Set autorestart to `true`. The default value for autorestart is `unexpected`, but celery < 4.x will exit -; with an exit code of zero for certain types of unrecoverable errors, so we must make sure that the workers -; are auto restarted even when exiting with code 0. -; The Celery bug was reported in https://github.com/celery/celery/issues/2024, and is fixed in Celery 4.0.0. -autorestart=true {% endfor %} @@ -37,21 +32,28 @@ environment= EDX_REST_API_CLIENT_NAME=edx.lms.core.default, SINGLE_BEAT_LOCK_TIME={{ EDXAPP_SINGLE_BEAT_LOCK_TIME }}, SINGLE_BEAT_HEARTBEAT_INTERVAL={{ EDXAPP_SINGLE_BEAT_HEARTBEAT_INTERVAL }}, - SINGLE_BEAT_IDENTIFIER="celerybeat", - SINGLE_BEAT_REDIS_SERVER="redis://{{ EDXAPP_CELERY_BROKER_HOSTNAME }}/{{ EDXAPP_CELERY_BROKER_VHOST }}", - SINGLE_BEAT_WAIT_MODE="supervised" + SINGLE_BEAT_IDENTIFIER="{{ EDXAPP_SINGLE_BEAT_IDENTIFIER }}", + SINGLE_BEAT_REDIS_SERVER="redis://{{ EDXAPP_SINGLE_BEAT_USER }}:{{ EDXAPP_SINGLE_BEAT_PASSWORD }}@{{ EDXAPP_CELERY_BROKER_HOSTNAME }}/{{ EDXAPP_CELERY_BROKER_VHOST }}", + SINGLE_BEAT_WAIT_MODE="supervised", + SERVICE_CONFIG="lms.envs.{{ worker_django_settings_module }}" user={{ common_web_user }} directory={{ edxapp_code_dir }} stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log -command={{ edxapp_app_dir }}/beat_scheduler.sh --config=lms.envs.{{ worker_django_settings_module }} --loglevel=info --schedule="{{ supervisor_log_dir }}/celerybeat-schedule" --pidfile="{{ supervisor_log_dir }}/celerybeat.pid" +command={{ edxapp_app_dir }}/beat_scheduler.sh --loglevel=info --schedule="{{ supervisor_log_dir }}/celerybeat-schedule" --pidfile="{{ supervisor_log_dir }}/celerybeat.pid" killasgroup=true stopwaitsecs={{ EDXAPP_WORKER_DEFAULT_STOPWAITSECS }} -; Set autorestart to `true`. The default value for autorestart is `unexpected`, but celery < 4.x will exit -; with an exit code of zero for certain types of unrecoverable errors, so we must make sure that the workers -; are auto restarted even when exiting with code 0. -; The Celery bug was reported in https://github.com/celery/celery/issues/2024, and is fixed in Celery 4.0.0. + +# If multiple app servers are running, celery-beat will exit on the new app +# server as it is already running on the old one. Once the process exited with +# status 0, it wont restart again event the old server is deprovisioned. To +# resolve this conflict, use `autorestart=true` to keep trying to start the +# process. Startretries are scheduled 3 times by default; since there is no way +# to set infinite retries, the recommended way is setting a high number. When +# the previous server is stopped, celery-beat will start normally. autorestart=true +startsecs=30 +startretries=10000 {% endif %} From 930d041a8c84508d5d91f41eb47bc8b1f7c18b19 Mon Sep 17 00:00:00 2001 From: Gabor Boros Date: Thu, 17 Mar 2022 10:09:27 +0100 Subject: [PATCH 2/6] fix: bump setuptools Signed-off-by: Gabor Boros --- playbooks/roles/common_vars/defaults/main.yml | 2 +- util/install/native.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/common_vars/defaults/main.yml b/playbooks/roles/common_vars/defaults/main.yml index c4c018a9824..9555c13494a 100644 --- a/playbooks/roles/common_vars/defaults/main.yml +++ b/playbooks/roles/common_vars/defaults/main.yml @@ -157,7 +157,7 @@ COMMON_PIP_VERSION: '20.0.2' common_pip_pkgs: - pip=={{ COMMON_PIP_VERSION }} - configparser==4.0.2 - - setuptools==44.1.0 + - 'setuptools<59.7.0,>=59.1.1' - virtualenv==20.2.0 - zipp==1.2.0 - boto3 diff --git a/util/install/native.sh b/util/install/native.sh index 1322f0be1f9..94faa4b9079 100644 --- a/util/install/native.sh +++ b/util/install/native.sh @@ -102,7 +102,7 @@ sudo apt-get install -y build-essential software-properties-common curl git-core # ansible-bootstrap installs yaml that pip 19 can't uninstall. sudo apt-get remove -y python-yaml sudo pip3 install --upgrade pip==20.0.2 -sudo pip3 install --upgrade setuptools==44.1.0 +sudo pip3 install --upgrade 'setuptools<59.7.0,>=59.1.1' sudo -H pip3 install --upgrade virtualenv==20.2.0 ## From ce464455db3a5b973edb581ab3416126c8f2d14c Mon Sep 17 00:00:00 2001 From: Gabor Boros Date: Thu, 17 Mar 2022 12:04:32 +0100 Subject: [PATCH 3/6] fix: reset setuptools Signed-off-by: Gabor Boros --- playbooks/roles/common_vars/defaults/main.yml | 2 +- util/install/native.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/common_vars/defaults/main.yml b/playbooks/roles/common_vars/defaults/main.yml index 9555c13494a..c4c018a9824 100644 --- a/playbooks/roles/common_vars/defaults/main.yml +++ b/playbooks/roles/common_vars/defaults/main.yml @@ -157,7 +157,7 @@ COMMON_PIP_VERSION: '20.0.2' common_pip_pkgs: - pip=={{ COMMON_PIP_VERSION }} - configparser==4.0.2 - - 'setuptools<59.7.0,>=59.1.1' + - setuptools==44.1.0 - virtualenv==20.2.0 - zipp==1.2.0 - boto3 diff --git a/util/install/native.sh b/util/install/native.sh index 94faa4b9079..1322f0be1f9 100644 --- a/util/install/native.sh +++ b/util/install/native.sh @@ -102,7 +102,7 @@ sudo apt-get install -y build-essential software-properties-common curl git-core # ansible-bootstrap installs yaml that pip 19 can't uninstall. sudo apt-get remove -y python-yaml sudo pip3 install --upgrade pip==20.0.2 -sudo pip3 install --upgrade 'setuptools<59.7.0,>=59.1.1' +sudo pip3 install --upgrade setuptools==44.1.0 sudo -H pip3 install --upgrade virtualenv==20.2.0 ## From 100233278b64a72bfd8018033621d5458621cddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Boros?= Date: Tue, 22 Mar 2022 17:11:19 +0100 Subject: [PATCH 4/6] Update openedx_native.yml --- playbooks/openedx_native.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/openedx_native.yml b/playbooks/openedx_native.yml index e62637e0025..f9e46c566ee 100644 --- a/playbooks/openedx_native.yml +++ b/playbooks/openedx_native.yml @@ -7,6 +7,10 @@ become: True gather_facts: True vars: + # TODO: @gabor-boros - remove this line when we upgrade to Maple. For more information: + # https://tasks.opencraft.com/browse/SE-4860 + EDXAPP_EXTRA_REQUIREMENTS: '{{ EDXAPP_EXTRA_REQUIREMENTS + [{"name": "setuptools<59.7.0,>=59.1.1"}] }}' + migrate_db: "yes" MFE_DEPLOY_NGINX_PORT: 19010 MFE_BASE: "{{ EDXAPP_LMS_BASE }}:{{ MFE_DEPLOY_NGINX_PORT }}" From 161a94677509d99ab67cb00010a0adc1d33e895c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Boros?= Date: Wed, 23 Mar 2022 08:39:09 +0100 Subject: [PATCH 5/6] revert custom extra requirements --- playbooks/openedx_native.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/playbooks/openedx_native.yml b/playbooks/openedx_native.yml index f9e46c566ee..e62637e0025 100644 --- a/playbooks/openedx_native.yml +++ b/playbooks/openedx_native.yml @@ -7,10 +7,6 @@ become: True gather_facts: True vars: - # TODO: @gabor-boros - remove this line when we upgrade to Maple. For more information: - # https://tasks.opencraft.com/browse/SE-4860 - EDXAPP_EXTRA_REQUIREMENTS: '{{ EDXAPP_EXTRA_REQUIREMENTS + [{"name": "setuptools<59.7.0,>=59.1.1"}] }}' - migrate_db: "yes" MFE_DEPLOY_NGINX_PORT: 19010 MFE_BASE: "{{ EDXAPP_LMS_BASE }}:{{ MFE_DEPLOY_NGINX_PORT }}" From 75a3d1ff81cdf7cdef9523a5707adaef3014dbf5 Mon Sep 17 00:00:00 2001 From: nadeemshahzad Date: Fri, 15 Apr 2022 16:26:44 +0500 Subject: [PATCH 6/6] fix: add safe directory config and use escalated privileges with git clean (cherry picked from commit 1f4ff355d9df684a215617ea7e3d8802864b6f8a) --- playbooks/roles/git_clone/tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/playbooks/roles/git_clone/tasks/main.yml b/playbooks/roles/git_clone/tasks/main.yml index 09d3bf32dff..07a52eb1e5d 100644 --- a/playbooks/roles/git_clone/tasks/main.yml +++ b/playbooks/roles/git_clone/tasks/main.yml @@ -111,6 +111,15 @@ - install - install:code +- name: Run git safe.directory + shell: git config --global --add safe.directory {{ item.DESTINATION }} + become: true + with_items: "{{ GIT_REPOS }}" + no_log: "{{ GIT_CLONE_NO_LOGGING }}" + tags: + - install + - install:code + - name: Run git clean after checking out code shell: cd {{ item.DESTINATION }} && git clean -xdf become: true