PrairieLearn icon indicating copy to clipboard operation
PrairieLearn copied to clipboard

Use Ubuntu as a base for Docker

Open ThePageGuy opened this issue 6 months ago β€’ 11 comments

Hello, this is an idea that was brought up on slack by @jgfoster. With his help, we have been able to modify the PrairieLearn code to move from an Amazon:Linux base to an Ubuntu Image.

  • We put all of the code to build the plbase in the Dockerfile instead of using a separate script. (We can change to script if that is the preference.)
  • The use of a virtual environment was changed, so we are now installing things in a /venv directory. (We can change if you like.)
  • We created directory to hold certificates so that the virtual environment could run correctly.

ThePageGuy avatar Jun 02 '25 23:06 ThePageGuy

πŸ“ Walkthrough

"""

Walkthrough

The Docker build process was updated by switching the base image from Amazon Linux to Ubuntu 24.04 and relocating the installation steps from an external shell script into the Dockerfile with explicit package installations and configurations. Additional adjustments include creating TLS directories, updating environment variables, and removing the installation script.

Changes

Files/Paths Change Summary
images/plbase/Dockerfile Changed base image to Ubuntu 24.04; replaced shell script with inline package installs and setup for PostgreSQL, Redis, Node.js, Python.
images/plbase/plbase-install.sh Deleted; installation and setup logic moved into Dockerfile.
Dockerfile Updated RUN command to create TLS directories and set permissions; appended PATH environment variable to include /root/.local/bin.

Suggested reviewers

  • nwalters512 """

πŸ“œ Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a7fa7e4217cdac3c5248b8ad8c7c44cc0a89b69f and 5b58a7eee74a7656043b2f151a9e359ab89dfc8f.

πŸ“’ Files selected for processing (1)
  • images/plbase/Dockerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • images/plbase/Dockerfile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Jun 02 '25 23:06 coderabbitai[bot]

πŸ‘‹ thanks for opening this! Please ensure you resolve the merge conflicts so that CI can proceed.

nwalters512 avatar Jun 02 '25 23:06 nwalters512

I took the liberty of resolving the merge conflicts. There are some CI issues that will need to be addressed.

nwalters512 avatar Jun 04 '25 17:06 nwalters512

I took the liberty of resolving the merge conflicts. There are some CI issues that will need to be addressed.

Thanks. We have an appointment for this afternoon to look at the issues raised.

jgfoster avatar Jun 04 '25 18:06 jgfoster

I'm Looking at the Merge Conflicts

ThePageGuy avatar Jun 05 '25 00:06 ThePageGuy

@ThePageGuy please be careful when resolving merge conflicts and getting things up to date with master. You've pulled in a ton of unrelated commits+changes to this PR. If you're not sure how this process generally works, please ask! We on the PL team (and possible @jgfoster) would be happy to help you out.

My recommendation would be to hard-reset back to https://github.com/PrairieLearn/PrairieLearn/pull/12100/commits/5fa4ee76e252f98bf7ec49b6dd6bdc93eaef7d89, force-push, and go from there.

nwalters512 avatar Jun 05 '25 16:06 nwalters512

Sorry about the mistake, I would reset it as soon as possible.

ThePageGuy avatar Jun 05 '25 17:06 ThePageGuy

I'm still looking at failing tests

ThePageGuy avatar Jun 06 '25 00:06 ThePageGuy

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 66.40%. Comparing base (ffaa493) to head (dc9d002). :warning: Report is 352 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12100      +/-   ##
==========================================
- Coverage   66.40%   66.40%   -0.01%     
==========================================
  Files         759      759              
  Lines       75257    75257              
  Branches     7909     7910       +1     
==========================================
- Hits        49977    49976       -1     
- Misses      25110    25111       +1     
  Partials      170      170              
Flag Coverage Ξ”
javascript 65.95% <ΓΈ> (-0.01%) :arrow_down:
python 81.09% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 09 '25 23:06 codecov[bot]

I am in the process of ensuring the JavaScript tests pass. If there are other changes or improvements that can be made, I'm all ears.

ThePageGuy avatar Jun 23 '25 23:06 ThePageGuy

DId a quick look, everything is looking better!

reteps avatar Jun 26 '25 19:06 reteps

@reteps given your work in #12293, this PR is now heavily conflicting with master. Do you think there's still value in this work, and if so, do you want to try to rework this to account for the removal of prairielearn/plbase?

nwalters512 avatar Aug 12 '25 22:08 nwalters512

I think we should close this out and reopen with a fresh start given that the removal of prairielearn/plbase means that this PR will have to be heavily reworked. @ThePageGuy if you still have interest in doing this, feel free to open another PR.

reteps avatar Sep 10 '25 22:09 reteps