diff --git a/playbooks/discussions.yml b/playbooks/discussions.yml new file mode 100644 index 000000000..851599061 --- /dev/null +++ b/playbooks/discussions.yml @@ -0,0 +1,17 @@ +- name: Deploy discussions MFE Frontend + hosts: all + become: True + gather_facts: True + vars: + ENABLE_NEWRELIC: False + CLUSTER_NAME: 'discussions' + MYMFE_ENABLED: True + MYMFE_SANDBOX_BUILD: False + roles: + - role: mfe + MFE_NAME: discussions + MFE_VERSION: '{{ DISCUSSIONS_MFE_VERSION }}' + - role: splunkforwarder + when: COMMON_ENABLE_SPLUNKFORWARDER + - role: newrelic_infrastructure + when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE \ No newline at end of file diff --git a/playbooks/edx_continuous_integration.yml b/playbooks/edx_continuous_integration.yml index fdc34ee38..bc07e9a70 100644 --- a/playbooks/edx_continuous_integration.yml +++ b/playbooks/edx_continuous_integration.yml @@ -38,7 +38,8 @@ - oraclejdk - elasticsearch - opensearch - - forum + - role: forum + when: FORUM_USE_CS_COMMENTS_SERVICE | default(false) - { role: "xqueue", update_users: True } - edx_ansible - analytics_api @@ -82,6 +83,9 @@ - role: mfe MFE_NAME: learner-dashboard when: LEARNER_DASHBOARD_MFE_ENABLED + - role: mfe + MFE_NAME: discussions + when: DISCUSSIONS_MFE_ENABLED | default(false) - { role: oauth_client_setup, when: edxapp_containerized is defined and not edxapp_containerized } - role: datadog when: COMMON_ENABLE_DATADOG diff --git a/playbooks/roles/edx_ansible/templates/update.j2 b/playbooks/roles/edx_ansible/templates/update.j2 index dbca95613..abf4c02fb 100644 --- a/playbooks/roles/edx_ansible/templates/update.j2 +++ b/playbooks/roles/edx_ansible/templates/update.j2 @@ -16,7 +16,7 @@ IFS="," - must be one of edx-platform, edx-workers, xqueue, cs_comments_service, credentials, configuration, read-only-certificate-code, edx-analytics-data-api, edx-ora2, insights, ecommerce, discovery, video_web_frontend, video_delivery_worker, veda_pipeline_worker, video_encode_worker, veda_ffmpeg, - registrar, program_console, learner_portal, prospectus, authn, payment, learning, ora_grading, enterprise_catalog + registrar, program_console, learner_portal, prospectus, authn, payment, learning, discussions, ora_grading, enterprise_catalog - can be a commit or tag - specify extra_vars to any of the ansible plays with the -e switch and then ecaptulating your vars in "double quotes" example: update -e "-e 'hallo=bye' -e 'bye=hallo'" @@ -81,6 +81,7 @@ repos_to_cmd["prospectus"]="$edx_ansible_cmd prospectus.yml -e 'PROSPECTUS_VERSI repos_to_cmd["authn"]="$edx_ansible_cmd authn_frontend.yml -e 'AUTHN_MFE_VERSION=$2'" repos_to_cmd["payment"]="$edx_ansible_cmd payment.yml -e 'PAYMENT_MFE_VERSION=$2'" repos_to_cmd["learning"]="$edx_ansible_cmd learning.yml -e 'LEARNING_MFE_VERSION=$2'" +repos_to_cmd["discussions"]="$edx_ansible_cmd discussions.yml -e 'DISCUSSIONS_MFE_VERSION=$2'" repos_to_cmd["course_authoring"]="$edx_ansible_cmd course_authoring.yml -e 'COURSE_AUTHORING_MFE_VERSION=$2'" repos_to_cmd["library_authoring"]="$edx_ansible_cmd library_authoring.yml -e 'COURSE_AUTHORING_MFE_VERSION=$2'" repos_to_cmd["ora_grading"]="$edx_ansible_cmd ora_grading.yml -e 'ORA_GRADING_MFE_VERSION=$2'" diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index fe09a8c3c..f4c1b6952 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -1122,6 +1122,9 @@ EDXAPP_DASHBOARD_COURSE_LIMIT: null # Completion Aggregator URL needed for progress bar EDXAPP_COMPLETION_AGGREGATOR_URL: null +# Discussion microfrontend URL +EDXAPP_DISCUSSIONS_MICROFRONTEND_URL: null + #-------- Everything below this line is internal to the role ------------ #Use YAML references (& and *) and hash merge <<: to factor out shared settings @@ -1722,6 +1725,7 @@ lms_env_config: ACCOUNT_MICROFRONTEND_URL: "{{ EDXAPP_ACCOUNT_MICROFRONTEND_URL }}" PROGRAM_CONSOLE_MICROFRONTEND_URL: "{{ EDXAPP_PROGRAM_CONSOLE_MICROFRONTEND_URL}}" LEARNING_MICROFRONTEND_URL: "{{ EDXAPP_LEARNING_MICROFRONTEND_URL}}" + DISCUSSIONS_MICROFRONTEND_URL: "{{ EDXAPP_DISCUSSIONS_MICROFRONTEND_URL }}" DCS_SESSION_COOKIE_SAMESITE: "{{ EDXAPP_DCS_SESSION_COOKIE_SAMESITE }}" DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL: "{{ EDXAPP_DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL }}" diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index 4552fdb55..21290e0a5 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -618,3 +618,18 @@ tags: - manage - manage:db + +- name: create forum v2 waffle flags + shell: > + . /edx/app/edxapp/edxapp_env && + /edx/app/edxapp/venvs/edxapp/bin/python ./manage.py lms --settings=production + waffle_flag --create --everyone {{ item }} + args: + chdir: /edx/app/edxapp/edx-platform + loop: + - discussions.enable_forum_v2 + - forum_v2.enable_mysql_backend + - discussions.enable_discussions_mfe + - discussions.override_discussion_legacy_settings + - discussions.pages_and_resources_mfe + - discussions.enable_new_structure_discussions diff --git a/playbooks/roles/launch_ec2/tasks/main.yml b/playbooks/roles/launch_ec2/tasks/main.yml index 33ccab3c2..e0ac6be78 100644 --- a/playbooks/roles/launch_ec2/tasks/main.yml +++ b/playbooks/roles/launch_ec2/tasks/main.yml @@ -91,7 +91,7 @@ with_nested: - "{{ ec2.instances }}" - ['studio', 'ecommerce', 'preview', 'discovery', 'credentials', 'veda', 'analytics-api', 'registrar', 'program-console', - 'learner-portal', 'prospectus', 'authn', 'payment', 'license-manager', 'learning', 'enterprise-catalog', 'ora-grading', + 'learner-portal', 'prospectus', 'authn', 'payment', 'license-manager', 'learning', 'discussions', 'enterprise-catalog', 'ora-grading', 'course-authoring','library-authoring', 'commerce-coordinator', 'edx-exams', 'subscriptions', 'profile', 'learner-dashboard'] - name: Add new instance to host group diff --git a/util/jenkins/ansible-provision.sh b/util/jenkins/ansible-provision.sh index 8a2a23634..0b5a8f764 100644 --- a/util/jenkins/ansible-provision.sh +++ b/util/jenkins/ansible-provision.sh @@ -283,6 +283,14 @@ if [[ -z $learning_version ]]; then LEARNING_MFE_VERSION="master" fi +if [[ -z $discussions ]]; then + discussions="${forum:-false}" +fi + +if [[ -z $discussions_version ]]; then + DISCUSSIONS_MFE_VERSION="master" +fi + if [[ -z $ora_grading ]]; then ora_grading="false" fi @@ -465,6 +473,12 @@ LEARNING_MFE_VERSION: $learning_version LEARNING_MFE_ENABLED: $learning LEARNING_SANDBOX_BUILD: True +DISCUSSIONS_NGINX_PORT: 80 +DISCUSSIONS_SSL_NGINX_PORT: 443 +DISCUSSIONS_MFE_VERSION: $discussions_version +DISCUSSIONS_MFE_ENABLED: $discussions +DISCUSSIONS_SANDBOX_BUILD: True + ORA_GRADING_NGINX_PORT: 80 ORA_GRADING_SSL_NGINX_PORT: 443 ORA_GRADING_MFE_VERSION: $ora_grading_version @@ -586,6 +600,7 @@ EDXAPP_ECOMMERCE_PUBLIC_URL_ROOT: "https://ecommerce-${deploy_host}" EDXAPP_ECOMMERCE_API_URL: "https://ecommerce-${deploy_host}/api/v2" EDXAPP_DISCOVERY_API_URL: "https://discovery-${deploy_host}/api/v1" EDXAPP_COURSE_CATALOG_API_URL: "{{ EDXAPP_DISCOVERY_API_URL }}" +EDXAPP_DISCUSSIONS_MICROFRONTEND_URL: "https://discussions-${deploy_host}" ANALYTICS_API_LMS_BASE_URL: "https://{{ EDXAPP_LMS_BASE }}/" @@ -717,7 +732,7 @@ EOF fi declare -A deploy -plays="prospectus edxapp forum ecommerce credentials discovery enterprise_catalog analyticsapi xqueue certs demo testcourses registrar program_console learner_portal" +plays="prospectus edxapp ecommerce credentials discovery enterprise_catalog analyticsapi xqueue certs demo testcourses registrar program_console learner_portal" for play in $plays; do deploy[$play]=${!play}