[feature] Add Docker support for development and testing #741#743
[feature] Add Docker support for development and testing #741#743CodingWithSaksham wants to merge 5 commits into
Conversation
Added Docker support to streamline development and testing workflows Closes openwisp#741
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (11)
🔇 Additional comments (1)
📝 WalkthroughWalkthroughA development Docker image is added with system packages, Python test dependencies, editable project installation, runtime environment variables, and a Bash entrypoint that runs migrations, creates a superuser, and starts Django. Docker Compose is updated to use an Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Dockerfile
participant docker-entrypoint.sh
participant Django
participant Shell
Dockerfile->>docker-entrypoint.sh: start container with bash
docker-entrypoint.sh->>Django: migrate --no-input
docker-entrypoint.sh->>Shell: create_superuser check/create
docker-entrypoint.sh->>Django: runserver 0.0.0.0:8000
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors, 2 warnings)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Around line 31-47: The image currently relies on Compose to set the working
directory, so running it directly with docker run breaks when CMD invokes
docker-entrypoint.sh and that script calls python manage.py. Update the
Dockerfile to make the runtime self-contained by setting the container working
directory to the directory that contains docker-entrypoint.sh and manage.py, and
ensure the final CMD can run without any external working_dir override. Use the
existing docker-entrypoint.sh and manage.py references to verify the path
change.
In `@tests/docker-entrypoint.sh`:
- Around line 21-22: The Docker bootstrap currently hardcodes the admin
superuser credentials, which should not be created with fixed values. Update the
bootstrap logic in create_superuser within the Docker entrypoint flow to read
the username, email, and password from environment variables instead of using
admin/admin@example.com/admin, and require explicit configuration before
creating the account. Make sure the migrate-and-bootstrap sequence still works
when those variables are provided, but does not silently fall back to built-in
credentials.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 698b74c3-a835-466e-a9ec-de2fb3bc302c
📒 Files selected for processing (4)
Dockerfiledocker-compose.ymldocs/developer/installation.rsttests/docker-entrypoint.sh
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
- GitHub Check: Python==3.13 | django~=5.2.0
- GitHub Check: Python==3.13 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=4.2.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=5.1.0
🧰 Additional context used
📓 Path-based instructions (1)
**/{docs,documentation}/**/*.{md,rst,adoc,html}
📄 CodeRabbit inference engine (Custom checks)
**/{docs,documentation}/**/*.{md,rst,adoc,html}: Documentation must be updated if a change affects behavior that is already documented
Feature documentation must mention the new feature. If the feature is heavily UI-related, a new section or page is appropriate
Files:
docs/developer/installation.rst
🪛 Checkov (3.3.1)
Dockerfile
[low] 1-47: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[low] 1-47: Ensure that a user for the container has been created
(CKV_DOCKER_3)
🪛 Hadolint (2.14.0)
Dockerfile
[warning] 6-6: Pin versions in apt get install. Instead of apt-get install <package> use apt-get install <package>=<version>
(DL3008)
🪛 Trivy (0.69.3)
Dockerfile
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
(IaC/Dockerfile)
[info] 1-1: No HEALTHCHECK defined
Add HEALTHCHECK instruction in your Dockerfile
Rule: DS-0026
(IaC/Dockerfile)
🔇 Additional comments (1)
docs/developer/installation.rst (1)
118-167: LGTM!
| python manage.py migrate --no-input | ||
| create_superuser admin admin@example.com admin |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Do not bootstrap the Docker admin with fixed admin/admin credentials.
Line 22 creates the same superuser in every environment, and the new docs advertise those credentials for the published admin UI. That makes any reachable dev instance trivially compromiseable. Read these values from environment variables and require an explicit choice instead of a built-in password.
Proposed fix
python manage.py migrate --no-input
-create_superuser admin admin@example.com admin
+create_superuser \
+ "${DJANGO_SUPERUSER_USERNAME:?set DJANGO_SUPERUSER_USERNAME}" \
+ "${DJANGO_SUPERUSER_EMAIL:?set DJANGO_SUPERUSER_EMAIL}" \
+ "${DJANGO_SUPERUSER_PASSWORD:?set DJANGO_SUPERUSER_PASSWORD}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| python manage.py migrate --no-input | |
| create_superuser admin admin@example.com admin | |
| python manage.py migrate --no-input | |
| create_superuser \ | |
| "${DJANGO_SUPERUSER_USERNAME:?set DJANGO_SUPERUSER_USERNAME}" \ | |
| "${DJANGO_SUPERUSER_EMAIL:?set DJANGO_SUPERUSER_EMAIL}" \ | |
| "${DJANGO_SUPERUSER_PASSWORD:?set DJANGO_SUPERUSER_PASSWORD}" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/docker-entrypoint.sh` around lines 21 - 22, The Docker bootstrap
currently hardcodes the admin superuser credentials, which should not be created
with fixed values. Update the bootstrap logic in create_superuser within the
Docker entrypoint flow to read the username, email, and password from
environment variables instead of using admin/admin@example.com/admin, and
require explicit configuration before creating the account. Make sure the
migrate-and-bootstrap sequence still works when those variables are provided,
but does not silently fall back to built-in credentials.
ReStructuredText Formatting ErrorsHello @CodingWithSaksham,
To fix this, please run the following command in your local environment: openwisp-qa-formatThis command should automatically reformat the file and resolve the issue. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile (1)
42-47: 🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy liftFix the container entrypoint paths
CMD ["bash", "docker-entrypoint.sh"]runs from/opt/openwisp/tests, butCOPY . .placestests/docker-entrypoint.shandtests/manage.pyunder/opt/openwisp/tests/tests/. The container won’t start until the CMD/pathing is adjusted, or the entrypointcds to the directory that containsmanage.py.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Dockerfile` around lines 42 - 47, The container startup path is wrong in the Dockerfile CMD, so the entrypoint cannot find docker-entrypoint.sh and manage.py where the image actually places them. Update the Dockerfile’s CMD and/or the docker-entrypoint.sh script so it uses the correct tests/ paths (or changes into the directory containing manage.py) before launching the app, referencing Dockerfile CMD and docker-entrypoint.sh to keep the startup location consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Dockerfile`:
- Around line 42-47: The container startup path is wrong in the Dockerfile CMD,
so the entrypoint cannot find docker-entrypoint.sh and manage.py where the image
actually places them. Update the Dockerfile’s CMD and/or the
docker-entrypoint.sh script so it uses the correct tests/ paths (or changes into
the directory containing manage.py) before launching the app, referencing
Dockerfile CMD and docker-entrypoint.sh to keep the startup location consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d1ff5074-e1cc-4691-838c-70a87f70e239
📒 Files selected for processing (2)
Dockerfiledocs/developer/installation.rst
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=4.2.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.13 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.13 | django~=5.2.0
🧰 Additional context used
📓 Path-based instructions (1)
**/{docs,documentation}/**/*.{md,rst,adoc,html}
📄 CodeRabbit inference engine (Custom checks)
**/{docs,documentation}/**/*.{md,rst,adoc,html}: Documentation must be updated if a change affects behavior that is already documented
Feature documentation must mention the new feature. If the feature is heavily UI-related, a new section or page is appropriate
Files:
docs/developer/installation.rst
🔇 Additional comments (6)
Dockerfile (2)
1-30: LGTM!
31-37: LGTM!docs/developer/installation.rst (4)
118-129: LGTM!
130-131: LGTM!
161-166: LGTM!
158-159: 🎯 Functional CorrectnessNo change needed for the admin credentials note.
Test Failures in CIHello @CodingWithSaksham, There is one test failure:
To fix this, you should adjust the test assertion to match the actual output or modify the code to produce the expected output. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile (1)
31-47: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winImage is not self-contained;
docker runfails without Composeworking_diroverride.
WORKDIRat Line 31 is/opt/openwisp, butdocker-entrypoint.shandmanage.pyreside under/opt/openwisp/tests. TheCMDat Line 47 invokes the script via relative path, so standalonedocker runwill fail with "No such file or directory". The entrypoint script also callspython manage.py, which requires the current working directory to containmanage.py. The container currently only works becausedocker-compose.ymloverridesworking_dirto/opt/openwisp/tests.This exact issue was flagged in a previous review and marked as addressed, but the current code still exhibits the problem.
🔧 Proposed fix
WORKDIR /opt/openwisp # Install test requirements first so this layer is cached separately # from the source code copy below. COPY requirements-test.txt . RUN pip install --no-cache-dir -r requirements-test.txt # Copy source and install the package with all optional extras COPY . . RUN pip install --no-cache-dir -e ".[saml,openvpn_status]" + + WORKDIR /opt/openwisp/tests ENV PYTHONUNBUFFERED=1 \ REDIS_HOST=redis \ INFLUXDB_HOST=influxdb EXPOSE 8000 - CMD ["bash", "docker-entrypoint.sh"] + CMD ["bash", "/opt/openwisp/tests/docker-entrypoint.sh"]Alternatively, keep the relative
CMDand rely on the newWORKDIRto resolve it:+ WORKDIR /opt/openwisp/tests ENV PYTHONUNBUFFERED=1 \ REDIS_HOST=redis \ INFLUXDB_HOST=influxdb EXPOSE 8000 CMD ["bash", "docker-entrypoint.sh"]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Dockerfile` around lines 31 - 47, Update the Dockerfile so the container can run standalone without relying on docker-compose.yml to override the working directory. The current WORKDIR and CMD combination leaves docker-entrypoint.sh and manage.py unresolved when using docker run directly, so adjust the image layout/working directory in the Dockerfile to match where docker-entrypoint.sh and manage.py live, and keep CMD consistent with that location. Refer to WORKDIR, CMD, and docker-entrypoint.sh when making the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Dockerfile`:
- Around line 31-47: Update the Dockerfile so the container can run standalone
without relying on docker-compose.yml to override the working directory. The
current WORKDIR and CMD combination leaves docker-entrypoint.sh and manage.py
unresolved when using docker run directly, so adjust the image layout/working
directory in the Dockerfile to match where docker-entrypoint.sh and manage.py
live, and keep CMD consistent with that location. Refer to WORKDIR, CMD, and
docker-entrypoint.sh when making the fix.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9daf84d8-77ab-4529-a1f7-de3fc0377e6e
📒 Files selected for processing (1)
Dockerfile
📜 Review details
⚠️ CI failures not shown inline (11)
GitHub Actions: OpenWISP RADIUS CI Build / 4_Python==3.11 django~=5.1.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
->openwisp-radius==1.3a0) (25.2)
Requirement already satisfied: drf-yasg<1.22.0,>=1.21.14 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)
Requirement already satisfied: billiard<5.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.2.4)
Requirement already satisfied: kombu>=5.6.0 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-pa...
GitHub Actions: OpenWISP RADIUS CI Build / 2_Python==3.12 django~=4.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)
Requirement already satisfied: billiard<5.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.2.4)
Requirement already satisfied: kombu>=5.6.0 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6...
GitHub Actions: OpenWISP RADIUS CI Build / 7_Python==3.12 django~=5.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (3.17.1)
Requirement already satisfied: django-filter<26.0,>=25.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (25.2)
Requirement already satisfied: drf-yasg<1.22.0,>=1.21.14 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)...
GitHub Actions: OpenWISP RADIUS CI Build / 3_Python==3.11 django~=4.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
stedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (3.17.1)
Requirement already satisfied: django-filter<26.0,>=25.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (25.2)
Requirement already satisfied: drf-yasg<1.22.0,>=1.21.14 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.ta...
GitHub Actions: OpenWISP RADIUS CI Build / 9_Python==3.10 django~=4.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
nwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (2.7.0)
Requirement already satisfied: distro~=1.9.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.9.0)
Requirement already satisfied: djangorestframework~=3.17.1 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (3.17.1)
Requirement already satisfied: django-filter<26.0,>=25.1 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (25.2)
Requirement already satisfied: drf-yasg<1.22.0,>=1.21.14 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwis...
GitHub Actions: OpenWISP RADIUS CI Build / 8_Python==3.13 django~=5.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)
Requirement already satisfied: billiard<5.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.2.4)
Requirement already satisfied: kombu>=5.6.0 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.2)
Requirement already satisfied: vine<6.0,>=5.1.0 in /opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages (from c...
GitHub Actions: OpenWISP RADIUS CI Build / 5_Python==3.10 django~=5.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
ds/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (0.7.1)
Requirement already satisfied: swapper~=1.4.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.4.0)
Requirement already satisfied: urllib3<3.0.0,>=2.0.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (2.7.0)
Requirement already satisfied: distro~=1.9.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.9.0)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement alread...
GitHub Actions: OpenWISP RADIUS CI Build / 10_Python==3.12 django~=5.1.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
nwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)
Requirement already satisfied: billiard<5.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.2.4)
Requirement already satisfied: kombu>=5.6.0 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.2)
Requirement already satisfied: vine<6.0,>=5.1.0 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.1.0)
Requirement already satisfied: click<9.0,>=8.1.2 in /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages (from celery~=5.6.1->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0...
GitHub Actions: OpenWISP RADIUS CI Build / 1_Python==3.13 django~=5.1.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
ss_obj._bootstrap(parent_sentinel=child_r)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/coverage/multiproc.py", line 51, in _bootstrap
return original_bootstrap(self, *args, **kwargs)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/multiprocessing/process.py", line 313, in _bootstrap
self.run()
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/django/test/runner.py", line 454, in _run_subsuite
result = runner.run(subsuite)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/django/test/runner.py", line 369, in run
test(result)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/unittest/suite.py", line 122, in run
test(result)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/django/test/testcases.py", line 317, in __call__
self._setup_and_call(result)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/django/test/testcases.py", line 369, in _setup_and_call
super().__call__(result)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/unittest/case.py", line 707, in __call__
return self.run(*args, **kwds)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/unittest/case.py", line 651, in run
self._callTestMethod(testMethod)
File "/opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/unittest/case.py", line 606, in _callTestMethod
if method() is not None:
File "/opt/hostedtoolca...
GitHub Actions: OpenWISP RADIUS CI Build / 11_Python==3.11 django~=5.2.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
isfied: django-filter<26.0,>=25.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (25.2)
Requirement already satisfied: drf-yasg<1.22.0,>=1.21.14 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (1.21.15)
Requirement already satisfied: channels~=4.3.0 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from channels[daphne]~=4.3.0; extra == "channels"->openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.2)
Requirement already satisfied: channels_redis<4.4.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (4.3.0)
Requirement already satisfied: celery~=5.6.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from openwisp-utils @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-utils[celery,rest] @ https://github.com/openwisp/openwisp-utils/archive/refs/heads/1.3.tar.gz->openwisp-radius==1.3a0) (5.6.3)
Requirement already satisfied: billiard<5.0,>=4.2.1 in /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages (from celery~=5.6.1->openwisp-utils @ https://github....
GitHub Actions: OpenWISP RADIUS CI Build / 6_Python==3.10 django~=5.1.0.txt: [feature] Add Docker support for development and testing #741
Conclusion: failure
gement/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/django/core/management/commands/test.py", line 63, in handle
failures = test_runner.run_tests(test_labels)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/django/test/runner.py", line 1073, in run_tests
result = self.run_suite(suite)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/django/test/runner.py", line 1000, in run_suite
return runner.run(suite)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/unittest/runner.py", line 184, in run
test(result)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/django/test/runner.py", line 516, in run
pool = multiprocessing.Pool(
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/multiprocessing/pool.py", line 215, in __init__
self._repopulate_pool()
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/multiprocessing/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/multiprocessing/pool.py", line 329, in _repopulate_pool_static
w.start()
File "/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/opt/hos...
🔇 Additional comments (1)
Dockerfile (1)
6-29: No change needed for the SAML install path. This image doesn’t install thexmlsecPython package; it installsdjangosaml2via.[saml], and the requiredxmlsec1runtime binary is already present.libxmlsec1-dev,libxmlsec1-openssl, andpkg-configonly matter if a separate source build ofpython-xmlsecis introduced.> Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.dockerignore:
- Around line 19-26: The .dockerignore cache section is missing several common
Django/Python artifacts, so update the ignore list to include .tox/, db.sqlite3,
*.mo, and node_modules/ alongside the existing cache patterns. Also review the
current Dockerfile* and docker-compose*.yml ignore rules in .dockerignore to
confirm they are intentional, and keep or adjust them consistently with any
other compose files in the repo.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e7fa471b-ea10-44af-b23f-9c143cdcf9e4
📒 Files selected for processing (2)
.dockerignoreDockerfile
💤 Files with no reviewable changes (1)
- Dockerfile
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=4.2.0
- GitHub Check: Python==3.13 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.13 | django~=5.1.0
| # Test / coverage / type-check caches | ||
| .pytest_cache/ | ||
| .coverage | ||
| .coverage.* | ||
| .mypy_cache/ | ||
| .pyre/ | ||
| .ruff_cache/ | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Add common Django/Python development artifacts to reduce build context bloat.
The following patterns are missing and commonly appear in Django projects:
.tox/— tox virtualenv directoriesdb.sqlite3— local SQLite database*.mo— compiled translation filesnode_modules/— if any frontend assets use npm
Also verify that docker-compose*.yml and Dockerfile* are intentionally ignored; these are safe since Docker consumes them directly, but document this if other compose files exist.
Also applies to: 36-37
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.dockerignore around lines 19 - 26, The .dockerignore cache section is
missing several common Django/Python artifacts, so update the ignore list to
include .tox/, db.sqlite3, *.mo, and node_modules/ alongside the existing cache
patterns. Also review the current Dockerfile* and docker-compose*.yml ignore
rules in .dockerignore to confirm they are intentional, and keep or adjust them
consistently with any other compose files in the repo.
684fd38 to
6b8edbe
Compare
|
The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (1/3). |
Added Docker support to streamline development and testing workflows
Checklist
Reference to Existing Issue
Closes #741
Description of Changes
Dockerfile: Development image with Python 3.12 and all required system dependencies (xmlsec1, gdal, spatialite, etc.)docker-compose.yml: Service orchestration with Redis, InfluxDB, and the radius development containertests/docker-entrypoint.sh: Container entrypoint that runs Django migrations and starts the development serverdocs/developer/installation.rst: Added section to "Install and Run on Docker"