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

perf: add redwood compatibility #68

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## v18.0.0 - 2024-06-27

### [18.0.0](https://github.com/eduNEXT/tutor-contrib-edunext-distro/compare/v17.2.0...v18.0.0) (2024-06-27)

#### ⚠ BREAKING CHANGES

* Add support to Redwood ([885e0b9](https://github.com/eduNEXT/tutor-contrib-edunext-distro/commit/885e0b955722e4d86f89547764537ee74f707cf9)); the main change
magajh marked this conversation as resolved.
Show resolved Hide resolved

* Fix when 'tutor distro enable-themes' was executed before, a new execution hung when it tried to overwrite the existing theme folder. The process requires confirmation ('yes') to proceed with the overwrite, but it did not receive this input automatically, leading to a freeze ([1924007](https://github.com/eduNEXT/tutor-contrib-edunext-distro/commit/1924007d121b46c9dc5949810f1e7f89fdf0fad2))
magajh marked this conversation as resolved.
Show resolved Hide resolved

## v17.2.0 - 2024-04-05

### [17.2.0](https://github.com/eduNEXT/tutor-contrib-edunext-distro/compare/v17.1.0...v17.2.0) (2024-04-05)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ Please see the following table for details on compatibility.
| olive | v15 |
| palm | v16 |
| quince | v17 |
| redwood | v18 |

Then, specify the docker image variables to identify your custom images, like the example:

```yaml
DOCKER_IMAGE_OPENEDX: 'docker.io/ednxops/distro-edunext-edxapp:quince'
DOCKER_IMAGE_OPENEDX_DEV: 'docker.io/ednxops/distro-edunext-edxapp-dev:quince'
DOCKER_IMAGE_OPENEDX: "docker.io/ednxops/distro-edunext-edxapp:redwood"
DOCKER_IMAGE_OPENEDX_DEV: "docker.io/ednxops/distro-edunext-edxapp-dev:redwood"
```

Finally, launch your instance or build a new image to reflect the changes.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 17.2.0
current_version = 18.0.0
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load_about():
packages=find_packages(),
include_package_data=True,
python_requires=">=3.8",
install_requires=["tutor>=17.0.3, <18", "click", "schema"],
install_requires=["tutor>=18.0.0, <19", "click", "schema"],
extras_require={
"test": ["behave", "pytest", "pylint", "pytest-mock", "pycodestyle", "isort", "schema"]
},
Expand Down
2 changes: 1 addition & 1 deletion tutordistro/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Tutor Distro version.
"""

__version__ = "17.2.0"
__version__ = "18.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,24 @@ def run_command(self, command: str):
command (str): Tutor command.
"""
try:
process = subprocess.run(
print(f'Running "{command}"')
BryanttV marked this conversation as resolved.
Show resolved Hide resolved
bra-i-am marked this conversation as resolved.
Show resolved Hide resolved

with subprocess.Popen(
command,
shell=True,
check=True,
capture_output=True,
executable="/bin/bash",
)
# This print is left on purpose to show the command output
print(process.stdout.decode())
magajh marked this conversation as resolved.
Show resolved Hide resolved
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
) as process:

stdout, stderr = process.communicate(input="y")

if process.returncode != 0 or "error" in stderr.lower():
raise subprocess.CalledProcessError(
process.returncode, command, output=stdout, stderr=stderr
)

except subprocess.CalledProcessError as error:
raise CommandError(
f"Error running command '{error.cmd}':\n{error.stderr.decode()}"
) from error
raise CommandError(f"\n{error.stderr}") from error
15 changes: 7 additions & 8 deletions tutordistro/patches/openedx-dockerfile-pre-assets
bra-i-am marked this conversation as resolved.
Show resolved Hide resolved
magajh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
ENV NO_PYTHON_UNINSTALL 1
ENV NO_PREREQ_INSTALL 1
RUN openedx-assets xmodule \
&& openedx-assets npm \
&& openedx-assets webpack --env=prod \
&& openedx-assets common
RUN npm run postinstall \
&& npm run webpack \
&& npm run compile-sass -- --skip-themes
{% if DISTRO_THEMES_ROOT is defined %}
COPY --chown=app:app ./themes/ {{ DISTRO_THEMES_ROOT }}
{% endif %}
{% if DISTRO_THEME_DIRS is defined and DISTRO_THEMES_NAME is defined %}
RUN openedx-assets themes \
--theme-dirs {{ DISTRO_THEME_DIRS | join(' ') }} \
--themes {{ DISTRO_THEMES_NAME | join(' ') }} \
&& openedx-assets collect --settings=tutor.assets \
RUN npm run compile-sass -- \
--theme-dir {{ DISTRO_THEME_DIRS | join(' --theme-dir ') }} \
--theme {{ DISTRO_THEMES_NAME | join(' --theme ') }} \
&& ./manage.py lms collectstatic --noinput --settings=tutor.assets \
&& rdfind -makesymlinks true -followsymlinks true /openedx/staticfiles/
{% endif %}
Loading