Files
openstack-api-simulator/docs/operations.md
T
inecs 6033967e6a Initial commit: stateful OpenStack API laboratory simulator.
Ship Keystone auth, multi-service handlers (Yoga→Dalmatian), Compose/Helm
packaging, API contract packs, and pytest/Pulumi coverage labs.
2026-07-18 04:26:48 +03:00

2.7 KiB

Language / Язык: English | Русский

Operations

Day-2 commands (Compose)

make up                 # start stack
make down               # stop stack
make restart
make logs
make db-migrate         # idempotent migrations
make seed               # minimal OpenStack seed
make seed-demo          # demo cloud (~1000 servers)
make smoke              # multi-service GET smoke

Migrations

Ordered SQL under app/db/migrations/ applies transactionally. Re-running make db-migrate is safe. /health/ready stays unavailable until migrations are applied. Helm runs the same migrate step as an initContainer.

Reseed

make seed               # minimal
make seed-demo          # replaces state with demo cloud

Or:

docker compose exec simulator python -m app.openstack.seed_cli --profile demo

Reseed truncates OpenStack lab tables and reloads. External automation that cached resource UUIDs must refresh.

OpenStack pack series

Cold start (env):

OPENSTACK_SERIES=caracal docker compose up -d

Helm:

--set config.openstackSeries=yoga

Hot-swap (Web UI or API):

curl -X POST http://127.0.0.1:5000/ui/api/openstack/contracts/activate \
  -H 'Content-Type: application/json' \
  -d '{"series":"dalmatian"}'

Series: yoga, antelope, caracal, dalmatian. Coverage: api_coverage.md.

Regenerating contract packs

PYTHONPATH=tools python3 tools/os_api_inventory/generate_packs.py
PYTHONPATH=tools python3 tools/os_api_inventory/coverage_report.py

Backing up lab state

PostgreSQL is the system of record. Use pg_dump / volume snapshots. Application containers are disposable when the database volume remains.

Publishing to Docker Hub

docker login
make release
Variable Default Meaning
DOCKERHUB_USER inecs Docker Hub namespace
IMAGE_NAME openstack-api-simulator Repository name
VERSION from pyproject.toml Image tag
make release VERSION=0.2.0
make release-build   # local tags only

Kubernetes day-2

See kubernetes.md for logs, reseed via kubectl exec, and uninstall.

API coverage lab CI (pulumi-tests)

Pulumi probes every pack operation across series — see hypervisor-lab.md.

make test-pulumi-smoke    # from repo root
make test-pulumi

Reports: pulumi-tests/reports/pulumi-report.html and pulumi-junit.xml.

Upgrades

  1. Pull / build new image tag.
  2. Apply migrations (automatic on start / Helm initContainer).
  3. Optionally reseed if the seed schema changed.
  4. Re-run make smoke or lifecycle probes.