Skip to content

docs: fix stale versions, log paths, and local dev setup#511

Merged
lgelauff merged 10 commits intomasterfrom
docs/beta-debugging-hints
Apr 26, 2026
Merged

docs: fix stale versions, log paths, and local dev setup#511
lgelauff merged 10 commits intomasterfrom
docs/beta-debugging-hints

Conversation

@lgelauff
Copy link
Copy Markdown
Collaborator

@lgelauff lgelauff commented Apr 18, 2026

Summary

  • Update Python version 3.9 → 3.11 and Node 18 → 20 throughout deployment.md
  • Standardize log paths to /data/project/<project>/logs/ across all three environments (verified on montage-dev, montage-beta, montage-prod)
  • Add mkdir step for log directory in from-scratch deployment instructions
  • Add debugging section covering uwsgi logs, pip/venv pitfalls, MariaDB inspection, and restart procedure
  • Clarify local login flow in dev.md — navigate to /complete_login directly; the login button triggers OAuth which doesn't work locally
  • Replace hardcoded rdb.py#L113 link with stable reference to MAINTAINERS constant

🤖 Generated with Claude Code

@lgelauff lgelauff changed the title docs: add debugging section to deployment.md docs: fix stale versions, log paths, and local dev setup Apr 21, 2026
lgelauff and others added 9 commits April 21, 2026 13:01
Documents common Toolforge debugging steps discovered during beta
deployment of the image→filerevision migration:
- uwsgi log location (/data/project/montage-beta/uwsgi.log)
- pip/Python must run inside toolforge webservice shell, not bastion
- restart command syntax
- how to inspect the SQLite DB without the sqlite3 CLI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Step 5: use correct `mariadb` command with explicit -h flag and utf8mb4 charset
- Step 6: fix db_url format (mysql+pymysql driver, tools.db.svc.wikimedia.cloud host, charset=utf8mb4)
- Step 8 (new): add schema initialisation step (create_schema.py for fresh installs, migrate_prod_db.sql for upgrades)
- Debugging: add MariaDB connection section, note that -h flag is required (no local socket on bastion)
- Debugging: rename SQLite section to clarify it is legacy/dev only

Observed during #514 (beta MariaDB setup).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All Toolforge deployments now use python3.11. The 3.9 references
were stale and would cause a venv mismatch for anyone following
the docs from scratch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
node18 is no longer available on Toolforge. node20 works as a
drop-in replacement — no issues observed in practice on montage-dev.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All three deployments (montage, montage-beta, montage-dev) now use
/data/project/<project>/logs/ for log files. Added mkdir step to
from-scratch instructions and corrected the debugging section note.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The login button triggers OAuth which doesn't work locally. Developers
need to navigate to /complete_login directly to establish their session.
Verified working locally (redirects to localhost:5173, sets cookie).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Line numbers drift as the file grows. Reference the MAINTAINERS
constant by name instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers contribution workflow, PR expectations, code quality rules,
three-environment deployment model, and the requirement to open and
discuss an issue before submitting a PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgelauff lgelauff force-pushed the docs/beta-debugging-hints branch from 01455dc to 707ee29 Compare April 21, 2026 11:01
Added guidelines for new contributors to provide a screen recording of issues and changes after checking with other maintainers.
Copy link
Copy Markdown
Member

@mahmoud mahmoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! couple of points about sqlite, but that'll be a separate PR :)

Comment thread CONTRIBUTING.md

- Follow existing patterns in the file you're editing
- Backend: read `montage/rdb.py` before writing queries — column names are authoritative there. Note that `.filter()` and `.order_by()` return new objects — always reassign
- Backend: write code that works with both MySQL (production) and SQLite (tests) — no MySQL-only syntax
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Docker support has gotten pretty good, I don't know if sqlite support is strictly necessary, tbh.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that also true locally? I like the simpler approach where possible, but would be nice indeed to split that into a separate PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah docker is just for local, so docker compose would be the best way to get production-like env locally now.

Comment thread deployment.md
Comment on lines +199 to +204
Note: montage-beta originally used SQLite and the file (`tmp_montage.db`) may still exist alongside the MariaDB setup. It is no longer used by the running service once the config switches to `mysql+pymysql://`.

There is no `sqlite3` CLI on Toolforge. Use Python instead:

```bash
python3 -c 'import sqlite3; c=sqlite3.connect("/data/project/montage-beta/www/python/src/tmp_montage.db"); print(c.execute("SELECT COUNT(*) FROM entries").fetchone())'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't need sqlite, we won't need this caveat :)

@lgelauff lgelauff merged commit 08c5a14 into master Apr 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants