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: install atlas translations tool #32952

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Conversation

OmarIthawi
Copy link
Member

@OmarIthawi OmarIthawi commented Aug 9, 2023

Description

Add the openedx-atlas to the kernel.in so it's available in all environments including Atlas, Devstack and Native installation.

This is part 1 out of several other steps to eventually let make pull_translations pull from https://github.com/openedx/openedx-translations instead of Transifex, which has been concluded by OEP-58.

This has been generated with the following command:

$ cd edx-platform
$ make upgrade-package package=openedx-atlas

Which is inspired by the upgrade-one-python-dependency.yml workflow which I suppose I cannot run due to the lack of GitHub permission.

Testing instructions

  • Build the image on my fork
  • Upgrade to openedx-atlas==0.5.0
  • Test again
$ DOCKER_BUILDKIT=1 docker build . --build-arg SERVICE_VARIANT=lms --build-arg SERVICE_PORT=8000 --target development -t openedx/lms-dev
...
$ docker run -it docker.io/openedx/lms-dev atlas --version
v0.5.0

...

devstack $ make dev.up.lms
devstack $ make dev.shell.lms
root@lms:/edx/app/edxapp/edx-platform# atlas --version
v0.5.0


  • Run atlas and pull translations on edx-platform
Testing atlas pull with --expand-glob
$ docker run -it docker.io/openedx/lms-dev bash
root@c8b826df60ce:/edx/app/edxapp/edx-platform# rm -rf conf/plugins-locale
root@c8b826df60ce:/edx/app/edxapp/edx-platform# atlas pull --expand-glob 'translations/*/done/conf/locale:conf/plugins-locale/done'
Pulling translation files
 - directory: translations/*/done/conf/locale:conf/plugins-locale/done
 - repository: openedx/openedx-translations
 - branch: main
 - filter: Not Specified
 - expand-glob: 1
Creating a temporary Git repository to pull translations into "./translations_TEMP"...
Done.
Setting git sparse-checkout rules...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 3), reused 1 (delta 1), pack-reused 0
Receiving objects: 100% (4/4), 2.78 KiB | 2.78 MiB/s, done.
Resolving deltas: 100% (3/3), done.
Done.
Pulling translation files from the repository...
Your branch is up to date with 'origin/main'.
Done.
Copying translations from "./translations_TEMP/translations/DoneXBlock/done/conf/locale" to "./conf/plugins-locale/done"...
Done.
Removing temporary directory...
Done.

Translations pulled successfully!
root@c8b826df60ce:/edx/app/edxapp/edx-platform# find conf/plugins-locale/ -type f
conf/plugins-locale/done/fr_CA/LC_MESSAGES/django.po
conf/plugins-locale/done/en/LC_MESSAGES/django.po
conf/plugins-locale/done/de/LC_MESSAGES/django.po
conf/plugins-locale/done/ar/LC_MESSAGES/django.po

Supporting information

This contribution is part of the FC-0012 project which is sparked by the Translation Infrastructure update OEP-58.

Up-to-date project overview and details are available in the Approach Memo and Technical Discovery: Translations Infrastructure Implementation document.

Join the conversation on Open edX Slack #translations-project-fc-0012.

Check the links above for full information about the overall project.

Internalization is being rearchitected in Open edX Python, XBlock, Micro-frontend, and other projects. There are a number of immediately visible changes:

  • Remove source and language translations from the repositories, hence no .json, .po or .mo files will be committed into the repos.
  • Add standardized make extract_translations in all repositories
  • Push user-facing messages strings into openedx/openedx-translations.
  • Integrate root repositories with openedx/openedx-atlas to pull translations on build/deploy time

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 9, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Aug 9, 2023

Thanks for the pull request, @OmarIthawi! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@brian-smith-tcril
Copy link
Contributor

I think we should hold off on this until we implement openedx/openedx-atlas#34

@OmarIthawi OmarIthawi marked this pull request as draft August 10, 2023 19:31
@OmarIthawi OmarIthawi force-pushed the install-atlas branch 3 times, most recently from fb2be59 to 1d8649d Compare August 16, 2023 08:14
@OmarIthawi OmarIthawi marked this pull request as ready for review August 16, 2023 20:05
@OmarIthawi OmarIthawi changed the title feat: install atlas in Dockerfile feat: install atlas CLI tool Aug 16, 2023
@OmarIthawi OmarIthawi changed the title feat: install atlas CLI tool feat: install atlas translations tool Aug 16, 2023
@OmarIthawi
Copy link
Member Author

I think we should hold off on this until we implement openedx/openedx-atlas#34

@brian-smith-tcril This is now ready for another review.

@brian-smith-tcril
Copy link
Contributor

@openedx/teaching-and-learning you're listed as "Review required from:" for this repo on the OEP-58/FC-12 repo reviewers spreadsheet. Would you mind taking a look at this one?

@brian-smith-tcril
Copy link
Contributor

@jristau1984 @jmbowman I'm tagging you because you're listed as "Review required from:" for this repo on the FC-0012/OEP-58 spreadsheet

Copy link
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

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

Approving on behalf of @jmbowman's team. I'm looking forward to translations being handled outside of Jenkins. Thank you.

@robrap
Copy link
Contributor

robrap commented Sep 6, 2023

@OmarIthawi @brian-smith-tcril: I know I just approved this, but I realize I do have a question. Is atlas actually needed in Production? Does it provide a potential security risk being a production dependency, rather than using another requirement file that can be used only where it is needed?

@OmarIthawi
Copy link
Member Author

OmarIthawi commented Sep 7, 2023

@OmarIthawi @brian-smith-tcril: I know I just approved this, but I realize I do have a question. Is atlas actually needed in Production? Does it provide a potential security risk being a production dependency, rather than using another requirement file that can be used only where it is needed?

@robrap Good question. My thinking is it's safe to have in production.

Atlas is a bash script that is calls git, and yes it's needed for production environments like Native Installation.

It has no server component, requirements or even a functional Python module. It's published on PyPi to make use of pip-tools and other dependency management tools.

Docker-based environments may benefit from deleting it but there's a very small benefit from doing so.

Approving on behalf of @jmbowman's team. I'm looking forward to translations being handled outside of Jenkins. Thank you.

You're welcome 😃

@OmarIthawi OmarIthawi marked this pull request as draft September 11, 2023 21:24
Add the openedx-atlas to the kernel.in so it's available in all
environments including Atlas, Devstack and Native installation.
@OmarIthawi OmarIthawi marked this pull request as ready for review September 13, 2023 09:34
@OmarIthawi
Copy link
Member Author

@brian-smith-tcril @robrap would you mind merging this pull request? It's been tested and reviewed.

cc: @mphilbrick211

@robrap robrap merged commit 3b869dd into openedx:master Sep 13, 2023
43 checks passed
@openedx-webhooks
Copy link

@OmarIthawi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants