Skip to content

build: expose working openedx/lms and openedx/cms docker images - #29549

Merged
kdmccormick merged 1 commit into
masterfrom
kdmccormick/docker
Jan 10, 2022
Merged

kdmccormick merged 1 commit into
masterfrom
kdmccormick/docker

Conversation

@kdmccormick

@kdmccormick kdmccormick commented Dec 10, 2021 •

Copy link
Copy Markdown
Member

Description

This PR 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 lms.yml and cms.yml configuration files, 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.

Testing instructions

See the testing instructions for the devstack PR.

Other information

This is blocked on the CMS vs Studio ADR. Whatever the result of that ADR is, I'll update the image tags here to match. Resolved.

Supporting information

This is a dependency attempt to use the experimental images in devstack, which itself is part of the effort to move off of edxops DockerHub org images.

@edx-status-bot

Copy link
Copy Markdown

Your PR has finished running tests. The following contexts failed:

  • jenkins/python

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes for reviewers

Comment thread Dockerfile Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No substantive changes to the system requirements; I just indented them to make the structure of the chained commands more apparent.

Comment thread Dockerfile Outdated
Comment on lines 60 to 63

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no changes here, just added equals signs and quotes for consistency.

Comment thread Dockerfile Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SETTINGS had no effect, so I nixed it.

I did, however, add EDX_PLATFORM_SETTINGS, which is looked at by our custom ./manage.py.

Comment thread Dockerfile Outdated
Comment on lines 66 to 68

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No substantive changes here, but I did factor CONFIG_ROOT out of LMS/STUDIO_CFG.

Comment thread Dockerfile Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

venv creation is moved downwards so that all base environment variables are in one place.

Comment thread Dockerfile Outdated
Comment on lines 104 to 150

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again: same old command, broken across lines.

Comment thread Dockerfile Outdated
Comment on lines 106 to 108

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, nix the newrelic stuff.

Comment thread Makefile Outdated
Comment on lines 157 to 165

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I promise I'll remove this block before merging.

Comment thread .dockerignore Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the Dockerfile in the docker context makes it super annoying to hack on the Dockerfile, because every time you change the Dockerfile, most of the build cache is busted.

Comment thread scripts/provision-demo-course.sh Outdated
Comment on lines 1 to 3

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script (and its LMS companion, provision-demo-users.sh) replaces the Ansible playbook in edx/configuration which provisions demo course and users for devstack.

I wasn't sure whether it belonged in here or in devstack. I chose here, in the spirit of "every service repo should have the materials necessary to build, run, and test itself", but I could be swayed into moving this code into edx/devstack.

@kdmccormick
kdmccormick marked this pull request as ready for review December 22, 2021 21:01
@kdmccormick
kdmccormick marked this pull request as draft December 22, 2021 21:12
@kdmccormick
kdmccormick force-pushed the kdmccormick/docker branch 2 times, most recently from 81b389b to 70a0cd8 Compare December 23, 2021 17:41
@kdmccormick
kdmccormick marked this pull request as ready for review December 23, 2021 17:44

@feanil feanil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, had 1 question.

Comment thread Dockerfile Outdated
# Env vars: path
ENV VIRTUAL_ENV='/edx/app/edxapp/venvs/edxapp'
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PATH="./node_modules/.bin:${PATH}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an explicit path instead of a relative path to where you are?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, the original Dockerfile used a relative path. I'm going to dig around git blame to see if there's any reason for using relative instead of absolute.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming up dry on any reasoning for the relative path. Since the edxops/edxapp image uses the full path, I'll update this to also use the full path. Thanks for catching.

Comment thread Dockerfile Outdated
Comment on lines 96 to 98

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr; I support this change, but putting my thinking down below in case it's useful to others..

At first, I had mixed feelings about this because I know that edX will need this bit for the image to be usable for them in production use-cases. Not having this here would require to create custom dockerfiles that built on top of this base image. However, as I thought more about it, I realized there are other issues specific to edX that would require them to do that anyway. In particular, they would need a custom image to install XBlocks and Plugins specific to edX.org that are not public or default for the Open edX Platform.

@kdmccormick kdmccormick changed the title build: expose working openedx/lms and openedx/studio docker images build: expose working openedx/lms and openedx/cms docker images Jan 4, 2022

@feanil feanil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One reminder to clean-up your testing make target which I'm sure you already have a note for but otherwise this looks good and I think can be merged.

Comment thread Makefile Resolved
@kdmccormick
kdmccormick merged commit 29ed3d9 into master Jan 10, 2022
@kdmccormick
kdmccormick deleted the kdmccormick/docker branch January 10, 2022 16:20
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants