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

feat: add minimal atlas step to the build FC-0012 #41

Merged
merged 1 commit into from
Oct 16, 2023
Merged
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
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,
Copy link

@shadinaif shadinaif Nov 13, 2023

Choose a reason for hiding this comment

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

@OmarIthawi , shouldn't this be DISCOVERY_ATLAS_PULL ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shadinaif the prefix is automatically added via Tutor. So in the config.yaml file it will be DISCOVERY_ATLAS_PULL: true.

Choose a reason for hiding this comment

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

Thank you!

"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 %}
regisb marked this conversation as resolved.
Show resolved Hide resolved
# 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