ShryukGrandhi opened a new pull request, #1011:
URL: https://github.com/apache/burr/pull/1011
The S3 tracking server README never explained how to create the SQLite
database before the first start. The server doesn't create the schema itself,
so a fresh deployment has no tables until aerich has been run. The only
instructions were in the "Developing" scratchpad, as a destructive reset, and
they ran `aerich init` before `cd "$BURR_SERVER_ROOT"`. aerich writes its
config (`pyproject.toml`) to the current directory, so the `aerich init-db`
that followed couldn't find that config.
## Changes
- New "Initializing the database" section in
`burr/tracking/server/s3/README.md`:
- one-time `aerich init` / `aerich init-db` run from inside
`$BURR_SERVER_ROOT`
- a note that `BURR_SERVER_ROOT` / `BURR_DB_FILENAME` must match between
initialization and the server
- for containers: use a persistent volume and run the steps in the
entrypoint (re-running `init-db` is a no-op)
- `aerich migrate` / `aerich upgrade` after upgrading Burr
- The "Running Locally" command now passes `--backend s3`. Without it the
CLI starts the local backend.
- Fixed the order in the "Developing" reset snippet so `cd` happens before
`aerich init`.
## How I tested this
In a fresh venv (`pip install -e ".[tracking-server-s3,cli]"`, aerich
0.10.1, tortoise-orm 1.1.9), I extracted the new snippet from the README and
ran it as-is against a temp `BURR_SERVER_ROOT`:
- It created `db.sqlite3` with the `aerich, application, indexingjob,
indexstatus, logfile, project` tables.
- Running `aerich init-db` a second time exits 0 without changing anything.
- `aerich migrate && aerich upgrade` report no changes.
Separately, running `aerich init` outside the root and `init-db` inside it
(the old order) does not work.
I did not start the server against a real S3 bucket. `pre-commit run --files
burr/tracking/server/s3/README.md` passes.
## Notes
The issue's script wraps `aerich init-db` in `timeout`. With current aerich,
`init-db` exited by itself in about 8s, so the docs don't add a timeout.
`initialize_db.py` still hard-codes `~/.burr_server`. I left it out of the
docs and out of this PR to keep the change docs-only.
Fixes #524
## Checklist
- [x] PR has an informative and human-readable title (this will be pulled
into the release notes)
- [x] Changes are limited to a single goal (no scope creep)
- [x] Code passed the pre-commit check & code is left cleaner/nicer than
when first encountered.
- [ ] Any _change_ in functionality is tested
- [ ] New functions are documented (with a description, list of inputs, and
expected output)
- [ ] Placeholder code is flagged / future TODOs are captured in comments
- [x] Project documentation has been updated if adding/changing
functionality.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]