Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Feature] Use a separate storage for storing live dependencies. (by @mlabeeb03)
6 changes: 6 additions & 0 deletions tutorlivedeps/patches/openedx-common-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
STORAGES["livedeps"] = {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
"OPTIONS": {
"bucket_name": "livedeps",
},
}
3 changes: 1 addition & 2 deletions tutorlivedeps/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ def build_live_dependencies(context: Context) -> t.Iterable[tuple[str, str]]:
archive_path = shutil.make_archive(base[:-4], format="zip", root_dir=DEPS_DIR)

with open(archive_path, "rb") as f:
# TODO Use a separate storage for live dependencies
storages["default"].save(DEPS_KEY, File(f))
storages["livedeps"].save(DEPS_KEY, File(f))
'
"""

Expand Down
3 changes: 1 addition & 2 deletions tutorlivedeps/templates/livedeps/build/monitor_livedeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
DEPS_ZIP_PATH = DEPS_DIR[:-4] + DEPS_KEY
TRIGGER_FILE = "/openedx/live-dependencies/uwsgi_trigger"

# TODO Use a separate storage for live dependencies
storage = storages["default"]
storage = storages["livedeps"]

while True:
if storage.exists(DEPS_KEY):
Expand Down
3 changes: 1 addition & 2 deletions tutorlivedeps/templates/livedeps/build/update_livedeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
DEPS_KEY = "deps.zip"
DEPS_ZIP_PATH = DEPS_DIR[:-4] + DEPS_KEY

# TODO Use a separate storage for live dependencies
storage = storages["default"]
storage = storages["livedeps"]

if storage.exists(DEPS_KEY):
if os.path.exists(DEPS_DIR):
Expand Down