Skip to content

Conversation

@dale-wahl
Copy link
Member

Create working 4cat:slim image

Deploy via docker compose -f docker-compose_build.yml up -d --build

Currently the 4cat:stable image is 4.73 GB on the drive. The image from Docker_slim reduces that to 2.06 GB.

Breakdown:

  • Base Docker image (i.e. python:3.11-slim ): 195MB
  • Python packages (/opt/venv/): 1.1 GB
  • 4CAT application: 70 MB
  • Additional linux packages: 114 MB
    • Including /usr/lib/x86_64-linux-gnu: 85MB which could perhaps be reduced

I already removed ffmpeg (it was ~400 MB). Additional reductions seem unlikely without reviewing python packages.

Issues

There are some consequences here. Mainly that we lose the ability to upgrade python environments. With Docker, that is not so bad a deal as you can download a previously created image with the appropriate environment.

Some maintenance will need to be done to test and ensure this image works with all environment changes. Processors using certain features (e.g., ffmpeg) need to be disabled.

Known To-do:

  • migrate.py will not work in its current form; it would need to be modified or circumvented. Ideally modified so that the environment and code base could be maintained/updated via Docker, but any necessary migrate scripts (for such things as database changes) could still be run.
  • Disable some frontend features such as update and update to branch.
    • Restarting the frontend also does not currently work, but that does not feel related

Question

Is the reduction of 2.6 gigs worth it? Is container size the real user bottleneck?

@dale-wahl
Copy link
Member Author

pytest fails: Missing modules: cv2 (for processors.visualisation.video_scene_identifier)
I suppose that is to be expected.

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.

2 participants