This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #827 from open-craft/alfred/enable-couse-block-str…
…ucture-caching [FAL-2123] Ocim Add playbook and block structure caching configuration
- Loading branch information
Showing
5 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
playbooks/enable_course_block_structure_caching/enable_course_block_structure_caching.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
# This playbook enable course block structure caching (more detail in FAL-2033) | ||
|
||
- hosts: all | ||
tasks: | ||
- name: Create BlockStructureConfiguration | ||
shell: | | ||
echo 'from openedx.core.djangoapps.content.block_structure.config.models import BlockStructureConfiguration | ||
if BlockStructureConfiguration.objects.count() == 0 : BlockStructureConfiguration.objects.create(enabled=True, num_versions_to_keep=1, cache_timeout_in_seconds=None)' | /edx/bin/edxapp-shell-lms | ||
- name: Generate cache | ||
shell: "sudo -Hsu www-data bash -c '. /edx/app/edxapp/edxapp_env && python /edx/bin/manage.edxapp lms generate_course_blocks --all_courses --with_storage --force_update'" | ||
|
||
- name: Enable waffle switch block_structure.raise_error_when_not_found | ||
shell: "sudo -Hsu www-data bash -c '. /edx/app/edxapp/edxapp_env && /edx/app/edxapp/venvs/edxapp/bin/python /edx/bin/manage.edxapp lms waffle_switch --create block_structure.raise_error_when_not_found off'" | ||
|
||
- name: Enable waffle switch block_structure.invalidate_cache_on_publish | ||
shell: "sudo -Hsu www-data bash -c '. /edx/app/edxapp/edxapp_env && /edx/app/edxapp/venvs/edxapp/bin/python /edx/bin/manage.edxapp lms waffle_switch --create block_structure.invalidate_cache_on_publish off'" | ||
|
||
- name: Enable waffle switch block_structure.storage_backing_for_cache | ||
shell: "sudo -Hsu www-data bash -c '. /edx/app/edxapp/edxapp_env && /edx/app/edxapp/venvs/edxapp/bin/python /edx/bin/manage.edxapp lms waffle_switch --create block_structure.storage_backing_for_cache on'" |
1 change: 1 addition & 0 deletions
1
playbooks/enable_course_block_structure_caching/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ansible==2.8.17 |