Use more efficient reloader in backend container
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Django's dev server uses almost no CPU time when idle with the watchman reloader. However this requires the `watchman` binary and `pywatchman` library.
The `watchman` binary is packaged in debian bullseye, but not the current stable release (buster).
I tried copying the binary from a 3rd party image in the Dockerfile. It is ugly but it works:
```
COPY --from=workbenchdata/watchman-bin:latest-buster-slim /usr/bin/watchman /usr/local/bin/
RUN install -m777 -d /usr/var/run/watchman/
```
An alternative solution could be to use `runserver_plus` from django extensions with the `watchdog` reloader. It is less efficient (~2% of idle CPU usage on my machine), but easier to setup (we just need to add `watchdog` to dev requirements).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Dockerfile and development requirements, then compare the proposed watchman/pywatchman setup with the django-extensions runserver_plus and watchdog alternative. Done means selecting and configuring a supported reloader for the backend container, with the required binary or dependency available and idle CPU usage checked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, docker, python
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100