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: clean translations before pulling them #1026

Merged
merged 1 commit into from
May 22, 2024

Conversation

kdmccormick
Copy link
Collaborator

@kdmccormick kdmccormick commented Mar 26, 2024

Description

If one is using a bind-mounted edx-platform directory, they may already have pulled translations. This will cause the Docker build to fail with:

CommandError: "/openedx/edx-platform/conf/plugins-locale/plugins" should be empty before running atlas pull.

To fix this, we simply clean out the edx-platform translation target directories before pulling in the Dockerfile.

Blockers

Extra discussion

https://openedx.slack.com/archives/C04R6TUJB7T/p1711482071806759?thread_ts=1711478732.261049&cid=C04R6TUJB7T

@kdmccormick kdmccormick requested a review from regisb March 26, 2024 19:56
@kdmccormick kdmccormick force-pushed the kdmccormick/clean-translations branch from 7e38821 to c19b234 Compare March 26, 2024 19:58
@kdmccormick
Copy link
Collaborator Author

kdmccormick commented Mar 26, 2024

Ack, this fails with:

 > [production 18/34] RUN make clean_translations:                                  
0.194 git clean -fdX conf/locale  # Removes core edx-platform translations but keeps Esperanto (eo) test translations
0.196 fatal: not a git repository (or any of the parent directories): .git
0.196 make: *** [Makefile:57: clean_translations] Error 128

This is happening because we intentionally avoid copying .git in at this layer, as that would bloat the layer and cause its cache to be invalidated with any git state change whatsoever.

I'm going to turn this into a draft, a propose an alternate upstream implementation of make clean_translations which doesn't rely on git.

UPDATE: the amended edx-platform PR is here: https://github.com/openedx/edx-platform/pull/34429/files

If one is using a bind-mounted edx-platform directory,
they may already have pulled translations. This will cause
the Docker build to fail with:

    CommandError: "/openedx/edx-platform/conf/plugins-locale/plugins" should be empty before running atlas pull.

To fix this, we simply clean out the edx-platform translation
target directories before pulling in the Dockerfile.
@kdmccormick kdmccormick marked this pull request as ready for review April 25, 2024 13:44
@kdmccormick kdmccormick force-pushed the kdmccormick/clean-translations branch from c19b234 to 402d185 Compare April 25, 2024 16:08
@kdmccormick
Copy link
Collaborator Author

The edx-platform PR linked above merged, so make clean_translations now works in the Dockerfile.

I tested this locally and confirmed that it fixes the error.

@DawoudSheraz DawoudSheraz self-requested a review May 7, 2024 09:21
@kdmccormick kdmccormick merged commit f5dbd54 into nightly May 22, 2024
2 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/clean-translations branch May 22, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants