It's needed by `make common_constraints.txt`. We're starting to see
failures running this command in lms-shell in devstack. This has probably
been going on the entire time, but the error suppression was only removed
recently in <https://github.com/openedx/edx-platform/pull/33271>.
The new RUN instruction for installing wget is added to the development
layer only, partly to limit image sizes and partly to make life harder for
any attacker who manages to gain code execution in production.
I've moved `USER app` from the end of the `base` layer to the start of the
`production` layer, since the only other layer (in this file) that builds
on `base` is `development`, which more or less immediately switches back
to root. (The intervening COPY instruction is not affected by the current
user.)
Ticket: https://github.com/openedx/edx-platform/issues/33287
Two fixes:
* In the (in-repo, non-Tutor) Dockerfile, add copy-node-modules.sh
before `npm install`, since it is needed by the new postinstall hook.
* In paver/assets.py, run copy-node-modules.sh for backwards com-
patibility, just for cases where `SKIP_NPM_INSTALL` is enabled
(which would prevent our new postinstall hook from running
automatically!). We will deprecate the paver asset commands all at
once once the new non-paver stuff is 100% working.
We are still seeing issues running devstack provisioning
of LMS because it's missing pkg-config. We believe this might
be the location we need to add the package to.
Otherwise we're not really respecting the package-lock file and won't get
repeatable results.
Also:
- Clean up old error handling for npm<3. Were on npm 8 now. Probably
can get rid of this.
- Use the shorthand `npm ci` rather than `npm clean-install` just for
consistency with code elsewhere.
- Update comments in tests to be explicit about use of ci rather than
install
* fix: remove DJANGO_SETTINGS_MODULE env from Dockerfile
This variable is being removed from development target of Dockerfile because, we are using `EDX_PLATFORM_SETTINGS` env variable for picking settings file to use with Django management commands. When
this env variable is set to `lms.envs.devstack_docker`, with dev image being used with devstack, it picks that settings for running tests too as it has higher precedence than the settings in ini
file. So removing this, so the test settings can be picked from ini file.
* fix: move apt dependencies in base layer
Previously, git and build-essentials were being installed in builder-production layer so these depenedencies were not available in the dev images that are being used as LMS and Studion devstack
images. So moving these dependencies to base layer so it is pre-installed in devstack images.
* chore: Overhaul Dockerfile for sandboxes using Docker best practices
* Reduce image size by installing and removing prerequisite packages
in the same layer.
* Rearrange stages to use docker-production settings for non-dev
targets. docker-production settings already inherit production
settings and can be used to override configuration specific to
containers e.g. logging.
* chore: write improved Dockerfile2 just for testing
* chore: update development stage to not run as app user
* fix: wrap settings configuration in if statement
* chore: update Dockerfile.
* Moved code COPY command down in the base stage.
* Added comments.
Co-authored-by: Alie Langston <alangsto@wellesley.edu>
This commits prepares edx-platform's experimental Dockerfile
for optional use in devstack. Presently, the image built by this
Dockerfile isn't used anywhere.
Notable changes:
* Drop the openedx/edx-platform image name in favor of
openedx/lms and openedx/cms.
* Drop the newrelic stages and tags.
* Create openedx/lms-dev and openedx/cms-dev image
variants which use Django devserver, install dev
requirements, and specify devstack Django settings.
* Add config files at (lms,cms)/envs/devstack-experimental.yml,
extracted from the existing edxapp docker image.
* Adds three new scripts, each of which replaces an Ansible
or Paver-supported function with a pure bash + Django
management command implementation.
We have decided not to pursue the decentralized devstack design right
now and so we want to cleanup files and task that were built as a part
of the process.
Related Ticket: ARCHBOM-1685
* Add and push Dockerfile; add decentralized devstack settings
Co-Authored-By: Diana Huang <dkh@edx.org>
Co-Authored-By: Kyle McCormick <kmccormick@edx.org>
* Remove Python requirements hack
Remove the attempted optimization to the installation of Python
package dependencies. The dependencies in edx-platform change
about three times per day, so this was of dubious value. And
because npm is run through nodeenv, which is a Python package,
the Python dependencies installation has to happen first.
* ARCHBOM-1439: Changing workdir to /edx/app/edxapp/edx-platform (#24835)
Context: The Dockerfile tries to stay in sych with legacy stuff.
In the ansible we configure the directory structure such that things
relating to the app but not in the codebase,
such as the env file wind up in /edx/app/edxapp/.
And the codebase winds up in /edx/app/edxapp/edx-platform.
I think due to accident, the dockerfile does
/edx/app/edx-platform/edx-platform instead of /edx/app/edxapp/edx-platform.
This commit tries to have Dockerfile more reflect what is currently happening in production
* Update ports for decentralized devstack ARCHBOM-1447 (#24841)
Switch from the LMS ports we've historically used for NGINX to those used for gunicorn, and fix the Studio ports to match the ones we've historically used for its gunicorn service. Also removed some leftover bits of the requirements hack.
Co-authored-by: Adam Blackwell <ablackwell@edx.org>
Co-authored-by: Diana Huang <dkh@edx.org>
Co-authored-by: jinder1s <msingh@edx.org>
Co-authored-by: Jeremy Bowman <jbowman@edx.org>
Co-authored-by: Manjinder Singh <49171515+jinder1s@users.noreply.github.com>
From what I've gleaned, CONFIG_FILE (and LMS_CFG and STUDIO_CFG
environment variables) supercedes CONFIG_ROOT. There's no code anymore
that reads the value of the CONFIG_ROOT django setting, and in turn the
CONFIG_ROOT environment variable.
Tangentially related to DENG-369