-
Notifications
You must be signed in to change notification settings - Fork 5
Fix: stabilize dev HTTPS + APPSI HiGHS and clean up defaults seeding #2
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
Open
XxUnkn0wnxX
wants to merge
14
commits into
Scott1903:main
Choose a base branch
from
XxUnkn0wnxX:feat/dev-https-docs-and-appsi-hardening
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix: stabilize dev HTTPS + APPSI HiGHS and clean up defaults seeding #2
XxUnkn0wnxX
wants to merge
14
commits into
Scott1903:main
from
XxUnkn0wnxX:feat/dev-https-docs-and-appsi-hardening
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- ignore tmp/, AGENTS.md, .venv/, and dev TLS certs - switch UI optimizer to appsi_highs with quiet logging fallback
- add sslserver and django-extensions to INSTALLED_APPS - extend requirements with local HTTPS dev dependencies
- replace plain text README with Markdown version - archive original README.txt under docs/oldreadme.txt
- add cross-platform dev-local.md guide covering mkcert and self-signed flows
- update running instructions to reference docs/dev-local.md via relative link
- add Homebrew reference link beside macOS commands
- collapse identical Bash/PowerShell snippets for runsslserver and runserver_plus
- move DefaultSettings bootstrap from AppConfig.ready() into a post_migrate signal - prevents Django 5.2 RuntimeWarning about database access during app init - retains existing default.json import and error handling
- add logging to the post_migrate seeding hook so missing data/default.json surfaces immediately - helps devs understand why defaults were not created after migrations
- switch optimizer import to pyomo.environ so the appsi_highs plugin loads reliably - prevents 'solver plugin was not registered' errors seen with direct pyomo.opt import
- include official GNU GPL v3 text in COPYING.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix optimizer, docs, and defaults: stabilize dev HTTPS + APPSI HiGHS
Summary
This PR bundles three developer‑experience fixes:
500onPOST /optimize/.sslserverquickstart, plusuvicorn+cert alternative; consistent port 8100; certify/ignore local certs).AppConfig.ready()into apost_migratesignal; add a logger warning whenui/data/default.jsonis missing. This removes the Django warning about DB access during app init and makes first‑run behavior explicit.Branch:
feat/dev-https-docs-and-appsi-hardeningMotivation
Dev HTTPS runs (Werkzeug/ASGI with TLS) occasionally deadlocked when HiGHS (APPSI) wrote to stdout/stderr while the dev server also captured output. Symptoms included:
DeveloperError: Deadlock closing capture_outputRuntimeError: TeeStream: deadlock observed joining reader threadsssl.SSLError … _ssl.c:2427(debug page write after socket closed)New contributors also tripped on enforced HTTPS locally; we needed a one‑command, cross‑platform dev path.
Django 5.2 warns against DB access in
AppConfig.ready(); defaults bootstrap lived there.Changes
1) Optimizer: explicit APPSI + quiet logs
2) Docs: cross‑platform local HTTPS
README quickstart now shows an all‑pip HTTPS command and links to the new dev guide.
docs/dev-local.md (new):
django-sslserverself‑signed onhttps://127.0.0.1:8100/.uvicornwith a local cert (mkcert optional; NSS note for Firefox).certs/*.pemare git‑ignored.3) Defaults seeding:
post_migrate+ loggingpost_migratereceiver scoped to theuiapp and guarded bydispatch_uid.ui/data/default.jsonis missing so contributors immediately see why defaults weren’t created.Testing
Solver smoke test (no server)
Expect:
available: Trueandx = 1.0.Dev HTTPS flows
python manage.py runsslserver 127.0.0.1:8100python manage.py runserver_plus --cert-file certs/localhost.pem --key-file certs/localhost-key.pem 127.0.0.1:8100DJANGO_ALLOW_ASYNC_UNSAFE=true uvicorn satopt.asgi:application --host 127.0.0.1 --port 8100 --ssl-certfile certs/localhost.pem --ssl-keyfile certs/localhost-key.pemDefaults bootstrap
rm db.sqlite3 && python manage.py migrate) creates defaults ifui/data/default.jsonexists.Backwards compatibility
Notes for maintainers
appsi_highsand fall back to an external CLI solver (CBC/GLPK) automatically.Checklist
appsi_highs; solver console logging silenced in devdocs/dev-local.mdcerts/*.pemignored by gitpost_migrate; idempotent; warning on missing JSON/optimize/under sslserver and uvicornReady for review.
Related