|
|
||
|---|---|---|
| acupedia_ops | ||
| ansible | ||
| config | ||
| docs | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| MANUAL_SETUP_GUIDE.md | ||
| README.md | ||
| docker-compose.dev.yml | ||
| docker-compose.local.yml | ||
| docker-compose.prod.yml | ||
| pyproject.toml | ||
| requirements.txt | ||
| uv.lock | ||
README.md
acupedia-ops
Operational tooling for AccuPedia.
The repository owns:
- reusable content/data preprocessing;
- local development orchestration;
- backend bootstrap invocation through a CLI boundary;
- remote deployment orchestration;
- Gitea Actions runner lifecycle;
- Ansible playbooks/roles;
- operational validation and shared utilities.
It does not own application business logic and does not import app.* from
acupedia-api.
Installation
python -m venv .venv
source .venv/bin/activate
pip install -e .
For Ansible/deployment support:
pip install -e ".[deployment]"
Development:
pip install -e ".[dev]"
Workspace base path
Local repositories can be configured relative to one canonical workspace root:
ACUPEDIA_WORKSPACE_BASE_PATH=/home/amit/Work/Project/acupedia
ACUPEDIA_API_PATH=acupedia-api
ACUPEDIA_MOBILE_PATH=acupedia-mobile-ui
ACUPEDIA_WEB_PORTAL_PATH=acupedia-web-portal
ACUPEDIA_ADMIN_PORTAL_PATH=acupedia-admin-portal
ACUPEDIA_CONTENT_PATH=acupedia-content
ACUPEDIA_OPS_PATH=acupedia-ops
Relative paths are always resolved against ACUPEDIA_WORKSPACE_BASE_PATH,
never against the current working directory. Absolute component paths remain
supported.
Local workspace
cp .env.example .env
acupedia-ops local validate
acupedia-ops local setup
Typical local flow:
acupedia-ops local infra-up
acupedia-ops local bootstrap content --publish-content
Then, in separate terminals:
acupedia-ops local run api
acupedia-ops local run mobile
For complete documentation see:
docs/local-development.mddocs/gitea-runner-lifecycle.md
Local commands
acupedia-ops local validate
acupedia-ops local setup [--install]
acupedia-ops local status [--json]
acupedia-ops local run api|mobile|web|admin
acupedia-ops local infra-up
acupedia-ops local infra-down
acupedia-ops local infra-restart
acupedia-ops local infra-status
acupedia-ops local logs
acupedia-ops local bootstrap [auth|content|media|commerce|all|validate]
acupedia-ops local reset-db [--execute]
Backend bootstrap boundary
The bootstrap implementation remains in acupedia-api. acupedia-ops resolves
and invokes the backend-owned acupedia-bootstrap executable instead of
importing backend Python internals.
Direct usage is also available:
acupedia-ops bootstrap content \
--api-root ../acupedia-api \
-- \
--config ../acupedia-content/config.json \
--modules-root ../acupedia-content
Image preprocessing
acupedia-ops image clean-border input.jpg output.jpg
Directory and ZIP processing remain supported.
Gitea runner lifecycle
export GITEA_RUNNER_REGISTRATION_TOKEN='...'
acupedia-ops runner provision \
--inventory ansible/inventories/gitea-runners.yml
See docs/gitea-runner-lifecycle.md.
Remote deployment
acupedia-ops deploy backend --env dev
acupedia-ops deploy database --env dev
Local development deliberately uses native dev processes and Docker Compose. Ansible remains the remote deployment/configuration mechanism.
Acupedia CLI
acupedia-ops bootstrap all \
--content-config ./config.json \
--content-modules-root ../acupedia-content \
--content-module-code M0001 \
--media-manifest ./media.json \
--media-media-root ../acupedia-content/M0001-Acupuncture Points
acupedia-ops bootstrap media \
--manifest "../acupedia-content/M0001-Acupuncture Points/media.json" \
--media-root "../acupedia-content/M0001-Acupuncture Points" \
--validate-only
acupedia-ops bootstrap media \
--manifest "../acupedia-content/M0001-Acupuncture Points/media.json" \
--media-root "../acupedia-content/M0001-Acupuncture Points"
acupedia-ops bootstrap content \
--config ../acupedia-content/config.json \
--modules-root ../acupedia-content \
--module-code M0001 \
--publish-content
acupedia-ops bootstrap content \
--config ../acupedia-content/config.json \
--modules-root ../acupedia-content \
--module-code M0001 \
--seed-search-facets-only
acupedia-ops bootstrap content \
--config ../acupedia-content/config.json \
--modules-root ../acupedia-content \
--module-code M0001 \
--template-code M0001_CT0003 \
--content-code LU-1 \
--publish-content
acupedia-ops bootstrap commerce --plans ../acupedia-content/plans.json
acupedia-ops reset \
--scope module \
--module-code M0002 \
--execute
acupedia-access grant-plan \
--email av.salunke@gmail.com \
--plan-code POINTS_ACU
Grant a plan and all modules mapped through commerce.access_plan_modules:
acupedia-ops access grant-plan \
--email user@example.com \
--plan-code POINTS_ACU
Optional finite test access:
acupedia-ops access grant-plan \
--email user@example.com \
--plan-code POINTS_ACU \
--expires-in-days 30
Revoke access sourced from the plan:
acupedia-ops access revoke-plan \
--email user@example.com \
--plan-code POINTS_ACU
--user-id <uuid> can be used instead of --email.
The grant operation is idempotent for an already-active subscription and active module entitlements. It never invents plan/module mappings; the selected plan must already have rows in commerce.access_plan_modules.
python3 diff.py \
/home/chintan/Downloads/Acupedia_Dump/src \
/home/chintan/Work/Project/acupedia-api \
-o diff-report.txt \
--exclude "*.lock" \
--exclude "generated/**" \
--exclude "uploads/**" \
--exclude "alembic/versions/**" \
--no-new-file-content \
--no-removed-file-content
python3 diff.py \
/home/chintan/Downloads/Acupedia_Dump/src \
/home/chintan/Work/Project/acupedia-mobile-ui/src \
-o diff-report.txt \
--no-new-file-content \
--no-removed-file-content