-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
healthchecks: 2.10 -> 3.3 #282912
healthchecks: 2.10 -> 3.3 #282912
Conversation
Thanks for packaging this. I've been working on it here and there for the past week and have been struggling. The release notes mention upgrading to django 5, but I wasn't able to figure this out -- pytest-django seems to rely on django 4 and fail. Do you think it would be good to follow upstream in this regard? |
5433a7c
to
5a47889
Compare
@n8henrie: Thanks for your kind words and this helpful hint!
Yes, right! The (very basic) nixos integration tests seemed to pass anyway, but I had simply had missed that django_5 exists in nixpkgs (django is still 4.2.9). So just forced pushed and will ask ofborg to run the test. |
@ofborg test healthchecks |
I already tried the same locally but am getting build errors on my aarch64-darwin machine (your prior PR was building at least):
|
@n8henrie Tests are still running in ofborg, but could you elaborate whats your use case of running healthchecks.io on darwin would be? Otherwise I'd propose to just restrict it to Linux, as I am not sure it's intended to run on darwin as all? And as there's no macOS server anymore, it might not be too relevant. The failing test on aarch64-linux is a problem though. /nix/store/iw4fqx70235rv6dazkfcknvhn1qsflmj-python3.11-pytest-django-4.7.0.drv seems to fail in an shutil call https://logs.ofborg.org/?key=nixos/nixpkgs.282912&attempt_id=b5a3302d-3845-4304-b1b0-e1d820f92ee4 |
I guess that's an interesting question. I'm about 50/50 linux / darwin day-to-day. Healthchecks is python / django and specifically includes MacOS-specific installation instructions -- turning the question around, why wouldn't one expect this package to build on macOS?
Plenty of people running Mac Minis as dandy little servers (and I'd argue that a used / refurb M1 mini can be pretty darn competitive in terms of cost / performance / power usage). nix-darwin and home-manager both work really well for configuring launchd agents. |
Because maintainer time is finite :) I am happy if it works on macOS, I just can't commit to investing much time into that myself. So in the context of this PR: Did 2.1 run on darwin? |
Yes, works fine: $ sw_vers
ProductName: macOS
ProductVersion: 14.2.1
BuildVersion: 23C71
$ DB_NAME=./hc.sqlite STATIC_ROOT=./result/opt/healthchecks/static ./result/opt/healthchecks/manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
January 23, 2024 - 23:30:17
Django version 4.2.7, using settings 'hc.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C. |
I'll take a look at the test failure |
I'm running it (including the django_5 commit) on a on a Pi4 and it seems to work great. |
@n8henrie The ofborg test on aarch64-linux failed in https://github.com/NixOS/nixpkgs/pull/282912/checks?check_run_id=20794046357 . But nice it works for you, so just the darwin thing to figure out |
Hmmm. All nix's levels of indirection make debugging this harder. pytest-django is getting a permission error trying to bind a socket. I'm not sure what behavior would have changed here between django 4 and 5. |
@n8henrie I can reproduce test failures in pytest-django on aarch64-darwin by running just |
Thanks, that helps a lot to know -- my local checkout was building Let me pull and rebase and take another look. |
Still building fine. Just now: $ nix build github:nixos/nixpkgs/master#python3.pkgs.pytest-django
$ echo $?
0 I must be doing something wrong here. Will try with substituters disabled. |
Hmmm, sandbox issue. I can now reproduce the pytest-django failure (with $ nix build --rebuild .#python311.pkgs.pytest-django
error: builder for '/nix/store/l35qps1mk6nxhwwa9ijblsk6xw8q2fnf-python3.11-pytest-django-4.7.0.drv' failed with exit code 1;
last 10 log lines:
> ERROR tests/test_fixtures.py::TestLiveServer::test_change_settings - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> ERROR tests/test_fixtures.py::TestLiveServer::test_transactions - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> ERROR tests/test_fixtures.py::TestLiveServer::test_serve_static_dj17_without_staticfiles_app - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> ERROR tests/test_fixtures.py::TestLiveServer::test_db_changes_visibility - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> ERROR tests/test_fixtures.py::TestLiveServer::test_item - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> ERROR tests/test_fixtures.py::TestLiveServer::test_url - socket.gaierror: [Errno 8] nodename nor servname provided, or not known
> FAILED tests/test_fixtures.py::TestLiveServer::test_specified_port_django_111 - PermissionError: [Errno 1] Operation not permitted
> FAILED tests/test_fixtures.py::TestLiveServer::test_serve_static_with_staticfiles_app - Failed: nomatch: '*test_a*PASSED*'
> ============= 2 failed, 202 passed, 2 skipped, 10 errors in 25.24s =============
> /nix/store/ymqnr6q4slam0ns76mjpcjry70fa8h3i-stdenv-darwin/setup: line 1591: pop_var_context: head of shell_variables not a function context
For full logs, run 'nix log /nix/store/l35qps1mk6nxhwwa9ijblsk6xw8q2fnf-python3.11-pytest-django-4.7.0.drv'.
$
$ nix build --rebuild .#python311.pkgs.pytest-django --option sandbox false
$ echo $?
0 |
And agree that the problem looks isolated to that package; after a successful (due to no-sandbox) build of $ nix build --rebuild .#healthchecks
$ echo $?
0 So this seems good to go to me. I'll look for / open a separate issue. Thank you again! |
Now that #284401 is merged, after a rebase: $ nix build --rebuild .#healthchecks
$ echo $?
0 FWIW I've been running hc-3.1 from this PR on my Pi for the past few days and it's been working brilliantly -- thank you again! |
Setting
Adding One can still run the debug server manually with: e.g. |
@n8henrie This might be due to us calling manage.py compress during service startup, which might might not be supported in debug mode. can you check whether it works as expected for you if you replace that line with |
Yes, I assumed the same but didn't have time to test that day. Unfortunately ran into a bunch of infinite recursion issues trying to use fetchers from Can confirm that with this diff debug mode is working: Note that diff --git a/nixos/modules/services/web-apps/healthchecks.nix b/nixos/modules/services/web-apps/healthchecks.nix
index 1d439f162313..d0a211992fc1 100644
--- a/nixos/modules/services/web-apps/healthchecks.nix
+++ b/nixos/modules/services/web-apps/healthchecks.nix
@@ -1,4 +1,4 @@
-{ config, lib, options, pkgs, buildEnv, ... }:
+{ config, lib, options, pkgs, ... }:
with lib;
@@ -213,8 +213,7 @@ in
preStart = ''
${pkg}/opt/healthchecks/manage.py collectstatic --no-input
${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input
- ${pkg}/opt/healthchecks/manage.py compress
- '';
+ '' + lib.optionalString (cfg.settings.DEBUG != "True") "${pkg}/opt/healthchecks/manage.py compress";
serviceConfig = commonConfig // {
Restart = "always"; |
5a47889
to
92acaf3
Compare
Not sure what happened here: I had rebased (on master) and force-pushed after updating to 3.3. |
Latest changes look good, nixpkgs-review also satisfied:
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-already-reviewed/2617/1574 |
Description of changes
Fixed version of automated PR at #282497.
Remove a now unused dependency, add a few missing ones, packaging one of those.
Tests are now passing.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.