Open kdmccormick opened 3 months ago
I have updated the Django settings to clarify that we will also be removing the STATIC_ROOT_BASE Django setting.
Now that this is accepted, I'll split the removal into three steps:
Step 1 is free of downstream contingencies. It is safe to happen at any time.
For Step 2, we'll coordinate with early deployers (2U) so that they have time to update their deployment scripts to avoid the assets and prereqs commands. This step will deliver a speed-up to the production Tutor build.
For Step 3, we'll need to move the remaining quality/js checks out of Paver, uninstall Paver, and a do bulk sweep through the docs and update all instructions that still specify "paver".
FYI, I created https://github.com/openedx/edx-platform/issues/34834 to handle a specific github workflow around paver assets that also needs an enhancement.
That workflow update ^ is now handled.
Here is an epic to handle the remaining upstream CI updates:
As of May 7th 2024, the operator-facing Paver commands have been fully replaced with npm & django commands. The replacement commands are being invoked in Redwood (directly) and on edx.org (via legacy Paver wrappers). Given that, we're targeting Nov 7th 2024 for removal of the Paver wrappers, or earlier if our first deployers (2U) indicate that they're ready. I've updated this ticket's description and added "Operators: ACTION REQUIRED" wherever I believe operators need to migrate; I'll make sure those land in the Sumac release notes too. Operators, let me know if there's anything I can do to clarify. Thanks!
The ticket currently says under Replacement Available « Internal CI commands: 2024-11-09, Sumac (Target) » but that's after the targeted removal date of Nov 7. It sounds like maybe the replacements are already available, though?
So Kyle broke this out into a couple of different sections above (different tables). The Commands with known users (Operators: ACTION REQUIRED)
and the Commands without known users
sections have replacements that have already been implemented as of right now. In some cases the "replacement" is just calling the underlying command directly.
The unfinished section is the Commands used by internal CI
where some have been implemented but some still remain. Let me know if that doesn't answer your questions.
What @feanil says is right. I've tried to amend the description to be a bit clearer. In retrospect, it may have been clearer to just have two DEPR tickets, but doing that now would probably just add confusion. @timmc-edx let me know if it's still unclear.
I see now, thanks!
Just putting it here as a note for something that I/someone else could do: would be nice to create a make command for running asset processing, because otherwise I will forget the correct way of doing it.
Just putting it here as a note for something that I/someone else could do: would be nice to create a make command for running asset processing, because otherwise I will forget the correct way of doing it.
FWIW, it's just npm run build
or npm run build-dev
, that does all the things and aligns with our MFEs which do npm build
to build out the serialized assets.
Also there is a full guide in the docs: https://github.com/kdmccormick/edx-platform/blob/master/docs/references/static-assets.rst
Oh, awesome! I have been around too long and of course I didn't think to read the doc. 😅
:information_source: This DEPR ticket considers the Paver commands in two groups:
Timeline
Communicated
Operator-facing commands: 2023-03-08 (thread) Internal CI commands: 2024-05-01 (thread)
Acceptance
Operator-facing commands: 2023-05-03 Internal CI commands: 2024-05-21
Replacement available
Operator-facing commands: 2024-05-07, Redwood Internal CI commands: 2024-11-09, Sumac (Target)
Earliest removal
Operator-facing commands: 2024-11-09, Sumac Internal CI commands: as soon as replacement is available
Rationale
edx-platform historically handled its build scripts with paver:
Using paver has a few problems:
paver
package, this means that we installlibsass-python
in production, which takes 60+ seconds (!) to compile and install.For the Paver Asset commands in particular, more depth is provided in the 'Reimplement edx-platform static asset processing' ADR.
Replacement
pylint
, etc.) when possible, Makefile targets otherwisepip
Migration
To ease migration for Paver users, in Redwood, each Paver Asset command will simply proxy to its replacement command, and will raise a deprecation warning explaining the new command that it is running.
By Nov 7th 2024, operators will need to have switched to the new commands, taking the steps indicated below by ACTION REQUIRED.
Requirements (Operators: ACTION REQUIRED)
In Redwood and earlier, Paver and its dependencies were included in requirements/edx/base.txt
Starting in Sumac, these dependencies will be removed from requirements/edx/base.txt. Instead, operators will need to install:
Operator-facing commands with known users (Operators: ACTION REQUIRED)
These replacements are production-ready as of May 7th, for Redwood.
paver update_assets
npm run build && ./manage.py lms collecstatic --noinput && ./manage.py cms collectstatic
paver process_xmodule_assets
paver compile_sass
npm run compile-sass
./manage.py [lms/cms] compile_sass
npm run compile-sass
paver webpack
npm run webpack
paver watch_assets
npm run watch
paver install_prereqs
pip install -r requirements/edx/base.txt -r requirements/edx/assets.txt && npm clean-install
paver install_node_prereqs
npm clean-install
paver uninstall_python_packages
paver install_coverage_prereqs
pip install -r requirements/edx/coverage.txt
paver install_python_prereqs
pip install -r requirements/edx/base.txt
Operator-facing commands without known users
These commands have been replaced for a long time. We don't know of any users of them, except the old Vagrant Devstack, which was deprecated 8 years ago.
paver build_docs
make docs
paver i18n_validate_gettext
which xgettext
paver i18n_extract
make extract_translations
paver i18n_dummy
i18n_tool dummy && i18n_tool generate
paver i18n_generate
i18n_tool generate
paver i18n_generate_strict
i18n_tool generate --strict
paver i18n_clean
make clean_translations
paver check_settings
paver lms
./manage.py lms runserver
paver studio
./manage.py cms runserver
paver run_all_servers
tutor local ...
paver devstack
tutor dev ...
Internal CI commands
These commands are only used by the upstream openedx project for CI. They will replaced before Sumac. Operators do not need to take action.
paver find_fixme
paver run_eslint
eslint
paver run_stylelint
make stylelint_js
paver run_xsslint
make xsslint
paver run_pii_check
make pii_check
paver check_keywords
make check_keywords
paver run_quality
pylint
paver run_pylint
pylint
paver run_pep8
pycodestyle
paver diff_coverage
make diff_coverage_js
paver test_js
make test_js
paver test_js_run
make test_js
paver test_js_dev
make test_js MODE=browser
Django settings for Asset commands (Operators: ACTION REQUIRED)
In order to reimplement the Paver Asset commands without Python/Django, we are changing how several settings are configured.
The following Django settings are becoming read-only mirrors. If you override them now, remove your overrides:
STATIC_ROOT
(a string, loaded fromSTATIC_ROOT_LMS
env var)COMPREHENSIVE_THEME_DIRS
(loaded from the env var, parsed into a list of strings)STATIC_ROOT
(a string, loaded fromSTATIC_ROOT_CMS
env var)COMPREHENSIVE_THEME_DIRS
(loaded from the env var, parsed into a list of strings)The following Django settings are being removed. If you override them now, remove your overrides:
STATIC_ROOT_BASE
WEBPACK_CONFIG_PATH
JS_ENV_EXTRA_CONFIG
STATIC_ROOT_BASE
WEBPACK_CONFIG_PATH
JS_ENV_EXTRA_CONFIG
The following new environment variables are available. Set these in your environment, in place of the overrides you removed above:
STATIC_ROOT_LMS
(path)STATIC_ROOT_CMS
(path)COMPREHENSIVE_THEME_DIRS
(colon-separated paths)WEBPACK_CONFIG_PATH
(path)JS_ENV_EXTRA_CONFIG
(serialized as json)Note: If you previously set the
STATIC_ROOT_BASE
Django setting to/blah
, then you should now set the LMS and CMS environment variables as so:STATIC_ROOT_LMS=/blah
STATIC_ROOT_CMS=/blah/studio
Deprecation
In time for Redwood, deprecation warnings will be added to all edx-platform Paver Asset commands.
Removal
In edx-platform:
Elsewhere in the openedx GitHub org:
In Tutor: