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

[draft] feat: dockerize #940

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[draft] feat: dockerize #940

wants to merge 1 commit into from

Conversation

bard
Copy link

@bard bard commented Jan 26, 2025

What kind of change does this PR introduce?

Ability to create a browser-accessible Docker image where OpenAdapt is set up and ready to run.

screencast.mp4

Summary

Goals:

  1. cut the effort to try out OpenAdapt down to a single command
  2. run OpenAdapt on Linux workstations where the snowball effect of replacing key components of the OS would make it impractical (e.g. Wayland→X11, pipewire→portaudio, Qt6.x→Qt6.8)
  3. run OpenAdapt worry-free because the environment is isolated
  4. run OpenAdapt on common cloud infrastructure, whether for production or CI

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?

Launch with:

docker build -t openadapt-local .
docker run --rm --shm-size=512m -p 6901:6901 openadapt-local

Then open http://localhost:6901 in the browser.

Other information

How it works:

  • uses Ubuntu jammy (from the kasm project), as it comes by default with a supported python
  • installes build and runtime dependencies (node21, tesseract, portaudio)
  • installs cpu-only torch and torchvision
  • installs cpu-only prebuilt detectron
  • moves ForceFloat out of models.py because requiring models.py in migrations otherwise triggers an import chain that ends with packages that expect an X11 environment, which is not available during the docker build

There are probably more correct ways for doing all of the above; for now I've only aimed at the first step of the "make it work, make it right, make it fast" mantra.

What works:

  • python -m openadapt.record "testing out openadapt"
  • python -m openadapt.app.dashboard.run

What doesn't yet:

  • commands that rely on PySide, such as python -m openadapt.entrypoint (downgrading PySide to 6.2 to match system-installed Qt libraries makes these commands run, but also causes segfaults on openadapt.record)

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