Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure mounted installable packages are installed as expected #1016

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tutor/commands/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _add_core_init_tasks() -> None:
hooks.Filters.CLI_DO_INIT_TASKS.add_item(
(
"lms",
env.read_core_template_file("jobs", "init", "mounted-edx-platform.sh"),
env.read_core_template_file("jobs", "init", "mounted-directories.sh"),
),
# If edx-platform is mounted, then we may need to perform some setup
# before other initialization scripts can be run.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# The initialization job contains various re-install operations needed to be done
# on mounted directories (edx-platform, /mnt/*xblock)
# 1. /mnt/*xblock
# Whenever xblocks are mounted, during the image build time, they are copied over to container and
# installed. This results in egg_info generation for the mounted xblocks. However, the egg_info is not carried
# over to host. When the containers are launched, the host directories without egg_info are mounted on runtime
# and disappear from pip list.
# 2. edx-platform
# When a new local copy of edx-platform is bind-mounted, certain build
# artifacts from the openedx image's edx-platform directory are lost.
# We regenerate them here.


for mounted_xblock in /mnt/*xblock/; do
regisb marked this conversation as resolved.
Show resolved Hide resolved
if ! ls "$mounted_xblock"*.egg-info >/dev/null 2>&1; then
echo "Unable to locate egg-info in $mounted_xblock"
pip install -e $mounted_xblock
fi
done

if [ -f /openedx/edx-platform/bindmount-canary ] ; then
# If this file exists, then edx-platform has not been bind-mounted,
# so no build artifacts need to be regenerated.
Expand Down
Loading