Skip to content

feat: Add volume to docker client and volume permission testing #241

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

angela-ko
Copy link
Contributor

Description of changes

  • Add volume class to docker_client and docker_cleanup
  • Add user flag to docker container run
  • Add tests to explore folder permission issues: Testing had to be done with Volumes instead of bind mounts since MacOS's Docker runs Docker in a vm so bind mounts have to first be mounted into the vm and this leads to all sorts of weird uid mapping issues which would lead to inconsistent test results. The only way to consistently do this is via Volumes whose permissions are managed by Docker itself.
    • Tests explore volume with 700 mounted to another container with uid 1000 (simulating bind mounts kinda..? since the other container owns the directory we are mounting the volume to) read, write permissions
    • Explore ways to circumvent the permission issues (resolved in 2 different ways - having a root access container copy the file from the restricted folder to a folder with open permissions, and just calling chmod on the folder that's getting mounted before we swap to uid1000). These are also the two methods I had thought of that would work to achieve our goal of having a mount point that has no permission issues.

Testing done

Unit Testing

Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 34.09091% with 29 lines in your changes missing coverage. Please review.

Project coverage is 64.79%. Comparing base (299acac) to head (e4f5885).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tesseract_core/sdk/docker_client.py 34.09% 29 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (299acac) and HEAD (e4f5885). Click for more details.

HEAD has 20 uploads less than BASE
Flag BASE (299acac) HEAD (e4f5885)
23 3
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #241       +/-   ##
===========================================
- Coverage   76.52%   64.79%   -11.73%     
===========================================
  Files          28       28               
  Lines        3156     3201       +45     
  Branches      505      507        +2     
===========================================
- Hits         2415     2074      -341     
- Misses        520      954      +434     
+ Partials      221      173       -48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant