Skip to content

Commit

Permalink
feat: add minimal atlas step to the build
Browse files Browse the repository at this point in the history
This contribution is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
  • Loading branch information
OmarIthawi authored and regisb committed Oct 16, 2023
1 parent 1667af1 commit b9dd940
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/20230909_160414_i_atlas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Feature] Pull translations via `atlas` during Docker build. (by @OmarIthawi)
1 change: 1 addition & 0 deletions tutordiscovery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"OAUTH2_KEY_SSO": "discovery-sso",
"OAUTH2_KEY_SSO_DEV": "discovery-sso-dev",
"CACHE_REDIS_DB": "{{ OPENEDX_CACHE_REDIS_DB }}",
"ATLAS_PULL": False,
"EXTRA_PIP_REQUIREMENTS": [],
},
}
Expand Down
12 changes: 10 additions & 2 deletions tutordiscovery/templates/discovery/build/discovery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked{% endif %} \
apt update && \
apt install -y curl git-core language-pack-en python3 python3-dev python3-pip python3-venv \
apt install -y curl git-core gettext language-pack-en python3 python3-dev python3-pip python3-venv \
build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \
pkg-config
ENV LC_ALL en_US.UTF-8
Expand Down Expand Up @@ -61,7 +61,15 @@ RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,
# Use redis as a django cache https://pypi.org/project/django-redis/
django-redis==5.2.0 \
# uwsgi server https://pypi.org/project/uWSGI/
uwsgi==2.0.21
uwsgi==2.0.21 \
# Open edX Atlas tranlsation management tool https://pypi.org/project/openedx-atlas/
openedx-atlas==0.5.0

{% if DISCOVERY_ATLAS_PULL %}
# Pull translations. Support the OEP-58 proposal behind a feature flag until it's fully implemented.
RUN atlas pull {{ patch("atlas-extra-args") }} translations/course-discovery/course_discovery/conf/locale:course_discovery/conf/locale
RUN python manage.py compilemessages
{% endif %}

# Collect static assets
COPY --chown=app:app assets.py ./course_discovery/settings/assets.py
Expand Down

0 comments on commit b9dd940

Please sign in to comment.